Skip to content

Commit 52634ca

Browse files
andy5995claude
andcommitted
test: skip btrfs test if sudo requires a password
Prevents the test from hanging or failing in headless CI environments where passwordless sudo is not configured. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1cd4001 commit 52634ca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/test_btrfs_clone.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ BTRFS_IMAGE_MOUNTPOINT="/tmp/rmw-loop"
1111
IMAGE_PATH="${MESON_SOURCE_ROOT}/test/rmw-btrfs-test.img"
1212

1313
if [ ! -f "$IMAGE_PATH" ]; then
14-
echo "Test image not found, but exiting with zero anyway."
14+
echo "Test image not found; skipping."
15+
exit 0
16+
fi
17+
18+
if ! sudo -n true 2>/dev/null; then
19+
echo "sudo not available without password; skipping btrfs test."
1520
exit 0
1621
fi
1722

0 commit comments

Comments
 (0)