From d2100cd47359ef0afa1a25f6f3a6a7708cd855f7 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 12 Feb 2020 17:06:53 -0500 Subject: Only set --all when a status filter is given to ps The changes in #5075 turn out to be too aggressive; we should only be setting --all if a status= filter is given. Otherwise only running containers are filtered. Signed-off-by: Matthew Heon --- test/e2e/ps_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go index fccc5c93b..48dd186e2 100644 --- a/test/e2e/ps_test.go +++ b/test/e2e/ps_test.go @@ -243,6 +243,19 @@ var _ = Describe("Podman ps", func() { Expect(psAll.OutputToString()).To(Equal(psFilter.OutputToString())) }) + It("podman filter without status does not find non-running", func() { + ctrName := "aContainerName" + ctr := podmanTest.Podman([]string{"create", "--name", ctrName, "-t", "-i", ALPINE, "ls", "/"}) + ctr.WaitWithDefaultTimeout() + Expect(ctr.ExitCode()).To(Equal(0)) + + psFilter := podmanTest.Podman([]string{"ps", "--no-trunc", "--quiet", "--format", "{{.Names}}", "--filter", fmt.Sprintf("name=%s", ctrName)}) + psFilter.WaitWithDefaultTimeout() + Expect(psFilter.ExitCode()).To(Equal(0)) + + Expect(strings.Contains(psFilter.OutputToString(), ctrName)).To(BeFalse()) + }) + It("podman ps mutually exclusive flags", func() { session := podmanTest.Podman([]string{"ps", "-aqs"}) session.WaitWithDefaultTimeout() -- cgit v1.2.3-54-g00ecf