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:
Giuseppe Scrivano
2025-02-17 09:12:31 +01:00
parent 35d2a65e3a
commit c65bb903b6
6 changed files with 39 additions and 18 deletions

View File

@@ -10,7 +10,7 @@ load helpers.network
err_no_such_cmd="Error:.*/no/such/command.*[Nn]o such file or directory"
# runc: RHEL8 on 2023-07-17: "is a directory".
# Everything else (crun; runc on debian): "permission denied"
err_no_exec_dir="Error:.*exec.*\\\(permission denied\\\|is a directory\\\)"
err_no_exec_dir="Error:.*\\\(exec.*\\\(permission denied\\\|is a directory\\\)\\\|is not a regular file\\\)"
tests="
true | 0 |
@@ -1657,14 +1657,14 @@ search | $IMAGE |
# runc and crun emit different diagnostics
runtime=$(podman_runtime)
case "$runtime" in
crun) expect='crun: executable file `` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found' ;;
crun) expect='\(executable file `` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found\|executable path is empty\)' ;;
runc) expect='runc: runc create failed: unable to start container process: exec: "": executable file not found in $PATH: OCI runtime attempted to invoke a command that was not found' ;;
*) skip "Unknown runtime '$runtime'" ;;
esac
# The '.*' in the error below is for dealing with podman-remote, which
# includes "error preparing container <sha> for attach" in output.
is "$output" "Error.*: $expect" "podman emits useful diagnostic when no entrypoint is set"
is "$output" "Error.* $expect" "podman emits useful diagnostic when no entrypoint is set"
}
# bats test_tags=ci:parallel