Skip to content

Commit

Permalink
test: look at the file base name
Browse files Browse the repository at this point in the history
make the test more robust when an absolute path is used.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed May 29, 2024
1 parent 6243f5c commit 5dc1738
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/e2e/run_seccomp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package integration

import (
"fmt"
"path/filepath"

. "github.com/containers/podman/v5/test/utils"
. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -35,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 {
} else if base == "crun" {
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)
}
Expect(session).To(ExitWithError(126, expect))
} else {
Skip("Not valid with the current OCI runtime")
}
})

Expand Down

0 comments on commit 5dc1738

Please sign in to comment.