summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/build_test.go21
-rw-r--r--test/e2e/healthcheck_run_test.go16
-rw-r--r--test/e2e/run_device_test.go7
3 files changed, 42 insertions, 2 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go
index 9a9dec191..5ed873f78 100644
--- a/test/e2e/build_test.go
+++ b/test/e2e/build_test.go
@@ -273,6 +273,23 @@ RUN printenv http_proxy`, ALPINE)
os.Unsetenv("http_proxy")
})
+ It("podman build relay exit code to process", func() {
+ if IsRemote() {
+ podmanTest.StopRemoteService()
+ podmanTest.StartRemoteService()
+ }
+ podmanTest.AddImageToRWStore(ALPINE)
+ dockerfile := fmt.Sprintf(`FROM %s
+RUN exit 5`, ALPINE)
+
+ dockerfilePath := filepath.Join(podmanTest.TempDir, "Dockerfile")
+ err := ioutil.WriteFile(dockerfilePath, []byte(dockerfile), 0755)
+ Expect(err).To(BeNil())
+ session := podmanTest.Podman([]string{"build", "-t", "error-test", "--file", dockerfilePath, podmanTest.TempDir})
+ session.Wait(120)
+ Expect(session).Should(Exit(5))
+ })
+
It("podman build and check identity", func() {
session := podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/basicalpine/Containerfile.path", "--no-cache", "-t", "test", "build/basicalpine"})
session.WaitWithDefaultTimeout()
@@ -646,7 +663,7 @@ RUN ls /dev/fuse`, ALPINE)
Expect(err).To(BeNil())
session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", "--file", containerfilePath, podmanTest.TempDir})
session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(125))
+ Expect(session).Should(Exit(1))
session = podmanTest.Podman([]string{"build", "--pull-never", "--device", "/dev/fuse", "-t", "test", "--file", containerfilePath, podmanTest.TempDir})
session.WaitWithDefaultTimeout()
@@ -662,7 +679,7 @@ RUN ls /dev/test1`, ALPINE)
Expect(err).To(BeNil())
session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", "--file", containerfilePath, podmanTest.TempDir})
session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(125))
+ Expect(session).Should(Exit(1))
session = podmanTest.Podman([]string{"build", "--pull-never", "--device", "/dev/zero:/dev/test1", "-t", "test", "--file", containerfilePath, podmanTest.TempDir})
session.WaitWithDefaultTimeout()
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go
index 6e4dc5bbf..c2084a6fd 100644
--- a/test/e2e/healthcheck_run_test.go
+++ b/test/e2e/healthcheck_run_test.go
@@ -242,4 +242,20 @@ var _ = Describe("Podman healthcheck run", func() {
Expect(ps.OutputToStringArray()).To(HaveLen(2))
Expect(ps.OutputToString()).To(ContainSubstring("hc"))
})
+
+ It("stopping and then starting a container with healthcheck cmd", func() {
+ session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "--health-cmd", "[\"ls\", \"/foo\"]", ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ stop := podmanTest.Podman([]string{"stop", "-t0", "hc"})
+ stop.WaitWithDefaultTimeout()
+ Expect(stop).Should(Exit(0))
+
+ startAgain := podmanTest.Podman([]string{"start", "hc"})
+ startAgain.WaitWithDefaultTimeout()
+ Expect(startAgain).Should(Exit(0))
+ Expect(startAgain.OutputToString()).To(Equal("hc"))
+ Expect(startAgain.ErrorToString()).To(Equal(""))
+ })
})
diff --git a/test/e2e/run_device_test.go b/test/e2e/run_device_test.go
index 08905aed2..fbf1eb791 100644
--- a/test/e2e/run_device_test.go
+++ b/test/e2e/run_device_test.go
@@ -119,4 +119,11 @@ var _ = Describe("Podman run device", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
})
+
+ It("podman run cannot access non default devices", func() {
+ session := podmanTest.Podman([]string{"run", "-v /dev:/dev-host", ALPINE, "head", "-1", "/dev-host/kmsg"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Not(Exit(0)))
+ })
+
})