aboutsummaryrefslogtreecommitdiff
path: root/test/e2e/containers_conf_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/containers_conf_test.go')
-rw-r--r--test/e2e/containers_conf_test.go35
1 files changed, 33 insertions, 2 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"))
+ })
+
})