diff options
author | Peter Hunt <pehunt@redhat.com> | 2020-09-10 17:22:53 -0400 |
---|---|---|
committer | Peter Hunt <pehunt@redhat.com> | 2020-09-10 17:22:55 -0400 |
commit | b80b95eea0c2f32de6101e558ce5314e1bd08c25 (patch) | |
tree | 6f018ff8ddb629b7a976b574f8ca67303ec2e9e1 /test/e2e/generate_kube_test.go | |
parent | 96bc5eb4b77d00f59a342b7af1f6f3ecd35772a5 (diff) | |
download | podman-b80b95eea0c2f32de6101e558ce5314e1bd08c25.tar.gz podman-b80b95eea0c2f32de6101e558ce5314e1bd08c25.tar.bz2 podman-b80b95eea0c2f32de6101e558ce5314e1bd08c25.zip |
play/generate: support shareProcessNamespace
this is an option that allows a user to specify whether to share PID namespace in the pod
for play kube and generate kube
associated test added
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'test/e2e/generate_kube_test.go')
-rw-r--r-- | test/e2e/generate_kube_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index 3c3fb5a4d..e886c6000 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -348,4 +348,33 @@ var _ = Describe("Podman generate kube", func() { Expect(inspect.ExitCode()).To(Equal(0)) Expect(inspect.OutputToString()).To(ContainSubstring(vol1)) }) + + It("podman generate kube sharing pid namespace", func() { + podName := "test" + podSession := podmanTest.Podman([]string{"pod", "create", "--name", podName, "--share", "pid"}) + podSession.WaitWithDefaultTimeout() + Expect(podSession.ExitCode()).To(Equal(0)) + + session := podmanTest.Podman([]string{"create", "--pod", podName, "--name", "test1", ALPINE, "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + outputFile := filepath.Join(podmanTest.RunRoot, "pod.yaml") + kube := podmanTest.Podman([]string{"generate", "kube", podName, "-f", outputFile}) + kube.WaitWithDefaultTimeout() + Expect(kube.ExitCode()).To(Equal(0)) + + rm := podmanTest.Podman([]string{"pod", "rm", "-f", podName}) + rm.WaitWithDefaultTimeout() + Expect(rm.ExitCode()).To(Equal(0)) + + play := podmanTest.Podman([]string{"play", "kube", outputFile}) + play.WaitWithDefaultTimeout() + Expect(play.ExitCode()).To(Equal(0)) + + inspect := podmanTest.Podman([]string{"pod", "inspect", podName}) + inspect.WaitWithDefaultTimeout() + Expect(inspect.ExitCode()).To(Equal(0)) + Expect(inspect.OutputToString()).To(ContainSubstring(`"pid"`)) + }) }) |