Skip to content

Commit

Permalink
test/e2e: gpg keep stdout/err attached
Browse files Browse the repository at this point in the history
By default go will not keep the stdout/err attach when executing
commands via exec.Command(). It is required to explicitly pass the
current stdout/err fds down to the child so we can see the error output
in the logs to debug containers#17966.

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Mar 29, 2023
1 parent d29a85b commit c40eaa2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/e2e/image_sign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ var _ = Describe("Podman image sign", func() {

It("podman sign image", func() {
cmd := exec.Command("gpg", "--import", "sign/secret-key.asc")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
Expect(err).ToNot(HaveOccurred())
sigDir := filepath.Join(podmanTest.TempDir, "test-sign")
Expand All @@ -60,6 +62,8 @@ var _ = Describe("Podman image sign", func() {

It("podman sign --all multi-arch image", func() {
cmd := exec.Command("gpg", "--import", "sign/secret-key.asc")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
Expect(err).ToNot(HaveOccurred())
sigDir := filepath.Join(podmanTest.TempDir, "test-sign-multi")
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/save_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ var _ = Describe("Podman save", func() {
}

cmd := exec.Command("gpg", "--import", "sign/secret-key.asc")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Run()
Expect(err).ToNot(HaveOccurred())

Expand Down

0 comments on commit c40eaa2

Please sign in to comment.