From 1cbce851fa0315c147ba02afccd5a2899b5e5c5a Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 7 Jun 2018 11:59:07 -0400 Subject: Test to make sure we are getting proper exit codes on podman run podman run command screws up we should get 125 podman run command succeeds but command in container fails to exec 126 podman run command succeeds but command exits with non 0 exit code Signed-off-by: Daniel J Walsh Closes: #921 Approved by: TomSweeneyRedHat --- test/e2e/run_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 759c292eb..34ed55941 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -465,4 +465,15 @@ var _ = Describe("Podman run", func() { Expect(session.ExitCode()).To(Equal(125)) }) + It("podman run exit code on failure to exec", func() { + session := podmanTest.Podman([]string{"run", ALPINE, "/etc"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(126)) + }) + + It("podman run error on exec", func() { + session := podmanTest.Podman([]string{"run", ALPINE, "sh", "-c", "exit 100"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(100)) + }) }) -- cgit v1.2.3-54-g00ecf