From 33a752e180d7d4ac0c9648faf1dfe2d6c37ed6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 21 Feb 2014 09:47:37 +0100 Subject: [PATCH] ssl-opt.sh: count and report failures --- tests/ssl-opt.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 2b9f61266..08b30202f 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -12,6 +12,9 @@ PROGS_DIR='../programs/ssl' SRV_CMD="$PROGS_DIR/ssl_server2" CLI_CMD="$PROGS_DIR/ssl_client2" +TESTS=0 +FAILS=0 + # print_name print_name() { echo -n "$1 " @@ -19,12 +22,20 @@ print_name() { LEN=`echo 72 - $LEN | bc` for i in `seq 1 $LEN`; do echo -n '.'; done echo -n ' ' + + TESTS=`echo $TESTS + 1 | bc` } # fail fail() { echo "FAIL" echo " $1" + + cp srv_out srv-${TESTS}.log + cp cli_out cli-${TESTS}.log + echo " outputs saved to srv-${TESTS}.log and cli-${TESTS}.log" + + FAILS=`echo $FAILS + 1 | bc` } # Usage: run_test name srv_args cli_args cli_exit [option [...]] @@ -364,3 +375,15 @@ run_test "Renegotiation #5 (server-initiated, client-rejected)" \ -s "write hello request" \ -s "SSL - An unexpected message was received from our peer" \ -s "failed" + +echo "------------------------------------------------------------------------" + +if [ $FAILS = 0 ]; then + echo -n "PASSED" +else + echo -n "FAILED" +fi +PASSES=`echo $TESTS - $FAILS | bc` +echo " ($PASSES / $TESTS)" + +exit $FAILS