diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/generate_kube_test.go | 11 | ||||
-rw-r--r-- | test/system/410-selinux.bats | 4 | ||||
-rw-r--r-- | test/system/420-cgroups.bats | 4 | ||||
-rw-r--r-- | test/system/helpers.bash | 12 |
4 files changed, 28 insertions, 3 deletions
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index cb556991c..cb987e139 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -6,6 +6,8 @@ import ( "path/filepath" "strconv" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/util" . "github.com/containers/podman/v3/test/utils" "github.com/ghodss/yaml" @@ -555,6 +557,15 @@ var _ = Describe("Podman generate kube", func() { kube.WaitWithDefaultTimeout() Expect(kube).Should(Exit(0)) + b, err := ioutil.ReadFile(outputFile) + Expect(err).ShouldNot(HaveOccurred()) + pod := new(v1.Pod) + err = yaml.Unmarshal(b, pod) + Expect(err).To(BeNil()) + val, found := pod.Annotations[define.BindMountPrefix+vol1] + Expect(found).To(BeTrue()) + Expect(val).To(HaveSuffix("z")) + rm := podmanTest.Podman([]string{"pod", "rm", "-f", "test1"}) rm.WaitWithDefaultTimeout() Expect(rm).Should(Exit(0)) diff --git a/test/system/410-selinux.bats b/test/system/410-selinux.bats index 5ee0e0715..0f7c35c65 100644 --- a/test/system/410-selinux.bats +++ b/test/system/410-selinux.bats @@ -113,6 +113,10 @@ function check_label() { @test "podman selinux: shared context in (some) namespaces" { 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 exec myctr cat -v /proc/self/attr/current context_c1="$output" diff --git a/test/system/420-cgroups.bats b/test/system/420-cgroups.bats index 89c81a742..025a20012 100644 --- a/test/system/420-cgroups.bats +++ b/test/system/420-cgroups.bats @@ -8,9 +8,7 @@ load helpers @test "podman run, preserves initial --cgroup-manager" { skip_if_remote "podman-remote does not support --cgroup-manager" - if is_rootless && is_cgroupsv1; then - skip "not supported as rootless under cgroups v1" - fi + skip_if_rootless_cgroupsv1 # Find out our default cgroup manager, and from that, get the non-default run_podman info --format '{{.Host.CgroupManager}}' diff --git a/test/system/helpers.bash b/test/system/helpers.bash index 28ea924bb..666735b0c 100644 --- a/test/system/helpers.bash +++ b/test/system/helpers.bash @@ -428,6 +428,18 @@ function skip_if_cgroupsv1() { 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 ################################## |