summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-04 22:22:07 +0200
committerGitHub <noreply@github.com>2019-07-04 22:22:07 +0200
commitf7407f2eb512e1407f8281009eb829f37405119b (patch)
tree08bbb002a9bcac9620aeedb9c5b43bcb6ffc63ca /test
parent1fe2965e4f672674f7b66648e9973a0ed5434bb4 (diff)
parentaeabc45ccef10fc858677765675bd86944a93db6 (diff)
downloadpodman-f7407f2eb512e1407f8281009eb829f37405119b.tar.gz
podman-f7407f2eb512e1407f8281009eb829f37405119b.tar.bz2
podman-f7407f2eb512e1407f8281009eb829f37405119b.zip
Merge pull request #3472 from haircommander/generate-volumes
generate kube with volumes
Diffstat (limited to 'test')
-rw-r--r--test/e2e/generate_kube_test.go31
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))
+ })
})