aboutsummaryrefslogtreecommitdiffstats
path: root/ttcn3-bsc-test/jenkins.sh
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-06 17:41:33 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-06 19:08:45 +0100
commitfacbb6575e31b0249590ffc6a4b3090daee9963a (patch)
treea1b40a05a8d9d6898678848371f641e4c1c1f91f /ttcn3-bsc-test/jenkins.sh
parentafe1ec8dc1e99c2dfca76b52eceba5f188eea71e (diff)
move every 'test network' to its own IP address space
Ideally we would want to launch a group of containers with their own private network segment and use the same static IP addresses in those isolated networks. The stupidity of docker is requiring unique IPv4 addresses even on isolated (!) networks. This means we have to manually give each of our test setups a different subnet, and then we can at least run one instance that test in parallel to at most one instance of each other test. If this weird reestriction about unique IPv4 addresses didn't exist, we could start any number of test runs in parallel.
Diffstat (limited to 'ttcn3-bsc-test/jenkins.sh')
-rwxr-xr-xttcn3-bsc-test/jenkins.sh19
1 files changed, 14 insertions, 5 deletions
diff --git a/ttcn3-bsc-test/jenkins.sh b/ttcn3-bsc-test/jenkins.sh
index 03be9fe..4c9cc4a 100755
--- a/ttcn3-bsc-test/jenkins.sh
+++ b/ttcn3-bsc-test/jenkins.sh
@@ -10,6 +10,8 @@ if [ "x$WORKSPACE" = "x" ]; then
WORKSPACE=/tmp
fi
+NET_NAME="bsc-tester"
+
VOL_BASE_DIR=`mktemp -d`
mkdir $VOL_BASE_DIR/bsc-tester
cp BSC_Tests.cfg $VOL_BASE_DIR/bsc-tester/
@@ -20,16 +22,19 @@ cp osmo-stp.cfg $VOL_BASE_DIR/stp/
mkdir $VOL_BASE_DIR/bsc
cp osmo-bsc.cfg $VOL_BASE_DIR/bsc/
+echo Creating network $NET_NAME
+docker network create --internal --subnet 172.18.2.0/24 $NET_NAME
+
echo Starting container with STP
docker run --rm \
- --network sigtran --ip 172.18.0.200 \
+ --network $NET_NAME --ip 172.18.2.200 \
-v $VOL_BASE_DIR/stp:/data \
--name stp -d \
$REPO_USER/osmo-stp-master
echo Starting container with BSC
docker run --rm \
- --network sigtran --ip 172.18.0.20 \
+ --network $NET_NAME --ip 172.18.2.20 \
-v $VOL_BASE_DIR/bsc:/data \
--name bsc -d \
$REPO_USER/osmo-bsc-master
@@ -37,14 +42,14 @@ docker run --rm \
for i in `seq 0 2`; do
echo Starting container with OML for BTS$i
docker run --rm \
- --network sigtran --ip 172.18.0.10$i \
+ --network $NET_NAME --ip 172.18.2.10$i \
--name bts$i -d \
- $REPO_USER/osmo-bts-omldummy ./respawn.sh 172.18.0.20 $((i + 1234))
+ $REPO_USER/osmo-bts-omldummy ./respawn.sh 172.18.2.20 $((i + 1234))
done
echo Starting container with BSC testsuite
docker run --rm \
- --network sigtran --ip 172.18.0.203 \
+ --network $NET_NAME --ip 172.18.2.203 \
-v $VOL_BASE_DIR/bsc-tester:/data \
--name ttcn3-bsc-test \
$REPO_USER/ttcn3-bsc-test
@@ -56,6 +61,10 @@ done
docker container kill bsc
docker container kill stp
+echo Removing network $NET_NAME
+docker network remove $NET_NAME
+
+
rm -rf $WORKSPACE/logs
mkdir -p $WORKSPACE/logs
cp -a $VOL_BASE_DIR/* $WORKSPACE/logs/