From 911622d84a86c13b946a39687db9e031ffc004f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 27 Feb 2014 11:50:40 +0100 Subject: [PATCH] compat.sh: never kill our server --- tests/compat.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/compat.sh b/tests/compat.sh index 2be70c453..860858cc0 100755 --- a/tests/compat.sh +++ b/tests/compat.sh @@ -74,8 +74,8 @@ filter() NEW_LIST="$NEW_LIST $( echo "$i" | grep "$FILTER" )" done - # make sure the list is actually empty if it contains only whitespace - echo "$NEW_LIST" | sed -e 's/^[[:space:]]*//' + # normalize whitespace + echo "$NEW_LIST" | sed -e 's/[[:space:]]\+/ /g' -e 's/^ //' -e 's/ $//' } setup_ciphersuites() @@ -463,16 +463,20 @@ start_server() { sleep 1 } -# terminate the running server (try closing it cleanly if possible) +# terminate the running server (closing it cleanly if it is ours) stop_server() { case $SERVER_NAME in [Pp]olar*) - echo SERVERQUIT | $OPENSSL s_client $O_CLIENT_ARGS >/dev/null 2>&1 - sleep 1 + # we must force a PSK suite when in PSK mode (otherwise client + # auth will fail), so use $O_CIPHERS + CS=$( echo "$O_CIPHERS" | tr ' ' ':' ) + echo SERVERQUIT | \ + $OPENSSL s_client $O_CLIENT_ARGS -cipher "$CS" >/dev/null 2>&1 ;; + *) + kill $PROCESS_ID 2>/dev/null esac - kill $PROCESS_ID 2>/dev/null wait $PROCESS_ID 2>/dev/null rm -f srv_out }