summaryrefslogtreecommitdiff
path: root/tests/misc-tests
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2018-06-20 08:38:39 +0800
committerDavid Sterba <dsterba@suse.com>2018-08-06 14:59:49 +0200
commit014a0db6cbc09b720e832e9e069028b52dd0bc11 (patch)
tree3bf1759bc0b7869e6ad70d48134a4c87965b3e27 /tests/misc-tests
parent7fb70440cff73c57a2b3a53f22a6ff023718ea39 (diff)
btrfs-progs: misc-tests: Fix 029 test cases for sudo test environment
Test misc/029 only works if the test case is executed as root, while for sudo usage, it doesn't work as initial mkdir and final cleanup doesn't use $SUDO_HELPER. Add "run_check $SUDO_HELPER" for such cases to allow it works under sudo usage. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests/misc-tests')
-rwxr-xr-xtests/misc-tests/029-send-p-different-mountpoints/test.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/misc-tests/029-send-p-different-mountpoints/test.sh b/tests/misc-tests/029-send-p-different-mountpoints/test.sh
index 0b42b772..90465e1d 100755
--- a/tests/misc-tests/029-send-p-different-mountpoints/test.sh
+++ b/tests/misc-tests/029-send-p-different-mountpoints/test.sh
@@ -14,7 +14,7 @@ prepare_test_dev
SUBVOL_MNT="$TEST_MNT/subvol"
TOPLEVEL_MNT="$TEST_MNT/toplevel"
TEST_MNT="$TOPLEVEL_MNT"
-mkdir -p "$TOPLEVEL_MNT" "$SUBVOL_MNT"
+run_check $SUDO_HELPER mkdir -p "$TOPLEVEL_MNT" "$SUBVOL_MNT"
run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
run_check_mount_test_dev
@@ -47,5 +47,5 @@ run_mustfail_stdout "send -p on 2 mount points" \
run_check_umount_test_dev "$SUBVOL_MNT"
run_check_umount_test_dev "$TOPLEVEL_MNT"
-rmdir "$SUBVOL_MNT"
-rmdir "$TOPLEVEL_MNT"
+run_check $SUDO_HELPER rmdir "$SUBVOL_MNT"
+run_check $SUDO_HELPER rmdir "$TOPLEVEL_MNT"