tests: improved tests with cookies

They use the --background openconnect option instead of the shell
background command.
This commit is contained in:
Nikos Mavrogiannopoulos
2015-04-21 16:18:36 +02:00
parent c6c9ca9a2c
commit 8e5e00a40d
3 changed files with 8 additions and 13 deletions

View File

@@ -41,7 +41,7 @@ fi
sleep 10
echo ""
echo "Connecting with cookie... "
echo "test" | $OPENCONNECT -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ &
echo "test" | $OPENCONNECT -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ --background
sleep 4
@@ -52,12 +52,11 @@ fi
CPID=`cat ${srcdir}/pid1.$$`
kill $CPID
rm -f "${srcdir}/pid1.$$"
wait $CPID
sleep 10
echo ""
echo "Connecting again with cookie... "
echo "test" | $OPENCONNECT -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ &
echo "test" | $OPENCONNECT -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ --background
sleep 4
@@ -68,12 +67,11 @@ fi
CPID=`cat ${srcdir}/pid1.$$`
kill -9 $CPID
rm -f "${srcdir}/pid1.$$"
wait $CPID
sleep 10
echo ""
echo "Connecting after forced kill with cookie... "
echo "test" | $OPENCONNECT -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ &
echo "test" | $OPENCONNECT -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ --background
sleep 4
@@ -84,13 +82,12 @@ fi
CPID=`cat ${srcdir}/pid1.$$`
kill $CPID
rm -f "${srcdir}/pid1.$$"
wait $CPID
sleep 40
echo ""
echo "Connecting with cookie after expiration... "
echo "test" | $OPENCONNECT -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ &
echo "test" | $OPENCONNECT -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ --background
sleep 4
@@ -99,7 +96,6 @@ if [ -f ${srcdir}/pid1.$$ ];then
CPID=`cat ${srcdir}/pid1.$$`
kill $CPID
rm -f "${srcdir}/pid1.$$"
wait $CPID
fi
# test cookie verification after cookie verification failure. That is to verify whether

View File

@@ -41,7 +41,7 @@ fi
sleep 10
echo ""
echo "Connecting with cookie... "
echo "test" | $OPENCONNECT -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid.$$ &
echo "test" | $OPENCONNECT -q -b localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid.$$ --background
sleep 4
@@ -56,7 +56,7 @@ rm -f "${srcdir}/pid2.$$"
sleep 30
echo ""
echo "Connecting again with cookie (overriding first session)... "
echo "test" | $OPENCONNECT -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid2.$$ &
echo "test" | $OPENCONNECT -b -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid2.$$ --background
sleep 6
@@ -67,7 +67,6 @@ else
CPID=`cat ${srcdir}/pid2.$$`
kill $CPID
rm -f "${srcdir}/pid2.$$"
wait $CPID
fi
kill $PID

View File

@@ -40,7 +40,7 @@ fi
#echo "Cookie: $COOKIE"
echo "Connecting with cookie... "
echo "test" | $OPENCONNECT -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ &
echo "test" | $OPENCONNECT -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid1.$$ --background
CPID=$!
sleep 4
@@ -48,7 +48,7 @@ sleep 4
echo "Connecting again with same cookie... "
#( echo "test" | $OPENCONNECT -q localhost:$PORT -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly >/dev/null 2>&1 ) ||
# fail $PID "Could not connect to server"
echo "test" | $OPENCONNECT -q localhost:$PORT -b -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid2.$$ &
echo "test" | $OPENCONNECT -q localhost:$PORT -b -u test -C "$COOKIE" --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true --verbose --pid-file ${srcdir}/pid2.$$ --background
C2PID=$!
sleep 4