system tests: fix volume exec/noexec test

The return code is "126" in the current version of runc.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
This commit is contained in:
Toshiki Sonoda
2023-02-02 18:18:28 +09:00
parent 68bbdc283f
commit 68371ff550

View File

@ -178,13 +178,8 @@ EOF
# By default, volumes are mounted exec, but we have manually added the # By default, volumes are mounted exec, but we have manually added the
# noexec option. This should fail. # noexec option. This should fail.
# ARGH. Unfortunately, runc (used for cgroups v1) has different exit status run_podman 126 run --rm --volume $myvolume:/vol:noexec,z $IMAGE /vol/myscript
local expect_rc=126
if [[ $(podman_runtime) = "runc" ]]; then
expect_rc=1
fi
run_podman ${expect_rc} run --rm --volume $myvolume:/vol:noexec,z $IMAGE /vol/myscript
# crun and runc emit different messages, and even runc is inconsistent # crun and runc emit different messages, and even runc is inconsistent
# with itself (output changed some time in 2022?). Deal with all. # with itself (output changed some time in 2022?). Deal with all.
assert "$output" =~ 'exec.* permission denied' "run on volume, noexec" assert "$output" =~ 'exec.* permission denied' "run on volume, noexec"