summaryrefslogtreecommitdiff
path: root/test/e2e/pod_create_test.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-09-13 11:54:08 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-09-16 07:42:19 -0400
commitb3d6383f25e71748793535733a767c60ccfcbd82 (patch)
tree847b11be7a0587ff338ed45232b889ed359df6c1 /test/e2e/pod_create_test.go
parent0d14d7b7152ac7a0856fcbb2bbc0f7238ab182d6 (diff)
downloadpodman-b3d6383f25e71748793535733a767c60ccfcbd82.tar.gz
podman-b3d6383f25e71748793535733a767c60ccfcbd82.tar.bz2
podman-b3d6383f25e71748793535733a767c60ccfcbd82.zip
Fix podman pod create --infra-command and --infra-image
Currently infr-command and --infra-image commands are ignored from the user. This PR instruments them and adds tests for each combination. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e/pod_create_test.go')
-rw-r--r--test/e2e/pod_create_test.go76
1 files changed, 76 insertions, 0 deletions
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index f260a123a..ed62e8a4b 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -329,4 +329,80 @@ var _ = Describe("Podman pod create", func() {
Expect(session.ExitCode()).To(Equal(0))
}
})
+
+ It("podman create pod with defaults", func() {
+ name := "test"
+ session := podmanTest.Podman([]string{"pod", "create", "--name", name})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ check := podmanTest.Podman([]string{"pod", "inspect", name})
+ check.WaitWithDefaultTimeout()
+ Expect(check.ExitCode()).To(Equal(0))
+ data := check.InspectPodToJSON()
+
+ check1 := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.Config.Entrypoint}}", data.Containers[0].ID})
+ check1.WaitWithDefaultTimeout()
+ Expect(check1.ExitCode()).To(Equal(0))
+ Expect(check1.OutputToString()).To(Equal("/pause"))
+ })
+
+ It("podman create pod with --infra-command", func() {
+ name := "test"
+ session := podmanTest.Podman([]string{"pod", "create", "--infra-command", "/pause1", "--name", name})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ check := podmanTest.Podman([]string{"pod", "inspect", name})
+ check.WaitWithDefaultTimeout()
+ Expect(check.ExitCode()).To(Equal(0))
+ data := check.InspectPodToJSON()
+
+ check1 := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.Config.Entrypoint}}", data.Containers[0].ID})
+ check1.WaitWithDefaultTimeout()
+ Expect(check1.ExitCode()).To(Equal(0))
+ Expect(check1.OutputToString()).To(Equal("/pause1"))
+ })
+
+ It("podman create pod with --infra-image", func() {
+ dockerfile := `FROM docker.io/library/alpine:latest
+entrypoint ["/fromimage"]
+`
+ podmanTest.BuildImage(dockerfile, "localhost/infra", "false")
+ name := "test"
+ session := podmanTest.Podman([]string{"pod", "create", "--infra-image", "localhost/infra", "--name", name})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ check := podmanTest.Podman([]string{"pod", "inspect", name})
+ check.WaitWithDefaultTimeout()
+ Expect(check.ExitCode()).To(Equal(0))
+ data := check.InspectPodToJSON()
+
+ check1 := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.Config.Entrypoint}}", data.Containers[0].ID})
+ check1.WaitWithDefaultTimeout()
+ Expect(check1.ExitCode()).To(Equal(0))
+ Expect(check1.OutputToString()).To(Equal("/fromimage"))
+ })
+
+ It("podman create pod with --infra-command --infra-image", func() {
+ dockerfile := `FROM docker.io/library/alpine:latest
+entrypoint ["/fromimage"]
+`
+ podmanTest.BuildImage(dockerfile, "localhost/infra", "false")
+ name := "test"
+ session := podmanTest.Podman([]string{"pod", "create", "--infra-image", "localhost/infra", "--infra-command", "/fromcommand", "--name", name})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ check := podmanTest.Podman([]string{"pod", "inspect", name})
+ check.WaitWithDefaultTimeout()
+ Expect(check.ExitCode()).To(Equal(0))
+ data := check.InspectPodToJSON()
+
+ check1 := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.Config.Entrypoint}}", data.Containers[0].ID})
+ check1.WaitWithDefaultTimeout()
+ Expect(check1.ExitCode()).To(Equal(0))
+ Expect(check1.OutputToString()).To(Equal("/fromcommand"))
+ })
})