From 9cd4768bde2665fc54d1e47aed0a880cfd0f5bff Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Wed, 10 Sep 2025 15:32:27 -0400 Subject: [PATCH] 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 --- tests/run.bats | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/run.bats b/tests/run.bats index 0697d49d6..7cf50723d 100644 --- a/tests/run.bats +++ b/tests/run.bats @@ -982,13 +982,13 @@ _EOF run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine cid=$output 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 sh -c "echo $mask/*" # globbing will fail whether it's simply unreadable, or readable but empty - expect_output "$mask/*" "Directories should be empty" + if test -d $mask; then + 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 - expect_output "" "Directories should be empty" + run_buildah run $cid cat $mask + expect_output "" "Directories should be empty" fi done }