summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-07-27 09:38:12 -0400
committerGitHub <noreply@github.com>2022-07-27 09:38:12 -0400
commiteea8e570f2af82944e61410e5e7dd9b540feae34 (patch)
treec910ea4c27decea8fbe1d767dce874b9e5ef58a2 /test
parent0bf6ee61dd2a533cd482d2175594fadf488c43a6 (diff)
parent4724a0000d48d372c84057a065e40a1bd298603a (diff)
downloadpodman-eea8e570f2af82944e61410e5e7dd9b540feae34.tar.gz
podman-eea8e570f2af82944e61410e5e7dd9b540feae34.tar.bz2
podman-eea8e570f2af82944e61410e5e7dd9b540feae34.zip
Merge pull request #14997 from cdoern/prune
prune filter handling
Diffstat (limited to 'test')
-rw-r--r--test/e2e/prune_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/e2e/prune_test.go b/test/e2e/prune_test.go
index 89cc65540..0b1d68aea 100644
--- a/test/e2e/prune_test.go
+++ b/test/e2e/prune_test.go
@@ -280,6 +280,24 @@ var _ = Describe("Podman prune", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session.OutputToStringArray()).To(HaveLen(0))
+
+ // Create new network.
+ session = podmanTest.Podman([]string{"network", "create", "test1", "--label", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ // Remove all unused networks.
+ session = podmanTest.Podman([]string{"system", "prune", "-f", "--filter", "label!=foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).Should(Equal("Total reclaimed space: 0B"))
+
+ // Unused networks removed.
+ session = podmanTest.Podman([]string{"network", "ls", "-q", "--filter", "name=^test1$"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ // label should make sure we do not remove this network
+ Expect(session.OutputToStringArray()).To(HaveLen(1))
})
It("podman system prune - pod,container stopped", func() {