summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-08-27 15:25:54 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-09-09 12:06:10 -0400
commit046178e55f72ed9db7cf5898d3be91b0112ab94f (patch)
treead844579a48f043d1959233ca881307801f79a45 /test
parent16a70490852fdaf3ea5aeea6b2be19dd70fbf1c7 (diff)
downloadpodman-046178e55f72ed9db7cf5898d3be91b0112ab94f.tar.gz
podman-046178e55f72ed9db7cf5898d3be91b0112ab94f.tar.bz2
podman-046178e55f72ed9db7cf5898d3be91b0112ab94f.zip
Add function for looking up volumes by partial name
This isn't included in Docker, but seems handy enough. Use the new API for 'volume rm' and 'volume inspect'. Fixes #3891 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/volume_rm_test.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/e2e/volume_rm_test.go b/test/e2e/volume_rm_test.go
index 5dcf51ccd..61cf9b893 100644
--- a/test/e2e/volume_rm_test.go
+++ b/test/e2e/volume_rm_test.go
@@ -89,4 +89,38 @@ var _ = Describe("Podman volume rm", func() {
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(Equal(0))
})
+
+ It("podman volume rm by partial name", func() {
+ session := podmanTest.Podman([]string{"volume", "create", "myvol"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"volume", "rm", "myv"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"volume", "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(0))
+ })
+
+ It("podman volume rm by nonunique partial name", func() {
+ session := podmanTest.Podman([]string{"volume", "create", "myvol1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"volume", "create", "myvol2"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"volume", "rm", "myv"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+
+ session = podmanTest.Podman([]string{"volume", "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray()) >= 2).To(BeTrue())
+ })
})