Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions test/e2e/run_seccomp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package integration

import (
"fmt"
"path"

. "github.com/containers/podman/v5/test/utils"
. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -55,11 +55,21 @@ var _ = Describe("Podman run", func() {
session := podmanTest.Podman([]string{"run", "--seccomp-policy", "image", img, "ls"})
session.WaitWithDefaultTimeout()

expect := fmt.Sprintf("OCI runtime error: %s: read from the init process", podmanTest.OCIRuntime)
if IsRemote() {
expect = fmt.Sprintf("for attach: %s: read from the init process: OCI runtime error", podmanTest.OCIRuntime)
switch path.Base(podmanTest.OCIRuntime) {
case "crun":
// "crun create" fails with "read from the init process" error.
Expect(session).To(ExitWithError(126, "read from the init process"))
case "runc":
// "runc create" succeeds, then...
Expect(session).To(Or(
// either "runc start" fails with "cannot start a container that has stopped",
ExitWithError(126, "cannot start a container that has stopped"),
// or podman itself fails with "failed to connect to container's attach socket".
ExitWithError(127, "failed to connect to container's attach socket"),
))
default:
Expect(session.ExitCode()).To(BeNumerically(">", 0), "Exit status using generic runtime")
}
Expect(session).To(ExitWithError(126, expect))
})

It("podman run --seccomp-policy image (bogus profile)", func() {
Expand Down