summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/create_test.go15
-rw-r--r--test/e2e/images_test.go11
-rw-r--r--test/e2e/pod_create_test.go15
-rw-r--r--test/e2e/run_test.go15
4 files changed, 56 insertions, 0 deletions
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index b9a1ff83d..822e470f2 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -429,4 +429,19 @@ var _ = Describe("Podman create", func() {
Expect(len(data)).To(Equal(1))
Expect(data[0].HostConfig.NanoCpus).To(Equal(int64(nanoCPUs)))
})
+
+ It("podman create --replace", func() {
+ // Make sure we error out with --name.
+ session := podmanTest.Podman([]string{"create", "--replace", ALPINE, "/bin/sh"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
+
+ // Create and replace 5 times in a row the "same" container.
+ ctrName := "testCtr"
+ for i := 0; i < 5; i++ {
+ session = podmanTest.Podman([]string{"create", "--replace", "--name", ctrName, ALPINE, "/bin/sh"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ }
+ })
})
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go
index b16cff411..0ee7260c2 100644
--- a/test/e2e/images_test.go
+++ b/test/e2e/images_test.go
@@ -186,6 +186,17 @@ RUN apk update && apk add strace
Expect(len(result.OutputToStringArray()) >= 1).To(BeTrue())
})
+ It("podman images workingdir from image", func() {
+ dockerfile := `FROM docker.io/library/alpine:latest
+WORKDIR /test
+`
+ podmanTest.BuildImage(dockerfile, "foobar.com/workdir:latest", "false")
+ result := podmanTest.Podman([]string{"run", "foobar.com/workdir:latest", "pwd"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(Equal("/test"))
+ })
+
It("podman images filter after image", func() {
podmanTest.RestoreAllArtifacts()
rmi := podmanTest.PodmanNoCache([]string{"rmi", "busybox"})
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index a7d5783cb..8d07f6290 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -305,4 +305,19 @@ var _ = Describe("Podman pod create", func() {
data := check.InspectPodToJSON()
Expect(data.ID).To(Equal(string(id)))
})
+
+ It("podman pod create --replace", func() {
+ // Make sure we error out with --name.
+ session := podmanTest.Podman([]string{"pod", "create", "--replace", ALPINE, "/bin/sh"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
+
+ // Create and replace 5 times in a row the "same" pod.
+ podName := "testCtr"
+ for i := 0; i < 5; i++ {
+ session = podmanTest.Podman([]string{"pod", "create", "--replace", "--name", podName})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ }
+ })
})
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 59215c7e5..76944b3db 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -931,4 +931,19 @@ USER mail`
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
+
+ It("podman run --replace", func() {
+ // Make sure we error out with --name.
+ session := podmanTest.Podman([]string{"create", "--replace", ALPINE, "/bin/sh"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
+
+ // Run and replace 5 times in a row the "same" container.
+ ctrName := "testCtr"
+ for i := 0; i < 5; i++ {
+ session := podmanTest.Podman([]string{"run", "--detach", "--replace", "--name", ctrName, ALPINE, "/bin/sh"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ }
+ })
})