summaryrefslogtreecommitdiff
path: root/test/e2e/generate_kube_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-25 10:44:03 -0700
committerGitHub <noreply@github.com>2021-03-25 10:44:03 -0700
commit24581d8760691af1657c4f890d42ebd76f5e85c4 (patch)
treed2714d9c46161f51420690222652b0e08c144a04 /test/e2e/generate_kube_test.go
parentd64ebc5369192253a76d6463a95a697c481fd9aa (diff)
parentcbf53c166d674d294e0eec784ca7f7d3bd6ccd90 (diff)
downloadpodman-24581d8760691af1657c4f890d42ebd76f5e85c4.tar.gz
podman-24581d8760691af1657c4f890d42ebd76f5e85c4.tar.bz2
podman-24581d8760691af1657c4f890d42ebd76f5e85c4.zip
Merge pull request #9759 from EduardoVega/9129-multi-docs-kube
Support multi doc yaml for generate/play kube
Diffstat (limited to 'test/e2e/generate_kube_test.go')
-rw-r--r--test/e2e/generate_kube_test.go36
1 files changed, 19 insertions, 17 deletions
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go
index 9cfda0e75..1c53307bd 100644
--- a/test/e2e/generate_kube_test.go
+++ b/test/e2e/generate_kube_test.go
@@ -155,6 +155,23 @@ var _ = Describe("Podman generate kube", func() {
Expect(numContainers).To(Equal(1))
})
+ It("podman generate kube multiple pods", func() {
+ pod1 := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:pod1", ALPINE, "top"})
+ pod1.WaitWithDefaultTimeout()
+ Expect(pod1.ExitCode()).To(Equal(0))
+
+ pod2 := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:pod2", ALPINE, "top"})
+ pod2.WaitWithDefaultTimeout()
+ Expect(pod2.ExitCode()).To(Equal(0))
+
+ kube := podmanTest.Podman([]string{"generate", "kube", "pod1", "pod2"})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube.ExitCode()).To(Equal(0))
+
+ Expect(string(kube.Out.Contents())).To(ContainSubstring(`name: pod1`))
+ Expect(string(kube.Out.Contents())).To(ContainSubstring(`name: pod2`))
+ })
+
It("podman generate kube on pod with host network", func() {
podSession := podmanTest.Podman([]string{"pod", "create", "--name", "testHostNetwork", "--network", "host"})
podSession.WaitWithDefaultTimeout()
@@ -537,21 +554,6 @@ var _ = Describe("Podman generate kube", func() {
Expect(inspect.OutputToString()).To(ContainSubstring(`"pid"`))
})
- It("podman generate kube multiple pods should fail", func() {
- SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
- pod1 := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:pod1", ALPINE, "top"})
- pod1.WaitWithDefaultTimeout()
- Expect(pod1.ExitCode()).To(Equal(0))
-
- pod2 := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:pod2", ALPINE, "top"})
- pod2.WaitWithDefaultTimeout()
- Expect(pod2.ExitCode()).To(Equal(0))
-
- kube := podmanTest.Podman([]string{"generate", "kube", "pod1", "pod2"})
- kube.WaitWithDefaultTimeout()
- Expect(kube.ExitCode()).ToNot(Equal(0))
- })
-
It("podman generate kube with pods and containers should fail", func() {
pod1 := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:pod1", ALPINE, "top"})
pod1.WaitWithDefaultTimeout()
@@ -594,7 +596,7 @@ var _ = Describe("Podman generate kube", func() {
Expect(kube.ExitCode()).To(Equal(0))
})
- It("podman generate kube with containers in a pod should fail", func() {
+ It("podman generate kube with containers in pods should fail", func() {
pod1 := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:pod1", "--name", "top1", ALPINE, "top"})
pod1.WaitWithDefaultTimeout()
Expect(pod1.ExitCode()).To(Equal(0))
@@ -603,7 +605,7 @@ var _ = Describe("Podman generate kube", func() {
pod2.WaitWithDefaultTimeout()
Expect(pod2.ExitCode()).To(Equal(0))
- kube := podmanTest.Podman([]string{"generate", "kube", "pod1", "pod2"})
+ kube := podmanTest.Podman([]string{"generate", "kube", "top1", "top2"})
kube.WaitWithDefaultTimeout()
Expect(kube.ExitCode()).ToNot(Equal(0))
})