diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-15 09:10:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-15 09:10:12 -0400 |
commit | 4b6ffda31c258aadcbc6171a7dd745d0fb17393c (patch) | |
tree | b05003f91e2f1fd73dd1cd945241d3d7188d2b5f /test | |
parent | 4dd7bfdfaa3adf95af39fd45f74d49cea0c80064 (diff) | |
parent | 84005330aa3d25cf6134fffc1bf20354d4a3dd85 (diff) | |
download | podman-4b6ffda31c258aadcbc6171a7dd745d0fb17393c.tar.gz podman-4b6ffda31c258aadcbc6171a7dd745d0fb17393c.tar.bz2 podman-4b6ffda31c258aadcbc6171a7dd745d0fb17393c.zip |
Merge pull request #11409 from cdoern/podVolumes
Pod Volumes Support
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/pod_create_test.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go index 7297bfc6e..7d40d36dd 100644 --- a/test/e2e/pod_create_test.go +++ b/test/e2e/pod_create_test.go @@ -850,4 +850,38 @@ ENTRYPOINT ["sleep","99999"] Expect(ok).To(BeTrue()) }) + It("podman pod create --volume", func() { + volName := "testVol" + volCreate := podmanTest.Podman([]string{"volume", "create", volName}) + volCreate.WaitWithDefaultTimeout() + Expect(volCreate).Should(Exit(0)) + podName := "testPod" + podCreate := podmanTest.Podman([]string{"pod", "create", "--volume", volName + ":/tmp1", "--name", podName}) + podCreate.WaitWithDefaultTimeout() + Expect(podCreate).Should(Exit(0)) + podInspect := podmanTest.Podman([]string{"pod", "inspect", podName}) + podInspect.WaitWithDefaultTimeout() + Expect(podInspect).Should(Exit(0)) + data := podInspect.InspectPodToJSON() + Expect(data.Mounts[0].Name).To(Equal(volName)) + ctrName := "testCtr" + ctrCreate := podmanTest.Podman([]string{"create", "--pod", podName, "--name", ctrName, ALPINE}) + ctrCreate.WaitWithDefaultTimeout() + Expect(ctrCreate).Should(Exit(0)) + ctrInspect := podmanTest.Podman([]string{"inspect", ctrName}) + ctrInspect.WaitWithDefaultTimeout() + Expect(ctrInspect).Should(Exit(0)) + ctrData := ctrInspect.InspectContainerToJSON() + Expect(ctrData[0].Mounts[0].Name).To(Equal(volName)) + + ctr2 := podmanTest.Podman([]string{"run", "--pod", podName, ALPINE, "sh", "-c", "echo hello >> " + "/tmp1/test"}) + ctr2.WaitWithDefaultTimeout() + Expect(ctr2).Should(Exit(0)) + + ctr3 := podmanTest.Podman([]string{"run", "--pod", podName, ALPINE, "cat", "/tmp1/test"}) + ctr3.WaitWithDefaultTimeout() + Expect(ctr3.OutputToString()).To(ContainSubstring("hello")) + + }) + }) |