3 # $Id: stress-server.sh,v 1.6.4.2 2003/11/07 20:51:11 alex Exp $
5 [ -z "$srcdir" ] && srcdir=`dirname $0`
7 [ "$1" -gt 0 ] 2> /dev/null && CLIENTS="$1" || CLIENTS=5
10 test=`echo ${name} | cut -d '.' -f 1`
13 type expect > /dev/null 2>&1
15 echo " ${name}: \"expect\" not found."; exit 77
17 type telnet > /dev/null 2>&1
19 echo " ${name}: \"telnet\" not found."; exit 77
22 echo " stressing server with $CLIENTS clients (be patient!) ..."
24 while [ ${no} -lt $CLIENTS ]; do
25 cat ${srcdir}/stress-A.e > tests/${no}.e
26 echo "send \"nick test${no}\\r\"" >> tests/${no}.e
27 cat ${srcdir}/stress-B.e >> tests/${no}.e
31 while [ ${no} -lt $CLIENTS ]; do
32 expect tests/${no}.e > logs/stress-${no}.log 2> /dev/null &
36 touch logs/check-idle.log
38 expect ${srcdir}/check-idle.e >> logs/check-idle.log
40 [ $res -eq 0 ] && exit 0
41 [ $res -eq 1 ] && exit 1
43 echo "====================" >> logs/check-idle.log