tor_multipath_voip/scripts/xp1

50 lines
1 KiB
Text
Raw Normal View History

#!/bin/bash
# Create workdir
XP_FOLDER=`mktemp -d -p . xp1-XXXXXXXXXXXXXXXX`
2019-03-15 08:39:23 +00:00
XP_ID=`echo $XP_FOLDER|cut -c 3-`
cd $XP_FOLDER
2019-03-15 08:39:23 +00:00
COUNT=$1
INTERVAL=$2
SIZE=$3
ALLOWED_BOOTSTRAP=190
ALLOWED_TIME=`expr $(expr ${COUNT} * ${INTERVAL}) / 1000 + ${ALLOWED_BOOTSTRAP}`
echo "Will run for ${ALLOWED_TIME} (count=$1, interval=$2)"
# Create folders
2019-03-06 17:32:19 +00:00
docker run \
--rm \
-ti \
-v `pwd`:/mnt \
ubuntu \
bash -c "cd /mnt; mkdir -p ./{shared,log,res}; chown -R 1000 ./{shared,log,res}"
# Run server
docker run \
--privileged \
--rm \
2019-03-15 08:39:23 +00:00
--name "$XP_ID-server" \
-v `pwd`/shared:/home/donar/shared \
-v `pwd`/log:/home/donar/log \
registry.gitlab.inria.fr/qdufour/donar \
xp1-server &
2019-03-15 08:39:23 +00:00
sleep 10
# Run client
docker run \
--privileged \
--rm \
2019-03-15 08:39:23 +00:00
--name "$XP_ID-client" \
-v `pwd`/res:/home/donar/res \
-v `pwd`/shared:/home/donar/shared \
-v `pwd`/log:/home/donar/log \
registry.gitlab.inria.fr/qdufour/donar \
2019-03-15 08:39:23 +00:00
xp1-client $COUNT $INTERVAL $SIZE &
2019-03-15 08:39:23 +00:00
sleep $ALLOWED_TIME
2019-03-06 17:32:19 +00:00
2019-03-15 08:39:23 +00:00
# Kill
docker kill "$XP_ID-client" || true
docker kill "$XP_ID-server" || true