diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-07-15 17:30:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 17:30:16 -0400 |
commit | 12b67aaf62b6e99f94db7ea89dad87f16a9fbd86 (patch) | |
tree | ce0c74860f2ccaeb7e85dceb4bbd370d1b282b93 /test/e2e | |
parent | 9d87dc74084b9b1ae67106a23cf3ed5327ca0681 (diff) | |
parent | f7321681d04d65da3b307d1e5e4ba12c42b5c456 (diff) | |
download | podman-12b67aaf62b6e99f94db7ea89dad87f16a9fbd86.tar.gz podman-12b67aaf62b6e99f94db7ea89dad87f16a9fbd86.tar.bz2 podman-12b67aaf62b6e99f94db7ea89dad87f16a9fbd86.zip |
Merge pull request #10894 from cdoern/pidPod
podman pod create --pid flag
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/pod_create_test.go | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go index 71fec8d21..63f55fb88 100644 --- a/test/e2e/pod_create_test.go +++ b/test/e2e/pod_create_test.go @@ -560,4 +560,65 @@ ENTRYPOINT ["sleep","99999"] podJSON := podInspect.InspectPodToJSON() Expect(podJSON.CPUSetCPUs).To(Equal(in)) }) + + It("podman pod create --pid", func() { + podName := "pidPod" + ns := "ns:/proc/self/ns/" + podCreate := podmanTest.Podman([]string{"pod", "create", "--pid", ns, "--name", podName, "--share", "pid"}) + podCreate.WaitWithDefaultTimeout() + Expect(podCreate.ExitCode()).To(Equal(0)) + + podInspect := podmanTest.Podman([]string{"pod", "inspect", podName}) + podInspect.WaitWithDefaultTimeout() + Expect(podInspect.ExitCode()).To(Equal(0)) + podJSON := podInspect.InspectPodToJSON() + Expect(podJSON.InfraConfig.PidNS).To(Equal("path")) + + podName = "pidPod2" + ns = "pod" + + podCreate = podmanTest.Podman([]string{"pod", "create", "--pid", ns, "--name", podName, "--share", "pid"}) + podCreate.WaitWithDefaultTimeout() + Expect(podCreate.ExitCode()).To(Equal(0)) + + podInspect = podmanTest.Podman([]string{"pod", "inspect", podName}) + podInspect.WaitWithDefaultTimeout() + Expect(podInspect.ExitCode()).To(Equal(0)) + podJSON = podInspect.InspectPodToJSON() + Expect(podJSON.InfraConfig.PidNS).To(Equal("pod")) + + podName = "pidPod3" + ns = "host" + + podCreate = podmanTest.Podman([]string{"pod", "create", "--pid", ns, "--name", podName, "--share", "pid"}) + podCreate.WaitWithDefaultTimeout() + Expect(podCreate.ExitCode()).To(Equal(0)) + + podInspect = podmanTest.Podman([]string{"pod", "inspect", podName}) + podInspect.WaitWithDefaultTimeout() + Expect(podInspect.ExitCode()).To(Equal(0)) + podJSON = podInspect.InspectPodToJSON() + Expect(podJSON.InfraConfig.PidNS).To(Equal("host")) + + podName = "pidPod4" + ns = "private" + + podCreate = podmanTest.Podman([]string{"pod", "create", "--pid", ns, "--name", podName, "--share", "pid"}) + podCreate.WaitWithDefaultTimeout() + Expect(podCreate.ExitCode()).To(Equal(0)) + + podInspect = podmanTest.Podman([]string{"pod", "inspect", podName}) + podInspect.WaitWithDefaultTimeout() + Expect(podInspect.ExitCode()).To(Equal(0)) + podJSON = podInspect.InspectPodToJSON() + Expect(podJSON.InfraConfig.PidNS).To(Equal("private")) + + podName = "pidPod5" + ns = "container:randomfakeid" + + podCreate = podmanTest.Podman([]string{"pod", "create", "--pid", ns, "--name", podName, "--share", "pid"}) + podCreate.WaitWithDefaultTimeout() + Expect(podCreate).Should(ExitWithError()) + + }) }) |