aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-13 08:02:26 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-13 08:02:26 +0000
commitd5e6404b8bd8eef5057daaa27491a437d1386d71 (patch)
tree788ab5f2755c0bf6e42ee3ea544561b1910b8c7e /tests
parentbc84fe1cf3841f3dc4e08660055d4c9675ebf4ce (diff)
uses the new httpd server, runs the tests much faster
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.sh51
1 files changed, 40 insertions, 11 deletions
diff --git a/tests/runtests.sh b/tests/runtests.sh
index de49aad7e..64a335b77 100755
--- a/tests/runtests.sh
+++ b/tests/runtests.sh
@@ -17,6 +17,39 @@ NC=nc
# simply run a particular one:
TESTCASES=" 1 2 3 4"
+stopserver() {
+ PIDFILE="$LOGDIR/server.pid"
+
+ # check for pidfile
+ if [ -f $PIDFILE ] ; then
+ PID=`cat $PIDFILE`
+ kill -9 $PID
+ fi
+}
+
+runserver () {
+ PIDFILE="$LOGDIR/server.pid"
+
+ # check for pidfile
+ if [ -f $PIDFILE ] ; then
+ PID=`cat $PIDFILE`
+ if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then
+ STATUS="httpd (pid $PID) running"
+ RUNNING=1
+ else
+ STATUS="httpd (pid $PID?) not running"
+ RUNNING=0
+ fi
+ else
+ STATUS="httpd (no pid file) not running"
+ RUNNING=0
+ fi
+
+ if [ $RUNNING != "1" ]; then
+ ./httpserver.pl $HOSTPORT &
+ sleep 1 # give it a little time to start
+ fi
+}
compare () {
# filter off the $4 pattern before compare!
@@ -55,10 +88,6 @@ singletest ()
echo "test $NUMBER... [$DESC]"
- ./runserv.pl $HOSTIP $HOSTPORT &
-
- sleep 1
-
# get the command line options to use
cmd=`sed -e "s/%HOSTIP/$HOSTIP/g" -e "s/%HOSTPORT/$HOSTPORT/g" <$CURLCMD `
@@ -135,14 +164,8 @@ mkdir $LOGDIR
#######################################################################
# First, start the TCP server
#
-#./runserv.pl $HOSTIP $HOSTPORT &
-
-#if [ $? != "0" ]; then
-# echo "failed starting the TCP server"
-# exit
-#fi
-#sleep 1 # give it a second to start
+runserver
#######################################################################
# The main test-loop
@@ -154,3 +177,9 @@ for NUMBER in $TESTCASES; do
# loop for next test
done
+
+#######################################################################
+# Tests done, stop server
+#
+
+stopserver