mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 08:59:37 -05:00
added scripts to run tests.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4476 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
179693e2a4
commit
d656e0912f
32
libretroshare/src/tests/tcponudp/test_tou.sh
Executable file
32
libretroshare/src/tests/tcponudp/test_tou.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#/bin/sh
|
||||||
|
# Script to Test the udp_server code.
|
||||||
|
|
||||||
|
EXEC=./test_tou
|
||||||
|
TMPOUTPUT=tmpoutput$$
|
||||||
|
EXPECTEDPERIOD=10
|
||||||
|
# launches one instance in server mode.
|
||||||
|
$EXEC 127.0.0.1 4001 127.0.0.1 4002 > $TMPOUTPUT &
|
||||||
|
#2> udp_server1.cerr &
|
||||||
|
|
||||||
|
# launch a second in connect mode.
|
||||||
|
$EXEC -c 127.0.0.1 4002 127.0.0.1 4001 < $EXEC
|
||||||
|
# 2> udp_server2.cerr
|
||||||
|
# pipe a bunch of data through.
|
||||||
|
# make sure the data is the same.
|
||||||
|
|
||||||
|
# print success / failure.
|
||||||
|
sleep $EXPECTEDPERIOD
|
||||||
|
killall $EXEC
|
||||||
|
|
||||||
|
if diff -s $EXEC $TMPOUTPUT
|
||||||
|
then
|
||||||
|
echo "SUCCESS"
|
||||||
|
else
|
||||||
|
echo "FAILURE to accurately transfer DATA"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#rm udp_server1.cerr
|
||||||
|
#rm udp_server2.cerr
|
||||||
|
rm $TMPOUTPUT
|
||||||
|
|
||||||
|
|
32
libretroshare/src/tests/tcponudp/udp_server.sh
Executable file
32
libretroshare/src/tests/tcponudp/udp_server.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#/bin/sh
|
||||||
|
# Script to Test the udp_server code.
|
||||||
|
|
||||||
|
EXEC=./udp_server
|
||||||
|
TMPOUTPUT=tmpoutput$$
|
||||||
|
EXPECTEDPERIOD=10
|
||||||
|
# launches one instance in server mode.
|
||||||
|
$EXEC 127.0.0.1 4001 127.0.0.1 4002 > $TMPOUTPUT &
|
||||||
|
#2> udp_server1.cerr &
|
||||||
|
|
||||||
|
# launch a second in connect mode.
|
||||||
|
$EXEC -c 127.0.0.1 4002 127.0.0.1 4001 < $EXEC
|
||||||
|
# 2> udp_server2.cerr
|
||||||
|
# pipe a bunch of data through.
|
||||||
|
# make sure the data is the same.
|
||||||
|
|
||||||
|
# print success / failure.
|
||||||
|
sleep $EXPECTEDPERIOD
|
||||||
|
killall $EXEC
|
||||||
|
|
||||||
|
if diff -s $EXEC $TMPOUTPUT
|
||||||
|
then
|
||||||
|
echo "SUCCESS"
|
||||||
|
else
|
||||||
|
echo "FAILURE to accurately transfer DATA"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#rm udp_server1.cerr
|
||||||
|
#rm udp_server2.cerr
|
||||||
|
rm $TMPOUTPUT
|
||||||
|
|
||||||
|
|
31
libretroshare/src/tests/tcponudp/udpsock_test.sh
Executable file
31
libretroshare/src/tests/tcponudp/udpsock_test.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#/bin/sh
|
||||||
|
# Script to Test the udp_server code.
|
||||||
|
|
||||||
|
EXEC=./udpsock_test
|
||||||
|
TMPOUTPUT=tmpoutput$$
|
||||||
|
EXPECTEDPERIOD=10
|
||||||
|
$EXEC 6001 6002 6003 6004 6005 &
|
||||||
|
#2> udp_server1.cerr &
|
||||||
|
|
||||||
|
$EXEC 6002 6001 6003 6004 6005 &
|
||||||
|
$EXEC 6003 6002 6001 6004 6005 &
|
||||||
|
$EXEC 6004 6002 6003 6001 6005 &
|
||||||
|
$EXEC 6005 6002 6003 6004 6001 &
|
||||||
|
|
||||||
|
## print success / failure.
|
||||||
|
sleep $EXPECTEDPERIOD
|
||||||
|
killall $EXEC
|
||||||
|
|
||||||
|
#
|
||||||
|
#if diff -s $EXEC $TMPOUTPUT
|
||||||
|
#then
|
||||||
|
# echo "SUCCESS"
|
||||||
|
#else
|
||||||
|
# echo "FAILURE to accurately transfer DATA"
|
||||||
|
#fi
|
||||||
|
#
|
||||||
|
##rm udp_server1.cerr
|
||||||
|
##rm udp_server2.cerr
|
||||||
|
#rm $TMPOUTPUT
|
||||||
|
##
|
||||||
|
###
|
31
libretroshare/src/tests/tcponudp/udpsort_test.sh
Executable file
31
libretroshare/src/tests/tcponudp/udpsort_test.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#/bin/sh
|
||||||
|
# Script to Test the udp_server code.
|
||||||
|
|
||||||
|
EXEC=./udpsort_test
|
||||||
|
TMPOUTPUT=tmpoutput$$
|
||||||
|
EXPECTEDPERIOD=10
|
||||||
|
$EXEC 6001 6002 6003 6004 6005 &
|
||||||
|
#2> udp_server1.cerr &
|
||||||
|
|
||||||
|
$EXEC 6002 6001 6003 6004 6005 &
|
||||||
|
$EXEC 6003 6002 6001 6004 6005 &
|
||||||
|
$EXEC 6004 6002 6003 6001 6005 &
|
||||||
|
$EXEC 6005 6002 6003 6004 6001 &
|
||||||
|
|
||||||
|
## print success / failure.
|
||||||
|
sleep $EXPECTEDPERIOD
|
||||||
|
killall $EXEC
|
||||||
|
|
||||||
|
#
|
||||||
|
#if diff -s $EXEC $TMPOUTPUT
|
||||||
|
#then
|
||||||
|
# echo "SUCCESS"
|
||||||
|
#else
|
||||||
|
# echo "FAILURE to accurately transfer DATA"
|
||||||
|
#fi
|
||||||
|
#
|
||||||
|
##rm udp_server1.cerr
|
||||||
|
##rm udp_server2.cerr
|
||||||
|
#rm $TMPOUTPUT
|
||||||
|
##
|
||||||
|
###
|
Loading…
Reference in New Issue
Block a user