diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-07-19 03:27:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-19 03:27:28 +0200 |
commit | 398aeac8537e82ca813bb77e44ddfcefa5cc5ad5 (patch) | |
tree | e102899dd712e697edba88e84c0041a014294fa0 /test | |
parent | deb087d7b173832138c2e46ab4b7b626a98a910c (diff) | |
parent | 5047c79e71a336da1fa2e0b8fc6e50811801f878 (diff) | |
download | podman-398aeac8537e82ca813bb77e44ddfcefa5cc5ad5.tar.gz podman-398aeac8537e82ca813bb77e44ddfcefa5cc5ad5.tar.bz2 podman-398aeac8537e82ca813bb77e44ddfcefa5cc5ad5.zip |
Merge pull request #3599 from QiWang19/ps-regexp
support podman ps filter regular expressions
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/ps_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go index 2b86f663f..efcf44f76 100644 --- a/test/e2e/ps_test.go +++ b/test/e2e/ps_test.go @@ -332,4 +332,30 @@ var _ = Describe("Podman ps", func() { Expect(result.ExitCode()).To(Equal(0)) Expect(result.OutputToStringArray()[0]).To(Equal(fullCid)) }) + + It("podman ps filter name regexp", func() { + session := podmanTest.Podman([]string{"run", "-d", "--name", "test1", ALPINE, "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + fullCid := session.OutputToString() + + session2 := podmanTest.Podman([]string{"run", "-d", "--name", "test11", ALPINE, "top"}) + session2.WaitWithDefaultTimeout() + Expect(session2.ExitCode()).To(Equal(0)) + + result := podmanTest.Podman([]string{"ps", "-aq", "--no-trunc", "--filter", "name=test1"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + + output := result.OutputToStringArray() + Expect(len(output)).To(Equal(2)) + + result = podmanTest.Podman([]string{"ps", "-aq", "--no-trunc", "--filter", "name=test1$"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + + output = result.OutputToStringArray() + Expect(len(output)).To(Equal(1)) + Expect(output[0]).To(Equal(fullCid)) + }) }) |