mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-10 19:05:44 +00:00
shell scripts: clean up when exiting on signal
This commit is contained in:
parent
c1da664e89
commit
a9062e96e7
|
@ -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
|
||||
|
|
|
@ -48,10 +48,10 @@ run_test() {
|
|||
shift
|
||||
|
||||
# run the commands
|
||||
eval "$1" > srv_out 2>&1 &
|
||||
$SHELL -c "$1" > srv_out 2>&1 &
|
||||
SRV_PID=$!
|
||||
sleep 1
|
||||
eval "$2" > cli_out 2>&1
|
||||
$SHELL -c "$2" > cli_out 2>&1
|
||||
CLI_EXIT=$?
|
||||
echo SERVERQUIT | openssl s_client -no_ticket \
|
||||
-cert data_files/cli2.crt -key data_files/cli2.key \
|
||||
|
@ -118,7 +118,13 @@ run_test() {
|
|||
rm -r srv_out cli_out
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
kill $SRV_PID
|
||||
exit 1
|
||||
}
|
||||
|
||||
killall -q openssl ssl_server ssl_server2
|
||||
trap cleanup INT TERM HUP
|
||||
|
||||
# Test for SSLv2 ClientHello
|
||||
|
||||
|
|
Loading…
Reference in a new issue