reduced fragility of the tests

This commit is contained in:
Nikos Mavrogiannopoulos
2013-12-08 13:28:26 +01:00
parent 32bfe5f6ae
commit 816c51c7d2
8 changed files with 46 additions and 32 deletions
+4 -3
View File
@@ -2,14 +2,14 @@
# #
# Copyright (C) 2013 Nikos Mavrogiannopoulos # Copyright (C) 2013 Nikos Mavrogiannopoulos
# #
# This file is part of GnuTLS. # This file is part of ocserv.
# #
# GnuTLS is free software; you can redistribute it and/or modify it # ocserv is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the # under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at # Free Software Foundation; either version 2 of the License, or (at
# your option) any later version. # your option) any later version.
# #
# GnuTLS is distributed in the hope that it will be useful, but # ocserv is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
@@ -19,6 +19,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
SERV="${SERV:-../src/ocserv}" SERV="${SERV:-../src/ocserv}"
srcdir=${srcdir:-.}
PORT=4446 PORT=4446
. `dirname $0`/common.sh . `dirname $0`/common.sh
+9 -5
View File
@@ -2,14 +2,14 @@
# #
# Copyright (C) 2013 Nikos Mavrogiannopoulos # Copyright (C) 2013 Nikos Mavrogiannopoulos
# #
# This file is part of GnuTLS. # This file is part of ocserv.
# #
# GnuTLS is free software; you can redistribute it and/or modify it # ocserv is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the # under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at # Free Software Foundation; either version 2 of the License, or (at
# your option) any later version. # your option) any later version.
# #
# GnuTLS is distributed in the hope that it will be useful, but # ocserv is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
@@ -19,13 +19,16 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
SERV="${SERV:-../src/ocserv}" SERV="${SERV:-../src/ocserv}"
PORT=4447 srcdir=${srcdir:-.}
PORT=4501
. `dirname $0`/common.sh . `dirname $0`/common.sh
echo "Testing ocserv and user route application... " echo "Testing ocserv and user route application... "
launch_server -d -f -c test-iroute.config & PID=$! rm -f ${srcdir}/test-iroute.tmp
launch_server -d -f -c ${srcdir}/test-iroute.config & PID=$!
wait_server $PID wait_server $PID
echo -n "Connecting to obtain cookie (with certificate)... " echo -n "Connecting to obtain cookie (with certificate)... "
@@ -34,6 +37,7 @@ echo -n "Connecting to obtain cookie (with certificate)... "
echo ok echo ok
sleep 1
echo -n "Checking if routes have been applied... " echo -n "Checking if routes have been applied... "
if [ ! -f ${srcdir}/test-iroute.tmp ];then if [ ! -f ${srcdir}/test-iroute.tmp ];then
+2 -2
View File
@@ -24,8 +24,8 @@ max-clients = 16
max-same-clients = 2 max-same-clients = 2
# TCP and UDP port number # TCP and UDP port number
tcp-port = 4447 tcp-port = 4501
udp-port = 4447 udp-port = 4501
# Keepalive in seconds # Keepalive in seconds
keepalive = 32400 keepalive = 32400
+17 -11
View File
@@ -2,14 +2,14 @@
# #
# Copyright (C) 2013 Red Hat # Copyright (C) 2013 Red Hat
# #
# This file is part of GnuTLS. # This file is part of ocserv.
# #
# GnuTLS is free software; you can redistribute it and/or modify it # ocserv is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the # under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at # Free Software Foundation; either version 2 of the License, or (at
# your option) any later version. # your option) any later version.
# #
# GnuTLS is distributed in the hope that it will be useful, but # ocserv is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
@@ -19,13 +19,15 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
SERV="${SERV:-../src/ocserv}" SERV="${SERV:-../src/ocserv}"
PORT=4449 srcdir=${srcdir:-.}
PORT=4500
. `dirname $0`/common.sh . `dirname $0`/common.sh
echo "Testing whether cookies are being re-used... " echo "Testing whether cookies are being re-used... "
rm -f ${srcdir}/pid1 ${srcdir}/pid2
launch_server -d -f -c test-multi-cookie.config & PID=$! launch_server -d -f -c ${srcdir}/test-multi-cookie.config & PID=$!
wait_server $PID wait_server $PID
echo "Connecting to obtain cookie... " echo "Connecting to obtain cookie... "
@@ -38,29 +40,33 @@ fi
#echo "Cookie: $COOKIE" #echo "Cookie: $COOKIE"
echo "Connecting with cookie... " echo "Connecting with cookie... "
echo "test" | openconnect -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true >/dev/null 2>&1 & echo "test" | openconnect -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1 &
CPID=$! CPID=$!
echo "Connecting again with same cookie... " echo "Connecting again with same cookie... "
#( echo "test" | openconnect -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) || #( echo "test" | openconnect -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) ||
# fail $PID "Could not connect to server" # fail $PID "Could not connect to server"
echo "test" | openconnect -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose >/dev/null 2>&1 & rm -f ${srcdir}/ok
echo "test" | openconnect -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid2 &
C2PID=$! C2PID=$!
sleep 4 sleep 4
kill $C2PID >/dev/null 2>&1 if [ !-f ${srcdir}/pid2 ];then
if [ $? != 0 ];then
fail $PID "It was not possible to establish session!" fail $PID "It was not possible to establish session!"
fi fi
# checking whether server has already terminated $CPID # checking whether server has already terminated $CPID
sleep 1 sleep 1
kill $CPID >/dev/null 2>&1
if [ $? == 0 ];then if [ -f ${srcdir}/pid1 ];then
fail $PID "Initial connection was still running!" fail $PID "Initial connection was still running!"
fi fi
rm -f ${srcdir}/pid1 ${srcdir}/pid2
kill $C2PID >/dev/null 2>&1
kill $CPID >/dev/null 2>&1
kill $PID kill $PID
wait wait
+2 -2
View File
@@ -24,8 +24,8 @@ max-clients = 16
max-same-clients = 2 max-same-clients = 2
# TCP and UDP port number # TCP and UDP port number
tcp-port = 4449 tcp-port = 4500
udp-port = 4449 udp-port = 4500
# Keepalive in seconds # Keepalive in seconds
keepalive = 32400 keepalive = 32400
+4 -3
View File
@@ -2,14 +2,14 @@
# #
# Copyright (C) 2013 Nikos Mavrogiannopoulos # Copyright (C) 2013 Nikos Mavrogiannopoulos
# #
# This file is part of GnuTLS. # This file is part of ocserv.
# #
# GnuTLS is free software; you can redistribute it and/or modify it # ocserv is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the # under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at # Free Software Foundation; either version 2 of the License, or (at
# your option) any later version. # your option) any later version.
# #
# GnuTLS is distributed in the hope that it will be useful, but # ocserv is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
@@ -19,6 +19,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
SERV="${SERV:-../src/ocserv}" SERV="${SERV:-../src/ocserv}"
srcdir=${srcdir:-.}
PORT=4444 PORT=4444
. `dirname $0`/common.sh . `dirname $0`/common.sh
+4 -3
View File
@@ -2,14 +2,14 @@
# #
# Copyright (C) 2013 Nikos Mavrogiannopoulos # Copyright (C) 2013 Nikos Mavrogiannopoulos
# #
# This file is part of GnuTLS. # This file is part of ocserv.
# #
# GnuTLS is free software; you can redistribute it and/or modify it # ocserv is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the # under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at # Free Software Foundation; either version 2 of the License, or (at
# your option) any later version. # your option) any later version.
# #
# GnuTLS is distributed in the hope that it will be useful, but # ocserv is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
@@ -19,6 +19,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
SERV="${SERV:-../src/ocserv}" SERV="${SERV:-../src/ocserv}"
srcdir=${srcdir:-.}
PORT=4445 PORT=4445
. `dirname $0`/common.sh . `dirname $0`/common.sh
+4 -3
View File
@@ -2,14 +2,14 @@
# #
# Copyright (C) 2013 Nikos Mavrogiannopoulos # Copyright (C) 2013 Nikos Mavrogiannopoulos
# #
# This file is part of GnuTLS. # This file is part of ocserv.
# #
# GnuTLS is free software; you can redistribute it and/or modify it # ocserv is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the # under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at # Free Software Foundation; either version 2 of the License, or (at
# your option) any later version. # your option) any later version.
# #
# GnuTLS is distributed in the hope that it will be useful, but # ocserv is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
@@ -19,6 +19,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
SERV="${SERV:-../src/ocserv}" SERV="${SERV:-../src/ocserv}"
srcdir=${srcdir:-.}
PORT=4448 PORT=4448
. `dirname $0`/common.sh . `dirname $0`/common.sh