From 5a9bf964fb3371dafb4815f4ddd07003d5b3d94e Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Thu, 8 Jan 2026 18:48:30 +0530 Subject: [PATCH] Fix run_podman to support exit code with warnings notation (+w) (cherry picked from commit 652ec9578b982e3e3d6ef51738235ec7b4da6dbe) 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 --- test/system/helpers.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/system/helpers.bash b/test/system/helpers.bash index 0fc8316216..ee73974200 100644 --- a/test/system/helpers.bash +++ b/test/system/helpers.bash @@ -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