diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-06-20 13:57:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-20 13:57:42 +0000 |
commit | fe8e536328eef61f0cf7ffd42b74d4e5be4654ee (patch) | |
tree | 52f56b0a427d04313a363ab71f883a85b7b83faf /test/e2e | |
parent | 55052c6b9807b5a51b50abc90e391e872be450c2 (diff) | |
parent | 4811cb110accec51df168742df6a319f48ed37b6 (diff) | |
download | podman-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.go | 23 |
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() |