diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-06-28 00:32:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 00:32:58 +0000 |
commit | d095053b9cda99b009d102c5b595e77b980ee1a0 (patch) | |
tree | 8f0850f53d3ad4f978c25e11555a84b2d1d1f61d /test/e2e | |
parent | 9c4b8a29b06c179725983e7fa8fadf7ee68d9863 (diff) | |
parent | 3b10c1b78a8aa2acab59d1a99a010437a73a50b8 (diff) | |
download | podman-d095053b9cda99b009d102c5b595e77b980ee1a0.tar.gz podman-d095053b9cda99b009d102c5b595e77b980ee1a0.tar.bz2 podman-d095053b9cda99b009d102c5b595e77b980ee1a0.zip |
Merge pull request #14597 from containers/closes_14583
Use Regexp in volume ls --filter name
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/volume_ls_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/e2e/volume_ls_test.go b/test/e2e/volume_ls_test.go index 19f87fb8a..dcfb13f4e 100644 --- a/test/e2e/volume_ls_test.go +++ b/test/e2e/volume_ls_test.go @@ -152,6 +152,37 @@ var _ = Describe("Podman volume ls", func() { Expect(lsDangling).Should(Exit(0)) Expect(lsDangling.OutputToString()).To(ContainSubstring(volName1)) }) + + It("podman ls volume with --filter name", func() { + volName1 := "volume1" + session := podmanTest.Podman([]string{"volume", "create", volName1}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + volName2 := "volume2" + session2 := podmanTest.Podman([]string{"volume", "create", volName2}) + session2.WaitWithDefaultTimeout() + Expect(session2).Should(Exit(0)) + + session = podmanTest.Podman([]string{"volume", "ls", "--filter", "name=volume1*"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(session.OutputToStringArray()).To(HaveLen(3)) + Expect(session.OutputToStringArray()[1]).To(ContainSubstring(volName1)) + Expect(session.OutputToStringArray()[2]).To(ContainSubstring(volName2)) + + session = podmanTest.Podman([]string{"volume", "ls", "--filter", "name=volumex"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(session.OutputToStringArray()).To(BeEmpty()) + + session = podmanTest.Podman([]string{"volume", "ls", "--filter", "name=volume1"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(session.OutputToStringArray()).To(HaveLen(2)) + Expect(session.OutputToStringArray()[1]).To(ContainSubstring(volName1)) + }) + It("podman ls volume with multiple --filter flag", func() { session := podmanTest.Podman([]string{"volume", "create", "--label", "foo=bar", "myvol"}) volName := session.OutputToString() |