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
This commit is contained in:
Charles Herlin 2019-01-23 12:54:33 +01:00
parent 9ba0361be0
commit 13c88c7da2
2 changed files with 4 additions and 3 deletions

View File

@ -27,8 +27,8 @@ if [ ! -f "$dockerfile" ] ; then
exit 1 exit 1
fi fi
trap 'docker rm debian_cis_test_${target}' EXIT HUP INT
docker build -f "$dockerfile" -t "debian_cis_test:${target}" "$(dirname "$0")"/../ 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}" "$@"

View File

@ -7,10 +7,11 @@ set -u
#set -x #set -x
mytmpdir=$(mktemp -d -t debian-cis-test.XXXXXX) mytmpdir=$(mktemp -d -t debian-cis-test.XXXXXX)
totalerrors=255
cleanup_and_exit() { cleanup_and_exit() {
rm -rf "$mytmpdir" rm -rf "$mytmpdir"
exit 255 exit $totalerrors
} }
trap "cleanup_and_exit" EXIT HUP INT trap "cleanup_and_exit" EXIT HUP INT