From b5d7f73125cd2155e0eb8b700890dbe50d3da3f3 Mon Sep 17 00:00:00 2001 From: Joe Testa Date: Wed, 29 Jul 2020 12:31:24 -0400 Subject: [PATCH] When an unexpected exit code is returned, print more debugging info. --- docker_test.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker_test.sh b/docker_test.sh index 03f72cd..23743c8 100755 --- a/docker_test.sh +++ b/docker_test.sh @@ -514,7 +514,8 @@ function run_policy_test { ./ssh-audit.py -P ${policy_path} localhost:2222 > ${test_result_stdout} actual_exit_code=$? if [[ ${actual_exit_code} != ${expected_exit_code} ]]; then - echo -e "${test_name} ${REDB}FAILED${CLR} (expected exit code: ${expected_exit_code}; actual exit code: ${actual_exit_code}" + echo -e "${test_name} ${REDB}FAILED${CLR} (expected exit code: ${expected_exit_code}; actual exit code: ${actual_exit_code}\n" + cat ${test_result_stdout} docker container stop -t 0 $cid > /dev/null exit 1 fi @@ -523,7 +524,8 @@ function run_policy_test { ./ssh-audit.py -P ${policy_path} -j localhost:2222 > ${test_result_json} actual_exit_code=$? if [[ ${actual_exit_code} != ${expected_exit_code} ]]; then - echo -e "${test_name} ${REDB}FAILED${CLR} (expected exit code: ${expected_exit_code}; actual exit code: ${actual_exit_code}" + echo -e "${test_name} ${REDB}FAILED${CLR} (expected exit code: ${expected_exit_code}; actual exit code: ${actual_exit_code}\n" + cat ${test_result_json} docker container stop -t 0 $cid > /dev/null exit 1 fi