Merge pull request #6232 from edsantiago/bats_cgroupsv1_fixes

system tests: small fixes for rawhide+cgroups v1
This commit is contained in:
OpenShift Merge Robot
2020-05-18 20:37:20 +02:00
committed by GitHub
3 changed files with 20 additions and 4 deletions

View File

@ -116,8 +116,17 @@ EOF
chmod 755 $mountpoint/myscript chmod 755 $mountpoint/myscript
# By default, volumes are mounted noexec. This should fail. # By default, volumes are mounted noexec. This should fail.
run_podman 126 run --rm --volume $myvolume:/vol:z $IMAGE /vol/myscript # ARGH. Unfortunately, runc (used for cgroups v1) produces a different error
is "$output" ".* OCI runtime permission denied.*" "run on volume, noexec" local expect_rc=126
local expect_msg='.* OCI runtime permission denied.*'
run_podman info --format '{{ .Host.OCIRuntime.Path }}'
if expr "$output" : ".*/runc"; then
expect_rc=1
expect_msg='.* exec user process caused.*permission denied'
fi
run_podman ${expect_rc} run --rm --volume $myvolume:/vol:z $IMAGE /vol/myscript
is "$output" "$expect_msg" "run on volume, noexec"
# With exec, it should pass # With exec, it should pass
run_podman run --rm -v $myvolume:/vol:z,exec $IMAGE /vol/myscript run_podman run --rm -v $myvolume:/vol:z,exec $IMAGE /vol/myscript

View File

@ -33,6 +33,13 @@ function teardown() {
# This test can fail in dev. environment because of SELinux. # This test can fail in dev. environment because of SELinux.
# quick fix: chcon -t container_runtime_exec_t ./bin/podman # quick fix: chcon -t container_runtime_exec_t ./bin/podman
@test "podman generate - systemd - basic" { @test "podman generate - systemd - basic" {
# podman initializes this if unset, but systemctl doesn't
if is_rootless; then
if [ -z "$XDG_RUNTIME_DIR" ]; then
export XDG_RUNTIME_DIR=/run/user/$(id -u)
fi
fi
cname=$(random_string) cname=$(random_string)
run_podman create --name $cname --detach $IMAGE top run_podman create --name $cname --detach $IMAGE top