diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-12-13 07:33:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-13 07:33:12 -0800 |
commit | e3a1a7efca7f64b125fcd4f627a871bc699b5888 (patch) | |
tree | 564e4e4030f644ead1cdf3a0607123cf7c142580 /test/e2e/start_test.go | |
parent | d8d3950dd3c2ca15ae32bc94e1bedc088a66a1d8 (diff) | |
parent | 9786542620afea96d5eee2d05b7e1dec38a8235d (diff) | |
download | podman-e3a1a7efca7f64b125fcd4f627a871bc699b5888.tar.gz podman-e3a1a7efca7f64b125fcd4f627a871bc699b5888.tar.bz2 podman-e3a1a7efca7f64b125fcd4f627a871bc699b5888.zip |
Merge pull request #1989 from baude/deletecontainerfailstart
failed containers with --rm should remove themselves
Diffstat (limited to 'test/e2e/start_test.go')
-rw-r--r-- | test/e2e/start_test.go | 26 |
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)) + }) }) |