summaryrefslogtreecommitdiff
path: root/test/e2e/play_kube_test.go
diff options
context:
space:
mode:
authorChen Zhiwei <zhiweik@gmail.com>2019-08-14 07:13:24 +0000
committerChen Zhiwei <zhiweik@gmail.com>2019-08-14 09:22:29 -0400
commitfb9e1d7d9f332e513d392c7b8ccf1093807bb1a0 (patch)
tree2404cf3100c07e22d9357f0570c42783bc7db251 /test/e2e/play_kube_test.go
parentce64c1403df0e4ca75be50e4a835cc0889b0c8ac (diff)
downloadpodman-fb9e1d7d9f332e513d392c7b8ccf1093807bb1a0.tar.gz
podman-fb9e1d7d9f332e513d392c7b8ccf1093807bb1a0.tar.bz2
podman-fb9e1d7d9f332e513d392c7b8ccf1093807bb1a0.zip
Fix play kube command in pod yaml
Signed-off-by: Chen Zhiwei <zhiweik@gmail.com>
Diffstat (limited to 'test/e2e/play_kube_test.go')
-rw-r--r--test/e2e/play_kube_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index 331412a39..b0a9f2ead 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -140,6 +140,30 @@ var _ = Describe("Podman generate kube", func() {
Expect(inspect.OutputToString()).To(ContainSubstring(ctrCmd[0]))
})
+ It("podman play kube test correct output", func() {
+ ctrName := "testCtr"
+ ctrCmd := []string{"echo", "hello"}
+ testContainer := Container{ctrCmd, ALPINE, ctrName, false, nil, nil}
+ tempFile := filepath.Join(podmanTest.TempDir, "kube.yaml")
+
+ err := generateKubeYaml([]Container{testContainer}, tempFile)
+ Expect(err).To(BeNil())
+
+ kube := podmanTest.Podman([]string{"play", "kube", tempFile})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube.ExitCode()).To(Equal(0))
+
+ logs := podmanTest.Podman([]string{"logs", ctrName})
+ logs.WaitWithDefaultTimeout()
+ Expect(logs.ExitCode()).To(Equal(0))
+ Expect(logs.OutputToString()).To(ContainSubstring("hello"))
+
+ inspect := podmanTest.Podman([]string{"inspect", ctrName, "--format", "'{{ .Config.Cmd }}'"})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect.ExitCode()).To(Equal(0))
+ Expect(inspect.OutputToString()).To(ContainSubstring("hello"))
+ })
+
It("podman play kube cap add", func() {
ctrName := "testCtr"
ctrCmd := []string{"cat", "/proc/self/status"}