Merge pull request #24274 from Luap99/fix-signal-exit

test/e2e: fix default signal exit code test
This commit is contained in:
openshift-merge-bot[bot] 2024-10-15 13:47:53 +00:00 committed by GitHub
commit 1dcb4c58c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -92,10 +92,6 @@ var _ = Describe("Podman run with --sig-proxy", func() {
Specify("signals are not forwarded to container with sig-proxy false", func() {
signal := syscall.SIGFPE
if isRootless() {
err = podmanTest.RestoreArtifact(fedoraMinimal)
Expect(err).ToNot(HaveOccurred())
}
session, pid := podmanTest.PodmanPID([]string{"run", "--name", "test2", "--sig-proxy=false", fedoraMinimal, "bash", "-c", sigCatch2})
Expect(WaitForContainer(podmanTest)).To(BeTrue(), "WaitForContainer()")
@ -112,7 +108,11 @@ var _ = Describe("Podman run with --sig-proxy", func() {
Expect(killSession).Should(ExitCleanly())
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError(2, "SIGFPE: floating-point exception"))
// Exit code is normally 2, however with GOTRACEBACK=crash (default in
// Fedora/RHEL rpm builds) it will be 134 thus allow both.
// https://github.com/containers/podman/issues/24213
errorMsg := "SIGFPE: floating-point exception"
Expect(session).To(Or(ExitWithError(2, errorMsg), ExitWithError(134, errorMsg)))
Expect(session.OutputToString()).To(Not(ContainSubstring("Received")))
})