diff mbox series

[3/4] btrfs-progs: fix fsck-tests/059 to run without root

Message ID bd2af0ac1f8723ffa81dad28b56f138fd24cd2f6.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 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.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 tests/fsck-tests/059-shrunk-device/test.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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"