tor_multipath_voip/scripts/run-2
2019-05-21 16:38:53 +02:00

88 lines
2.6 KiB
Bash
Executable file

#!/bin/bash
WAITFOR=2280 # 38min
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..10}; do
echo "Spawning container $i..."
docker run \
--rm \
-d \
--name "donarxp_server_${i}" \
-e HOME='/tmp' \
-v `pwd`/out:/home/donar \
registry.gitlab.inria.fr/qdufour/donar \
tor -f /etc/torrc
docker run \
--rm \
-d \
--name "donarxp_client_${i}" \
-e HOME='/tmp' \
-v `pwd`/out:/home/donar \
registry.gitlab.inria.fr/qdufour/donar \
tor -f /etc/torrc
done
sleep 10
for j in {1..100}; do
echo "Run xp $j..."
run_fold=`mktemp -up . XXXXXXXXXXXXXXXX`
echo "Reset containers..."
for i in {1..10}; 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'
done
echo "Launch servers..."
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 &
docker exec donarxp_server_6 rrhr-server ${run_fold}-rrhr-6 &
docker exec donarxp_server_7 dup2-server ${run_fold}-dup2-7 &
docker exec donarxp_server_8 orig-server ${run_fold}-orig-8 &
docker exec donarxp_server_9 orig-server ${run_fold}-orig-9 &
docker exec donarxp_server_10 orig-server ${run_fold}-orig-10 &
sleep 10
echo "Launch measures..."
timeout $WAITFOR bash <<EOF
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 &
sleep 10
docker exec donarxp_client_3 dup2-client 6000 100 100 ${run_fold}-dup2-3 &
sleep 10
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 &
sleep 10
docker exec donarxp_client_8 orig-client 6000 100 100 ${run_fold}-orig-8 &
sleep 10
docker exec donarxp_client_9 orig-client 6000 100 100 ${run_fold}-orig-9 &
sleep 10
docker exec donarxp_client_10 orig-client 6000 100 100 ${run_fold}-orig-10 &
sleep 10
wait;
EOF
done
echo "Unspawn containers..."
for i in {1..10}; do
docker kill "donarxp_server_${i}"
docker kill "donarxp_client_${i}"
done