summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2020-02-03 22:39:50 -0500
committerMatthew Heon <mheon@redhat.com>2020-02-04 09:52:25 -0500
commitee5b749e653f4c78298d1e290d5a1ae03edc3c05 (patch)
tree997b4c37b9fbe5d9cac564f62c241750c9950d40 /test
parentc4f6d5615a34ea67b1335a2a446bd09789d98015 (diff)
downloadpodman-ee5b749e653f4c78298d1e290d5a1ae03edc3c05.tar.gz
podman-ee5b749e653f4c78298d1e290d5a1ae03edc3c05.tar.bz2
podman-ee5b749e653f4c78298d1e290d5a1ae03edc3c05.zip
Force --all when --filter is passed to podman ps
When we filter, it should be out of all containers, not just running ones, by default - this is necessary to ensure Docker compatability. Fixes #5050 Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/ps_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go
index 12bfdfe41..fccc5c93b 100644
--- a/test/e2e/ps_test.go
+++ b/test/e2e/ps_test.go
@@ -227,6 +227,22 @@ var _ = Describe("Podman ps", func() {
Expect(output[0]).To(Equal(fullCid))
})
+ It("podman ps filter by exited does not need all", func() {
+ ctr := podmanTest.Podman([]string{"run", "-t", "-i", ALPINE, "ls", "/"})
+ ctr.WaitWithDefaultTimeout()
+ Expect(ctr.ExitCode()).To(Equal(0))
+
+ psAll := podmanTest.Podman([]string{"ps", "-aq", "--no-trunc"})
+ psAll.WaitWithDefaultTimeout()
+ Expect(psAll.ExitCode()).To(Equal(0))
+
+ psFilter := podmanTest.Podman([]string{"ps", "--no-trunc", "--quiet", "--filter", "status=exited"})
+ psFilter.WaitWithDefaultTimeout()
+ Expect(psFilter.ExitCode()).To(Equal(0))
+
+ Expect(psAll.OutputToString()).To(Equal(psFilter.OutputToString()))
+ })
+
It("podman ps mutually exclusive flags", func() {
session := podmanTest.Podman([]string{"ps", "-aqs"})
session.WaitWithDefaultTimeout()