Skip to content

Commit 6e4d1ca

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 actually-unreadable case, which can happen with crun 1.24. Signed-off-by: Nalin Dahyabhai <[email protected]>
1 parent af18a2e commit 6e4d1ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/run.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -981,10 +981,10 @@ _EOF
981981

982982
run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine
983983
cid=$output
984-
for mask in /proc/acpi /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
984+
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
985985
if test -d $mask; then
986-
run_buildah run $cid ls $mask
987-
expect_output "" "Directories should be empty"
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
990990
run_buildah run $cid cat $mask

0 commit comments

Comments
 (0)