Skip to content

Commit 9cd4768

Browse files
committed
tests/run.bats: "run masks" test: accept "unreadable" masked directories
When checking that certain directories are masked, treat the readable-but-empty case as acceptable, as before, and now also accept the actually-unreadable case, which can happen with crun 1.24. Signed-off-by: Nalin Dahyabhai <[email protected]>
1 parent a18468f commit 9cd4768

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/run.bats

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -982,13 +982,13 @@ _EOF
982982
run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine
983983
cid=$output
984984
for mask in /proc/acpi /proc/interrupts /proc/kcore /proc/keys /proc/latency_stats /proc/sched_debug /proc/scsi /proc/timer_list /proc/timer_stats /sys/devices/virtual/powercap /sys/firmware /sys/fs/selinux; do
985-
if test -d $mask; then
986-
run_buildah run $cid sh -c "echo $mask/*" # globbing will fail whether it's simply unreadable, or readable but empty
987-
expect_output "$mask/*" "Directories should be empty"
985+
if test -d $mask; then
986+
run_buildah run $cid sh -c "echo $mask/*" # globbing will fail whether it's simply unreadable, or readable but empty
987+
expect_output "$mask/*" "Directories should be empty"
988988
fi
989989
if test -f $mask; then
990-
run_buildah run $cid cat $mask
991-
expect_output "" "Directories should be empty"
990+
run_buildah run $cid cat $mask
991+
expect_output "" "Directories should be empty"
992992
fi
993993
done
994994
}

0 commit comments

Comments
 (0)