tor_multipath_voip/scripts/run-2

80 lines
2.2 KiB
Text
Raw Normal View History

2019-05-15 09:24:13 +00:00
#!/bin/bash
WAITFOR=2280 # 38min
2019-05-15 13:53:09 +00:00
echo "Create output folder..."
docker run \
--rm \
--user root \
-v `pwd`/out:/home/donar \
registry.gitlab.inria.fr/qdufour/donar \
chown -R 1000:1000 /home/donar
for i in {1..7}; do
echo "Spawning container $i..."
2019-05-15 09:24:13 +00:00
docker run \
--rm \
-d \
2019-05-15 13:53:09 +00:00
--name "donarxp_server_${i}" \
-e HOME='/tmp' \
-v `pwd`/out:/home/donar \
2019-05-15 09:24:13 +00:00
registry.gitlab.inria.fr/qdufour/donar \
tor -f /etc/torrc
docker run \
--rm \
-d \
2019-05-15 13:53:09 +00:00
--name "donarxp_client_${i}" \
-e HOME='/tmp' \
-v `pwd`/out:/home/donar \
2019-05-15 09:24:13 +00:00
registry.gitlab.inria.fr/qdufour/donar \
tor -f /etc/torrc
2019-05-15 13:53:09 +00:00
docker ps
2019-05-15 09:24:13 +00:00
done
sleep 10
2019-05-15 13:53:09 +00:00
for j in {1..100}; do
echo "Run xp $j..."
2019-05-15 09:24:13 +00:00
run_fold=`mktemp -up . XXXXXXXXXXXXXXXX`
2019-05-15 13:53:09 +00:00
echo "Reset containers..."
for i in {1..7}; do
docker exec donarxp_client_${i} sh -c 'killall -9 bash; killall -9 donar; killall -9 measlat; killall -9 udpecho'
docker exec donarxp_server_${i} sh -c 'killall -9 bash; killall -9 donar; killall -9 measlat; killall -9 udpecho'
2019-05-15 09:24:13 +00:00
done
echo "Launch servers..."
2019-05-15 13:53:09 +00:00
docker exec donarxp_server_2 rrhr-server ${run_fold}-rrhr-2 &
docker exec donarxp_server_3 dup2-server ${run_fold}-dup2-3 &
docker exec donarxp_server_4 rrhr-server ${run_fold}-rrhr-4 &
docker exec donarxp_server_5 dup2-server ${run_fold}-dup2-5 &
2019-05-15 14:01:20 +00:00
docker exec donarxp_server_6 rrhr-server ${run_fold}-rrhr-6 &
docker exec donarxp_server_7 dup2-server ${run_fold}-dup2-7 &
2019-05-15 09:24:13 +00:00
sleep 10
echo "Launch measures..."
timeout $WAITFOR bash <<EOF
2019-05-15 13:53:09 +00:00
docker exec donarxp_client_1 witness2-client 6000 100 100 ${run_fold}-witness2-1 &
sleep 10
docker exec donarxp_client_2 rrhr-client 6000 100 100 ${run_fold}-rrhr-2 &
2019-05-15 09:24:13 +00:00
sleep 10
2019-05-15 13:53:09 +00:00
docker exec donarxp_client_3 dup2-client 6000 100 100 ${run_fold}-dup2-3 &
2019-05-15 09:24:13 +00:00
sleep 10
2019-05-15 13:53:09 +00:00
docker exec donarxp_client_4 rrhr-client 6000 100 100 ${run_fold}-rrhr-4 &
sleep 10
docker exec donarxp_client_5 dup2-client 6000 100 100 ${run_fold}-dup2-5 &
sleep 10
docker exec donarxp_client_6 rrhr-client 6000 100 100 ${run_fold}-rrhr-6 &
sleep 10
docker exec donarxp_client_7 dup2-client 6000 100 100 ${run_fold}-dup2-7 &
2019-05-15 09:24:13 +00:00
wait;
EOF
done
2019-05-15 13:53:09 +00:00
echo "Unspawn containers..."
for i in {1..7}; do
docker kill "donarxp_server_${i}"
docker kill "donarxp_client_${i}"
done