Skip to content

Commit

Permalink
e2e: serialize gpg tests
Browse files Browse the repository at this point in the history
Reason: gpg tests all run with a different GNUPGHOME, and gpg-agent
does not like that, and there's no longer any way to run gpg
without the agent. So, do not run these tests in parallel, and
clean up agent after each test.

Fixes: containers#17966 (I hope)

May also fix containers#18358 but it will take some time to be sure.

Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago committed May 15, 2023
1 parent 4c399fc commit a485ba5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/e2e/image_sign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ var _ = Describe("Podman image sign", func() {
})

AfterEach(func() {
// There's no way to run gpg without an agent, so, clean up
// after every test. No need to check error status.
cmd := exec.Command("gpgconf", "--kill", "gpg-agent")
cmd.Stdout = GinkgoWriter
cmd.Stderr = GinkgoWriter
_ = cmd.Run()

os.Setenv("GNUPGHOME", origGNUPGHOME)
})

It("podman sign image", func() {
It("podman sign image", Serial, func() {
cmd := exec.Command("gpg", "--import", "sign/secret-key.asc")
cmd.Stdout = GinkgoWriter
cmd.Stderr = GinkgoWriter
Expand All @@ -45,7 +52,7 @@ var _ = Describe("Podman image sign", func() {
Expect(err).ToNot(HaveOccurred())
})

It("podman sign --all multi-arch image", func() {
It("podman sign --all multi-arch image", Serial, func() {
cmd := exec.Command("gpg", "--import", "sign/secret-key.asc")
cmd.Stdout = GinkgoWriter
cmd.Stderr = GinkgoWriter
Expand Down

0 comments on commit a485ba5

Please sign in to comment.