From: victor Date: Fri, 6 Nov 2009 17:06:46 +0000 (+0000) Subject: testing swarming X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=6f65b77d69006b770140d8f43bf8e1156bd07794;p=swift-upb.git testing swarming git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@506 e16421f0-f15b-0410-abcd-98678b794739 --- diff --git a/BUGS b/BUGS index 8fb861c..610a7fa 100644 --- a/BUGS +++ b/BUGS @@ -14,3 +14,5 @@ * minimize the number of template instantiations * Channel thinks how much it HINTs a second, picker thinks which HINTs are snubbed + * dead Channels are not killed => cannot open a new one + (have a channel already) diff --git a/exec/leecher.cpp b/exec/leecher.cpp index cee17e4..8734d61 100644 --- a/exec/leecher.cpp +++ b/exec/leecher.cpp @@ -15,7 +15,7 @@ using namespace p2tp; /** P2TP downloader. Params: root hash, filename, tracker ip/port, own ip/port */ int main (int argn, char** args) { - srand(time(NULL)); + srand(Datagram::Time()); FileTransfer::instance = rand(); if (argn<4) { diff --git a/tests/pex_test.sh b/tests/pex_test.sh new file mode 100755 index 0000000..89767ad --- /dev/null +++ b/tests/pex_test.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +EXEC=build/Debug/ +PEERCOUNT=2 +STORE=_pextest +TOKILL= +rm -rf $STORE +mkdir $STORE + +#$EXEC/seeder doc/sofi.jpg 7001 + +for i in `seq 1 $PEERCOUNT`; do + ( $EXEC/leecher 282a863d5567695161721686a59f0c667250a35d \ + $STORE/sofi$i.jpg 7001 710$i > $STORE/leecher$i.log ) & + TOKILL="$TOKILL $!" + sleep 1; +done + +sleep 10 + +for p in $TOKILL; do + kill -9 $p +done + +for i in `seq 1 $PEERCOUNT`; do + cat $STORE/leecher$i.log | grep sent | awk '{print $5}' | \ + sort | uniq -c > $STORE/peers$i.txt + peers=`wc -l < $STORE/peers$i.txt` + if [ $peers -ne $PEERCOUNT ]; then + echo Peer $i has $peers peers + fi +done