summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-13 16:44:52 +0100
committerGitHub <noreply@github.com>2022-01-13 16:44:52 +0100
commitab7228b3c27719e447de4dffe9b3fd7f67d6f346 (patch)
tree281392e18e84d47b859554b0bd612ea5db431e98 /test
parente98058a3cf4f5ba4cd2d37dfdb2a0951b9aa9730 (diff)
parentf257d983943d6ec2253d50a245cd4810cab45e4b (diff)
downloadpodman-ab7228b3c27719e447de4dffe9b3fd7f67d6f346.tar.gz
podman-ab7228b3c27719e447de4dffe9b3fd7f67d6f346.tar.bz2
podman-ab7228b3c27719e447de4dffe9b3fd7f67d6f346.zip
Merge pull request #12836 from cdoern/podSysCtl
Podman Pod Create --sysctl support
Diffstat (limited to 'test')
-rw-r--r--test/e2e/pod_create_test.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index fab107af8..623377ea1 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -1029,4 +1029,43 @@ ENTRYPOINT ["sleep","99999"]
Expect(inspect[0].AppArmorProfile).To(Equal(apparmor.Profile))
})
+
+ It("podman pod create --sysctl test", func() {
+ SkipIfRootless("Network sysctls are not available root rootless")
+ podCreate := podmanTest.Podman([]string{"pod", "create", "--sysctl", "net.core.somaxconn=65535"})
+ podCreate.WaitWithDefaultTimeout()
+ Expect(podCreate).Should(Exit(0))
+ session := podmanTest.Podman([]string{"run", "--pod", podCreate.OutputToString(), "--rm", ALPINE, "sysctl", "net.core.somaxconn"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).To(ContainSubstring("net.core.somaxconn = 65535"))
+
+ // if not sharing the net NS, nothing should fail, but the sysctl should not be passed
+ podCreate = podmanTest.Podman([]string{"pod", "create", "--share", "pid", "--sysctl", "net.core.somaxconn=65535"})
+ podCreate.WaitWithDefaultTimeout()
+ Expect(podCreate).Should(Exit(0))
+ session = podmanTest.Podman([]string{"run", "--pod", podCreate.OutputToString(), "--rm", ALPINE, "sysctl", "net.core.somaxconn"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).NotTo(ContainSubstring("net.core.somaxconn = 65535"))
+
+ // one other misc option
+ podCreate = podmanTest.Podman([]string{"pod", "create", "--sysctl", "kernel.msgmax=65535"})
+ podCreate.WaitWithDefaultTimeout()
+ Expect(podCreate).Should(Exit(0))
+ session = podmanTest.Podman([]string{"run", "--pod", podCreate.OutputToString(), "--rm", ALPINE, "sysctl", "kernel.msgmax"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).To(ContainSubstring("kernel.msgmax = 65535"))
+
+ podCreate = podmanTest.Podman([]string{"pod", "create", "--share", "pid", "--sysctl", "kernel.msgmax=65535"})
+ podCreate.WaitWithDefaultTimeout()
+ Expect(podCreate).Should(Exit(0))
+ session = podmanTest.Podman([]string{"run", "--pod", podCreate.OutputToString(), "--rm", ALPINE, "sysctl", "kernel.msgmax"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).NotTo(ContainSubstring("kernel.msgmax = 65535"))
+
+ })
+
})