Skip to content

Commit

Permalink
tests: adjust old build test to expect exit code
Browse files Browse the repository at this point in the history
Old build tests were expecting genric error code `125` however another
commit in this PR ensures that we relay exact exit code from build to
registry.

Hence adjusting tests

Signed-off-by: Aditya Rajan <[email protected]>
  • Loading branch information
flouthoc committed Dec 17, 2021
1 parent f566d8b commit 6423174
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/e2e/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ RUN printenv http_proxy`, ALPINE)

It("podman build relay exit code to process", func() {
if IsRemote() {
// following states true for all the remote commands
Skip("Remote server does not emits error with exit status")
podmanTest.StopRemoteService()
podmanTest.StartRemoteService()
}
podmanTest.AddImageToRWStore(ALPINE)
dockerfile := fmt.Sprintf(`FROM %s
Expand Down Expand Up @@ -663,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()
Expand All @@ -679,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()
Expand Down
2 changes: 1 addition & 1 deletion test/system/070-build.bats
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ FROM $IMAGE
RUN echo $rand_content
EOF

run_podman 125 --runtime-flag invalidflag build -t build_test $tmpdir
run_podman 1 --runtime-flag invalidflag build -t build_test $tmpdir
is "$output" ".*invalidflag" "failed when passing undefined flags to the runtime"
}

Expand Down

0 comments on commit 6423174

Please sign in to comment.