From 0001f0a735eab90857052782c3ce8c8da19ade5b Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 10 Apr 2023 14:11:33 -0400 Subject: [PATCH] btrfs-progs: tests: fix fsck-tests/059 to run without root We missed a couple of $SUDO_HELPER uses in this test that made it impossible to run without root. Add them in so we can run as a normal user. Reviewed-by: Neal Gompa Signed-off-by: Josef Bacik Signed-off-by: David Sterba --- tests/fsck-tests/059-shrunk-device/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsck-tests/059-shrunk-device/test.sh b/tests/fsck-tests/059-shrunk-device/test.sh index 140ee3a4..3ac2640f 100755 --- a/tests/fsck-tests/059-shrunk-device/test.sh +++ b/tests/fsck-tests/059-shrunk-device/test.sh @@ -14,7 +14,7 @@ _mktemp_local "$file" 1g dev=$(run_check_stdout $SUDO_HELPER losetup --find --show "$file") -run_check "$TOP/mkfs.btrfs" -f "$dev" +run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$dev" # The original device size from prepare_loopdevs is 2G. # Since the fs is empty, shrinking it to 996m will not cause any @@ -26,5 +26,5 @@ dev=$(run_check_stdout $SUDO_HELPER losetup --find --show "$file") run_mustfail "btrfs check should detect errors in device size" \ "$TOP/btrfs" check "$dev" -losetup -d "$dev" +$SUDO_HELPER losetup -d "$dev" rm -- "$file"