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 <nalin@redhat.com>
This commit is contained in:
Nalin Dahyabhai 2025-09-10 15:32:27 -04:00
parent af18a2ea6a
commit 6e4d1ca83a
1 changed files with 3 additions and 3 deletions

View File

@ -981,10 +981,10 @@ _EOF
run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine
cid=$output
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
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
if test -d $mask; then
run_buildah run $cid ls $mask
expect_output "" "Directories should be empty"
run_buildah run $cid sh -c "echo $mask/*" # globbing will fail whether it's simply unreadable, or readable but empty
expect_output "$mask/*" "Directories should be empty"
fi
if test -f $mask; then
run_buildah run $cid cat $mask