summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-22 14:11:24 -0400
committerGitHub <noreply@github.com>2021-07-22 14:11:24 -0400
commit365775489f24bcfe84a7e5257cf64ea51d523b6e (patch)
tree4cc046907e0b658cfda5507562e475e09baa3525 /test
parent6370622444676db812cbc54aef56e691ea7788d0 (diff)
parent2d8e837a9b351536fa45da8f80de5df118db6f1b (diff)
downloadpodman-365775489f24bcfe84a7e5257cf64ea51d523b6e.tar.gz
podman-365775489f24bcfe84a7e5257cf64ea51d523b6e.tar.bz2
podman-365775489f24bcfe84a7e5257cf64ea51d523b6e.zip
Merge pull request #11015 from jmguzik/until-list-volume
Add until filter to volume ls filters list
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/30-volumes.at2
-rw-r--r--test/e2e/volume_ls_test.go16
2 files changed, 18 insertions, 0 deletions
diff --git a/test/apiv2/30-volumes.at b/test/apiv2/30-volumes.at
index b639e05f9..fd1542293 100644
--- a/test/apiv2/30-volumes.at
+++ b/test/apiv2/30-volumes.at
@@ -174,6 +174,8 @@ t POST libpod/volumes/create \
# with date way back in the past, volume should not be deleted (compat api)
t POST volumes/prune?filters='{"until":["500000"]}' 200
t GET libpod/volumes/json?filters='{"label":["testuntilcompat"]}' 200 length=1
+t GET libpod/volumes/json?filters='{"until":["500000"]}' 200 length=0
+t GET libpod/volumes/json?filters='{"until":["5000000000"]}' 200 length=1
# with date far in the future, volume should be deleted (compat api)
t POST volumes/prune?filters='{"until":["5000000000"]}' 200
diff --git a/test/e2e/volume_ls_test.go b/test/e2e/volume_ls_test.go
index ff3551ad9..0dd1a2b7c 100644
--- a/test/e2e/volume_ls_test.go
+++ b/test/e2e/volume_ls_test.go
@@ -101,6 +101,22 @@ var _ = Describe("Podman volume ls", func() {
Expect(len(session.OutputToStringArray())).To(Equal(0))
})
+ It("podman ls volume with --filter until flag", func() {
+ session := podmanTest.Podman([]string{"volume", "create"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"volume", "ls", "--filter", "until=5000000000"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(2))
+
+ session = podmanTest.Podman([]string{"volume", "ls", "--filter", "until=50000"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(0))
+ })
+
It("podman volume ls with --filter dangling", func() {
volName1 := "volume1"
session := podmanTest.Podman([]string{"volume", "create", volName1})