summaryrefslogtreecommitdiff
path: root/test/e2e/start_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/start_test.go')
-rw-r--r--test/e2e/start_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/e2e/start_test.go b/test/e2e/start_test.go
index c11511d1f..64245c609 100644
--- a/test/e2e/start_test.go
+++ b/test/e2e/start_test.go
@@ -89,4 +89,30 @@ var _ = Describe("Podman start", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(125))
})
+
+ It("podman failed to start with --rm should delete the container", func() {
+ session := podmanTest.Podman([]string{"create", "-it", "--rm", ALPINE, "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ start := podmanTest.Podman([]string{"start", "-l"})
+ start.WaitWithDefaultTimeout()
+ Expect(start.ExitCode()).To(Not(Equal(0)))
+
+ numContainers := podmanTest.NumberOfContainers()
+ Expect(numContainers).To(BeZero())
+ })
+
+ It("podman failed to start without --rm should NOT delete the container", func() {
+ session := podmanTest.Podman([]string{"create", "-it", ALPINE, "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ start := podmanTest.Podman([]string{"start", "-l"})
+ start.WaitWithDefaultTimeout()
+ Expect(start.ExitCode()).To(Not(Equal(0)))
+
+ numContainers := podmanTest.NumberOfContainers()
+ Expect(numContainers).To(Equal(1))
+ })
})