tor_multipath_voip/scripts/run-2

49 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
WAITFOR=2280 # 38min
echo "Spawn containers..."
for i in {1..10}; do
docker run \
--rm \
-d \
--name "donarxp-server-${i}" \
-v `pwd`/shared:/home/donar/shared \
registry.gitlab.inria.fr/qdufour/donar \
tor -f /etc/torrc
docker run \
--rm \
-d \
--name "donarxp-client-${i}" \
-v `pwd`/shared:/home/donar/shared \
registry.gitlab.inria.fr/qdufour/donar \
tor -f /etc/torrc
done
sleep 10
echo "Run xp..."
for i in j {1..100}; do
run_fold=`mktemp -up . XXXXXXXXXXXXXXXX`
echo "Reset containers... As tor has PID 1, it is not affected by kill -9"
for i in {1..10}; do
docker exec donarxp-client-${i} bash -c 'ls /proc|grep -Po "^\d+$"|while read p; do kill -9 $p; done'
docker exec donarxp-server-${i} bash -c 'ls /proc|grep -Po "^\d+$"|while read p; do kill -9 $p; done'
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 &
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}-rhhr-2 &
sleep 10
docker exec donarxp-client-3 dup2-client 6000 100 100 ${run_fold}-dup2-3 &
wait;
EOF
done