diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-11-15 15:13:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-15 15:13:51 +0100 |
commit | 392075631a284617b7e37b8bdfb3157f5918cdec (patch) | |
tree | 5b4d74bef8ff1a77c0bd5429c3f0076f6c07d90f /test | |
parent | 9fa09a83b30c5d9300eb40b3d50b405153b37f7a (diff) | |
parent | 0dad2499a33e3d76eb4508a52c7449224ee1e10b (diff) | |
download | podman-392075631a284617b7e37b8bdfb3157f5918cdec.tar.gz podman-392075631a284617b7e37b8bdfb3157f5918cdec.tar.bz2 podman-392075631a284617b7e37b8bdfb3157f5918cdec.zip |
Merge pull request #8345 from afbjorklund/volume-filter
Add support for volume ls --filter label=key=value
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/volume_ls_test.go | 22 |
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)) }) }) |