diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-12-17 13:16:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-17 13:16:23 +0100 |
commit | 820cf0e0661764de4e61e3d27a603acec817a363 (patch) | |
tree | 590b0a9811d1bc923385ab4ad4309b067af69ba4 /test/e2e | |
parent | c9a3f4ec44c4507c0a801635b93d840723826b7a (diff) | |
parent | 6423174c67d486522354806bf326c843c07d18c1 (diff) | |
download | podman-820cf0e0661764de4e61e3d27a603acec817a363.tar.gz podman-820cf0e0661764de4e61e3d27a603acec817a363.tar.bz2 podman-820cf0e0661764de4e61e3d27a603acec817a363.zip |
Merge pull request #12622 from flouthoc/return_exit_code_for_build
build: relay `exitcode` from imagebuildah to registry
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/build_test.go | 21 |
1 files changed, 19 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() |