summaryrefslogtreecommitdiff
path: root/test/e2e/create_test.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-04-12 10:57:10 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-04-12 22:14:00 +0200
commit0a7b5b4e086ee4583b8550d80934dfa5c356ff64 (patch)
treeb24ffcee237bfcd5f2c1016c995428d44f941ff8 /test/e2e/create_test.go
parent387d6012ba5ef0860df665132c1e3e3017405b8f (diff)
downloadpodman-0a7b5b4e086ee4583b8550d80934dfa5c356ff64.tar.gz
podman-0a7b5b4e086ee4583b8550d80934dfa5c356ff64.tar.bz2
podman-0a7b5b4e086ee4583b8550d80934dfa5c356ff64.zip
create: fix segfault if container name already exists
do not try to use ctr if there was an error. It fixes a segfault when there is already a container with the same name. regression introduced by: ba65301c955454e47c3893ca548f18a845a4c4a9 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test/e2e/create_test.go')
-rw-r--r--test/e2e/create_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index 6ed5ad2d8..105cba37c 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -70,6 +70,17 @@ var _ = Describe("Podman create", func() {
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
})
+ It("podman create using existing name", func() {
+ session := podmanTest.Podman([]string{"create", "--name=foo", ALPINE, "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainers()).To(Equal(1))
+
+ session = podmanTest.Podman([]string{"create", "--name=foo", ALPINE, "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
+ })
+
It("podman create adds annotation", func() {
session := podmanTest.Podman([]string{"create", "--annotation", "HELLO=WORLD", ALPINE, "ls"})
session.WaitWithDefaultTimeout()