diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-10-01 15:32:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-01 15:32:14 -0400 |
commit | 1de96f2c4c390bae29c303e2390da9e87a993d3f (patch) | |
tree | b9a2839581ca47bc7cbac93eabb248144d073848 /test | |
parent | 9dddd6ab4bd8d5d142ffc53732668212da34b0e6 (diff) | |
parent | 6da97c86314d8c80b912ba83db57fd26da19bfb7 (diff) | |
download | podman-1de96f2c4c390bae29c303e2390da9e87a993d3f.tar.gz podman-1de96f2c4c390bae29c303e2390da9e87a993d3f.tar.bz2 podman-1de96f2c4c390bae29c303e2390da9e87a993d3f.zip |
Merge pull request #11777 from cdoern/podVolumesFrom
Pod Volumes From Support
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/pod_create_test.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go index e8bc871da..34e879ed4 100644 --- a/test/e2e/pod_create_test.go +++ b/test/e2e/pod_create_test.go @@ -924,4 +924,37 @@ ENTRYPOINT ["sleep","99999"] } }) + It("podman pod create --volumes-from", func() { + volName := "testVol" + volCreate := podmanTest.Podman([]string{"volume", "create", volName}) + volCreate.WaitWithDefaultTimeout() + Expect(volCreate).Should(Exit(0)) + ctrName := "testCtr" + ctrCreate := podmanTest.Podman([]string{"create", "--volume", volName + ":/tmp1", "--name", ctrName, ALPINE}) + ctrCreate.WaitWithDefaultTimeout() + Expect(ctrCreate).Should(Exit(0)) + ctrInspect := podmanTest.Podman([]string{"inspect", ctrName}) + ctrInspect.WaitWithDefaultTimeout() + Expect(ctrInspect).Should(Exit(0)) + data := ctrInspect.InspectContainerToJSON() + Expect(data[0].Mounts[0].Name).To(Equal(volName)) + podName := "testPod" + podCreate := podmanTest.Podman([]string{"pod", "create", "--volumes-from", ctrName, "--name", podName}) + podCreate.WaitWithDefaultTimeout() + Expect(podCreate).Should(Exit(0)) + podInspect := podmanTest.Podman([]string{"pod", "inspect", podName}) + podInspect.WaitWithDefaultTimeout() + Expect(podInspect).Should(Exit(0)) + podData := podInspect.InspectPodToJSON() + Expect(podData.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")) + }) + }) |