summaryrefslogtreecommitdiff
path: root/test/e2e/run_exit_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-15 10:37:11 -0400
committerGitHub <noreply@github.com>2021-07-15 10:37:11 -0400
commitbc98c2003d36f9ce5650c1e0f4445be97ca0fa18 (patch)
tree9c3a777a89c015266578b7349a0f1233c2f325d0 /test/e2e/run_exit_test.go
parent47f351769bbf9e06ec47d340943e5a494d586e79 (diff)
parent547fff27033a294d1639ee3f9125f775032f39f5 (diff)
downloadpodman-bc98c2003d36f9ce5650c1e0f4445be97ca0fa18.tar.gz
podman-bc98c2003d36f9ce5650c1e0f4445be97ca0fa18.tar.bz2
podman-bc98c2003d36f9ce5650c1e0f4445be97ca0fa18.zip
Merge pull request #10932 from edsantiago/e2e_exit_checks
e2e tests: use Should(Exit()) and ExitWithError()
Diffstat (limited to 'test/e2e/run_exit_test.go')
-rw-r--r--test/e2e/run_exit_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/e2e/run_exit_test.go b/test/e2e/run_exit_test.go
index 3d969cbc2..21f1a8650 100644
--- a/test/e2e/run_exit_test.go
+++ b/test/e2e/run_exit_test.go
@@ -7,6 +7,7 @@ import (
. "github.com/containers/podman/v3/test/utils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
+ . "github.com/onsi/gomega/gexec"
)
var _ = Describe("Podman run exit", func() {
@@ -36,13 +37,13 @@ var _ = Describe("Podman run exit", func() {
It("podman run exit define.ExecErrorCodeGeneric", func() {
result := podmanTest.Podman([]string{"run", "--foobar", ALPINE, "ls", "$tmp"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(define.ExecErrorCodeGeneric))
+ Expect(result).Should(Exit(define.ExecErrorCodeGeneric))
})
It("podman run exit ExecErrorCodeCannotInvoke", func() {
result := podmanTest.Podman([]string{"run", ALPINE, "/etc"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(define.ExecErrorCodeCannotInvoke))
+ Expect(result).Should(Exit(define.ExecErrorCodeCannotInvoke))
})
It("podman run exit ExecErrorCodeNotFound", func() {
@@ -52,18 +53,18 @@ var _ = Describe("Podman run exit", func() {
// TODO This is failing we believe because of a race condition
// Between conmon and podman closing the socket early.
// Test with the following, once the race condition is solved
- // Expect(result.ExitCode()).To(Equal(define.ExecErrorCodeNotFound))
+ // Expect(result).Should(Exit(define.ExecErrorCodeNotFound))
})
It("podman run exit 0", func() {
result := podmanTest.Podman([]string{"run", ALPINE, "ls"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(0))
+ Expect(result).Should(Exit(0))
})
It("podman run exit 50", func() {
result := podmanTest.Podman([]string{"run", ALPINE, "sh", "-c", "exit 50"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(50))
+ Expect(result).Should(Exit(50))
})
})