Skip to content

Commit

Permalink
Merge pull request #10861 from jmguzik/until-prune-volume-cmd
Browse files Browse the repository at this point in the history
Add prune until filter test for podman volume cli
  • Loading branch information
openshift-merge-robot authored Jul 27, 2021
2 parents 684f15e + 7fa4d2c commit 508dc03
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
6 changes: 1 addition & 5 deletions docs/source/markdown/podman-volume-prune.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down
31 changes: 31 additions & 0 deletions test/e2e/volume_prune_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 508dc03

Please sign in to comment.