diff --git a/tests/cli-tests/001-btrfs/test.sh b/tests/cli-tests/001-btrfs/test.sh index 0f0d6715..85213fcc 100755 --- a/tests/cli-tests/001-btrfs/test.sh +++ b/tests/cli-tests/001-btrfs/test.sh @@ -6,7 +6,7 @@ source "$TEST_TOP/common" || exit check_prereq btrfs # returns 1 -run_mayfail $TOP/btrfs || true +run_mayfail "$TOP/btrfs" || true run_check "$TOP/btrfs" version run_check "$TOP/btrfs" version -- run_check "$TOP/btrfs" help diff --git a/tests/cli-tests/004-send-parent-multi-subvol/test.sh b/tests/cli-tests/004-send-parent-multi-subvol/test.sh index 94efcb86..cabc2a2d 100755 --- a/tests/cli-tests/004-send-parent-multi-subvol/test.sh +++ b/tests/cli-tests/004-send-parent-multi-subvol/test.sh @@ -13,7 +13,7 @@ prepare_test_dev run_check_mkfs_test_dev run_check_mount_test_dev -here=`pwd` +here=$(pwd) cd "$TEST_MNT" || _fail "cannot chdir to TEST_MNT" run_check $SUDO_HELPER "$TOP/btrfs" subvolume create subv-parent diff --git a/tests/cli-tests/008-subvolume-get-set-default/test.sh b/tests/cli-tests/008-subvolume-get-set-default/test.sh index 4e536ed7..2814fba3 100755 --- a/tests/cli-tests/008-subvolume-get-set-default/test.sh +++ b/tests/cli-tests/008-subvolume-get-set-default/test.sh @@ -13,14 +13,14 @@ check_default_id() { id=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" subvolume get-default .) \ || { echo "$id"; exit 1; } - if $(echo "$id" | grep -vq "ID $1"); then + if echo "$id" | grep -vq "ID $1"; then _fail "subvolume get-default: default id is not $1, but $id" fi } run_check_mkfs_test_dev run_check_mount_test_dev -cd "$TEST_MNT" +cd "$TEST_MNT" || _fail "Cannot cd into TEST_MNT $TEST_MNT" check_default_id 5 diff --git a/tests/cli-tests/014-multiple-profiles-warning/test.sh b/tests/cli-tests/014-multiple-profiles-warning/test.sh index 1e374e41..8fbbc9cb 100755 --- a/tests/cli-tests/014-multiple-profiles-warning/test.sh +++ b/tests/cli-tests/014-multiple-profiles-warning/test.sh @@ -62,8 +62,8 @@ test_run_commands() { run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -d single -m single "${loopdevs[@]}" run_check_mount_test_dev run_check "$TOP/btrfs" filesystem usage "$TEST_MNT" -for i in `seq 10`; do - run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT"/file$i bs=100M count=1 status=none +for i in $(seq 10); do + run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT/file$i" bs=100M count=1 status=none done # Create filesystem with single and RAID1 profiles run_check $SUDO_HELPER "$TOP/btrfs" balance start -dconvert=raid1,limit=1 "$TEST_MNT" @@ -76,8 +76,8 @@ run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f --mixed -d single -m single "${loopd run_check_mount_test_dev run_check "$TOP/btrfs" filesystem usage "$TEST_MNT" # Create 1 and a half of 1G chunks -for i in `seq 14`; do - run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT"/file$i bs=100M count=1 status=none +for i in $(seq 14); do + run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT/file$i" bs=100M count=1 status=none done # Create filesystem with single and RAID1 profiles, the limit=1 trick does not work # so use the usage filter to convert about half of the filesystem diff --git a/tests/cli-tests/016-btrfs-fi-usage/test.sh b/tests/cli-tests/016-btrfs-fi-usage/test.sh index ff1f9788..20b716fb 100755 --- a/tests/cli-tests/016-btrfs-fi-usage/test.sh +++ b/tests/cli-tests/016-btrfs-fi-usage/test.sh @@ -63,7 +63,7 @@ test_raid1() set -- $i IFS=$OLDIFS - run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -d"$1" ${loopdevs[@]} + run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -d"$1" "${loopdevs[@]}" run_check_mount_test_dev vars=($(report_numbers)) data_chunk_size=${vars[1]} @@ -87,7 +87,7 @@ test_raid0() local used_on_dev local data_ratio - run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -draid0 ${loopdevs[@]} + run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -draid0 "${loopdevs[@]}" run_check_mount_test_dev vars=($(report_numbers)) data_chunk_size=${vars[1]} @@ -118,7 +118,7 @@ test_raid56() set -- $i IFS=$OLDIFS - run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -d"$1" ${loopdevs[@]} + run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -d"$1" "${loopdevs[@]}" run_check_mount_test_dev vars=($(report_numbers)) data_chunk_size=${vars[1]} diff --git a/tests/cli-tests/024-scrub-limit/test.sh b/tests/cli-tests/024-scrub-limit/test.sh index d672722d..000371f2 100755 --- a/tests/cli-tests/024-scrub-limit/test.sh +++ b/tests/cli-tests/024-scrub-limit/test.sh @@ -36,11 +36,11 @@ fi # Set the limits by command here=`pwd` -cd "$sysfs/devinfo" +cd "$sysfs/devinfo" || _fail "Cannot cd to $sysfs/devinfo" for i in *; do run_check $SUDO_HELPER "$TOP/btrfs" scrub limit -d "$i" -l 20m "$TEST_MNT" done -cd "$here" +cd "$here" || _fail "Cannot cd to $here" run_check "$TOP/btrfs" scrub limit "$TEST_MNT" # Set limits for all devices