|
3 | 3 | package integration
|
4 | 4 |
|
5 | 5 | import (
|
6 |
| - "fmt" |
| 6 | + "path" |
7 | 7 |
|
8 | 8 | . "github.com/containers/podman/v5/test/utils"
|
9 | 9 | . "github.com/onsi/ginkgo/v2"
|
@@ -55,11 +55,21 @@ var _ = Describe("Podman run", func() {
|
55 | 55 | session := podmanTest.Podman([]string{"run", "--seccomp-policy", "image", img, "ls"})
|
56 | 56 | session.WaitWithDefaultTimeout()
|
57 | 57 |
|
58 |
| - expect := fmt.Sprintf("OCI runtime error: %s: read from the init process", podmanTest.OCIRuntime) |
59 |
| - if IsRemote() { |
60 |
| - expect = fmt.Sprintf("for attach: %s: read from the init process: OCI runtime error", podmanTest.OCIRuntime) |
| 58 | + switch path.Base(podmanTest.OCIRuntime) { |
| 59 | + case "crun": |
| 60 | + // "crun create" fails with "read from the init process" error. |
| 61 | + Expect(session).To(ExitWithError(126, "read from the init process")) |
| 62 | + case "runc": |
| 63 | + // "runc create" succeeds, then... |
| 64 | + Expect(session).To(Or( |
| 65 | + // either "runc start" fails with "cannot start a container that has stopped", |
| 66 | + ExitWithError(126, "cannot start a container that has stopped"), |
| 67 | + // or podman itself fails with "failed to connect to container's attach socket". |
| 68 | + ExitWithError(127, "failed to connect to container's attach socket"), |
| 69 | + )) |
| 70 | + default: |
| 71 | + Expect(session.ExitCode()).To(BeNumerically(">", 0), "Exit status using generic runtime") |
61 | 72 | }
|
62 |
| - Expect(session).To(ExitWithError(126, expect)) |
63 | 73 | })
|
64 | 74 |
|
65 | 75 | It("podman run --seccomp-policy image (bogus profile)", func() {
|
|
0 commit comments