diff options
author | Jakub Guzik <jakubmguzik@gmail.com> | 2021-07-26 22:37:45 +0200 |
---|---|---|
committer | Jakub Guzik <jakubmguzik@gmail.com> | 2021-07-26 22:37:45 +0200 |
commit | 7fa4d2cb18055d10847b2ede366205a44ec4a255 (patch) | |
tree | 9b4ded48c0f1662543f15a5ecc0e1e1304541503 | |
parent | 4f5b19c5080543974c3498804b43d277271b2f33 (diff) | |
download | podman-7fa4d2cb18055d10847b2ede366205a44ec4a255.tar.gz podman-7fa4d2cb18055d10847b2ede366205a44ec4a255.tar.bz2 podman-7fa4d2cb18055d10847b2ede366205a44ec4a255.zip |
Add prune until filter test for podman volume cli
This commit follows work started in #10756. Changes made in #11015
enabled cli support for volume prune --filter until. Adding e2e test
closes #10579.
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
-rw-r--r-- | docs/source/markdown/podman-volume-prune.1.md | 6 | ||||
-rw-r--r-- | test/e2e/volume_prune_test.go | 31 |
2 files changed, 32 insertions, 5 deletions
diff --git a/docs/source/markdown/podman-volume-prune.1.md b/docs/source/markdown/podman-volume-prune.1.md index 9477cb5d5..b9599c200 100644 --- a/docs/source/markdown/podman-volume-prune.1.md +++ b/docs/source/markdown/podman-volume-prune.1.md @@ -23,12 +23,8 @@ Do not prompt for confirmation. Filter volumes to be pruned. Volumes can be filtered by the following attributes: -- dangling -- driver - label -- name -- opt -- scope +- until #### **--help** diff --git a/test/e2e/volume_prune_test.go b/test/e2e/volume_prune_test.go index 68a257110..364ca0ab7 100644 --- a/test/e2e/volume_prune_test.go +++ b/test/e2e/volume_prune_test.go @@ -63,6 +63,37 @@ var _ = Describe("Podman volume prune", func() { podmanTest.Cleanup() }) + It("podman prune volume --filter until", func() { + session := podmanTest.Podman([]string{"volume", "create", "--label", "label1=value1", "myvol1"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + session = podmanTest.Podman([]string{"volume", "ls"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(len(session.OutputToStringArray())).To(Equal(2)) + + session = podmanTest.Podman([]string{"volume", "prune", "--force", "--filter", "until=50"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + session = podmanTest.Podman([]string{"volume", "ls"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(len(session.OutputToStringArray())).To(Equal(2)) + + session = podmanTest.Podman([]string{"volume", "prune", "--force", "--filter", "until=5000000000"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + session = podmanTest.Podman([]string{"volume", "ls"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(len(session.OutputToStringArray())).To(Equal(0)) + + podmanTest.Cleanup() + }) + It("podman prune volume --filter", func() { session := podmanTest.Podman([]string{"volume", "create", "--label", "label1=value1", "myvol1"}) session.WaitWithDefaultTimeout() |