Skip to content

Commit

Permalink
Merge pull request containers#22834 from giuseppe/simplify-seccomp-error
Browse files Browse the repository at this point in the history
tests: simplify expected output
  • Loading branch information
openshift-merge-bot[bot] authored May 30, 2024
2 parents 920e583 + 5dc1738 commit 939cb83
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/e2e/run_seccomp_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package integration

import (
"fmt"
"path/filepath"

. "github.com/containers/podman/v5/test/utils"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -33,17 +36,20 @@ var _ = Describe("Podman run", func() {
// TODO: we're getting a "cannot start a container that has
// stopped" error which seems surprising. Investigate
// why that is so.
if podmanTest.OCIRuntime == "runc" {
base := filepath.Base(podmanTest.OCIRuntime)
if base == "runc" {
// TODO: worse than that. With runc, we get two alternating failures:
// 126 + cannot start a container that has stopped
// 127 + failed to connect to container's attach socket ... ENOENT
Expect(session.ExitCode()).To(BeNumerically(">=", 126), "Exit status using runc")
} else {
expect := "OCI runtime error: crun: read from the init process"
} else if base == "crun" {
expect := fmt.Sprintf("OCI runtime error: %s: read from the init process", podmanTest.OCIRuntime)
if IsRemote() {
expect = "for attach: crun: read from the init process: OCI runtime error"
expect = fmt.Sprintf("for attach: %s: read from the init process: OCI runtime error", podmanTest.OCIRuntime)
}
Expect(session).To(ExitWithError(126, expect))
} else {
Skip("Not valid with the current OCI runtime")
}
})

Expand Down

0 comments on commit 939cb83

Please sign in to comment.