path: root/tests/misc-tests/021-image-multi-devices/
diff options
authorDavid Sterba <>2018-03-23 16:34:30 +0100
committerDavid Sterba <>2018-03-30 22:15:55 +0200
commitdcb174ce2e2c9be1eaad73757d0312246560ba3d (patch)
treeb265e3f36d473878962751f820fc12d7a5a3bf6a /tests/misc-tests/021-image-multi-devices/
parent3ccad2a6443fcae0fee2cd94132580d2d06268dd (diff)
btrfs-progs: tests: add shell quotes to misc test scripts
Signed-off-by: David Sterba <>
Diffstat (limited to 'tests/misc-tests/021-image-multi-devices/')
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/misc-tests/021-image-multi-devices/ b/tests/misc-tests/021-image-multi-devices/
index d78c44fb..5430847f 100755
--- a/tests/misc-tests/021-image-multi-devices/
+++ b/tests/misc-tests/021-image-multi-devices/
@@ -20,31 +20,31 @@ loop2=$(run_check_stdout $SUDO_HELPER losetup --find --show dev2)
# Create the test file system.
-run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f $loop1 $loop2
-run_check $SUDO_HELPER mount $loop1 "$TEST_MNT"
-run_check $SUDO_HELPER dd bs=1M count=1 if=/dev/zero "of=$TEST_MNT/foobar"
+run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$loop1" "$loop2"
+run_check $SUDO_HELPER mount "$loop1" "$TEST_MNT"
+run_check $SUDO_HELPER dd bs=1M count=1 if=/dev/zero of="$TEST_MNT/foobar"
orig_md5=$(run_check_stdout md5sum "$TEST_MNT/foobar" | cut -d ' ' -f 1)
run_check $SUDO_HELPER umount "$TEST_MNT"
# Create the image to restore later.
-run_check $SUDO_HELPER "$TOP/btrfs-image" $loop1 "$IMAGE"
+run_check $SUDO_HELPER "$TOP/btrfs-image" "$loop1" "$IMAGE"
# Wipe out the filesystem from the devices, restore the image on a single
# device, check everything works and file foobar is there and with 1Mb of
# zeroes.
-run_check $SUDO_HELPER wipefs -a $loop1
-run_check $SUDO_HELPER wipefs -a $loop2
+run_check $SUDO_HELPER wipefs -a "$loop1"
+run_check $SUDO_HELPER wipefs -a "$loop2"
-run_check $SUDO_HELPER $TOP/btrfs-image -r "$IMAGE" $loop1
+run_check $SUDO_HELPER "$TOP/btrfs-image" -r "$IMAGE" "$loop1"
-run_check $SUDO_HELPER mount $loop1 "$TEST_MNT"
+run_check $SUDO_HELPER mount "$loop1" "$TEST_MNT"
new_md5=$(run_check_stdout md5sum "$TEST_MNT/foobar" | cut -d ' ' -f 1)
run_check $SUDO_HELPER umount "$TEST_MNT"
# Cleanup loop devices.
-run_check $SUDO_HELPER losetup -d $loop1
-run_check $SUDO_HELPER losetup -d $loop2
+run_check $SUDO_HELPER losetup -d "$loop1"
+run_check $SUDO_HELPER losetup -d "$loop2"
rm -f dev1 dev2
# Compare the file digests.
-[ $orig_md5 == $new_md5 ] || _fail "File digests do not match"
+[ "$orig_md5" == "$new_md5" ] || _fail "File digests do not match"