mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 08:46:58 +08:00
tests: improved tests with cookies
They use the --background openconnect option instead of the shell background command.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user