diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-11-05 01:54:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-05 01:54:22 +0100 |
commit | 3ef721fa1f406d95fdc16b2ba46bf865b4a0433d (patch) | |
tree | 70c5af5d43d5ad1c7f0d6bd09bd6c788a452c0dd /test | |
parent | ab273a9cbd08e25e3794c606a863644eb3a06e30 (diff) | |
parent | a47fe37a97b93911b4509636888018fa18de500d (diff) | |
download | podman-3ef721fa1f406d95fdc16b2ba46bf865b4a0433d.tar.gz podman-3ef721fa1f406d95fdc16b2ba46bf865b4a0433d.tar.bz2 podman-3ef721fa1f406d95fdc16b2ba46bf865b4a0433d.zip |
Merge pull request #8238 from joelsmith/master
Use regex for "pod ps" name filter to match "ps" behavior
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/pod_ps_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go index a299d3cf2..5d63d5985 100644 --- a/test/e2e/pod_ps_test.go +++ b/test/e2e/pod_ps_test.go @@ -107,6 +107,28 @@ var _ = Describe("Podman ps", func() { Expect(result.ExitCode()).To(Equal(0)) }) + It("podman pod ps filter name regexp", func() { + _, ec, podid := podmanTest.CreatePod("mypod") + Expect(ec).To(Equal(0)) + _, ec2, _ := podmanTest.CreatePod("mypod1") + Expect(ec2).To(Equal(0)) + + result := podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", "name=mypod"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + + output := result.OutputToStringArray() + Expect(len(output)).To(Equal(2)) + + result = podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", "name=mypod$"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + + output = result.OutputToStringArray() + Expect(len(output)).To(Equal(1)) + Expect(output[0]).To(Equal(podid)) + }) + It("podman pod ps mutually exclusive flags", func() { session := podmanTest.Podman([]string{"pod", "ps", "-q", "--format", "{{.ID}}"}) session.WaitWithDefaultTimeout() |