mirror of
https://github.com/containers/podman.git
synced 2025-06-27 21:50:18 +08:00
Merge pull request #11798 from giuseppe/skip-pid-shared-ns-on-rootless-cgroups-v1
test: skip test on rootless cgroupsv1
This commit is contained in:
@ -113,6 +113,10 @@ function check_label() {
|
|||||||
@test "podman selinux: shared context in (some) namespaces" {
|
@test "podman selinux: shared context in (some) namespaces" {
|
||||||
skip_if_no_selinux
|
skip_if_no_selinux
|
||||||
|
|
||||||
|
# rootless users have no usable cgroups with cgroupsv1, so containers
|
||||||
|
# must use a pid namespace and not join an existing one.
|
||||||
|
skip_if_rootless_cgroupsv1
|
||||||
|
|
||||||
run_podman run -d --name myctr $IMAGE top
|
run_podman run -d --name myctr $IMAGE top
|
||||||
run_podman exec myctr cat -v /proc/self/attr/current
|
run_podman exec myctr cat -v /proc/self/attr/current
|
||||||
context_c1="$output"
|
context_c1="$output"
|
||||||
|
@ -8,9 +8,7 @@ load helpers
|
|||||||
@test "podman run, preserves initial --cgroup-manager" {
|
@test "podman run, preserves initial --cgroup-manager" {
|
||||||
skip_if_remote "podman-remote does not support --cgroup-manager"
|
skip_if_remote "podman-remote does not support --cgroup-manager"
|
||||||
|
|
||||||
if is_rootless && is_cgroupsv1; then
|
skip_if_rootless_cgroupsv1
|
||||||
skip "not supported as rootless under cgroups v1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find out our default cgroup manager, and from that, get the non-default
|
# Find out our default cgroup manager, and from that, get the non-default
|
||||||
run_podman info --format '{{.Host.CgroupManager}}'
|
run_podman info --format '{{.Host.CgroupManager}}'
|
||||||
|
@ -428,6 +428,18 @@ function skip_if_cgroupsv1() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
######################
|
||||||
|
# skip_if_rootless_cgroupsv1 # ...with an optional message
|
||||||
|
######################
|
||||||
|
function skip_if_rootless_cgroupsv1() {
|
||||||
|
if is_rootless; then
|
||||||
|
if ! is_cgroupsv2; then
|
||||||
|
local msg=$(_add_label_if_missing "$1" "rootless cgroupvs1")
|
||||||
|
skip "${msg:-not supported as rootless under cgroupsv1}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
# skip_if_journald_unavailable # rhbz#1895105: rootless journald permissions
|
# skip_if_journald_unavailable # rhbz#1895105: rootless journald permissions
|
||||||
##################################
|
##################################
|
||||||
|
Reference in New Issue
Block a user