diff options
author | Peter Hunt <pehunt@redhat.com> | 2019-07-02 09:34:32 -0400 |
---|---|---|
committer | Peter Hunt <pehunt@redhat.com> | 2019-07-02 15:18:44 -0400 |
commit | 341f5e22e5426e83e20174913fa274809a1f47ca (patch) | |
tree | ed687580e793c5f22a4c638cb782fae4639603a7 /test/e2e | |
parent | db2cc360334ec04e4c2c0a71335fd51540a1273f (diff) | |
download | podman-341f5e22e5426e83e20174913fa274809a1f47ca.tar.gz podman-341f5e22e5426e83e20174913fa274809a1f47ca.tar.bz2 podman-341f5e22e5426e83e20174913fa274809a1f47ca.zip |
Add test for generate kube with volumes
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/generate_kube_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index 1df54f753..49d2c12a8 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -207,4 +207,35 @@ var _ = Describe("Podman generate kube", func() { Expect(psOut).To(ContainSubstring("test1")) Expect(psOut).To(ContainSubstring("test2")) }) + + It("podman generate kube with volume", func() { + vol1 := filepath.Join(podmanTest.TempDir, "vol-test1") + err := os.MkdirAll(vol1, 0755) + Expect(err).To(BeNil()) + + // we need a container name because IDs don't persist after rm/play + ctrName := "test-ctr" + + session1 := podmanTest.Podman([]string{"run", "-d", "--pod", "new:test1", "--name", ctrName, "-v", vol1 + ":/volume/:z", "alpine", "top"}) + session1.WaitWithDefaultTimeout() + Expect(session1.ExitCode()).To(Equal(0)) + + outputFile := filepath.Join(podmanTest.RunRoot, "pod.yaml") + kube := podmanTest.Podman([]string{"generate", "kube", "test1", "-f", outputFile}) + kube.WaitWithDefaultTimeout() + Expect(kube.ExitCode()).To(Equal(0)) + + rm := podmanTest.Podman([]string{"pod", "rm", "-f", "test1"}) + 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{"inspect", ctrName}) + inspect.WaitWithDefaultTimeout() + Expect(inspect.ExitCode()).To(Equal(0)) + Expect(inspect.OutputToString()).To(ContainSubstring(vol1)) + }) }) |