testing RPCs
Ronan Waide
waider at waider.ie
Tue May 6 09:58:21 GMT 2003
Hi folks,
the following scrap of shell script is what I've been using to test
modifications to the RPC code. It makes progressively larger calls to
the rpc echo server and verifies that the call worked. Connection
failure will cause a retry; any other failure gets logged. Script
takes two parameters, the server to test against and the starting
RPC size. It will test up to a maximum of 16k, and log errors (if any)
in rpctest.log in the current directory.
It's horrid, but it does the job.
Cheers,
Waider.
---------------------->8---------------------------------------------------------------
#!/bin/sh
CREDENTIALS=username%password
SRV=$1
shift
i=1
if [ "$1" ]
then
i=$1
fi
while true
do
echo Testing $i
foo=`bin/rpcclient $SRV -U $CREDENTIALS -c "echodata $i" | grep -vi 'creating lame'`
if echo $foo | grep -q "Cannot connect to server"
then
echo "Failed to connect, retrying $i"
else
if [ "$foo" ]
then
echo "Failed $i ($foo)" >> rpctest.log
fi
i=`expr $i + 1`
if [ $i = 16385 ]
then
break
fi
fi
done
---------------------->8---------------------------------------------------------------
--
waider at waider.ie / Yes, it /is/ very personal of me.
"So, these portents, taken together with the eclipse and casting this
disembowelled handset over my desk... um, ... oh dear ... I think I need to
order a new phone from MIS." - james coleman
More information about the samba-technical
mailing list