summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2021-08-11 08:38:20 +0000
committerGitHub <noreply@github.com>2021-08-11 08:38:20 +0000
commit1968fdc874516e1195985024fd268d9a8da22953 (patch)
treeb4fc775df82c68aa64fe8309b1b0d75eeff196f8 /test
parent99e7ea51c7ae76216ba37cdfa9100574cb80d957 (diff)
parented30ae4a8aacf87cb9be3cfed2e43499cb4d8649 (diff)
downloadpodman-1968fdc874516e1195985024fd268d9a8da22953.tar.gz
podman-1968fdc874516e1195985024fd268d9a8da22953.tar.bz2
podman-1968fdc874516e1195985024fd268d9a8da22953.zip
Merge pull request #11173 from jmguzik/pod-ps-until-filter
Add until filter to podman pod ps
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/40-pods.at3
-rw-r--r--test/e2e/pod_ps_test.go16
2 files changed, 19 insertions, 0 deletions
diff --git a/test/apiv2/40-pods.at b/test/apiv2/40-pods.at
index 94c72dbaa..985b26411 100644
--- a/test/apiv2/40-pods.at
+++ b/test/apiv2/40-pods.at
@@ -19,6 +19,9 @@ t GET libpod/pods/json 200 \
.[0].Id=$pod_id \
.[0].Containers\|length=1
+t GET libpod/pods/json?filters='{"until":["500000"]}' 200 length=0
+t GET libpod/pods/json?filters='{"until":["5000000000"]}' 200 length=1
+
# Cannot create a dup pod with the same name
t POST "libpod/pods/create (dup pod)" name=foo 409 \
.cause="pod already exists"
diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go
index c27539d6f..b4a0df904 100644
--- a/test/e2e/pod_ps_test.go
+++ b/test/e2e/pod_ps_test.go
@@ -108,6 +108,22 @@ var _ = Describe("Podman ps", func() {
Expect(result).Should(Exit(0))
})
+ It("podman pod ps --filter until", func() {
+ name := "mypod"
+ _, ec, _ := podmanTest.CreatePod(map[string][]string{"--name": {name}})
+ Expect(ec).To(Equal(0))
+
+ result := podmanTest.Podman([]string{"pod", "ps", "--filter", "until=50"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(Not(ContainSubstring(name)))
+
+ result = podmanTest.Podman([]string{"pod", "ps", "--filter", "until=5000000000"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(name))
+ })
+
It("podman pod ps filter name regexp", func() {
_, ec, podid := podmanTest.CreatePod(map[string][]string{"--name": {"mypod"}})
Expect(ec).To(Equal(0))