test-socket-signal: add eurocon test suite
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Mon, 15 Nov 2010 22:04:49 +0000 (00:04 +0200)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tue, 16 Nov 2010 00:09:50 +0000 (02:09 +0200)
20 files changed:
Utils/test-socket-signal/test/eurocon/.gitignore [new file with mode: 0644]
Utils/test-socket-signal/test/eurocon/all-cts [new file with mode: 0644]
Utils/test-socket-signal/test/eurocon/all_ct_rsync [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/ct_rsync [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/local_clean [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/local_cont_client [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/local_create_torrent [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/local_ifdown [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/local_ifup [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/local_kill_client [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/local_run_tracker [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/local_start_leecher [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/local_start_seeder [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/local_suspend_client [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/pairs-ifdown [new file with mode: 0644]
Utils/test-socket-signal/test/eurocon/pairs-stop [new file with mode: 0644]
Utils/test-socket-signal/test/eurocon/pairs-suspend [new file with mode: 0644]
Utils/test-socket-signal/test/eurocon/remote_run_if [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/remote_run_stop [new file with mode: 0755]
Utils/test-socket-signal/test/eurocon/remote_run_suspend [new file with mode: 0755]

diff --git a/Utils/test-socket-signal/test/eurocon/.gitignore b/Utils/test-socket-signal/test/eurocon/.gitignore
new file mode 100644 (file)
index 0000000..a8a0dce
--- /dev/null
@@ -0,0 +1 @@
+*.bin
diff --git a/Utils/test-socket-signal/test/eurocon/all-cts b/Utils/test-socket-signal/test/eurocon/all-cts
new file mode 100644 (file)
index 0000000..4107171
--- /dev/null
@@ -0,0 +1,90 @@
+p2p-next-01.grid.pub.ro,10122
+p2p-next-01.grid.pub.ro,10222
+p2p-next-01.grid.pub.ro,10322
+p2p-next-01.grid.pub.ro,10422
+p2p-next-01.grid.pub.ro,10522
+p2p-next-01.grid.pub.ro,10622
+p2p-next-01.grid.pub.ro,10722
+p2p-next-01.grid.pub.ro,10822
+p2p-next-01.grid.pub.ro,10922
+p2p-next-01.grid.pub.ro,11022
+p2p-next-03.grid.pub.ro,10122
+p2p-next-03.grid.pub.ro,10222
+p2p-next-03.grid.pub.ro,10322
+p2p-next-03.grid.pub.ro,10422
+p2p-next-03.grid.pub.ro,10522
+p2p-next-03.grid.pub.ro,10622
+p2p-next-03.grid.pub.ro,10722
+p2p-next-03.grid.pub.ro,10822
+p2p-next-03.grid.pub.ro,10922
+p2p-next-03.grid.pub.ro,11022
+p2p-next-04.grid.pub.ro,10122
+p2p-next-04.grid.pub.ro,10222
+p2p-next-04.grid.pub.ro,10322
+p2p-next-04.grid.pub.ro,10422
+p2p-next-04.grid.pub.ro,10522
+p2p-next-04.grid.pub.ro,10622
+p2p-next-04.grid.pub.ro,10722
+p2p-next-04.grid.pub.ro,10822
+p2p-next-04.grid.pub.ro,10922
+p2p-next-04.grid.pub.ro,11022
+p2p-next-05.grid.pub.ro,10122
+p2p-next-05.grid.pub.ro,10222
+p2p-next-05.grid.pub.ro,10322
+p2p-next-05.grid.pub.ro,10422
+p2p-next-05.grid.pub.ro,10522
+p2p-next-05.grid.pub.ro,10622
+p2p-next-05.grid.pub.ro,10722
+p2p-next-05.grid.pub.ro,10822
+p2p-next-05.grid.pub.ro,10922
+p2p-next-05.grid.pub.ro,11022
+p2p-next-06.grid.pub.ro,10122
+p2p-next-06.grid.pub.ro,10222
+p2p-next-06.grid.pub.ro,10322
+p2p-next-06.grid.pub.ro,10422
+p2p-next-06.grid.pub.ro,10522
+p2p-next-06.grid.pub.ro,10622
+p2p-next-06.grid.pub.ro,10722
+p2p-next-06.grid.pub.ro,10822
+p2p-next-06.grid.pub.ro,10922
+p2p-next-06.grid.pub.ro,11022
+p2p-next-07.grid.pub.ro,10122
+p2p-next-07.grid.pub.ro,10222
+p2p-next-07.grid.pub.ro,10322
+p2p-next-07.grid.pub.ro,10422
+p2p-next-07.grid.pub.ro,10522
+p2p-next-07.grid.pub.ro,10622
+p2p-next-07.grid.pub.ro,10722
+p2p-next-07.grid.pub.ro,10822
+p2p-next-07.grid.pub.ro,10922
+p2p-next-07.grid.pub.ro,11022
+p2p-next-08.grid.pub.ro,10122
+p2p-next-08.grid.pub.ro,10222
+p2p-next-08.grid.pub.ro,10322
+p2p-next-08.grid.pub.ro,10422
+p2p-next-08.grid.pub.ro,10522
+p2p-next-08.grid.pub.ro,10622
+p2p-next-08.grid.pub.ro,10722
+p2p-next-08.grid.pub.ro,10822
+p2p-next-08.grid.pub.ro,10922
+p2p-next-08.grid.pub.ro,11022
+p2p-next-09.grid.pub.ro,10122
+p2p-next-09.grid.pub.ro,10222
+p2p-next-09.grid.pub.ro,10322
+p2p-next-09.grid.pub.ro,10422
+p2p-next-09.grid.pub.ro,10522
+p2p-next-09.grid.pub.ro,10622
+p2p-next-09.grid.pub.ro,10722
+p2p-next-09.grid.pub.ro,10822
+p2p-next-09.grid.pub.ro,10922
+p2p-next-09.grid.pub.ro,11022
+p2p-next-10.grid.pub.ro,10122
+p2p-next-10.grid.pub.ro,10222
+p2p-next-10.grid.pub.ro,10322
+p2p-next-10.grid.pub.ro,10422
+p2p-next-10.grid.pub.ro,10522
+p2p-next-10.grid.pub.ro,10622
+p2p-next-10.grid.pub.ro,10722
+p2p-next-10.grid.pub.ro,10822
+p2p-next-10.grid.pub.ro,10922
+p2p-next-10.grid.pub.ro,11022
diff --git a/Utils/test-socket-signal/test/eurocon/all_ct_rsync b/Utils/test-socket-signal/test/eurocon/all_ct_rsync
new file mode 100755 (executable)
index 0000000..312dd56
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+IFS=','
+
+while read host port; do
+       ./ct_rsync $host $port
+done < all-cts
diff --git a/Utils/test-socket-signal/test/eurocon/ct_rsync b/Utils/test-socket-signal/test/eurocon/ct_rsync
new file mode 100755 (executable)
index 0000000..56beebb
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if test $# -ne 2; then
+       echo "Usage: $0 hostname port" 1>&2
+       exit 1
+fi
+
+host=$1
+port=$2
+
+rsync -avz -e "ssh -p $port" ../eurocon p2p@$host:
diff --git a/Utils/test-socket-signal/test/eurocon/local_clean b/Utils/test-socket-signal/test/eurocon/local_clean
new file mode 100755 (executable)
index 0000000..0e5a6a1
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+pkill -f bttrack
+pkill -f hrktorrent
diff --git a/Utils/test-socket-signal/test/eurocon/local_cont_client b/Utils/test-socket-signal/test/eurocon/local_cont_client
new file mode 100755 (executable)
index 0000000..d352157
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+kill -CONT $(pgrep hrktorrent)
diff --git a/Utils/test-socket-signal/test/eurocon/local_create_torrent b/Utils/test-socket-signal/test/eurocon/local_create_torrent
new file mode 100755 (executable)
index 0000000..e74d5cc
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+addr=$(ip a s eth0 | grep 'inet ' | awk -F '[/ \t]+' '{print $3;}')
+
+cd /home/p2p/eurocon/
+
+btmakemetafile http://$addr/announce /home/p2p/eurocon/Data.100M.bin
diff --git a/Utils/test-socket-signal/test/eurocon/local_ifdown b/Utils/test-socket-signal/test/eurocon/local_ifdown
new file mode 100755 (executable)
index 0000000..06e9010
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+ip l s dev eth0 down
diff --git a/Utils/test-socket-signal/test/eurocon/local_ifup b/Utils/test-socket-signal/test/eurocon/local_ifup
new file mode 100755 (executable)
index 0000000..fda32aa
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+ip l s dev eth0 up
diff --git a/Utils/test-socket-signal/test/eurocon/local_kill_client b/Utils/test-socket-signal/test/eurocon/local_kill_client
new file mode 100755 (executable)
index 0000000..a8da362
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+kill -KILL $(pgrep hrktorrent)
diff --git a/Utils/test-socket-signal/test/eurocon/local_run_tracker b/Utils/test-socket-signal/test/eurocon/local_run_tracker
new file mode 100755 (executable)
index 0000000..fac21bf
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+nohup bttrack --port 6969 --dfile track.file > track.log 2>&1 &
diff --git a/Utils/test-socket-signal/test/eurocon/local_start_leecher b/Utils/test-socket-signal/test/eurocon/local_start_leecher
new file mode 100755 (executable)
index 0000000..aa9b7f2
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+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
diff --git a/Utils/test-socket-signal/test/eurocon/local_start_seeder b/Utils/test-socket-signal/test/eurocon/local_start_seeder
new file mode 100755 (executable)
index 0000000..d9ff445
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+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
diff --git a/Utils/test-socket-signal/test/eurocon/local_suspend_client b/Utils/test-socket-signal/test/eurocon/local_suspend_client
new file mode 100755 (executable)
index 0000000..3196d58
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+kill -STOP $(pgrep hrktorrent)
diff --git a/Utils/test-socket-signal/test/eurocon/pairs-ifdown b/Utils/test-socket-signal/test/eurocon/pairs-ifdown
new file mode 100644 (file)
index 0000000..661a059
--- /dev/null
@@ -0,0 +1,13 @@
+p2p-next-01.grid.pub.ro,10122,p2p-next-03.grid.pub.ro,10122
+p2p-next-01.grid.pub.ro,10222,p2p-next-03.grid.pub.ro,10222
+p2p-next-01.grid.pub.ro,10322,p2p-next-03.grid.pub.ro,10322
+p2p-next-01.grid.pub.ro,10422,p2p-next-03.grid.pub.ro,10422
+p2p-next-01.grid.pub.ro,10522,p2p-next-03.grid.pub.ro,10522
+p2p-next-01.grid.pub.ro,10622,p2p-next-03.grid.pub.ro,10622
+p2p-next-01.grid.pub.ro,10722,p2p-next-03.grid.pub.ro,10722
+p2p-next-01.grid.pub.ro,10822,p2p-next-03.grid.pub.ro,10822
+p2p-next-01.grid.pub.ro,10922,p2p-next-03.grid.pub.ro,10922
+p2p-next-01.grid.pub.ro,11022,p2p-next-03.grid.pub.ro,11022
+p2p-next-08.grid.pub.ro,10122,p2p-next-09.grid.pub.ro,10122
+p2p-next-08.grid.pub.ro,10222,p2p-next-09.grid.pub.ro,10222
+p2p-next-08.grid.pub.ro,10322,p2p-next-09.grid.pub.ro,10322
diff --git a/Utils/test-socket-signal/test/eurocon/pairs-stop b/Utils/test-socket-signal/test/eurocon/pairs-stop
new file mode 100644 (file)
index 0000000..9521844
--- /dev/null
@@ -0,0 +1,13 @@
+p2p-next-04.grid.pub.ro,10122,p2p-next-05.grid.pub.ro,10122
+p2p-next-04.grid.pub.ro,10222,p2p-next-05.grid.pub.ro,10222
+p2p-next-04.grid.pub.ro,10322,p2p-next-05.grid.pub.ro,10322
+p2p-next-04.grid.pub.ro,10422,p2p-next-05.grid.pub.ro,10422
+p2p-next-04.grid.pub.ro,10522,p2p-next-05.grid.pub.ro,10522
+p2p-next-04.grid.pub.ro,10622,p2p-next-05.grid.pub.ro,10622
+p2p-next-04.grid.pub.ro,10722,p2p-next-05.grid.pub.ro,10722
+p2p-next-04.grid.pub.ro,10822,p2p-next-05.grid.pub.ro,10822
+p2p-next-04.grid.pub.ro,10922,p2p-next-05.grid.pub.ro,10922
+p2p-next-04.grid.pub.ro,11022,p2p-next-05.grid.pub.ro,11022
+p2p-next-08.grid.pub.ro,10422,p2p-next-09.grid.pub.ro,10422
+p2p-next-08.grid.pub.ro,10522,p2p-next-09.grid.pub.ro,10522
+p2p-next-08.grid.pub.ro,10622,p2p-next-09.grid.pub.ro,10622
diff --git a/Utils/test-socket-signal/test/eurocon/pairs-suspend b/Utils/test-socket-signal/test/eurocon/pairs-suspend
new file mode 100644 (file)
index 0000000..8aa1199
--- /dev/null
@@ -0,0 +1,13 @@
+p2p-next-06.grid.pub.ro,10122,p2p-next-07.grid.pub.ro,10122
+p2p-next-06.grid.pub.ro,10222,p2p-next-07.grid.pub.ro,10222
+p2p-next-06.grid.pub.ro,10322,p2p-next-07.grid.pub.ro,10322
+p2p-next-06.grid.pub.ro,10422,p2p-next-07.grid.pub.ro,10422
+p2p-next-06.grid.pub.ro,10522,p2p-next-07.grid.pub.ro,10522
+p2p-next-06.grid.pub.ro,10622,p2p-next-07.grid.pub.ro,10622
+p2p-next-06.grid.pub.ro,10722,p2p-next-07.grid.pub.ro,10722
+p2p-next-06.grid.pub.ro,10822,p2p-next-07.grid.pub.ro,10822
+p2p-next-06.grid.pub.ro,10922,p2p-next-07.grid.pub.ro,10922
+p2p-next-06.grid.pub.ro,11022,p2p-next-07.grid.pub.ro,11022
+p2p-next-08.grid.pub.ro,10722,p2p-next-09.grid.pub.ro,10722
+p2p-next-08.grid.pub.ro,10822,p2p-next-09.grid.pub.ro,10822
+p2p-next-08.grid.pub.ro,10922,p2p-next-09.grid.pub.ro,10922
diff --git a/Utils/test-socket-signal/test/eurocon/remote_run_if b/Utils/test-socket-signal/test/eurocon/remote_run_if
new file mode 100755 (executable)
index 0000000..55523e3
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+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"
+
+# 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"
+
+# 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"
+
+# start leecher
+ssh -n -f -p $port2 -l p2p $host2 "/home/p2p/eurocon/local_client_leecher"
+
+# wait for it
+sleep 15
+
+# put leecher interface down
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_ifdown"
+
+# sleep as planned
+sleep $timeout
+
+# put interface up
+ssh -n -f -p $port2 -l root $host2 "/home/p2p/eurocon/local_ifup"
+
+sleep 45
+
+# 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
diff --git a/Utils/test-socket-signal/test/eurocon/remote_run_stop b/Utils/test-socket-signal/test/eurocon/remote_run_stop
new file mode 100755 (executable)
index 0000000..6eaf8fb
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+if test $# -ne 4; then
+       echo "Usage: $0 host1 port1 host2 port2" 1>&2
+       exit 1
+fi
diff --git a/Utils/test-socket-signal/test/eurocon/remote_run_suspend b/Utils/test-socket-signal/test/eurocon/remote_run_suspend
new file mode 100755 (executable)
index 0000000..6eaf8fb
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+if test $# -ne 4; then
+       echo "Usage: $0 host1 port1 host2 port2" 1>&2
+       exit 1
+fi