tests: use consistent name for PID file

This commit is contained in:
Nikos Mavrogiannopoulos
2015-12-07 14:20:35 +01:00
parent 4539bd2ef5
commit c9e3911eaf
6 changed files with 30 additions and 18 deletions

View File

@@ -31,6 +31,7 @@ CONFIG="proxyproto"
IMAGE=proxyproto-test
IMAGE_NAME=test_proxyproto_ocserv
TMP=$IMAGE_NAME.tmp
PIDFILE="$IMAGE_NAME.$$.pid"
. ./docker-common.sh
$DOCKER run -e OCCTL_PAGER=cat -P --privileged=true -p 22 --tty=false -d --name $IMAGE_NAME $IMAGE
@@ -57,7 +58,7 @@ fi
echo ""
echo "Connecting with correct username"
$ECHO_E "test" >pass-full$TMP
$OPENCONNECT $IP:$PORT_OCSERV -b --pid-file ${srcdir}/pid1.$$ -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 < pass-full$TMP
$OPENCONNECT $IP:$PORT_OCSERV -b --pid-file $PIDFILE -u test --passwd-on-stdin -v --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 < pass-full$TMP
if test $? != 0;then
echo "Cannot connect to server"
stop
@@ -67,12 +68,13 @@ fi
sleep 5
rm -f pass-full$TMP
if [ ! -f ${srcdir}/pid1.$$ ];then
if [ ! -f $PIDFILE ];then
echo "It was not possible to establish session!"
stop
fi
PID=`cat ${srcdir}/pid1.$$`
PID=`cat $PIDFILE`
rm -f $PIDFILE
# The client IP depends on the username so it shouldn't change.
ping -w 5 192.168.195.1