summaryrefslogtreecommitdiff
path: root/tests/misc-tests/002-uuid-rewrite
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-03-23 16:34:30 +0100
committerDavid Sterba <dsterba@suse.com>2018-03-30 22:15:55 +0200
commitdcb174ce2e2c9be1eaad73757d0312246560ba3d (patch)
treeb265e3f36d473878962751f820fc12d7a5a3bf6a /tests/misc-tests/002-uuid-rewrite
parent3ccad2a6443fcae0fee2cd94132580d2d06268dd (diff)
btrfs-progs: tests: add shell quotes to misc test scripts
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests/misc-tests/002-uuid-rewrite')
-rwxr-xr-xtests/misc-tests/002-uuid-rewrite/test.sh40
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/misc-tests/002-uuid-rewrite/test.sh b/tests/misc-tests/002-uuid-rewrite/test.sh
index 8e7011a8..0191bd5c 100755
--- a/tests/misc-tests/002-uuid-rewrite/test.sh
+++ b/tests/misc-tests/002-uuid-rewrite/test.sh
@@ -10,7 +10,7 @@ check_prereq btrfs
prepare_test_dev
get_fs_uuid() {
- run_check_stdout $TOP/btrfs inspect-internal dump-super "$1" | \
+ run_check_stdout "$TOP/btrfs" inspect-internal dump-super "$1" | \
grep '^fsid' | awk '{print $2}'
}
@@ -20,18 +20,18 @@ test_uuid_random()
origuuid=11111111-a101-4031-b29a-379d4f8b7a2d
- run_check $SUDO_HELPER $TOP/mkfs.btrfs -f \
- --uuid $origuuid \
- --rootdir $INTERNAL_BIN/Documentation \
- $TEST_DEV
- run_check $TOP/btrfs inspect-internal dump-super "$TEST_DEV"
- currentfsid=$(run_check_stdout $TOP/btrfstune -f -u $TEST_DEV | \
+ run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f \
+ --uuid "$origuuid" \
+ --rootdir "$INTERNAL_BIN/Documentation" \
+ "$TEST_DEV"
+ run_check "$TOP/btrfs" inspect-internal dump-super "$TEST_DEV"
+ currentfsid=$(run_check_stdout "$TOP/btrfstune" -f -u "$TEST_DEV" | \
grep -i 'current fsid:' | awk '{print $3}')
- if ! [ $currentfsid = $origuuid ]; then
+ if ! [ "$currentfsid" = "$origuuid" ]; then
_fail "FAIL: current UUID mismatch"
fi
- run_check $TOP/btrfs inspect-internal dump-super "$TEST_DEV"
- run_check $SUDO_HELPER $TOP/btrfs check $TEST_DEV
+ run_check "$TOP/btrfs" inspect-internal dump-super "$TEST_DEV"
+ run_check $SUDO_HELPER "$TOP/btrfs" check "$TEST_DEV"
}
test_uuid_user()
@@ -42,19 +42,19 @@ test_uuid_user()
origuuid=22222222-d324-4f92-80e9-7658bf3b845f
newuuid=33333333-bfc9-4045-9399-a396dc6893b3
- run_check $SUDO_HELPER $TOP/mkfs.btrfs -f \
- --uuid $origuuid \
- --rootdir $INTERNAL_BIN/Documentation \
- $TEST_DEV
- run_check $TOP/btrfs inspect-internal dump-super "$TEST_DEV"
- run_check $TOP/btrfstune -f -U $newuuid \
- $TEST_DEV
+ run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f \
+ --uuid "$origuuid" \
+ --rootdir "$INTERNAL_BIN/Documentation" \
+ "$TEST_DEV"
+ run_check "$TOP/btrfs" inspect-internal dump-super "$TEST_DEV"
+ run_check "$TOP/btrfstune" -f -U "$newuuid" \
+ "$TEST_DEV"
# btrfs inspect-internal dump-super is called within get_fs_uuid
- fsid=$(get_fs_uuid $TEST_DEV)
- if ! [ $fsid = $newuuid ]; then
+ fsid=$(get_fs_uuid "$TEST_DEV")
+ if ! [ "$fsid" = "$newuuid" ]; then
_fail "FAIL: UUID not rewritten"
fi
- run_check $SUDO_HELPER $TOP/btrfs check $TEST_DEV
+ run_check $SUDO_HELPER "$TOP/btrfs" check "$TEST_DEV"
}
test_uuid_random