tor_multipath_voip/scripts/run-2
2019-05-15 15:53:09 +02:00

79 lines
2.2 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..7}; 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
docker ps
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..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'
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_4 rrhr-server ${run_fold}-rrhr-6 &
docker exec donarxp_server_5 dup2-server ${run_fold}-dup2-7 &
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 &
wait;
EOF
done
echo "Unspawn containers..."
for i in {1..7}; do
docker kill "donarxp_server_${i}"
docker kill "donarxp_client_${i}"
done