mirror of
https://github.com/containers/podman.git
synced 2025-07-03 17:27:18 +08:00
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>
This commit is contained in:
@ -23,12 +23,8 @@ Do not prompt for confirmation.
|
|||||||
|
|
||||||
Filter volumes to be pruned. Volumes can be filtered by the following attributes:
|
Filter volumes to be pruned. Volumes can be filtered by the following attributes:
|
||||||
|
|
||||||
- dangling
|
|
||||||
- driver
|
|
||||||
- label
|
- label
|
||||||
- name
|
- until
|
||||||
- opt
|
|
||||||
- scope
|
|
||||||
|
|
||||||
#### **--help**
|
#### **--help**
|
||||||
|
|
||||||
|
@ -63,6 +63,37 @@ var _ = Describe("Podman volume prune", func() {
|
|||||||
podmanTest.Cleanup()
|
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() {
|
It("podman prune volume --filter", func() {
|
||||||
session := podmanTest.Podman([]string{"volume", "create", "--label", "label1=value1", "myvol1"})
|
session := podmanTest.Podman([]string{"volume", "create", "--label", "label1=value1", "myvol1"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
|
Reference in New Issue
Block a user