mirror of
https://github.com/containers/podman.git
synced 2025-10-17 11:14:40 +08:00
test: adapt tests new crun error messages
Needed-by: https://github.com/containers/crun/pull/1672 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -421,19 +421,20 @@ var _ = Describe("Podman exec", func() {
|
||||
session := podmanTest.Podman([]string{"exec", "test1", "/etc"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
|
||||
// crun (and, we hope, any other future runtimes)
|
||||
expectedStatus := 126
|
||||
expectedMessage := "open executable: Operation not permitted: OCI permission denied"
|
||||
|
||||
// ...but it's much more complicated under runc (#19552)
|
||||
if podmanTest.OCIRuntime == "runc" {
|
||||
expectedMessage = `exec failed: unable to start container process: exec: "/etc": is a directory`
|
||||
expectedStatus = 255
|
||||
expectedMessage := `exec failed: unable to start container process: exec: "/etc": is a directory`
|
||||
expectedStatus := 255
|
||||
if IsRemote() {
|
||||
expectedStatus = 125
|
||||
}
|
||||
Expect(session).Should(ExitWithError(expectedStatus, expectedMessage))
|
||||
} else {
|
||||
// crun (and, we hope, any other future runtimes)
|
||||
expectedStatus := 126
|
||||
expectedMessage := ".*(open executable|the path `/etc` is not a regular file): Operation not permitted: OCI permission denied.*"
|
||||
Expect(session).Should(ExitWithErrorRegex(expectedStatus, expectedMessage))
|
||||
}
|
||||
Expect(session).Should(ExitWithError(expectedStatus, expectedMessage))
|
||||
})
|
||||
|
||||
It("podman exec command not found", func() {
|
||||
|
Reference in New Issue
Block a user