diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-11-18 21:16:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-18 21:16:21 +0100 |
commit | 4434bd797842c3015c0e6132eaf2509fed370c26 (patch) | |
tree | 07576e5d9c5b37f06a48bc027ce1c1d73852c8e7 /test/e2e/pod_ps_test.go | |
parent | 8672c4dea05366ae65c609a4d7f7d848d1cf04e0 (diff) | |
parent | e7fd9234cd0e6a23e32dd31c912ac47883b59738 (diff) | |
download | podman-4434bd797842c3015c0e6132eaf2509fed370c26.tar.gz podman-4434bd797842c3015c0e6132eaf2509fed370c26.tar.bz2 podman-4434bd797842c3015c0e6132eaf2509fed370c26.zip |
Merge pull request #8395 from Luap99/podman-pod-ps-filters
Align the podman pod ps --filter behavior with podman ps
Diffstat (limited to 'test/e2e/pod_ps_test.go')
-rw-r--r-- | test/e2e/pod_ps_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go index 5d63d5985..ea8d10e78 100644 --- a/test/e2e/pod_ps_test.go +++ b/test/e2e/pod_ps_test.go @@ -194,12 +194,24 @@ var _ = Describe("Podman ps", func() { Expect(session.OutputToString()).To(ContainSubstring(podid1)) Expect(session.OutputToString()).To(Not(ContainSubstring(podid2))) + session = podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", "ctr-names=test", "--filter", "ctr-status=running"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(ContainSubstring(podid1)) + Expect(session.OutputToString()).To(Not(ContainSubstring(podid2))) + session = podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", fmt.Sprintf("ctr-ids=%s", cid)}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) Expect(session.OutputToString()).To(ContainSubstring(podid2)) Expect(session.OutputToString()).To(Not(ContainSubstring(podid1))) + session = podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", "ctr-ids=" + cid[:40], "--filter", "ctr-ids=" + cid + "$"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(ContainSubstring(podid2)) + Expect(session.OutputToString()).To(Not(ContainSubstring(podid1))) + _, ec3, podid3 := podmanTest.CreatePod("") Expect(ec3).To(Equal(0)) @@ -210,6 +222,13 @@ var _ = Describe("Podman ps", func() { Expect(session.OutputToString()).To(ContainSubstring(podid2)) Expect(session.OutputToString()).To(Not(ContainSubstring(podid3))) + session = podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", "ctr-number=1", "--filter", "ctr-number=0"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(ContainSubstring(podid1)) + Expect(session.OutputToString()).To(ContainSubstring(podid2)) + Expect(session.OutputToString()).To(ContainSubstring(podid3)) + session = podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", "ctr-status=running"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -224,6 +243,13 @@ var _ = Describe("Podman ps", func() { Expect(session.OutputToString()).To(Not(ContainSubstring(podid1))) Expect(session.OutputToString()).To(Not(ContainSubstring(podid3))) + session = podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", "ctr-status=exited", "--filter", "ctr-status=running"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(ContainSubstring(podid1)) + Expect(session.OutputToString()).To(ContainSubstring(podid2)) + Expect(session.OutputToString()).To(Not(ContainSubstring(podid3))) + session = podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", "ctr-status=created"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) |