summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnders F Björklund <anders.f.bjorklund@gmail.com>2020-11-14 20:10:57 +0100
committerAnders F Björklund <anders.f.bjorklund@gmail.com>2020-11-14 20:18:52 +0100
commit0dad2499a33e3d76eb4508a52c7449224ee1e10b (patch)
tree1e70b1a1ff898cfa4f72bbc2b83bfda1a10aade3 /test
parent738d62ea960af439bd545820e1853cbd73464493 (diff)
downloadpodman-0dad2499a33e3d76eb4508a52c7449224ee1e10b.tar.gz
podman-0dad2499a33e3d76eb4508a52c7449224ee1e10b.tar.bz2
podman-0dad2499a33e3d76eb4508a52c7449224ee1e10b.zip
Add support for volume ls --filter label=key=value
Supposed to be able to search for labels with a given value. Previously it meant searching for label key and label value: --filter label=key --filter label=value Add some documentation and integration tests for it as well. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/volume_ls_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/e2e/volume_ls_test.go b/test/e2e/volume_ls_test.go
index cda118bf1..5c466124d 100644
--- a/test/e2e/volume_ls_test.go
+++ b/test/e2e/volume_ls_test.go
@@ -83,6 +83,22 @@ var _ = Describe("Podman volume ls", func() {
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(Equal(2))
Expect(session.OutputToStringArray()[1]).To(ContainSubstring(volName))
+
+ session = podmanTest.Podman([]string{"volume", "ls", "--filter", "label=foo=foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"volume", "ls", "--filter", "label=foo=bar"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(2))
+ Expect(session.OutputToStringArray()[1]).To(ContainSubstring(volName))
+
+ session = podmanTest.Podman([]string{"volume", "ls", "--filter", "label=foo=baz"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(0))
})
It("podman volume ls with --filter dangling", func() {
@@ -132,5 +148,11 @@ var _ = Describe("Podman volume ls", func() {
Expect(session.OutputToStringArray()[1]).To(ContainSubstring(volName))
Expect(session.OutputToStringArray()[2]).To(ContainSubstring(anotherVol))
+ session = podmanTest.Podman([]string{"volume", "ls", "--filter", "label=foo=bar", "--filter", "label=foo2=bar2"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(3))
+ Expect(session.OutputToStringArray()[1]).To(ContainSubstring(volName))
+ Expect(session.OutputToStringArray()[2]).To(ContainSubstring(anotherVol))
})
})