mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
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:

committed by
Ed Santiago

parent
a5aa524ca7
commit
7848291d89
@ -149,16 +149,11 @@ 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) produces a different error
|
run_podman 126 run --rm --volume $myvolume:/vol:noexec,z $IMAGE /vol/myscript
|
||||||
local expect_rc=126
|
|
||||||
local expect_msg='.* OCI permission denied.*'
|
|
||||||
if [[ $(podman_runtime) = "runc" ]]; then
|
|
||||||
expect_rc=1
|
|
||||||
expect_msg='.* exec user process caused.*permission denied'
|
|
||||||
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
|
||||||
is "$output" "$expect_msg" "run on volume, noexec"
|
# with itself (output changed some time in 2022?). Deal with all.
|
||||||
|
assert "$output" =~ 'permission denied' "run on volume, noexec"
|
||||||
|
|
||||||
# With the default, it should pass
|
# With the default, it should pass
|
||||||
run_podman run --rm -v $myvolume:/vol:z $IMAGE /vol/myscript
|
run_podman run --rm -v $myvolume:/vol:z $IMAGE /vol/myscript
|
||||||
|
Reference in New Issue
Block a user