summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/suite/Makefile.am4
-rwxr-xr-xtests/suite/testsrn41
2 files changed, 20 insertions, 25 deletions
diff --git a/tests/suite/Makefile.am b/tests/suite/Makefile.am
index 5a85761ec6..32aab4a492 100644
--- a/tests/suite/Makefile.am
+++ b/tests/suite/Makefile.am
@@ -72,6 +72,6 @@ nodist_eagain_cli_SOURCES = mini-eagain2.c
noinst_PROGRAMS = eagain-cli
-nodist_check_SCRIPTS = eagain #testsrn
+nodist_check_SCRIPTS = eagain testsrn
-TESTS = eagain #testsrn
+TESTS = eagain testsrn
diff --git a/tests/suite/testsrn b/tests/suite/testsrn
index 8df797c6e6..68993b5d78 100755
--- a/tests/suite/testsrn
+++ b/tests/suite/testsrn
@@ -26,18 +26,17 @@ CLI="${CLI:-../../src/gnutls-cli$EXEEXT}"
PORT="${PORT:-5558}"
unset RETCODE
-fail() {
- echo "Failure: $1" >&2
- RETCODE=${RETCODE:-${2:-1}}
-}
+if test "${WINDIR}" != "";then
+ exit 77
+fi
-echo "Checking Safe renegotiation"
+. ../scripts/common.sh
-$SERV -p $PORT --echo --priority NORMAL:+ANON-DH:%PARTIAL_RENEGOTIATION --dhparams $srcdir/params.dh >/dev/null 2>&1 &
-pid=$!
+echo "Checking Safe renegotiation"
-# give the server a chance to initialize
-sleep 2
+launch_server $$ --echo --priority NORMAL:+ANON-DH:%PARTIAL_RENEGOTIATION --dhparams $srcdir/params.dh >/dev/null 2>&1 &
+PID=$!
+wait_server $PID
$CLI -p $PORT 127.0.0.1 --rehandshake --priority NONE:+AES-128-CBC:+MD5:+SHA1:+VERS-SSL3.0:+ANON-DH:+COMP-NULL:%SAFE_RENEGOTIATION </dev/null >/dev/null 2>&1 || \
fail "0. Renegotiation should have succeeded!"
@@ -55,14 +54,12 @@ $CLI -p $PORT 127.0.0.1 --rehandshake --priority NORMAL:+ANON-DH:%DISABLE_SAFE_R
fail "4. Unsafe renegotiation should have failed!"
-kill $pid
+kill $PID
wait
-$SERV -p $PORT --echo --priority NORMAL:+ANON-DH:%SAFE_RENEGOTIATION --dhparams $srcdir/params.dh >/dev/null 2>&1 &
-pid=$!
-
-# give the server a chance to initialize
-sleep 2
+launch_server $$ --echo --priority NORMAL:+ANON-DH:%SAFE_RENEGOTIATION --dhparams $srcdir/params.dh >/dev/null 2>&1 &
+PID=$!
+wait_server $PID
$CLI -p $PORT 127.0.0.1 --rehandshake --priority NORMAL:+ANON-DH:%SAFE_RENEGOTIATION </dev/null >/dev/null 2>&1 || \
fail "5. Safe rehandshake should have succeeded!"
@@ -76,14 +73,12 @@ $CLI -p $PORT 127.0.0.1 --priority NORMAL:+ANON-DH:%DISABLE_SAFE_RENEGOTIATION <
$CLI -p $PORT 127.0.0.1 --rehandshake --priority NORMAL:+ANON-DH:%DISABLE_SAFE_RENEGOTIATION </dev/null >/dev/null 2>&1 && \
fail "8. Unsafe renegotiation should have failed!"
-kill $pid
+kill $PID
wait
-$SERV -p $PORT --echo --priority NORMAL:+ANON-DH:%DISABLE_SAFE_RENEGOTIATION --dhparams $srcdir/params.dh >/dev/null 2>&1 &
-pid=$!
-
-# give the server a chance to initialize
-sleep 2
+launch_server $$ --echo --priority NORMAL:+ANON-DH:%DISABLE_SAFE_RENEGOTIATION --dhparams $srcdir/params.dh >/dev/null 2>&1 &
+PID=$!
+wait_server $PID
$CLI -p $PORT 127.0.0.1 --priority NORMAL:+ANON-DH:%SAFE_RENEGOTIATION </dev/null >/dev/null 2>&1 && \
fail "9. Initial connection should have failed!"
@@ -97,7 +92,7 @@ $CLI -p $PORT 127.0.0.1 --priority NORMAL:+ANON-DH:%DISABLE_SAFE_RENEGOTIATION <
$CLI -p $PORT 127.0.0.1 --rehandshake --priority NORMAL:+ANON-DH:%DISABLE_SAFE_RENEGOTIATION </dev/null >/dev/null 2>&1 || \
fail "12. Unsafe renegotiation should have succeeded!"
-kill $pid
+kill $PID
wait
-exit ${RETCODE:-0}
+exit 0