tests: use the --pid-file and -p options in ocserv

This allows detecting issues like in #143 where these
two options regressed.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
Nikos Mavrogiannopoulos
2018-03-01 19:17:35 +01:00
parent 8769b2e041
commit 274415d050
2 changed files with 12 additions and 2 deletions

View File

@@ -22,13 +22,14 @@ SERV="${SERV:-../src/ocserv}"
srcdir=${srcdir:-.}
NO_NEED_ROOT=1
PORT=4444
PIDFILE=ocserv-pid.$$.tmp
. `dirname $0`/common.sh
echo "Testing local backend with username-password... "
update_config test1.config
launch_sr_server -d 1 -f -c ${CONFIG} & PID=$!
launch_sr_server -d 1 -p ${PIDFILE} -f -c ${CONFIG} & PID=$!
wait_server $PID
echo "Connecting to obtain cookie... "
@@ -63,6 +64,10 @@ echo "Connecting to obtain cookie with empty password... "
#( echo "test" | LD_PRELOAD=libsocket_wrapper.so $OPENCONNECT -q $ADDRESS:$PORT -u test --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --script=/bin/true ) ||
# fail $PID "Could not connect to server"
if ! test -f ${PIDFILE};then
fail $PID "Could not find pid file ${PIDFILE}"
fi
cleanup
exit 0