mirror of
https://github.com/containers/podman.git
synced 2025-07-01 16:17:06 +08:00
Merge pull request #22834 from giuseppe/simplify-seccomp-error
tests: simplify expected output
This commit is contained in:
@ -1,6 +1,9 @@
|
|||||||
package integration
|
package integration
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
. "github.com/containers/podman/v5/test/utils"
|
. "github.com/containers/podman/v5/test/utils"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
@ -33,17 +36,20 @@ var _ = Describe("Podman run", func() {
|
|||||||
// TODO: we're getting a "cannot start a container that has
|
// TODO: we're getting a "cannot start a container that has
|
||||||
// stopped" error which seems surprising. Investigate
|
// stopped" error which seems surprising. Investigate
|
||||||
// why that is so.
|
// 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:
|
// TODO: worse than that. With runc, we get two alternating failures:
|
||||||
// 126 + cannot start a container that has stopped
|
// 126 + cannot start a container that has stopped
|
||||||
// 127 + failed to connect to container's attach socket ... ENOENT
|
// 127 + failed to connect to container's attach socket ... ENOENT
|
||||||
Expect(session.ExitCode()).To(BeNumerically(">=", 126), "Exit status using runc")
|
Expect(session.ExitCode()).To(BeNumerically(">=", 126), "Exit status using runc")
|
||||||
} else {
|
} else if base == "crun" {
|
||||||
expect := "OCI runtime error: crun: read from the init process"
|
expect := fmt.Sprintf("OCI runtime error: %s: read from the init process", podmanTest.OCIRuntime)
|
||||||
if IsRemote() {
|
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))
|
Expect(session).To(ExitWithError(126, expect))
|
||||||
|
} else {
|
||||||
|
Skip("Not valid with the current OCI runtime")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user