]> err.no Git - util-linux/commitdiff
tests: use $AWK based on configure results
authorKarel Zak <kzak@redhat.com>
Fri, 20 Jul 2007 13:08:54 +0000 (15:08 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 23 Jul 2007 13:07:13 +0000 (15:07 +0200)
The hardcoded "gawk" seems like a bad idea.

Signed-off-by: Karel Zak <kzak@redhat.com>
tests/commands.sh.in
tests/functions.sh
tests/ts-ipcs.sh

index f8128bb898e451976b6fb074c574a3b40cef990c..a9572e062d9e6d29f4629365097dbe35c9d229aa 100644 (file)
@@ -1,6 +1,8 @@
 TOPDIR=@top_srcdir@
 TS_TOPDIR=$TOPDIR/tests
 
+AWK=@AWK@
+
 # Misc settings
 TS_TESTUSER=${TS_TESTUSER:-"test"}
 
index 3b10e1af5e1435bcdbdbf9efb7995329227ee55a..fffd7946eb0973140482d48ac8d9bcad4218f4b0 100644 (file)
@@ -60,7 +60,7 @@ function ts_log {
 function ts_has_option {
        NAME="$1"
        ALL="$2"
-       echo -n $ALL | sed 's/ //g' | gawk 'BEGIN { FS="="; RS="--" } /('$NAME'$|'$NAME'=)/ { print "yes" }'
+       echo -n $ALL | sed 's/ //g' | $AWK 'BEGIN { FS="="; RS="--" } /('$NAME'$|'$NAME'=)/ { print "yes" }'
 }
 
 function ts_init {
@@ -167,7 +167,7 @@ function ts_device_init {
        dd if=/dev/zero of="$IMAGE" bs=1M count=5 &> /dev/null
 
        $TS_CMD_LOSETUP -f "$IMAGE" 2>&1 >> $TS_OUTPUT
-       DEV=$( $TS_CMD_LOSETUP -a | gawk 'BEGIN {FS=":"} /'$IMAGE_RE'/ { print $1 }' )
+       DEV=$( $TS_CMD_LOSETUP -a | $AWK 'BEGIN {FS=":"} /'$IMAGE_RE'/ { print $1 }' )
 
        if [ -z "$DEV" ]; then
                ts_device_deinit $DEV
index 09790a4e446921d87ca59cb4988126a957b98e1e..ff35e75ea9c88b19d0e71c9d5cc675d8e6b4df4e 100644 (file)
@@ -38,9 +38,9 @@ IPCS_KERNEL_CMD=(
 
 # data from the ipcs command
 IPCS_CMD=(
-       "$TS_CMD_IPCS -m -l | gawk '/max number of segments/ { print \$6 }'"
-       "$TS_CMD_IPCS -m -l | gawk '/max total shared memory/ { print \$7 }'"
-       "$TS_CMD_IPCS -m -l | gawk '/max seg size/ { print \$6 }'"
+       "$TS_CMD_IPCS -m -l | $AWK '/max number of segments/ { print \$6 }'"
+       "$TS_CMD_IPCS -m -l | $AWK '/max total shared memory/ { print \$7 }'"
+       "$TS_CMD_IPCS -m -l | $AWK '/max seg size/ { print \$6 }'"
 )