diff --git a/test/system/libs/helpers.bash b/test/system/libs/helpers.bash index 482cf92..7283799 100644 --- a/test/system/libs/helpers.bash +++ b/test/system/libs/helpers.bash @@ -449,8 +449,6 @@ function container_started() { # shellcheck disable=SC2154 if [ "$status" -ne 0 ]; then fail "Failed to invoke '$PODMAN logs'" - [ "$output" != "" ] && echo "$output" - [ "$stderr" != "" ] && echo "$stderr" >&2 ret_val="$status" break fi @@ -465,6 +463,15 @@ function container_started() { sleep 1 done + if [ "$ret_val" -ne 0 ]; then + if [ "$j" -eq "$num_of_retries" ]; then + fail "Failed to initialize container $container_name" + fi + + [ "$output" != "" ] && echo "$output" + [ "$stderr" != "" ] && echo "$stderr" >&2 + fi + return "$ret_val" }