diff mbox series

[1/4] btrfs-progs: fix fsck-tests/056 to run without root

Message ID 9c27fc4cb1f2d0bbf215afa2f1388d927cd0f239.1681150198.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: make some of the fsck-tests run without root | expand

Commit Message

Josef Bacik April 10, 2023, 6:11 p.m. UTC
We need to make sure the root helper is setup before calling the loop
helpers, and additionally we need to use $SUDO_HELPER when we run the
final btrfs check.  With this patch we can now run this test as a normal
user.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 tests/fsck-tests/056-raid56-false-alerts/test.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/tests/fsck-tests/056-raid56-false-alerts/test.sh b/tests/fsck-tests/056-raid56-false-alerts/test.sh
index 6efb5c00..fcd37971 100755
--- a/tests/fsck-tests/056-raid56-false-alerts/test.sh
+++ b/tests/fsck-tests/056-raid56-false-alerts/test.sh
@@ -10,13 +10,13 @@  check_prereq btrfs
 check_prereq mkfs.btrfs
 check_global_prereq losetup
 
+setup_root_helper
+
 setup_loopdevs 3
 prepare_loopdevs
 dev1=${loopdevs[1]}
 TEST_DEV=$dev1
 
-setup_root_helper
-
 run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -m raid1 -d raid5 "${loopdevs[@]}"
 run_check_mount_test_dev
 
@@ -26,6 +26,6 @@  run_check $SUDO_HELPER dd if=/dev/urandom of="$TEST_MNT/file" bs=16K count=1 \
 run_check_umount_test_dev
 
 # Check data csum should not report false alerts
-run_check "$TOP/btrfs" check --check-data-csum "$dev1"
+run_check $SUDO_HELPER "$TOP/btrfs" check --check-data-csum "$dev1"
 
 cleanup_loopdevs