From 244d15a79aae4dd12da1d3b8cc7ec5530a18b440 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez-Fernandez Date: Jul 08 2023 19:39:12 +0000 Subject: podman: cat output when fails Signed-off-by: Carlos Rodriguez-Fernandez --- diff --git a/tests/p_podman/10_podman_tests.sh b/tests/p_podman/10_podman_tests.sh index ff9f932..9dacf08 100755 --- a/tests/p_podman/10_podman_tests.sh +++ b/tests/p_podman/10_podman_tests.sh @@ -18,12 +18,17 @@ tests_in_order=( rm -rf ${HOME}/Containerfile" ) +output_file=$(mktemp) +trap "rm -f ${output_file}" EXIT + for cmd in "${tests_in_order[@]}"; do t_Log "Running $0: ${cmd}" - if ! eval "${cmd}" > /dev/null 2>&1; then + if ! eval "${cmd}" > ${output_file} 2>&1; then t_Log "FAIL: $0: ${cmd}" + cat ${output_file} exit 1 else t_Log "PASS: $0: ${cmd}" fi done +