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