summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-20 13:57:42 +0000
committerGitHub <noreply@github.com>2022-06-20 13:57:42 +0000
commitfe8e536328eef61f0cf7ffd42b74d4e5be4654ee (patch)
tree52f56b0a427d04313a363ab71f883a85b7b83faf /test/e2e
parent55052c6b9807b5a51b50abc90e391e872be450c2 (diff)
parent4811cb110accec51df168742df6a319f48ed37b6 (diff)
downloadpodman-fe8e536328eef61f0cf7ffd42b74d4e5be4654ee.tar.gz
podman-fe8e536328eef61f0cf7ffd42b74d4e5be4654ee.tar.bz2
podman-fe8e536328eef61f0cf7ffd42b74d4e5be4654ee.zip
Merge pull request #14556 from sstosh/system-prune-network
podman system prune support prune unused networks
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/prune_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/e2e/prune_test.go b/test/e2e/prune_test.go
index 75adf1724..119c8d41e 100644
--- a/test/e2e/prune_test.go
+++ b/test/e2e/prune_test.go
@@ -258,6 +258,29 @@ var _ = Describe("Podman prune", func() {
Expect(pods.OutputToStringArray()).To(HaveLen(2))
})
+ It("podman system prune networks", func() {
+ // About netavark network backend test.
+ session := podmanTest.Podman([]string{"network", "create", "test"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"system", "prune", "-f"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ // Default network should exists.
+ session = podmanTest.Podman([]string{"network", "ls", "-q", "--filter", "name=^podman$"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToStringArray()).To(HaveLen(1))
+
+ // Remove all unused networks.
+ session = podmanTest.Podman([]string{"network", "ls", "-q", "--filter", "name=^test$"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToStringArray()).To(HaveLen(0))
+ })
+
It("podman system prune - pod,container stopped", func() {
session := podmanTest.Podman([]string{"pod", "create"})
session.WaitWithDefaultTimeout()