2002-11-21 17:49:52 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
|
|
# A simple script to launch an automated test run.
|
|
|
|
|
# Highly dependant on the local setup.
|
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
|
|
ab_names=/infres/shalmaneser/quinot/projects/droopi/cos/naming/ab_names
|
|
|
|
|
serverp=/infres/shalmaneser/quinot/projects/droopi/examples/bbs/serverp
|
2002-11-26 02:37:50 +00:00
|
|
|
serverp_conf=/infres/shalmaneser/quinot/projects/droopi/examples/bbs/serverp.conf
|
2002-11-21 17:49:52 +00:00
|
|
|
evolutedp=/infres/ir10/astre/quinot/polyorb-sparc/build/examples/bbs/evolutedp
|
2002-11-28 04:07:19 +00:00
|
|
|
evolutedp_conf=/infres/shalmaneser/quinot/projects/droopi/examples/bbs/evolutedp.conf
|
2002-11-25 21:46:48 +00:00
|
|
|
output=/infres/shalmaneser/quinot/polyorb-output
|
2002-11-21 17:49:52 +00:00
|
|
|
|
|
|
|
|
Revolutedp_pids=""
|
|
|
|
|
|
2002-12-04 01:18:53 +00:00
|
|
|
sol8_hosts=valjean:cosette:fadette:roland:isengrin:candide:fracasse:donjuan:chimene:elvire:gavroche:lantier:folcoche:quasimodo:
|
|
|
|
|
#cyrano:
|
|
|
|
|
|
|
|
|
|
sol9_hosts=nadja:blizzard:aurelien:goriot:esmeralda:esmeralda2:rodrigue:vautrin:arsene:javert:
|
|
|
|
|
|
|
|
|
|
hosts=$sol8_hosts
|
2002-11-25 14:38:29 +00:00
|
|
|
|
2002-12-01 23:04:13 +00:00
|
|
|
nhosts=`echo $hosts | tr -cd : | wc -c`
|
2002-11-25 14:38:29 +00:00
|
|
|
size=100
|
|
|
|
|
count=100
|
2002-12-01 23:04:13 +00:00
|
|
|
cli_per_host=1
|
|
|
|
|
nmax=$nhosts
|
2002-11-29 23:07:46 +00:00
|
|
|
ulimit -c unlimited
|
2002-11-25 21:46:48 +00:00
|
|
|
kill=false
|
2002-12-03 13:52:25 +00:00
|
|
|
broadcast=""
|
2002-11-25 14:38:29 +00:00
|
|
|
|
2002-12-03 13:52:25 +00:00
|
|
|
while getopts bks:c:n:N: opt; do
|
2002-11-25 14:38:29 +00:00
|
|
|
case "$opt" in
|
2002-11-25 21:46:48 +00:00
|
|
|
k) kill=true ;;
|
2002-12-03 13:52:25 +00:00
|
|
|
b) broadcast="-b" ;;
|
2002-11-25 14:38:29 +00:00
|
|
|
s) size=$OPTARG ;;
|
|
|
|
|
c) count=$OPTARG ;;
|
2002-12-01 23:04:13 +00:00
|
|
|
N) cli_per_host=$OPTARG ;;
|
|
|
|
|
n) nmax=$OPTARG ;;
|
2002-11-25 14:38:29 +00:00
|
|
|
*) echo "invalid parameter"; exit 1;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
2002-12-01 23:04:13 +00:00
|
|
|
if [ "$nmax" -gt `expr "$nhosts" '*' "$cli_per_host"` ]; then
|
|
|
|
|
echo "Too many total clients ($nhosts hosts, $cli_per_host clients each".
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2002-11-25 21:46:48 +00:00
|
|
|
if $kill; then
|
|
|
|
|
IFS=:
|
|
|
|
|
for h in $hosts; do
|
|
|
|
|
if [ "$h" != "" ]; then
|
|
|
|
|
echo $h
|
2002-12-01 15:16:11 +00:00
|
|
|
rsh $h "/usr/ucb/ps axuw|grep 'quinot.*$evolutedp' | grep -v grep \
|
|
|
|
|
| awk '{print \$2}' | xargs kill -9 2> /dev/null || echo ---"
|
2002-11-25 21:46:48 +00:00
|
|
|
fi
|
|
|
|
|
done
|
2002-11-28 04:07:19 +00:00
|
|
|
ps axw|grep "tail -f /tmp/cli"|awk '{print $1}'|xargs kill 2> /dev/null
|
2002-11-25 21:46:48 +00:00
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
2002-11-25 14:38:29 +00:00
|
|
|
now=`date +"%F_%T" | tr -d :`
|
|
|
|
|
output=$output/$now
|
|
|
|
|
mkdir $output
|
|
|
|
|
|
2002-12-03 13:52:25 +00:00
|
|
|
(
|
|
|
|
|
echo "output=$output"
|
|
|
|
|
echo "size=$size"
|
|
|
|
|
echo "count=$count"
|
|
|
|
|
echo "nmax=$nmax"
|
|
|
|
|
echo "cli_per_host=$cli_per_host"
|
|
|
|
|
if [ "$brodcast" = "-b" ]; then
|
|
|
|
|
echo "broadcast=true"
|
|
|
|
|
else
|
|
|
|
|
echo "broadcast=false"
|
|
|
|
|
fi
|
|
|
|
|
) > $output/00PARAMETERS
|
2002-11-25 14:38:29 +00:00
|
|
|
|
2002-11-26 02:37:50 +00:00
|
|
|
echo "000 init"
|
|
|
|
|
sed "s/^/ /" $output/00PARAMETERS
|
|
|
|
|
cp $ab_names_conf $serverp_conf $evolutedp_conf $output 2> /dev/null || true
|
2002-11-28 04:07:19 +00:00
|
|
|
trap 'echo kill $ab_names_pid $serverp_pid $Revolutedp_pids;
|
2002-11-28 20:38:04 +00:00
|
|
|
kill -9 $ab_names_pid $serverp_pid $Revolutedp_pids;
|
2002-11-28 04:07:19 +00:00
|
|
|
exit' 0 2 15
|
2002-11-25 14:38:29 +00:00
|
|
|
|
2002-11-26 02:37:50 +00:00
|
|
|
echo "001 Starting name server..."
|
|
|
|
|
|
2002-11-28 11:20:43 +00:00
|
|
|
touch $output/ab_names.out
|
2002-11-28 04:07:19 +00:00
|
|
|
POLYORB_CONF=$ab_names_conf $ab_names > $output/ab_names.out 2> /dev/null &
|
2002-11-25 14:38:29 +00:00
|
|
|
ab_names_pid=$!
|
2002-11-28 11:20:43 +00:00
|
|
|
while ! grep POLYORB_CORBA_NAMING_IOR $output/ab_names.out; do
|
|
|
|
|
sleep 5
|
|
|
|
|
done
|
2002-11-25 14:38:29 +00:00
|
|
|
. $output/ab_names.out
|
|
|
|
|
export POLYORB_CORBA_NAMING_IOR
|
|
|
|
|
|
2002-11-26 02:37:50 +00:00
|
|
|
echo "002 Starting server partition..."
|
|
|
|
|
POLYORB_CONF=$serverp_conf $serverp > $output/serverp.out 2>&1 &
|
2002-11-25 14:38:29 +00:00
|
|
|
serverp_pid=$!
|
2002-11-28 11:20:43 +00:00
|
|
|
sleep 5
|
2002-11-21 17:49:52 +00:00
|
|
|
|
2002-11-26 02:37:50 +00:00
|
|
|
clinumber=0
|
2002-12-01 23:04:13 +00:00
|
|
|
hostnumber=0
|
|
|
|
|
while [ "$hostnumber" -lt "$nhosts" -a "$clinumber" -lt "$nmax" ]; do
|
2002-11-25 21:46:48 +00:00
|
|
|
eval `echo $hosts | sed 's/^\([^:]*\):\(.*\)$/host=\1;hosts=\2/'`
|
|
|
|
|
ping -c 2 $host > /dev/null || continue
|
|
|
|
|
|
2002-12-01 23:04:13 +00:00
|
|
|
cli_thishost=0
|
|
|
|
|
while [ "$cli_thishost" -lt "$cli_per_host" -a "$clinumber" -lt "$nmax" ]; do
|
|
|
|
|
ctl=/tmp/cli${clinumber}_ctl
|
|
|
|
|
rm -f $ctl
|
|
|
|
|
mkfifo $ctl
|
|
|
|
|
cliout=$output/cli$clinumber-$host
|
|
|
|
|
touch $cliout
|
|
|
|
|
cliouts="$cliouts $cliout"
|
|
|
|
|
echo `expr 100 + $clinumber`" Starting client $clinumber on $host"
|
|
|
|
|
sh -c "tail -f $ctl | rsh $host \"ulimit -c unlimited;TERM=dumb \
|
|
|
|
|
POLYORB_CORBA_NAMING_IOR=$POLYORB_CORBA_NAMING_IOR \
|
|
|
|
|
POLYORB_CONF=$evolutedp_conf \
|
|
|
|
|
LD_LIBRARY_PATH=/usr/local/lib \
|
2002-12-03 13:59:41 +00:00
|
|
|
$evolutedp $broadcast -n $nmax -c $count -s $size TEST_$clinumber 2>&1 \" \
|
2002-12-01 23:04:13 +00:00
|
|
|
>> $cliout" &
|
|
|
|
|
Revolutedp_pids="$Revolutedp_pids $!"
|
|
|
|
|
eval "cli_host_$clinumber=$h"
|
|
|
|
|
clinumber=`expr $clinumber + 1`
|
|
|
|
|
cli_thishost=`expr $cli_thishost + 1`
|
|
|
|
|
done
|
2002-11-21 17:49:52 +00:00
|
|
|
done
|
|
|
|
|
|
2002-11-28 11:20:43 +00:00
|
|
|
echo "200 Waiting for clients to become ready."
|
|
|
|
|
retries=0
|
|
|
|
|
while [ "`grep -L Ready $cliouts`" != "" -a "$retries" -lt 60 ]; do
|
|
|
|
|
retries=`expr $retries + 1`
|
2002-11-26 02:37:50 +00:00
|
|
|
sleep 2
|
2002-11-25 14:38:29 +00:00
|
|
|
done
|
2002-11-28 11:20:43 +00:00
|
|
|
if [ "$retries" -ge 60 ]; then
|
|
|
|
|
echo "222 Timed out"
|
|
|
|
|
$0 -k
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2002-11-25 14:38:29 +00:00
|
|
|
|
2002-11-26 02:37:50 +00:00
|
|
|
echo "201 GO!"
|
2002-11-21 17:49:52 +00:00
|
|
|
date
|
|
|
|
|
i=0
|
|
|
|
|
while [ $i -lt $clinumber ]; do
|
|
|
|
|
echo "" > /tmp/cli${i}_ctl &
|
|
|
|
|
i=`expr $i + 1`
|
|
|
|
|
done
|
|
|
|
|
date
|
|
|
|
|
|
2002-11-26 02:37:50 +00:00
|
|
|
echo "202 Waiting for clients to complete."
|
|
|
|
|
while true; do
|
|
|
|
|
if [ "`grep -L 'Elapsed :' $cliouts`" = "" ]; then
|
|
|
|
|
echo "555 Success."
|
2002-11-28 04:07:19 +00:00
|
|
|
echo OK > $output/98STATUS
|
2002-11-26 02:37:50 +00:00
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
|
2002-11-26 03:03:27 +00:00
|
|
|
if egrep -i 'Raised|STORAGE|ASSERT' $cliouts > /dev/null; then
|
2002-11-26 02:37:50 +00:00
|
|
|
echo "666 Exception."
|
2002-11-28 04:07:19 +00:00
|
|
|
echo FAIL > $output/98STATUS
|
2002-11-26 02:37:50 +00:00
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
sleep 5
|
|
|
|
|
done
|
|
|
|
|
date
|
|
|
|
|
echo "888 Completed, cleaning up."
|
2002-11-28 04:07:19 +00:00
|
|
|
$0 -k
|