summaryrefslogtreecommitdiff
path: root/test/e2e/pod_rm_test.go
diff options
context:
space:
mode:
authorcdoern <cdoern@redhat.com>2021-10-04 10:18:01 -0400
committerMatthew Heon <matthew.heon@pm.me>2021-11-12 11:08:25 -0500
commit3b67336b608efd72a0e7a023b85b1b3dc2dc4746 (patch)
tree8de77f2d0aeeca7a653db1572d4ea58959392ff7 /test/e2e/pod_rm_test.go
parentf8ede7c5ed01324f47ebc01f69c11ab1046e1ebb (diff)
downloadpodman-3b67336b608efd72a0e7a023b85b1b3dc2dc4746.tar.gz
podman-3b67336b608efd72a0e7a023b85b1b3dc2dc4746.tar.bz2
podman-3b67336b608efd72a0e7a023b85b1b3dc2dc4746.zip
Pod Rm Infra Improvements
Made changes so that if the pod contains all exited containers and only infra is running, remove the pod. resolves #11713 Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'test/e2e/pod_rm_test.go')
-rw-r--r--test/e2e/pod_rm_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go
index c5d91d679..ac1f322ef 100644
--- a/test/e2e/pod_rm_test.go
+++ b/test/e2e/pod_rm_test.go
@@ -301,4 +301,21 @@ var _ = Describe("Podman pod rm", func() {
Expect(session).Should(Exit(0))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
})
+
+ It("podman pod rm with exited containers", func() {
+ _, ec, podid := podmanTest.CreatePod(nil)
+ Expect(ec).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"run", "--pod", podid, ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"run", "--pod", podid, ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ result := podmanTest.Podman([]string{"pod", "rm", podid})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+ })
})