mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-08-08 09:21:48 +08:00
tests: fixed flaky condition in disconnect-user
Ensure the client is killed eventually to prevent an openconnect re-connect to keep the test up. Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
@@ -30,6 +30,7 @@ srcdir=${srcdir:-.}
|
||||
TMPFILE=ocfile.$$.tmp
|
||||
PIDFILE=ocserv-pid.$$.tmp
|
||||
CLIPID=oc-pid.$$.tmp
|
||||
CLIPID2=oc-pid2.$$.tmp
|
||||
OCCTL_SOCKET=./occtl-$$.socket
|
||||
|
||||
. `dirname $0`/common.sh
|
||||
@@ -45,6 +46,8 @@ echo "Testing ocserv disconnection via occtl... "
|
||||
|
||||
function finish {
|
||||
echo " * Cleaning up..."
|
||||
test -n "${CLIPID2}" && test -f "${CLIPID2}" && kill $(cat ${CLIPID2}) >/dev/null 2>&1
|
||||
test -n "${CLIPID2}" && rm -f "${CLIPID2}" >/dev/null 2>&1
|
||||
cleanup_client_server
|
||||
test -n "${TMPFILE}" && rm -f ${TMPFILE} >/dev/null 2>&1
|
||||
}
|
||||
@@ -94,7 +97,7 @@ if test $? != 0;then
|
||||
fi
|
||||
|
||||
echo " * Re-connecting to obtain cookie after disconnect... "
|
||||
( ${CMDNS1} ${OPENCONNECT} -q ${ADDRESS}:${PORT} -u test --servercert=pin-sha256:xp3scfzy3rOQsv9NcOve/8YVVv+pHr4qNCXEXrNl5s8= -s ${srcdir}/scripts/vpnc-script -C "${COOKIE}" --pid-file=${CLIPID} -b )
|
||||
( ${CMDNS1} ${OPENCONNECT} -q ${ADDRESS}:${PORT} -u test --servercert=pin-sha256:xp3scfzy3rOQsv9NcOve/8YVVv+pHr4qNCXEXrNl5s8= -s ${srcdir}/scripts/vpnc-script -C "${COOKIE}" --pid-file=${CLIPID2} -b )
|
||||
if test $? = 0;then
|
||||
echo "Succeeded using the cookie to connect"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user