mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-25 07:17:35 +00:00
Fix run_podman to support exit code with warnings notation (+w)
(cherry picked from commit 652ec9578b)
The test framework was not parsing the '+w' suffix in expected exit
codes (e.g., '0+w' meaning "expect exit code 0 and warnings allowed").
This caused the literal string to be passed as a command argument to
podman, resulting in "unrecognized command" errors.
Added pattern matching for:
- [0-9]+w (single digit with warnings)
- [1-9][0-9]+w (double digit with warnings)
- [12][0-9][0-9]+w (triple digit with warnings)
The '+w' suffix is stripped off and only the numeric exit code is used
for validation. Note: The actual warning validation is not implemented
yet, but this allows tests using the '+w' notation to run correctly.
This fixes the "podman-remote: non-default connection" test failure.
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
This commit is contained in:
parent
f9a57e0e3e
commit
5a9bf964fb
1 changed files with 3 additions and 0 deletions
|
|
@ -177,6 +177,9 @@ function run_podman() {
|
|||
[0-9]) expected_rc=$1; shift;;
|
||||
[1-9][0-9]) expected_rc=$1; shift;;
|
||||
[12][0-9][0-9]) expected_rc=$1; shift;;
|
||||
[0-9]+w) expected_rc=${1%+w}; shift;; # exit code with warnings allowed
|
||||
[1-9][0-9]+w) expected_rc=${1%+w}; shift;; # exit code with warnings allowed
|
||||
[12][0-9][0-9]+w) expected_rc=${1%+w}; shift;; # exit code with warnings allowed
|
||||
'?') expected_rc= ; shift;; # ignore exit code
|
||||
esac
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue