summaryrefslogtreecommitdiff
path: root/test/e2e/run_exit_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/run_exit_test.go')
-rw-r--r--test/e2e/run_exit_test.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/e2e/run_exit_test.go b/test/e2e/run_exit_test.go
index 3d969cbc2..e86718577 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,34 +37,30 @@ 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() {
result := podmanTest.Podman([]string{"run", ALPINE, "foobar"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Not(Equal(define.ExecErrorCodeGeneric)))
- // 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))
})
})