From e4c5a57fbf51801b1d1766babbfb3f80ba405883 Mon Sep 17 00:00:00 2001 From: Charles Herlin Date: Wed, 23 Jan 2019 12:54:33 +0100 Subject: [PATCH] FIX: tests return value that was always 255 Return values tells the number of failed tests up to 254 255 being the return value for runtime errors --- tests/docker_build_and_run_tests.sh | 4 ++-- tests/launch_tests.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/docker_build_and_run_tests.sh b/tests/docker_build_and_run_tests.sh index aae2e52..252f1a3 100755 --- a/tests/docker_build_and_run_tests.sh +++ b/tests/docker_build_and_run_tests.sh @@ -27,8 +27,8 @@ if [ ! -f "$dockerfile" ] ; then exit 1 fi -trap 'docker rm debian_cis_test_${target}' EXIT HUP INT docker build -f "$dockerfile" -t "debian_cis_test:${target}" "$(dirname "$0")"/../ -docker run --name debian_cis_test_"${target}" debian_cis_test:"${target}" "$@" +docker run --rm debian_cis_test:"${target}" "$@" + diff --git a/tests/launch_tests.sh b/tests/launch_tests.sh index 0db0c97..a51297f 100755 --- a/tests/launch_tests.sh +++ b/tests/launch_tests.sh @@ -7,10 +7,11 @@ set -u #set -x mytmpdir=$(mktemp -d -t debian-cis-test.XXXXXX) +totalerrors=255 cleanup_and_exit() { rm -rf "$mytmpdir" - exit 255 + exit $totalerrors } trap "cleanup_and_exit" EXIT HUP INT