aboutsummaryrefslogtreecommitdiffstats
path: root/sua-test
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 /sua-test
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 'sua-test')
-rw-r--r--sua-test/Makefile2
-rwxr-xr-xsua-test/jenkins.sh43
-rw-r--r--sua-test/osmo-stp.cfg71
-rw-r--r--sua-test/sua-param-testtool-sgp.scm4
4 files changed, 98 insertions, 22 deletions
diff --git a/sua-test/Makefile b/sua-test/Makefile
index b7a6cb8..273a334 100644
--- a/sua-test/Makefile
+++ b/sua-test/Makefile
@@ -1,3 +1,3 @@
-RUN_ARGS?=--rm --network sigtran --ip 172.18.0.3
+RUN_ARGS?=--rm --network sigtran --ip 172.18.6.3
include ../make/Makefile
diff --git a/sua-test/jenkins.sh b/sua-test/jenkins.sh
index d87159f..11cb37a 100755
--- a/sua-test/jenkins.sh
+++ b/sua-test/jenkins.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+set -x
+
# non-jenkins execution: assume local user name
if [ "x$REPO_USER" = "x" ]; then
REPO_USER=$USER
@@ -10,35 +12,38 @@ if [ "x$WORKSPACE" = "x" ]; then
WORKSPACE=/tmp
fi
-LOGDIR=$WORKSPACE/logs
+NET_NAME="sua-tester"
+
+VOL_BASE_DIR=`mktemp -d`
+mkdir $VOL_BASE_DIR/sua-tester
+cp sua-param-testtool-sgp.scm some-sua-sgp-tests.txt $VOL_BASE_DIR/sua-tester/
+
+mkdir $VOL_BASE_DIR/stp
+cp osmo-stp.cfg $VOL_BASE_DIR/stp/
-rm -rf $LOGDIR || /bin/true
-mkdir -p $LOGDIR
+echo Creating network $NET_NAME
+docker network create --internal --subnet 172.18.6.0/24 $NET_NAME
+
+rm -rf $WORKSPACE/logs || /bin/true
+mkdir -p $WORKSPACE/logs
# start container with STP in background
-docker volume rm stp-vol || /bin/true
docker run --rm \
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
- --network sigtran --ip 172.18.0.200 \
- -v stp-vol:/data \
+ --network $NET_NAME --ip 172.18.6.200 \
+ -v $VOL_BASE_DIR/stp:/data \
--name stp \
-d $REPO_USER/osmo-stp-master
# start docker container with tests
-docker volume rm sua-test-vol || /bin/true
docker run --rm \
- --network sigtran --ip 172.18.0.3 \
- -v sua-test-vol:/data \
- $REPO_USER/sua-test > $LOGDIR/junit-xml-sua.log
+ --network $NET_NAME --ip 172.18.6.3 \
+ -v $VOL_BASE_DIR/sua-tester:/data \
+ $REPO_USER/sua-test > $WORKSPACE/logs/junit-xml-sua.log
docker container stop -t 1 stp
-# start some stupid helper container so we can access the volume
-docker run --rm \
- -v sua-test-vol:/sua-test \
- -v stp-vol:/stp \
- --name helper \
- -d busybox /bin/sh -c 'sleep 1000 & wait'
-docker cp helper:/sua-test $LOGDIR
-docker cp helper:/stp $LOGDIR
-docker container stop -t 0 helper
+echo Removing network $NET_NAME
+docker network remove $NET_NAME
+
+cp -a $VOL_BASE_DIR/* $WORKSPACE/logs/
diff --git a/sua-test/osmo-stp.cfg b/sua-test/osmo-stp.cfg
new file mode 100644
index 0000000..23a3eb1
--- /dev/null
+++ b/sua-test/osmo-stp.cfg
@@ -0,0 +1,71 @@
+!
+! osmo-stp (0.0.6.3.179-b248) configuration saved from vty
+!!
+!
+log stderr
+ logging filter all 1
+ logging color 1
+ logging print category 1
+ logging timestamp 0
+ logging level all everything
+ logging level lglobal notice
+ logging level llapd notice
+ logging level linp debug
+ logging level lmux notice
+ logging level lmi notice
+ logging level lmib notice
+ logging level lsms notice
+ logging level lctrl notice
+ logging level lgtp notice
+ logging level lstats notice
+ logging level lgsup notice
+ logging level loap notice
+ logging level lss7 debug
+ logging level lsccp debug
+ logging level lsua debug
+ logging level lm3ua debug
+log file /data/osmo-stp.log
+ logging filter all 1
+ logging color 0
+ logging print category 1
+ logging timestamp 1
+ logging level all everything
+ logging level lglobal notice
+ logging level llapd notice
+ logging level linp debug
+ logging level lmux notice
+ logging level lmi notice
+ logging level lmib notice
+ logging level lsms notice
+ logging level lctrl notice
+ logging level lgtp notice
+ logging level lstats notice
+ logging level lgsup notice
+ logging level loap notice
+ logging level lss7 debug
+ logging level lsccp debug
+ logging level lsua debug
+ logging level lm3ua debug
+!
+line vty
+ no login
+ bind 0.0.0.0
+!
+cs7 instance 0
+ asp asp0 0 2905 m3ua
+ remote-ip 172.18.6.2
+ asp asp-s-0 0 14001 sua
+ remote-ip 172.18.6.3
+ as as0 m3ua
+ asp asp0
+ routing-key 23 0.2.7
+ as as-s-0 sua
+ asp asp-s-0
+ routing-key 24 0.3.0
+ route-table system
+ update route 0.2.7 0.2.7 linkset as0
+ update route 0.3.0 0.3.0 linkset as-s-0
+ listen m3ua 2905
+ local-ip 172.18.6.200
+ listen sua 14001
+ local-ip 172.18.6.200
diff --git a/sua-test/sua-param-testtool-sgp.scm b/sua-test/sua-param-testtool-sgp.scm
index 486b098..87a3428 100644
--- a/sua-test/sua-param-testtool-sgp.scm
+++ b/sua-test/sua-param-testtool-sgp.scm
@@ -26,13 +26,13 @@
;;; $Id: sua-param-testtool-sgp.scm,v 1.2 2011/03/21 22:18:29 tuexen Exp $
;;; Define a transport address of the system under test
-(define sut-addr "172.18.0.200")
+(define sut-addr "172.18.6.200")
(define sut-port sua-port)
(define sut-port-1 sua-port)
(define sut-port-2 (1+ sua-port))
;;; Define the transport address of the tester
-(define tester-addr "172.18.0.3")
+(define tester-addr "172.18.6.3")
(define tester-port 0)
(define tester-port-1 3000)