summaryrefslogtreecommitdiff
path: root/test/e2e/pod_create_test.go
diff options
context:
space:
mode:
authorcdoern <cdoern@redhat.com>2021-09-01 10:59:23 -0400
committercdoern <cdoern@redhat.com>2021-09-14 08:32:07 -0400
commit84005330aa3d25cf6134fffc1bf20354d4a3dd85 (patch)
treeaef148fafb73e36c3fed0fd7c0f2696f98a71c79 /test/e2e/pod_create_test.go
parentad26684856551251100b945305f91246888ef153 (diff)
downloadpodman-84005330aa3d25cf6134fffc1bf20354d4a3dd85.tar.gz
podman-84005330aa3d25cf6134fffc1bf20354d4a3dd85.tar.bz2
podman-84005330aa3d25cf6134fffc1bf20354d4a3dd85.zip
Pod Volumes Support
added support for the --volume flag in pods using the new infra container design. users can specify all volume options they can with regular containers resolves #10379 Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'test/e2e/pod_create_test.go')
-rw-r--r--test/e2e/pod_create_test.go34
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"))
+
+ })
+
})