mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
System tests: fix broken silence127
Followup to #20394. For years (since BATS 1.5) we've been seeing and ignoring nasty red warnings at the end of every system test run. Thanks for fixing it, @giuseppe! But it broke down in the '?' case when $expected_rc is empty: test/system/helpers.bash: line 345: [: -eq: unary operator expected Simple fix. Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@ -339,11 +339,15 @@ function run_podman() {
|
|||||||
# Remember command args, for possible use in later diagnostic messages
|
# Remember command args, for possible use in later diagnostic messages
|
||||||
MOST_RECENT_PODMAN_COMMAND="podman $*"
|
MOST_RECENT_PODMAN_COMMAND="podman $*"
|
||||||
|
|
||||||
# BATS treats 127 as a special case, so we need to silence it when 127 is the
|
# BATS >= 1.5.0 treats 127 as a special case, adding a big nasty warning
|
||||||
# expected rc: https://bats-core.readthedocs.io/en/stable/warnings/BW01.html
|
# at the end of the test run if any command exits thus. Silence it.
|
||||||
silence127=""
|
# https://bats-core.readthedocs.io/en/stable/warnings/BW01.html
|
||||||
if [ $expected_rc -eq 127 ]; then
|
local silence127=
|
||||||
silence127="-127"
|
if [[ "$expected_rc" = "127" ]]; then
|
||||||
|
# We could use "-127", but that would cause BATS to fail if the
|
||||||
|
# command exits any other status -- and default BATS failure messages
|
||||||
|
# are much less helpful than the run_podman ones. "!" is more flexible.
|
||||||
|
silence127="!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# stdout is only emitted upon error; this printf is to help in debugging
|
# stdout is only emitted upon error; this printf is to help in debugging
|
||||||
|
Reference in New Issue
Block a user