summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/pod_infra_container_test.go16
-rw-r--r--test/e2e/prune_test.go18
2 files changed, 34 insertions, 0 deletions
diff --git a/test/e2e/pod_infra_container_test.go b/test/e2e/pod_infra_container_test.go
index a2e090524..b53630156 100644
--- a/test/e2e/pod_infra_container_test.go
+++ b/test/e2e/pod_infra_container_test.go
@@ -435,4 +435,20 @@ var _ = Describe("Podman pod create", func() {
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).To(ContainSubstring(hostname))
})
+
+ tests := []string{"", "none"}
+ for _, test := range tests {
+ test := test
+ It("podman pod create --share="+test+" should not create an infra ctr", func() {
+ session := podmanTest.Podman([]string{"pod", "create", "--share", test})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"pod", "inspect", "--format", "{{.NumContainers}}", session.OutputToString()})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).Should((Equal("0")))
+ })
+ }
+
})
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() {