#test script of stone_tcptp.sh with tcputils #usage: test connexion_file local_plugin_port #this script act as a very simple trustpeer server to test tcptp plugins ERRPROG=1 ERRNORM=2 #d'abord on teste le nombre de parametres sinon usage sur stderr et return ERRPROG pour signaler precondition 1 fausse if test $# -ne 2 then echo "test_requ: PRECONDITION 1 ASSERTION FAILED: needs 2 parameters: connexion_file local_plugin_port">&2 exit $ERRPROG fi #first we set the server port number of the plugin, as seen from trustpeer PLUGPORT=$2 #then we set the server port number of trustpeer, as seen from plugin TRUSTPORT=$(($PLUGPORT+1)) #now we launch our stone.sh plug/`head -n 1 $1` 0.1 $1 $PLUGPORT $TRUSTPORT sleep 2 tcpconnect -v localhost $PLUGPORT killall stone #FIXME should kill only the stones that were just launched