shell scripts: clean up when exiting on signal

This commit is contained in:
Manuel Pégourié-Gonnard 2014-02-25 16:21:22 +01:00
parent c1da664e89
commit a9062e96e7
2 changed files with 17 additions and 4 deletions

View file

@ -3,8 +3,6 @@
# Test interop with OpenSSL for each common ciphersuite and version.
# Also test selfop for ciphersuites not shared with OpenSSL.
killall -q openssl ssl_server ssl_server2
let "tests = 0"
let "failed = 0"
let "skipped = 0"
@ -481,6 +479,12 @@ stop_server() {
wait $PROCESS_ID 2>/dev/null
}
# kill the running server (used when killed by signal)
cleanup() {
kill $PROCESS_ID
exit 1
}
# run_client <name> <cipher>
run_client() {
# run the command and interpret result
@ -549,6 +553,9 @@ run_client() {
esac
}
killall -q openssl ssl_server ssl_server2
trap cleanup INT TERM HUP
for VERIFY in $VERIFIES; do
for MODE in $MODES; do
for TYPE in $TYPES; do