]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/testsuite/stress-server.sh
Added IDENT option to version string.
[ngircd-alex.git] / src / testsuite / stress-server.sh
index f978f4b8c7a3c2b9cd4ddf890a93458f81853492..df0969b4d9353978feb602ad92f3a590344f8b22 100755 (executable)
@@ -1,8 +1,10 @@
 #!/bin/sh
 # ngIRCd Test Suite
-# $Id: stress-server.sh,v 1.1 2002/09/09 22:56:07 alex Exp $
+# $Id: stress-server.sh,v 1.8 2003/08/22 11:31:18 alex Exp $
 
-CLIENTS=50
+[ -z "$srcdir" ] && srcdir=`dirname $0`
+
+[ "$1" -gt 0 ] 2> /dev/null && CLIENTS="$1" || CLIENTS=5
 
 name=`basename $0`
 test=`echo ${name} | cut -d '.' -f 1`
@@ -10,19 +12,19 @@ mkdir -p logs tests
 
 type expect > /dev/null 2>&1
 if [ $? -ne 0 ]; then
-  echo "SKIP: ${name} -- \"expect\" not found.";  exit 77
+  echo "      ${name}: \"expect\" not found.";  exit 77
 fi
 type telnet > /dev/null 2>&1
 if [ $? -ne 0 ]; then
-  echo "SKIP: ${name} -- \"telnet\" not found.";  exit 77
+  echo "      ${name}: \"telnet\" not found.";  exit 77
 fi
 
 echo "      stressing server with $CLIENTS clients (be patient!) ..."
 no=0
 while [ ${no} -lt $CLIENTS ]; do
-  cat stress-A.e > tests/${no}.e
+  cat ${srcdir}/stress-A.e > tests/${no}.e
   echo "send \"nick test${no}\\r\"" >> tests/${no}.e
-  cat stress-B.e >> tests/${no}.e
+  cat ${srcdir}/stress-B.e >> tests/${no}.e
   no=`expr ${no} + 1`
 done
 no=0
@@ -33,7 +35,7 @@ done
 
 touch logs/check-idle.log
 while true; do
-  expect check-idle.e >> logs/check-idle.log
+  expect ${srcdir}/check-idle.e >> logs/check-idle.log
   res=$?
   [ $res -eq 0 ] && exit 0
   [ $res -eq 1 ] && exit 1