summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-17 12:57:20 +0100
committerGitHub <noreply@github.com>2022-01-17 12:57:20 +0100
commit8514ebd1827b12bae8b5d53d8f0e36244d1b3c3a (patch)
treed8ccbe18806a8d03ac1d89754d4f009103803c5e /test/e2e
parent26cf6c82c82cbf45afe5998e4a881b9f52202a01 (diff)
parent607cb80bf77642c02b80bff56aa4c3e396a91fa0 (diff)
downloadpodman-8514ebd1827b12bae8b5d53d8f0e36244d1b3c3a.tar.gz
podman-8514ebd1827b12bae8b5d53d8f0e36244d1b3c3a.tar.bz2
podman-8514ebd1827b12bae8b5d53d8f0e36244d1b3c3a.zip
Merge pull request #12860 from rhatdan/cgroups
Use CONTAINERS_CONF cgroups flag for remote API.
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/containers_conf_test.go35
-rw-r--r--test/e2e/cp_test.go2
-rw-r--r--test/e2e/pod_infra_container_test.go2
-rw-r--r--test/e2e/pod_kill_test.go2
-rw-r--r--test/e2e/pod_ps_test.go2
-rw-r--r--test/e2e/run_ns_test.go4
-rw-r--r--test/e2e/run_selinux_test.go2
-rw-r--r--test/e2e/run_test.go12
-rw-r--r--test/e2e/toolbox_test.go2
9 files changed, 47 insertions, 16 deletions
diff --git a/test/e2e/containers_conf_test.go b/test/e2e/containers_conf_test.go
index 838221dd5..d6bf66a50 100644
--- a/test/e2e/containers_conf_test.go
+++ b/test/e2e/containers_conf_test.go
@@ -83,7 +83,7 @@ var _ = Describe("Podman run", func() {
})
It("podman Capabilities in containers.conf", func() {
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
+ SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
cap := podmanTest.Podman([]string{"run", ALPINE, "grep", "CapEff", "/proc/self/status"})
cap.WaitWithDefaultTimeout()
Expect(cap).Should(Exit(0))
@@ -123,7 +123,7 @@ var _ = Describe("Podman run", func() {
})
verifyNSHandling := func(nspath, option string) {
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
+ SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
os.Setenv("CONTAINERS_CONF", "config/containers-ns.conf")
if IsRemote() {
podmanTest.RestartRemoteService()
@@ -484,4 +484,35 @@ var _ = Describe("Podman run", func() {
Expect(result).Should(Exit(125))
Expect(result.ErrorToString()).To(ContainSubstring(errorString))
})
+
+ It("podman containers.conf cgroups=disabled", func() {
+ if !strings.Contains(podmanTest.OCIRuntime, "crun") {
+ Skip("FIXME: requires crun")
+ }
+ conffile := filepath.Join(podmanTest.TempDir, "container.conf")
+
+ err := ioutil.WriteFile(conffile, []byte("[containers]\ncgroups=\"disabled\"\n"), 0755)
+ Expect(err).To(BeNil())
+
+ result := podmanTest.Podman([]string{"create", ALPINE, "true"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+
+ inspect := podmanTest.Podman([]string{"inspect", "--format", "{{ .HostConfig.Cgroups }}", result.OutputToString()})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect.OutputToString()).To(Not(Equal("disabled")))
+
+ os.Setenv("CONTAINERS_CONF", conffile)
+ if IsRemote() {
+ podmanTest.RestartRemoteService()
+ }
+ result = podmanTest.Podman([]string{"create", ALPINE, "true"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+
+ inspect = podmanTest.Podman([]string{"inspect", "--format", "{{ .HostConfig.Cgroups }}", result.OutputToString()})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect.OutputToString()).To(Equal("disabled"))
+ })
+
})
diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go
index 360b8c7fc..70b559222 100644
--- a/test/e2e/cp_test.go
+++ b/test/e2e/cp_test.go
@@ -94,7 +94,7 @@ var _ = Describe("Podman cp", func() {
// Copy a file to the container, then back to the host in --pid=host
It("podman cp --pid=host file", func() {
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
+ SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
srcFile, err := ioutil.TempFile("", "")
Expect(err).To(BeNil())
defer srcFile.Close()
diff --git a/test/e2e/pod_infra_container_test.go b/test/e2e/pod_infra_container_test.go
index 4a5a8c6b0..f4b99bb6b 100644
--- a/test/e2e/pod_infra_container_test.go
+++ b/test/e2e/pod_infra_container_test.go
@@ -225,7 +225,7 @@ var _ = Describe("Podman pod create", func() {
})
It("podman pod container can override pod pid NS", func() {
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
+ SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
session := podmanTest.Podman([]string{"pod", "create", "--share", "pid"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
diff --git a/test/e2e/pod_kill_test.go b/test/e2e/pod_kill_test.go
index 7ab62ec5d..0bd9aa0f1 100644
--- a/test/e2e/pod_kill_test.go
+++ b/test/e2e/pod_kill_test.go
@@ -128,7 +128,7 @@ var _ = Describe("Podman pod kill", func() {
})
It("podman pod kill all", func() {
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
+ SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
_, ec, podid := podmanTest.CreatePod(nil)
Expect(ec).To(Equal(0))
diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go
index 4b2a3b66d..281aea9a9 100644
--- a/test/e2e/pod_ps_test.go
+++ b/test/e2e/pod_ps_test.go
@@ -174,7 +174,7 @@ var _ = Describe("Podman ps", func() {
})
It("podman pod ps --ctr-names", func() {
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
+ SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
_, ec, podid := podmanTest.CreatePod(nil)
Expect(ec).To(Equal(0))
diff --git a/test/e2e/run_ns_test.go b/test/e2e/run_ns_test.go
index db81cc1a7..7f4b58c0d 100644
--- a/test/e2e/run_ns_test.go
+++ b/test/e2e/run_ns_test.go
@@ -36,7 +36,7 @@ var _ = Describe("Podman run ns", func() {
})
It("podman run pidns test", func() {
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
+ SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
session := podmanTest.Podman([]string{"run", fedoraMinimal, "bash", "-c", "echo $$"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -115,7 +115,7 @@ var _ = Describe("Podman run ns", func() {
})
It("podman run --ipc=host --pid=host", func() {
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
+ SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
cmd := exec.Command("ls", "-l", "/proc/self/ns/pid")
res, err := cmd.Output()
Expect(err).To(BeNil())
diff --git a/test/e2e/run_selinux_test.go b/test/e2e/run_selinux_test.go
index a6672d45e..5ae49a5c2 100644
--- a/test/e2e/run_selinux_test.go
+++ b/test/e2e/run_selinux_test.go
@@ -260,7 +260,7 @@ var _ = Describe("Podman run", func() {
})
It("podman test --pid=host", func() {
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
+ SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
session := podmanTest.Podman([]string{"run", "--pid=host", ALPINE, "cat", "/proc/self/attr/current"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index e98f2c999..b461594c1 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -386,31 +386,31 @@ var _ = Describe("Podman run", func() {
SkipIfCgroupV1("podman umask on /sys/fs/cgroup will fail with cgroups V1")
SkipIfRootless("/sys/fs/cgroup rw access is needed")
- rwOnCGroups := "/sys/fs/cgroup cgroup2 rw"
+ rwOnCgroups := "/sys/fs/cgroup cgroup2 rw"
session := podmanTest.Podman([]string{"run", "--security-opt", "unmask=ALL", "--security-opt", "mask=/sys/fs/cgroup", ALPINE, "cat", "/proc/mounts"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.OutputToString()).To(ContainSubstring(rwOnCGroups))
+ Expect(session.OutputToString()).To(ContainSubstring(rwOnCgroups))
session = podmanTest.Podman([]string{"run", "--security-opt", "unmask=/sys/fs/cgroup", ALPINE, "cat", "/proc/mounts"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.OutputToString()).To(ContainSubstring(rwOnCGroups))
+ Expect(session.OutputToString()).To(ContainSubstring(rwOnCgroups))
session = podmanTest.Podman([]string{"run", "--security-opt", "unmask=/sys/fs/cgroup///", ALPINE, "cat", "/proc/mounts"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.OutputToString()).To(ContainSubstring(rwOnCGroups))
+ Expect(session.OutputToString()).To(ContainSubstring(rwOnCgroups))
session = podmanTest.Podman([]string{"run", "--security-opt", "unmask=ALL", ALPINE, "cat", "/proc/mounts"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.OutputToString()).To(ContainSubstring(rwOnCGroups))
+ Expect(session.OutputToString()).To(ContainSubstring(rwOnCgroups))
session = podmanTest.Podman([]string{"run", "--security-opt", "unmask=/sys/fs/cgroup", "--security-opt", "mask=/sys/fs/cgroup", ALPINE, "cat", "/proc/mounts"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.OutputToString()).To(ContainSubstring(rwOnCGroups))
+ Expect(session.OutputToString()).To(ContainSubstring(rwOnCgroups))
session = podmanTest.Podman([]string{"run", "--security-opt", "unmask=/sys/fs/cgroup", ALPINE, "ls", "/sys/fs/cgroup"})
session.WaitWithDefaultTimeout()
diff --git a/test/e2e/toolbox_test.go b/test/e2e/toolbox_test.go
index 40db5180a..72ada5c31 100644
--- a/test/e2e/toolbox_test.go
+++ b/test/e2e/toolbox_test.go
@@ -118,7 +118,7 @@ var _ = Describe("Toolbox-specific testing", func() {
if podmanTest.RemoteTest {
Skip("Shm size check does not work with a remote client")
}
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
+ SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
var session *PodmanSessionIntegration
var cmd *exec.Cmd
var hostShmSize, containerShmSize int