--- /dev/null
+#!/bin/bash
+
+IFS=','
+
+while read host port; do
+ ssh -n -f -l root $host -p $port "/home/p2p/eurocon/local_install"
+done < all-cts
--- /dev/null
+#!/bin/bash
+
+if test $# -ne 5; then
+ echo "Usage: $0 host1 port1 host2 port2 id" 1>&2
+ exit 1
+fi
+
+host1=$1
+port1=$2
+host2=$3
+port2=$4
+ID=$5
+
+for ts in 4 8 16 32 64 128 256 512; do
+ ./remote_run_if $host1 $port1 $host2 $port2 $ts $ID
+done
--- /dev/null
+#!/bin/bash
+
+if test $# -ne 5; then
+ echo "Usage: $0 host1 port1 host2 port2 id" 1>&2
+ exit 1
+fi
+
+host1=$1
+port1=$2
+host2=$3
+port2=$4
+ID=$5
+
+for ts in 4 8 16 32 64 128 256 512; do
+ ./remote_run_stop $host1 $port1 $host2 $port2 $ts $ID
+done
--- /dev/null
+#!/bin/bash
+
+if test $# -ne 5; then
+ echo "Usage: $0 host1 port1 host2 port2 id" 1>&2
+ exit 1
+fi
+
+host1=$1
+port1=$2
+host2=$3
+port2=$4
+ID=$5
+
+for ts in 4 8 16 32 64 128 256 512; do
+ ./remote_run_suspend $host1 $port1 $host2 $port2 $ts $ID
+done
#!/bin/bash
-addr=$(ip a s eth0 | grep 'inet ' | awk -F '[/ \t]+' '{print $3;}')
+if test $# -ne 1; then
+ echo "Usage: $0 ip-address" 1>&2
+ exit 1
+fi
+
+addr=$1
cd /home/p2p/eurocon/
-btmakemetafile http://$addr/announce /home/p2p/eurocon/Data.100M.bin
+btmakemetafile http://$addr:6969/announce /home/p2p/eurocon/Data.100M.bin
--- /dev/null
+#!/bin/bash
+
+ip a s eth0 | grep 'inet ' | awk -F '[/ \t]+' '{print $3;}'
--- /dev/null
+#!/bin/bash
+
+apt-get install -y bittornado
#!/bin/bash
-nohup bttrack --port 6969 --dfile track.file > track.log 2>&1 &
+nohup bttrack --port 6969 --dfile track.file >> track.log 2>&1 &
cd /tmp/
-LD_LIBRARY_PATH=/home/p2p/p2p-clients/hrktorrent/libtorrent-rasterbar/lib/ /home/p2p/cs-p2p-next/instrumentation/hrktorrent/hrktorrent --nodht --limitlocal --noupnp --maxconnections 1 --maxdown 100 /home/p2p/eurocon/Data.100M.ct.torrent
+LD_LIBRARY_PATH=/home/p2p/p2p-clients/hrktorrent/libtorrent-rasterbar/lib/ /home/p2p/cs-p2p-next/instrumentation/hrktorrent/hrktorrent --nodht --limitlocal --noupnp --maxconnections 1 --maxdown 100 /home/p2p/eurocon/Data.100M.bin.torrent >> /home/p2p/eurocon/hrk.log 2>&1
cd /home/p2p/eurocon/
-LD_LIBRARY_PATH=/home/p2p/p2p-clients/hrktorrent/libtorrent-rasterbar/lib/ /home/p2p/cs-p2p-next/instrumentation/hrktorrent/hrktorrent --nodht --limitlocal --noupnp --maxconnections 1 --maxdown 100 /home/p2p/Data.100M.bin
+LD_LIBRARY_PATH=/home/p2p/p2p-clients/hrktorrent/libtorrent-rasterbar/lib/ /home/p2p/cs-p2p-next/instrumentation/hrktorrent/hrktorrent --nodht --limitlocal --noupnp --maxconnections 1 --maxdown 100 /home/p2p/eurocon/Data.100M.bin.torrent >> /home/p2p/eurocon/hrk.log 2>&1
ssh -n -f -p $port1 -l root $host1 "/home/p2p/eurocon/local_clean"
ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_clean"
+ip=$(ssh -n -f -p $port1 -l root $host1 "/home/p2p/eurocon/local_get_ip")
+
# make torrent file
-ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_create_torrent"
-ssh -n -f -p $port2 -l p2p $host2 "/home/p2p/eurocon/local_create_torrent"
+ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_create_torrent $ip"
+ssh -n -f -p $port2 -l p2p $host2 "/home/p2p/eurocon/local_create_torrent $ip"
# start tracker
ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_run_tracker"
-ssh -n -f -p $port2 -l p2p $host2 "/home/p2p/eurocon/local_run_tracker"
sleep 5
# start seeder
-ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_client_seeder"
+ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_start_seeder"
# start leecher
-ssh -n -f -p $port2 -l p2p $host2 "/home/p2p/eurocon/local_client_leecher"
+ssh -n -f -p $port2 -l p2p $host2 "/home/p2p/eurocon/local_start_leecher"
# wait for it
sleep 15
sleep 45
+# cleanup
+ssh -n -f -p $port1 -l root $host1 "/home/p2p/eurocon/local_clean"
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_clean"
+
# sync back
-rsync -avz -e "ssh -p $port1" p2p@$host1:/home/p2p/eurocon/hrk.log $host1-$id-seeder.log
-rsync -avz -e "ssh -p $port2" p2p@$host2:/home/p2p/eurocon/hrk.log $host2-$id-leecher.log
+rsync -avz -e "ssh -p $port1" p2p@$host1:/home/p2p/eurocon/hrk.log ../eurocon-log/$host1-$port1-$id-$timeout-seeder.log
+rsync -avz -e "ssh -p $port2" p2p@$host2:/home/p2p/eurocon/hrk.log ../eurocon-log/$host2-$port2-$id-$timeout-leecher.log
+
+# backup logs
+ssh -n -f -p $port1 -l p2p $host1 "mv /home/p2p/eurocon/hrk.log hrk-$(date +%s).log"
+ssh -n -f -p $port2 -l p2p $host2 "mv /home/p2p/eurocon/hrk.log hrk-$(date +%s).log"
#!/bin/bash
-if test $# -ne 4; then
- echo "Usage: $0 host1 port1 host2 port2" 1>&2
+if test $# -ne 6; then
+ echo "Usage: $0 host1 port1 host2 port2 timeout id" 1>&2
exit 1
fi
+
+host1=$1
+port1=$2
+host2=$3
+port2=$4
+timeout=$5
+_id=$6
+
+# cleanup
+ssh -n -f -p $port1 -l root $host1 "/home/p2p/eurocon/local_clean"
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_clean"
+
+ip=$(ssh -n -f -p $port1 -l root $host1 "/home/p2p/eurocon/local_get_ip")
+
+# make torrent file
+ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_create_torrent $ip"
+ssh -n -f -p $port2 -l p2p $host2 "/home/p2p/eurocon/local_create_torrent $ip"
+
+# start tracker
+ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_run_tracker"
+
+sleep 5
+
+# start seeder
+ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_start_seeder"
+
+# start leecher
+ssh -n -f -p $port2 -l p2p $host2 "/home/p2p/eurocon/local_start_leecher"
+
+# wait for it
+sleep 15
+
+# put leecher down
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_kill_client"
+
+# sleep as planned
+sleep $timeout
+
+# restart client
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_start_leecher"
+
+sleep 45
+
+# cleanup
+ssh -n -f -p $port1 -l root $host1 "/home/p2p/eurocon/local_clean"
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_clean"
+
+# sync back
+rsync -avz -e "ssh -p $port1" p2p@$host1:/home/p2p/eurocon/hrk.log ../eurocon-log/$host1-$port1-$id-$timeout-seeder.log
+rsync -avz -e "ssh -p $port2" p2p@$host2:/home/p2p/eurocon/hrk.log ../eurocon-log/$host2-$port2-$id-$timeout-leecher.log
+
+# backup logs
+ssh -n -f -p $port1 -l p2p $host1 "mv /home/p2p/eurocon/hrk.log hrk-$(date +%s).log"
+ssh -n -f -p $port2 -l p2p $host2 "mv /home/p2p/eurocon/hrk.log hrk-$(date +%s).log"
#!/bin/bash
-if test $# -ne 4; then
- echo "Usage: $0 host1 port1 host2 port2" 1>&2
+if test $# -ne 6; then
+ echo "Usage: $0 host1 port1 host2 port2 timeout id" 1>&2
exit 1
fi
+
+host1=$1
+port1=$2
+host2=$3
+port2=$4
+timeout=$5
+_id=$6
+
+# cleanup
+ssh -n -f -p $port1 -l root $host1 "/home/p2p/eurocon/local_clean"
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_clean"
+
+ip=$(ssh -n -f -p $port1 -l root $host1 "/home/p2p/eurocon/local_get_ip")
+
+# make torrent file
+ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_create_torrent $ip"
+ssh -n -f -p $port2 -l p2p $host2 "/home/p2p/eurocon/local_create_torrent $ip"
+
+# start tracker
+ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_run_tracker"
+
+sleep 5
+
+# start seeder
+ssh -n -f -p $port1 -l p2p $host1 "/home/p2p/eurocon/local_start_seeder"
+
+# start leecher
+ssh -n -f -p $port2 -l p2p $host2 "/home/p2p/eurocon/local_start_leecher"
+
+# wait for it
+sleep 15
+
+# suspend leecher
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_suspend_client"
+
+# sleep as planned
+sleep $timeout
+
+# resume leecher
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_cont_client"
+
+sleep 45
+
+# cleanup
+ssh -n -f -p $port1 -l root $host1 "/home/p2p/eurocon/local_clean"
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_clean"
+
+# sync back
+rsync -avz -e "ssh -p $port1" p2p@$host1:/home/p2p/eurocon/hrk.log ../eurocon-log/$host1-$port1-$id-$timeout-seeder.log
+rsync -avz -e "ssh -p $port2" p2p@$host2:/home/p2p/eurocon/hrk.log ../eurocon-log/$host2-$port2-$id-$timeout-leecher.log
+
+# backup logs
+ssh -n -f -p $port1 -l p2p $host1 "mv /home/p2p/eurocon/hrk.log hrk-$(date +%s).log"
+ssh -n -f -p $port2 -l p2p $host2 "mv /home/p2p/eurocon/hrk.log hrk-$(date +%s).log"
--- /dev/null
+#!/bin/bash
+
+ID=1
+
+IFS=','
+
+while read host1 port1 host2 port2; do
+ echo "bla"
+ xterm -e /bin/bash -l -c "cd /home/razvan/projects/p2p-next/P2P-Testing-Infrastructure/Utils/test-socket-signal/test/eurocon && ./all_run_if $host1 $port1 $host2 $port2 $ID" &
+done < pairs-if
--- /dev/null
+#!/bin/bash
+
+ID=1
+
+IFS=','
+
+while read host1 port1 host2 port2; do
+ echo "bla"
+ xterm -e /bin/bash -l -c "cd /home/razvan/projects/p2p-next/P2P-Testing-Infrastructure/Utils/test-socket-signal/test/eurocon && ./all_run_stop $host1 $port1 $host2 $port2 $ID" &
+done < pairs-stop
--- /dev/null
+#!/bin/bash
+
+ID=1
+
+IFS=','
+
+while read host1 port1 host2 port2; do
+ xterm -e /bin/bash -l -c "cd /home/razvan/projects/p2p-next/P2P-Testing-Infrastructure/Utils/test-socket-signal/test/eurocon && ./all_run_suspend $host1 $port1 $host2 $port2 $ID" &
+done < pairs-suspend