tor_multipath_voip/scripts/xp-instance-runner

49 lines
1,022 B
Text
Raw Normal View History

#!/bin/bash
# Create workdir
2019-03-28 16:42:02 +01:00
XP_NAME=$1
XP_FOLDER=`mktemp -d -p . ${XP_NAME}-XXXXXXXXXXXXXXXX`
2019-03-15 09:39:23 +01:00
XP_ID=`echo $XP_FOLDER|cut -c 3-`
cd $XP_FOLDER
2019-03-28 16:42:02 +01:00
COUNT=$2
INTERVAL=$3
SIZE=$4
2019-03-15 09:39:23 +01:00
ALLOWED_BOOTSTRAP=190
# Create folders
2019-03-06 18:32:19 +01:00
docker run \
--rm \
-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-04-01 16:11:47 +02:00
-d \
2019-03-15 09:39:23 +01:00
--name "$XP_ID-server" \
-v `pwd`/shared:/home/donar/shared \
-v `pwd`/log:/home/donar/log \
registry.gitlab.inria.fr/qdufour/donar \
2019-04-18 16:36:14 +02:00
${XP_NAME}-server
2019-03-15 09:39:23 +01:00
sleep 10
2019-04-18 16:36:14 +02:00
docker ps
# Run client
docker run \
--privileged \
--rm \
2019-03-15 09:39:23 +01:00
--name "$XP_ID-client" \
2019-04-18 14:34:38 +02:00
$( [[ "${XP_NAME}" == 'witness' ]] && echo "--net=container:$XP_ID-server" ) \
-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-04-18 16:36:14 +02:00
${XP_NAME}-client $COUNT $INTERVAL $SIZE
2019-03-06 18:32:19 +01:00
2019-03-15 09:39:23 +01:00
# Kill
2019-04-02 15:35:17 +02:00
#docker kill "$XP_ID-client" || true
2019-03-15 09:39:23 +01:00
docker kill "$XP_ID-server" || true