]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
tests/btrfs: use $AWK_PROG instead of awk
authorLuis Chamberlain <mcgrof@kernel.org>
Tue, 15 Feb 2022 01:48:45 +0000 (17:48 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 20 Feb 2022 16:45:50 +0000 (00:45 +0800)
Use $AWK_PROG instead of awk in case the default awk
program is not called awk.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Adam Manzanares <a.manzanares@samsung.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
28 files changed:
tests/btrfs/001
tests/btrfs/003
tests/btrfs/006
tests/btrfs/011
tests/btrfs/022
tests/btrfs/027
tests/btrfs/035
tests/btrfs/085
tests/btrfs/090
tests/btrfs/124
tests/btrfs/125
tests/btrfs/149
tests/btrfs/161
tests/btrfs/162
tests/btrfs/163
tests/btrfs/164
tests/btrfs/175
tests/btrfs/176
tests/btrfs/181
tests/btrfs/184
tests/btrfs/185
tests/btrfs/194
tests/btrfs/197
tests/btrfs/198
tests/btrfs/215
tests/btrfs/216
tests/btrfs/218
tests/btrfs/254

index 000aeb34723ed55ffcccc7a0c7583c3c2676afd4..6c2639990373db22fea6c05faa03816e46a055ae 100755 (executable)
@@ -66,7 +66,7 @@ ls $SCRATCH_MNT
 
 # Test listing the subvolumes
 echo "Listing subvolumes"
-$BTRFS_UTIL_PROG subvolume list $SCRATCH_MNT | awk '{ print $NF }'
+$BTRFS_UTIL_PROG subvolume list $SCRATCH_MNT | $AWK_PROG '{ print $NF }'
 
 # Delete the snapshot
 $BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/snap | _filter_btrfs_subvol_delete
index 0aa4c99176b5661dfb4ee2459f7bee771403a76e..cf60573048fbe6b91d2866ec0de6325442a21534 100755 (executable)
@@ -167,7 +167,7 @@ _test_remove()
        _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
 
        # pick last dev in the list
-       dev_del=`echo ${SCRATCH_DEV_POOL} | awk '{print $NF}'`
+       dev_del=`echo ${SCRATCH_DEV_POOL} | $AWK_PROG '{print $NF}'`
        $BTRFS_UTIL_PROG device delete $dev_del $SCRATCH_MNT || _fail "btrfs device delete failed"
        $BTRFS_UTIL_PROG filesystem show $SCRATCH_DEV 2>&1 | grep $dev_del >> $seqres.full && _fail "btrfs still shows the deleted dev"
        _scratch_unmount
index fd0f89e232c33dd9fee416cb70f56a16885148b7..bff6f980a567d9bf2d9da678a14aa40c9542adb3 100755 (executable)
@@ -20,8 +20,8 @@ _supported_fs btrfs
 _require_scratch
 _require_scratch_dev_pool
 
-FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
-LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}'`
+LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $NF}'`
 TOTAL_DEVS=`echo $SCRATCH_DEV_POOL | wc -w`
 LABEL=TestLabel.$seq
 
@@ -40,7 +40,7 @@ _scratch_mount
 
 echo "== Show filesystem by label"
 $BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
-UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
+UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | $AWK_PROG '{print $NF}'`
 
 echo "UUID $UUID" >> $seqres.full
 
index 05ea96b94471f657b68efd1f48b8a633a6df96e5..0665e12627ae8ccf4d6f12aeb5c98d8d58133512 100755 (executable)
@@ -107,7 +107,7 @@ workout()
        local num_devs4raid="$2"
        local with_cancel="$3"
        local fssize="$4"
-       local source_dev="`echo ${SCRATCH_DEV_POOL} | awk '{print $1}'`"
+       local source_dev="`echo ${SCRATCH_DEV_POOL} | $AWK_PROG '{print $1}'`"
        local quick="quick"
 
        [[ $fssize != 64 ]] && quick="thorough"
index bfd6ac7ffbdc901cb72a03a1a7c06b319ad7c6ca..e2d37b0949b018dd26ec5b3c004c3cc3efb41bb8 100755 (executable)
@@ -35,12 +35,12 @@ _basic_test()
        # the shared values of both the original subvol and snapshot should
        # match
        a_shared=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid")
-       a_shared=$(echo $a_shared | awk '{ print $2 }')
+       a_shared=$(echo $a_shared | $AWK_PROG '{ print $2 }')
        echo "subvol a id=$subvolid" >> $seqres.full
        subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT b)
        echo "subvol b id=$subvolid" >> $seqres.full
        b_shared=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid")
-       b_shared=$(echo $b_shared | awk '{ print $2 }')
+       b_shared=$(echo $b_shared | $AWK_PROG '{ print $2 }')
        $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT >> $seqres.full
        [ $b_shared -eq $a_shared ] || _fail "shared values don't match"
 }
@@ -59,14 +59,14 @@ _rescan_test()
        sync
        output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid")
        echo "qgroup values before rescan: $output" >> $seqres.full
-       refer=$(echo $output | awk '{ print $2 }')
-       excl=$(echo $output | awk '{ print $3 }')
+       refer=$(echo $output | $AWK_PROG '{ print $2 }')
+       excl=$(echo $output | $AWK_PROG '{ print $3 }')
        _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
        output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid")
        echo "qgroup values after rescan: $output" >> $seqres.full
-       [ $refer -eq $(echo $output | awk '{ print $2 }') ] || \
+       [ $refer -eq $(echo $output | $AWK_PROG '{ print $2 }') ] || \
                _fail "reference values don't match after rescan"
-       [ $excl -eq $(echo $output | awk '{ print $3 }') ] || \
+       [ $excl -eq $(echo $output | $AWK_PROG '{ print $3 }') ] || \
                _fail "exclusive values don't match after rescan"
 }
 
index e8679248914c091deb5dff191a6f71bf7ff4e59d..46c14b9c1c1f5a9b9aecd18bbb2ee7c43c2097fb 100755 (executable)
@@ -45,8 +45,8 @@ run_test()
        fi
        _scratch_mount >>$seqres.full 2>&1
 
-       local missing_dev=`echo $SCRATCH_DEV_POOL | awk '{print $2}'`
-       local missing_dev_id=`$BTRFS_UTIL_PROG filesystem show $SCRATCH_MNT | grep $missing_dev | awk '{print $2}'`
+       local missing_dev=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'`
+       local missing_dev_id=`$BTRFS_UTIL_PROG filesystem show $SCRATCH_MNT | grep $missing_dev | $AWK_PROG '{print $2}'`
 
        # get some data on the filesystem so there's something to replace
        _ddt of="$SCRATCH_MNT"/file1 bs=1M count=1 >> $seqres.full 2>&1
index 4ddc5bf651165959839e8ac49160974f4f226668..7e644ecff4408c1d8eb6f7752c64189dfb8d950c 100755 (executable)
@@ -33,7 +33,7 @@ echo -n "$src_str" > $SCRATCH_MNT/src
 
 $CLONER_PROG $SCRATCH_MNT/src $SCRATCH_MNT/src.clone2
 
-snap_src_sz=`ls -lah $SCRATCH_MNT/src.clone1 | awk '{print $5}'`
+snap_src_sz=`ls -lah $SCRATCH_MNT/src.clone1 | $AWK_PROG '{print $5}'`
 echo "attempting ioctl (src.clone1 src)"
 $CLONER_PROG -s 0 -d 0 -l ${snap_src_sz} \
        $SCRATCH_MNT/src.clone1 $SCRATCH_MNT/src | _filter_btrfs_cloner_error
@@ -48,7 +48,7 @@ $CLONER_PROG -s 0 -d 0 -l ${snap_src_sz} \
 echo "File src data after attempt to clone from src.clone1 into src:"
 od -t x1 $SCRATCH_MNT/src
 
-snap_src_sz=`ls -lah $SCRATCH_MNT/src.clone2 | awk '{print $5}'`
+snap_src_sz=`ls -lah $SCRATCH_MNT/src.clone2 | $AWK_PROG '{print $5}'`
 echo "attempting ioctl (src.clone2 src)"
 $CLONER_PROG -s 0 -d 0 -l ${snap_src_sz} \
        $SCRATCH_MNT/src.clone2 $SCRATCH_MNT/src
index cef4da2838afada06ad9865544f8832c285895ce..bcbf1a05dc8384a0b3e206af134e1faca179ca60 100755 (executable)
@@ -112,7 +112,7 @@ new_subvolume()
 new_default()
 {
        new_subvolume
-       SUB=$($BTRFS_UTIL_PROG subvolume list $SCRATCH_MNT |awk '{print $2}')
+       SUB=$($BTRFS_UTIL_PROG subvolume list $SCRATCH_MNT | $AWK_PROG '{print $2}')
        _run_btrfs_util_prog subvolume set-default $SUB $SCRATCH_MNT
 
        _unmount_flakey
index 766c24cd2ba303fa186806327a33f19fa734dda6..3693a3ad0f40be5a1f22d721f5ca3a1920027c91 100755 (executable)
@@ -26,7 +26,7 @@ _supported_fs btrfs
 _require_scratch
 _require_scratch_dev_pool
 
-FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}'`
 TOTAL_DEVS=`echo $SCRATCH_DEV_POOL | wc -w`
 
 _scratch_pool_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
index 8771a3c12f8ba0f6f29f99e4c16a5ad5620e8a6a..e8d77aaadf2d3af24a91cb05e9992213a02a0041 100755 (executable)
@@ -45,8 +45,8 @@ _require_btrfs_forget_or_module_loadable
 
 _scratch_dev_pool_get 2
 
-dev1=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
-dev2=`echo $SCRATCH_DEV_POOL | awk '{print $2}'`
+dev1=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}'`
+dev2=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'`
 
 # RAID1 is not supported on zoned btrfs
 _require_non_zoned_device "$dev1"
index b6a28f5cf47ca4ccadf49e9538b5bb8678a79df0..44ba49ec565aa97f783d6a18d9517b37c30f7842 100755 (executable)
@@ -45,9 +45,9 @@ _require_btrfs_fs_feature raid56
 
 _scratch_dev_pool_get 3
 
-dev1=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
-dev2=`echo $SCRATCH_DEV_POOL | awk '{print $2}'`
-dev3=`echo $SCRATCH_DEV_POOL | awk '{print $3}'`
+dev1=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}'`
+dev2=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'`
+dev3=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $3}'`
 
 echo dev1=$dev1 >> $seqres.full
 echo dev2=$dev2 >> $seqres.full
index 176d8ec5b5c8abd1f6b9986141c6025a9c8712cb..d6dce45dcef579eaacd04a27581b12038a3690b5 100755 (executable)
@@ -75,8 +75,8 @@ $BTRFS_UTIL_PROG send -f $send_files_dir/1.snap \
 $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/mysnap1 -f $send_files_dir/2.snap \
                 $SCRATCH_MNT/mysnap2 2>&1 >/dev/null | _filter_scratch
 
-sum_src_snap1=$(md5sum $SCRATCH_MNT/mysnap1/foobar | awk '{print $1}')
-sum_src_snap2=$(md5sum $SCRATCH_MNT/mysnap2/foobar | awk '{print $1}')
+sum_src_snap1=$(md5sum $SCRATCH_MNT/mysnap1/foobar | $AWK_PROG '{print $1}')
+sum_src_snap2=$(md5sum $SCRATCH_MNT/mysnap2/foobar | $AWK_PROG '{print $1}')
 echo "File digests in the original filesystem:" >> $seqres.full
 echo "md5sum $SCRATCH_MNT/mysnap1/foobar " $sum_src_snap1 >> $seqres.full
 echo "md5sum $SCRATCH_MNT/mysnap2/foobar " $sum_src_snap2 >> $seqres.full
@@ -90,8 +90,8 @@ _scratch_mount "-o compress"
 $BTRFS_UTIL_PROG receive -f $send_files_dir/1.snap $SCRATCH_MNT > /dev/null
 $BTRFS_UTIL_PROG receive -f $send_files_dir/2.snap $SCRATCH_MNT > /dev/null
 
-sum_dest_snap1=$(md5sum $SCRATCH_MNT/mysnap1/foobar | awk '{print $1}')
-sum_dest_snap2=$(md5sum $SCRATCH_MNT/mysnap2/foobar | awk '{print $1}')
+sum_dest_snap1=$(md5sum $SCRATCH_MNT/mysnap1/foobar | $AWK_PROG '{print $1}')
+sum_dest_snap2=$(md5sum $SCRATCH_MNT/mysnap2/foobar | $AWK_PROG '{print $1}')
 echo "File digests in the new filesystem:" | tee -a $seqres.full
 echo "md5sum $SCRATCH_MNT/mysnap1/foobar " $sum_src_snap1 >> $seqres.full
 echo "md5sum $SCRATCH_MNT/mysnap2/foobar " $sum_src_snap2 >> $seqres.full
index ed5b67fac37e013e5ddb355fcdccf5add927878b..5aac8fe93a3bdcf3affbd899c1f1d89f3e00df99 100755 (executable)
@@ -23,8 +23,8 @@ _require_scratch_dev_pool 2
 
 _scratch_dev_pool_get 2
 
-dev_seed=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
-dev_sprout=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
+dev_seed=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}')
+dev_sprout=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
 
 create_seed()
 {
index 7680e1e4392eb3bca5629dd5a46f8a299ee3615e..1d8dbf9546be4f919f0de569fbc79a89e2cb67d7 100755 (executable)
@@ -25,9 +25,9 @@ _require_scratch_dev_pool 3
 
 _scratch_dev_pool_get 3
 
-dev_seed=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
-dev_sprout_seed=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
-dev_sprout=$(echo $SCRATCH_DEV_POOL | awk '{print $3}')
+dev_seed=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}')
+dev_sprout_seed=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
+dev_sprout=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $3}')
 
 create_seed()
 {
index 59f0461b626ac19a6992f406b761fd91b94ca678..c2a04791aa673fba4e38709023587afdf305ec21 100755 (executable)
@@ -38,9 +38,9 @@ _require_btrfs_forget_or_module_loadable
 
 _scratch_dev_pool_get 3
 
-dev_seed=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
-dev_sprout=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
-dev_replace_tgt=$(echo $SCRATCH_DEV_POOL | awk '{print $3}')
+dev_seed=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}')
+dev_sprout=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
+dev_replace_tgt=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $3}')
 
 create_seed()
 {
index 8fd6ab626cfd6862f33f4cfccfc19da4fe50401d..43c55c163cf237c5ac787799c82d743497cad06f 100755 (executable)
@@ -29,8 +29,8 @@ _require_scratch_dev_pool 2
 
 _scratch_dev_pool_get 2
 
-dev_seed=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
-dev_sprout=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
+dev_seed=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}')
+dev_sprout=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
 
 create_seed()
 {
index dc6c19217254bfff26b6105a9e1fbbcf275866f7..db877d419676f06d90aca0917cba14655c48f486 100755 (executable)
@@ -48,7 +48,7 @@ _scratch_mount
 # Create the swap file, then add the device. That way we know it's all on one
 # device.
 _format_swapfile "$SCRATCH_MNT/swap" $(($(get_page_size) * 10)) > /dev/null
-scratch_dev2="$(echo "${SCRATCH_DEV_POOL}" | awk '{ print $2 }')"
+scratch_dev2="$(echo "${SCRATCH_DEV_POOL}" | $AWK_PROG '{ print $2 }')"
 $BTRFS_UTIL_PROG device add -f "$scratch_dev2" "$SCRATCH_MNT" >> $seqres.full
 swapon "$SCRATCH_MNT/swap" 2>&1 | _filter_scratch
 swapoff "$SCRATCH_MNT/swap" > /dev/null 2>&1
index 33f9a061fe6541b83590a22b0850bd30af37b9be..7080d8608b61dbf2a5bf3a0f64c527dd4a264d49 100755 (executable)
@@ -22,9 +22,9 @@ _require_scratch_swapfile
 # We check the filesystem manually because we move devices around.
 rm -f "${RESULT_DIR}/require_scratch"
 
-scratch_dev1="$(echo "${SCRATCH_DEV_POOL}" | awk '{ print $1 }')"
-scratch_dev2="$(echo "${SCRATCH_DEV_POOL}" | awk '{ print $2 }')"
-scratch_dev3="$(echo "${SCRATCH_DEV_POOL}" | awk '{ print $3 }')"
+scratch_dev1="$(echo "${SCRATCH_DEV_POOL}" | $AWK_PROG '{ print $1 }')"
+scratch_dev2="$(echo "${SCRATCH_DEV_POOL}" | $AWK_PROG '{ print $2 }')"
+scratch_dev3="$(echo "${SCRATCH_DEV_POOL}" | $AWK_PROG '{ print $3 }')"
 
 echo "Remove device"
 _scratch_mkfs >> $seqres.full 2>&1
index 843413fcfe8f58213f7ed115285215a1d118bbf3..8a3c3c17ed08abc8b509f4276f1410e937f31089 100755 (executable)
@@ -32,7 +32,7 @@ nr_files=1024
 get_super_gen()
 {
        local ret=$($BTRFS_UTIL_PROG inspect dump-super "$SCRATCH_DEV" |\
-               grep ^generation | awk '{print $2}')
+               grep ^generation | $AWK_PROG '{print $2}')
        if [ -z $ret ]; then
                _fail "failed to get super block generation"
        fi
index 2efcfb64136ffbe0fb11de2a88d97df943f7eff2..ee43a8d3a387aa822f69a5c35c8c1288149c17b3 100755 (executable)
@@ -27,7 +27,7 @@ _scratch_pool_mkfs "-d raid0 -m raid0" >> $seqres.full 2>&1 || _fail "mkfs faile
 _scratch_mount
 
 # pick last dev in the list
-dev_del=`echo ${SCRATCH_DEV_POOL} | awk '{print $NF}'`
+dev_del=`echo ${SCRATCH_DEV_POOL} | $AWK_PROG '{print $NF}'`
 $BTRFS_UTIL_PROG device delete $dev_del $SCRATCH_MNT || _fail "btrfs device delete failed"
 for i in {0..2}; do
        output=$($BTRFS_UTIL_PROG inspect-internal dump-super -s $i $dev_del 2>&1)
index 7850f1bc6668ad820702e6e80a813a0b86f2dd4c..ee97b62661a3331753b64c2ec21e606f6b10f980 100755 (executable)
@@ -28,8 +28,8 @@ _supported_fs btrfs
 _require_scratch_dev_pool 2
 _scratch_dev_pool_get 2
 
-device_1=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
-device_2=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
+device_1=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}')
+device_2=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
 
 echo device_1=$device_1 device_2=$device_2 >> $seqres.full
 
@@ -38,7 +38,7 @@ mkdir $mnt
 _mkfs_dev $device_1
 _mount $device_1 $mnt
 
-[[ $(findmnt $mnt | grep -v TARGET | awk '{print $2}') != $device_1 ]] && \
+[[ $(findmnt $mnt | grep -v TARGET | $AWK_PROG '{print $2}') != $device_1 ]] && \
                                                _fail "mounted device changed"
 
 for sb_bytenr in 65536 67108864; do
@@ -53,7 +53,7 @@ done
 $BTRFS_UTIL_PROG device scan $device_2 >> $seqres.full 2>&1
 [[ $? != 1 ]] && _fail "cloned device scan should fail"
 
-[[ $(findmnt $mnt | grep -v TARGET | awk '{print $2}') != $device_1 ]] && \
+[[ $(findmnt $mnt | grep -v TARGET | $AWK_PROG '{print $2}') != $device_1 ]] && \
                                                _fail "mounted device changed"
 
 # Original device scan should be successful
index 2431692b9f844570a30cbaa8531a44fbd03b7f9c..228576e4e7f0b2813fe638d3aecddf898e5de06f 100755 (executable)
@@ -29,8 +29,8 @@ if [ $(get_page_size) != 4096 ]; then
        _notrun "This test need 4k page size"
 fi
 
-device_1=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
-device_2=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
+device_1=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}')
+device_2=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
 
 echo device_1=$device_1 device_2=$device_2 >> $seqres.full
 
index 22b37b4b2505b010181da5faec3e7680aecfc1ec..d259fd99fb505dcd6b50d049532341bc56dcb0b9 100755 (executable)
@@ -54,11 +54,11 @@ workout()
 
        # don't test with the first device as auto fs check (_check_scratch_fs)
        # picks the first device
-       device_1=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
+       device_1=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
        $BTRFS_UTIL_PROG device add -f "$device_1" "$TEST_DIR/$seq.mnt" >> \
                $seqres.full
 
-       device_2=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
+       device_2=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}')
        _mount -o degraded $device_2 $SCRATCH_MNT
        # Check if missing device is reported as in the .out
        $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \
index 035c63fdb5ecaefd32bdad05caccb42d6cce37cf..1edc83306515048ca728b3c769483bcb7bb8e180 100755 (executable)
@@ -39,10 +39,10 @@ workout()
 
        # don't test with the first device as auto fs check (_check_scratch_fs)
        # picks the first device
-       device_1=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
+       device_1=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
        $WIPEFS_PROG -a $device_1 >> $seqres.full 2>&1
 
-       device_2=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
+       device_2=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}')
        _mount -o degraded $device_2 $SCRATCH_MNT
        # Check if missing device is reported as in the 196.out
        $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \
index 9ee1a8b3996706768732c1defed864e06e922b14..cbcd60e020e4e92bed55c7bb4e67987a9688833b 100755 (executable)
@@ -72,14 +72,14 @@ echo 0 > /sys/fs/btrfs/$uuid/bdi/read_ahead_kb
 # buffered reads whould result in 2 * sectors_per_page errors since readahead code always submits
 # at least 1 page worth of IO and it will be counted as error(s) as well
 $XFS_IO_PROG -c "pread -b $filesize 0 $filesize" "$SCRATCH_MNT/foobar" > /dev/null 2>&1
-errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | awk '/corruption_errs/ { print $2 }')
+errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | $AWK_PROG '/corruption_errs/ { print $2 }')
 if [ $errs -ne $((2 * $sectors_per_page)) ]; then
        _fail "Errors: $errs expected: 2"
 fi
 
 # DIO does check every sector
 $XFS_IO_PROG -d -c "pread -b $filesize 0 $filesize" "$SCRATCH_MNT/foobar" > /dev/null 2>&1
-errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | awk '/corruption_errs/ { print $2 }')
+errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | $AWK_PROG '/corruption_errs/ { print $2 }')
 if [ $errs -ne $((6 * $sectors_per_page)) ]; then
        _fail "Errors: $errs expected: 6"
 fi
index 5d6cf902c9d125c1efc6899c17f68fcff0228edc..2ed4866887f745719fd38c090581856e680f4523 100755 (executable)
@@ -21,8 +21,8 @@ _require_scratch_dev_pool 2
 
 _scratch_dev_pool_get 2
 
-seed=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
-sprout=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
+seed=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}')
+sprout=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
 
 _mkfs_dev $seed
 $BTRFS_TUNE_PROG -S 1 $seed
index 83ec785ee2a06938fa2c94a3bd0e4d308743b67a..672ad0ff61f078d636dc2a4cedf3ecd227bc833d 100755 (executable)
@@ -27,8 +27,8 @@ _require_scratch_dev_pool 2
 
 _scratch_dev_pool_get 2
 
-dev_seed=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
-dev_sprout=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
+dev_seed=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $1}')
+dev_sprout=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
 
 # Create the seed device
 _mkfs_dev $dev_seed
index 2f3ae50f2e3e19188ab36fd04104c5590b371921..5d6e33f40bb51e7698f9bffa42bb249fb2199a3b 100755 (executable)
@@ -81,8 +81,8 @@ test_add_device()
 {
        setup_dmdev
        dmdev=$(realpath $lvdev)
-       scratch_dev2=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
-       scratch_dev3=$(echo $SCRATCH_DEV_POOL | awk '{print $3}')
+       scratch_dev2=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}')
+       scratch_dev3=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $3}')
 
        _mkfs_dev $scratch_dev3
        _mount $scratch_dev3 $seq_mnt