aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-03-01 16:05:14 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2021-04-16 13:38:24 +0000
commitd99e94e81d0c94ef4972280c92bcdeac7f970ef3 (patch)
tree01b8b142708069e7e02db59aea012599a1ac5ee7
parent161bd86992465a7d23ee14becc166a6b0b58dc04 (diff)
ttcn3 tests: make it convenient to invoke custom tests manually
In various ttcn3-*-test jenkins.sh / Dockerfile: - add -h (hack) option to jenkins.sh If calling jenkins.sh with the -h option, bind external osmo-ttcn3-hacks sources into the docker containers and start a shell instead of the tests: jenkins.sh -h ~/src/osmo-ttcn3-hacks [bind/this/path/to/src] An optional second argument is a path bound to /src in the docker image. - move Dockerfile RUN commands to Makefile within docker img Add a Makefile to the image's root, move the RUN command there and call that 'make' from the Dockerfile RUN command; allows easy manual invocation. Change-Id: Id7d47f665828557838f541b4467b713a8605389b
-rwxr-xr-xcommon/respawn.sh2
-rw-r--r--jenkins-common.sh2
-rw-r--r--osmo-bsc-master/Dockerfile5
-rw-r--r--osmo-bsc-master/Makefile.within-docker-img7
-rw-r--r--osmo-bts-master/Dockerfile6
-rw-r--r--osmo-bts-master/Makefile.within-docker-img10
-rw-r--r--osmo-msc-master/Dockerfile5
-rw-r--r--osmo-msc-master/Makefile.within-docker-img10
-rw-r--r--osmo-sgsn-master/Dockerfile5
-rw-r--r--osmo-sgsn-master/Makefile.within-docker-img20
-rw-r--r--ttcn3-bsc-test/Dockerfile3
-rw-r--r--ttcn3-bsc-test/Makefile.within-docker-img14
-rwxr-xr-xttcn3-bsc-test/jenkins-sccplite.sh29
-rwxr-xr-xttcn3-bsc-test/jenkins.sh29
-rw-r--r--ttcn3-bts-test/Dockerfile4
-rw-r--r--ttcn3-bts-test/Makefile.within-docker-img18
-rwxr-xr-xttcn3-bts-test/jenkins.sh38
-rw-r--r--ttcn3-hlr-test/Dockerfile4
-rw-r--r--ttcn3-hlr-test/Makefile.within-docker-img13
-rwxr-xr-xttcn3-hlr-test/jenkins.sh29
-rw-r--r--ttcn3-hlr-test/osmo-hlr.cfg4
-rw-r--r--ttcn3-mgw-test/Dockerfile3
-rw-r--r--ttcn3-mgw-test/Makefile.within-docker-img14
-rwxr-xr-xttcn3-mgw-test/jenkins.sh29
-rw-r--r--ttcn3-msc-test/Dockerfile4
-rw-r--r--ttcn3-msc-test/Makefile.within-docker-img13
-rwxr-xr-xttcn3-msc-test/jenkins.sh29
-rw-r--r--ttcn3-sgsn-test/Dockerfile3
-rw-r--r--ttcn3-sgsn-test/Makefile.within-docker-img18
-rwxr-xr-xttcn3-sgsn-test/jenkins.sh44
-rw-r--r--ttcn3-sgsn-test/osmo-sgsn.cfg5
-rwxr-xr-xttcn3-sip-test/jenkins.sh29
32 files changed, 413 insertions, 35 deletions
diff --git a/common/respawn.sh b/common/respawn.sh
index 31a8c06..fcaaaaf 100755
--- a/common/respawn.sh
+++ b/common/respawn.sh
@@ -6,7 +6,7 @@ SLEEP_BEFORE_RESPAWN=${SLEEP_BEFORE_RESPAWN:-0}
i=0
max_i=500
-while [ $i -lt $max_i ]; do
+while [ -e /etc/passwd ]; do
echo "$i: starting: $*"
$* &
LAST_PID=$!
diff --git a/jenkins-common.sh b/jenkins-common.sh
index 89048f7..1d3e0a3 100644
--- a/jenkins-common.sh
+++ b/jenkins-common.sh
@@ -352,3 +352,5 @@ fi
SUITE_NAME=`basename $PWD`
NET_NAME=$SUITE_NAME
+
+export OSMO_TTCN3_COMPARE_ARGS="--allow-xpass"
diff --git a/osmo-bsc-master/Dockerfile b/osmo-bsc-master/Dockerfile
index 32ded30..354d698 100644
--- a/osmo-bsc-master/Dockerfile
+++ b/osmo-bsc-master/Dockerfile
@@ -50,8 +50,9 @@ RUN cd osmo-bsc && \
VOLUME /data
COPY osmo-bsc.cfg /data/osmo-bsc.cfg
+COPY Makefile.within-docker-img /Makefile
-WORKDIR /data
-CMD ["/bin/sh", "-c", "/usr/local/bin/osmo-bsc -c /data/osmo-bsc.cfg >/data/osmo-bsc.log 2>&1"]
+WORKDIR /
+CMD ["make", "run"]
#EXPOSE
diff --git a/osmo-bsc-master/Makefile.within-docker-img b/osmo-bsc-master/Makefile.within-docker-img
new file mode 100644
index 0000000..4f42dd6
--- /dev/null
+++ b/osmo-bsc-master/Makefile.within-docker-img
@@ -0,0 +1,7 @@
+.PHONY: run dbg
+
+run:
+ cd /data && LD_LIBRARY_PATH=/usr/local/lib /bin/sh -c /usr/local/bin/osmo-bsc -c /data/osmo-bsc.cfg >/data/osmo-bsc.log 2>&1
+
+dbg:
+ cd /data && LD_LIBRARY_PATH=/usr/local/lib gdb --args /usr/local/bin/osmo-bsc -c osmo-bsc.cfg
diff --git a/osmo-bts-master/Dockerfile b/osmo-bts-master/Dockerfile
index 77c1e51..f98c6d7 100644
--- a/osmo-bts-master/Dockerfile
+++ b/osmo-bts-master/Dockerfile
@@ -48,9 +48,9 @@ RUN cd osmo-bts && \
VOLUME /data
COPY osmo-bts.cfg /data/osmo-bts.cfg
+COPY Makefile.within-docker-img /Makefile
-WORKDIR /data
- # send GSMTAP data to .230 which is the ttcn3-sysinfo test
-CMD ["/bin/sh", "-c", "/usr/local/bin/osmo-bts-virtual -c /data/osmo-bts.cfg -i 172.18.0.230 >>/data/osmo-bts-virtual.log 2>&1"]
+WORKDIR /
+CMD make run
#EXPOSE
diff --git a/osmo-bts-master/Makefile.within-docker-img b/osmo-bts-master/Makefile.within-docker-img
new file mode 100644
index 0000000..8357c03
--- /dev/null
+++ b/osmo-bts-master/Makefile.within-docker-img
@@ -0,0 +1,10 @@
+.PHONY: run run_ttcn3_bts_test
+
+# the Dockerfile invokes 'run' directly, the manual invocation is usually from the ttcn3-bts-test
+default: run_ttcn3_bts_test
+
+run:
+ cd /data && LD_LIBRARY_PATH=/usr/local/lib /bin/sh -c /usr/local/bin/osmo-bts-virtual -c /data/osmo-bts.cfg -i 172.18.0.230 >>/data/osmo-bts-virtual.log 2>&1
+
+run_ttcn3_bts_test:
+ cd /data && LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/respawn.sh /usr/local/bin/osmo-bts-trx -c /data/osmo-bts.cfg -i 172.18.9.10
diff --git a/osmo-msc-master/Dockerfile b/osmo-msc-master/Dockerfile
index 7687bd3..1f6c194 100644
--- a/osmo-msc-master/Dockerfile
+++ b/osmo-msc-master/Dockerfile
@@ -61,8 +61,9 @@ RUN apt-get install -y --no-install-recommends \
VOLUME /data
COPY osmo-msc.cfg /data/osmo-msc.cfg
+COPY Makefile.within-docker-img /Makefile
-WORKDIR /data
-CMD ["/bin/sh", "-c", "/usr/local/bin/osmo-msc -c /data/osmo-msc.cfg >/data/osmo-msc.log 2>&1"]
+WORKDIR /
+CMD ["make", "run"]
#EXPOSE
diff --git a/osmo-msc-master/Makefile.within-docker-img b/osmo-msc-master/Makefile.within-docker-img
new file mode 100644
index 0000000..0f9986f
--- /dev/null
+++ b/osmo-msc-master/Makefile.within-docker-img
@@ -0,0 +1,10 @@
+.PHONY: run dbg
+
+run:
+ cd /data && LD_LIBRARY_PATH=/usr/local/lib /bin/sh -c /usr/local/bin/osmo-msc -c /data/osmo-msc.cfg >/data/osmo-msc.log 2>&1
+
+manual:
+ cd /data && LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/osmo-msc
+
+dbg:
+ cd /data && LD_LIBRARY_PATH=/usr/local/lib gdb --args /usr/local/bin/osmo-msc
diff --git a/osmo-sgsn-master/Dockerfile b/osmo-sgsn-master/Dockerfile
index 55d9695..44264d6 100644
--- a/osmo-sgsn-master/Dockerfile
+++ b/osmo-sgsn-master/Dockerfile
@@ -57,8 +57,9 @@ RUN cd osmo-sgsn && \
VOLUME /data
COPY osmo-sgsn.cfg /data/osmo-sgsn.cfg
+COPY Makefile.within-docker-img /Makefile
-WORKDIR /data
-CMD ["/bin/sh", "-c", "/usr/local/bin/osmo-sgsn -c /data/osmo-sgsn.cfg >/data/osmo-sgsn.log 2>&1"]
+WORKDIR /
+CMD ["make", "run"]
EXPOSE 23000/udp 4245/tcp 4249/tcp 4246/tcp 4263/tcp
diff --git a/osmo-sgsn-master/Makefile.within-docker-img b/osmo-sgsn-master/Makefile.within-docker-img
new file mode 100644
index 0000000..2bcf46b
--- /dev/null
+++ b/osmo-sgsn-master/Makefile.within-docker-img
@@ -0,0 +1,20 @@
+.PHONY: compile run log
+
+all: compile run
+
+# construct the /build dir to build outside the mounted-in osmo-bsc source tree
+build:
+ cd /osmo-sgsn && ( test -f configure || autoreconf -fi )
+ mkdir -p /build
+ cd /build && /osmo-sgsn/configure
+
+# The compile target assumes an osmo-sgsn src tree mounted into /osmo-sgsn
+# using something like docker -v ~/src/osmo-sgsn:/osmo-sgsn
+compile: build
+ $(MAKE) -C /build -j install
+
+run:
+ cd /data && /bin/sh -c /usr/local/bin/osmo-sgsn -c /data/osmo-sgsn.cfg >/data/osmo-sgsn.log 2>&1
+
+log:
+
diff --git a/ttcn3-bsc-test/Dockerfile b/ttcn3-bsc-test/Dockerfile
index 1923c38..382338c 100644
--- a/ttcn3-bsc-test/Dockerfile
+++ b/ttcn3-bsc-test/Dockerfile
@@ -9,5 +9,6 @@ RUN ttcn3-docker-prepare "$OSMO_TTCN3_BRANCH" bsc
VOLUME /data
COPY BSC_Tests.cfg /data/BSC_Tests.cfg
+COPY Makefile.within-docker-img /Makefile
-CMD ttcn3-docker-run bsc BSC_Tests
+CMD cd / && make test
diff --git a/ttcn3-bsc-test/Makefile.within-docker-img b/ttcn3-bsc-test/Makefile.within-docker-img
new file mode 100644
index 0000000..2f19866
--- /dev/null
+++ b/ttcn3-bsc-test/Makefile.within-docker-img
@@ -0,0 +1,14 @@
+.PHONY: compile test log
+
+default: compile test
+
+compile:
+ $(MAKE) -C /osmo-ttcn3-hacks bsc/compile
+ $(MAKE) -C /osmo-ttcn3-hacks bsc -j
+
+test:
+ cd /data && \
+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bsc/BSC_Tests; \
+ exit_code=$$?; \
+ /osmo-ttcn3-hacks/log_merge.sh BSC_Tests --rm; \
+ exit $$exit_code
diff --git a/ttcn3-bsc-test/jenkins-sccplite.sh b/ttcn3-bsc-test/jenkins-sccplite.sh
index bc6eaa0..16e3e1f 100755
--- a/ttcn3-bsc-test/jenkins-sccplite.sh
+++ b/ttcn3-bsc-test/jenkins-sccplite.sh
@@ -13,6 +13,25 @@ set -e
#Make sure NET_NAME doesn't clash with the AoIP BSC test
NET_NAME=ttcn3-bsc_sccplite-test
+ADD_TTCN_RUN_OPTS=""
+ADD_TTCN_RUN_CMD=""
+ADD_TTCN_VOLUMES=""
+ADD_BSC_VOLUMES=""
+ADD_BSC_ARGS=""
+
+if [ "x$1" = "x-h" ]; then
+ ADD_TTCN_RUN_OPTS="-ti"
+ ADD_TTCN_RUN_CMD="bash"
+ if [ -d "$2" ]; then
+ ADD_TTCN_VOLUMES="$ADD_TTCN_VOLUMES -v $2:/osmo-ttcn3-hacks"
+ fi
+ if [ -d "$3" ]; then
+ ADD_BSC_RUN_CMD="sleep 100000"
+ ADD_BSC_VOLUMES="$ADD_BSC_VOLUMES -v $3:/src"
+ ADD_BSC_RUN_OPTS="--privileged"
+ fi
+fi
+
mkdir $VOL_BASE_DIR/bsc-tester
cp sccplite/BSC_Tests.cfg $VOL_BASE_DIR/bsc-tester/
@@ -27,9 +46,12 @@ docker run --rm \
$(docker_network_params $SUBNET 20) \
--ulimit core=-1 \
-v $VOL_BASE_DIR/bsc:/data \
+ $ADD_BSC_VOLUMES \
--name ${BUILD_TAG}-bsc -d \
$DOCKER_ARGS \
- $REPO_USER/osmo-bsc-$IMAGE_SUFFIX
+ $ADD_BSC_RUN_OPTS \
+ $REPO_USER/osmo-bsc-$IMAGE_SUFFIX \
+ $ADD_BSC_RUN_CMD
for i in `seq 0 2`; do
echo Starting container with OML for BTS$i
@@ -48,6 +70,9 @@ docker run --rm \
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/bsc-tester:/data \
+ $ADD_TTCN_VOLUMES \
--name ${BUILD_TAG}-ttcn3-bsc-test \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-bsc-test
+ $ADD_TTCN_RUN_OPTS \
+ $REPO_USER/ttcn3-bsc-test \
+ $ADD_TTCN_RUN_CMD
diff --git a/ttcn3-bsc-test/jenkins.sh b/ttcn3-bsc-test/jenkins.sh
index 18236a2..2820d9d 100755
--- a/ttcn3-bsc-test/jenkins.sh
+++ b/ttcn3-bsc-test/jenkins.sh
@@ -11,6 +11,25 @@ docker_images_require \
set_clean_up_trap
set -e
+ADD_TTCN_RUN_OPTS=""
+ADD_TTCN_RUN_CMD=""
+ADD_TTCN_VOLUMES=""
+ADD_BSC_VOLUMES=""
+ADD_BSC_ARGS=""
+
+if [ "x$1" = "x-h" ]; then
+ ADD_TTCN_RUN_OPTS="-ti"
+ ADD_TTCN_RUN_CMD="bash"
+ if [ -d "$2" ]; then
+ ADD_TTCN_VOLUMES="$ADD_TTCN_VOLUMES -v $2:/osmo-ttcn3-hacks"
+ fi
+ if [ -d "$3" ]; then
+ ADD_BSC_RUN_CMD="sleep 9999999"
+ ADD_BSC_VOLUMES="$ADD_BSC_VOLUMES -v $3:/src"
+ ADD_BSC_RUN_OPTS="--privileged"
+ fi
+fi
+
mkdir $VOL_BASE_DIR/bsc-tester
cp BSC_Tests.cfg $VOL_BASE_DIR/bsc-tester/
@@ -40,9 +59,12 @@ docker run --rm \
$(docker_network_params $SUBNET 20) \
--ulimit core=-1 \
-v $VOL_BASE_DIR/bsc:/data \
+ $ADD_BSC_VOLUMES \
--name ${BUILD_TAG}-bsc -d \
$DOCKER_ARGS \
- $REPO_USER/osmo-bsc-$IMAGE_SUFFIX
+ $ADD_BSC_RUN_OPTS \
+ $REPO_USER/osmo-bsc-$IMAGE_SUFFIX \
+ $ADD_BSC_RUN_CMD
for i in `seq 0 2`; do
echo Starting container with OML for BTS$i
@@ -62,6 +84,9 @@ docker run --rm \
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/bsc-tester:/data \
+ $ADD_TTCN_VOLUMES \
--name ${BUILD_TAG}-ttcn3-bsc-test \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-bsc-test
+ $ADD_TTCN_RUN_OPTS \
+ $REPO_USER/ttcn3-bsc-test \
+ $ADD_TTCN_RUN_CMD
diff --git a/ttcn3-bts-test/Dockerfile b/ttcn3-bts-test/Dockerfile
index 8ac7cb8..2d1389b 100644
--- a/ttcn3-bts-test/Dockerfile
+++ b/ttcn3-bts-test/Dockerfile
@@ -9,5 +9,7 @@ RUN ttcn3-docker-prepare "$OSMO_TTCN3_BRANCH" bts
VOLUME /data
COPY BTS_Tests.cfg /data/BTS_Tests.cfg
+COPY Makefile.within-docker-img /Makefile
-CMD ttcn3-docker-run bts BTS_Tests
+WORKDIR /
+CMD make test
diff --git a/ttcn3-bts-test/Makefile.within-docker-img b/ttcn3-bts-test/Makefile.within-docker-img
new file mode 100644
index 0000000..d3e43b7
--- /dev/null
+++ b/ttcn3-bts-test/Makefile.within-docker-img
@@ -0,0 +1,18 @@
+.PHONY: compile test log
+
+default: compile
+ $(MAKE) test; $(MAKE) log
+
+compile:
+ $(MAKE) -C /osmo-ttcn3-hacks bts/compile
+ $(MAKE) -C /osmo-ttcn3-hacks bts -j
+
+test:
+ cd /data && \
+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bts/BTS_Tests; \
+ exit_code=$$?; \
+ /osmo-ttcn3-hacks/log_merge.sh BTS_Tests --rm; \
+ exit $$exit_code
+
+log:
+ cd /data; /osmo-ttcn3-hacks/log_merge.sh BTS_Tests --rm
diff --git a/ttcn3-bts-test/jenkins.sh b/ttcn3-bts-test/jenkins.sh
index 67c6d07..74f2cd4 100755
--- a/ttcn3-bts-test/jenkins.sh
+++ b/ttcn3-bts-test/jenkins.sh
@@ -21,6 +21,26 @@ clean_up() {
$VOL_BASE_DIR/bts-tester-hopping/junit-xml-hopping-*.log
}
+ADD_TTCN_RUN_OPTS=""
+ADD_TTCN_RUN_CMD=""
+ADD_TTCN_VOLUMES=""
+BTS_JUST_IDLE=""
+ADD_BTS_VOLUMES=""
+ADD_BTS_RUN_OPTS=""
+
+if [ "x$1" = "x-h" ]; then
+ ADD_TTCN_RUN_OPTS="-ti"
+ ADD_TTCN_RUN_CMD="bash"
+ if [ -d "$2" ]; then
+ ADD_TTCN_VOLUMES="$ADD_TTCN_VOLUMES -v $2:/osmo-ttcn3-hacks"
+ fi
+ if [ -d "$3" ]; then
+ BTS_JUST_IDLE="1"
+ ADD_BTS_VOLUMES="$ADD_BTS_VOLUMES -v $3:/src"
+ ADD_BTS_RUN_OPTS="--privileged"
+ fi
+fi
+
start_bsc() {
echo Starting container with BSC
docker run --rm \
@@ -42,16 +62,26 @@ start_bts() {
echo ERROR: You have to specify a BTS variant
exit 23
fi
+ if [ "$BTS_JUST_IDLE" = 1 ]; then
+ # for running tests manually:
+ # practically idle forever, but for sanity not really forever
+ BTS_RUN_CMD="sleep 9999999"
+ else
+ # normal command to run unattended tests
+ BTS_RUN_CMD="/bin/sh -c \"/usr/local/bin/respawn.sh osmo-bts-$variant -c /data/osmo-bts.cfg >>/data/osmo-bts.log 2>&1\""
+ fi
docker run --rm \
$(docker_network_params $SUBNET 20) \
--ulimit core=-1 \
-v $VOL_BASE_DIR/bts:/data \
-v $VOL_BASE_DIR/unix:/data/unix \
+ $ADD_BTS_VOLUMES \
-e "SLEEP_BEFORE_RESPAWN=$sleep_time_respawn" \
--name ${BUILD_TAG}-bts -d \
$DOCKER_ARGS \
+ $ADD_BTS_RUN_OPTS \
$REPO_USER/osmo-bts-$IMAGE_SUFFIX \
- /bin/sh -c "/usr/local/bin/respawn.sh osmo-bts-$variant -c /data/osmo-bts.cfg >>/data/osmo-bts.log 2>&1"
+ $BTS_RUN_CMD
}
start_fake_trx() {
@@ -97,6 +127,7 @@ start_virtphy() {
--name ${BUILD_TAG}-virtphy -d \
$DOCKER_ARGS \
$REPO_USER/osmocom-bb-host-master \
+ virtphy -s /data/unix/osmocom_l2
/bin/sh -c "virtphy -s /data/unix/osmocom_l2 >>/data/virtphy.log 2>&1"
}
@@ -109,9 +140,12 @@ start_testsuite() {
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/bts-tester-${variant}:/data \
-v $VOL_BASE_DIR/unix:/data/unix \
+ $ADD_TTCN_VOLUMES \
--name ${BUILD_TAG}-ttcn3-bts-test \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-bts-test
+ $ADD_TTCN_RUN_OPTS \
+ $REPO_USER/ttcn3-bts-test \
+ $ADD_TTCN_RUN_CMD
}
SUBNET=9
diff --git a/ttcn3-hlr-test/Dockerfile b/ttcn3-hlr-test/Dockerfile
index 8480288..39378bf 100644
--- a/ttcn3-hlr-test/Dockerfile
+++ b/ttcn3-hlr-test/Dockerfile
@@ -9,5 +9,7 @@ RUN ttcn3-docker-prepare "$OSMO_TTCN3_BRANCH" hlr
VOLUME /data
COPY HLR_Tests.cfg /data/HLR_Tests.cfg
+COPY Makefile.within-docker-img /Makefile
-CMD ttcn3-docker-run hlr HLR_Tests
+WORKDIR /
+CMD make test
diff --git a/ttcn3-hlr-test/Makefile.within-docker-img b/ttcn3-hlr-test/Makefile.within-docker-img
new file mode 100644
index 0000000..20401cd
--- /dev/null
+++ b/ttcn3-hlr-test/Makefile.within-docker-img
@@ -0,0 +1,13 @@
+.PHONY: compile test log
+
+all: compile test
+
+compile:
+ $(MAKE) -C /osmo-ttcn3-hacks hlr/all
+
+test:
+ cd /data && \
+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/hlr/HLR_Tests HLR_Tests.cfg $(TEST); \
+ exit_code=$$?; \
+ /osmo-ttcn3-hacks/log_merge.sh HLR_Tests --rm; \
+ exit $$exit_code
diff --git a/ttcn3-hlr-test/jenkins.sh b/ttcn3-hlr-test/jenkins.sh
index e003e03..45cf7a5 100755
--- a/ttcn3-hlr-test/jenkins.sh
+++ b/ttcn3-hlr-test/jenkins.sh
@@ -9,6 +9,26 @@ docker_images_require \
set_clean_up_trap
set -e
+ADD_TTCN_RUN_OPTS=""
+ADD_TTCN_RUN_CMD=""
+ADD_TTCN_VOLUMES=""
+ADD_HLR_VOLUMES=""
+ADD_HLR_RUN_OPTS=""
+HLR_RUN_CMD="osmo-hlr -c /data/osmo-hlr.cfg"
+
+if [ "x$1" = "x-h" ]; then
+ ADD_TTCN_RUN_OPTS="-ti"
+ ADD_TTCN_RUN_CMD="bash"
+ if [ -d "$2" ]; then
+ ADD_TTCN_VOLUMES="$ADD_TTCN_VOLUMES -v $2:/osmo-ttcn3-hacks"
+ fi
+ if [ -d "$3" ]; then
+ ADD_HLR_VOLUMES="$ADD_HLR_VOLUMES -v $3:/src"
+ HLR_RUN_CMD="sleep 9999999"
+ ADD_HLR_RUN_OPTS="--privileged"
+ fi
+fi
+
SUBNET=10
network_create $SUBNET
@@ -23,10 +43,12 @@ docker run --rm \
$(docker_network_params $SUBNET 20) \
--ulimit core=-1 \
-v $VOL_BASE_DIR/hlr:/data \
+ $ADD_HLR_VOLUMES \
--name ${BUILD_TAG}-hlr -d \
$DOCKER_ARGS \
+ $ADD_HLR_RUN_OPTS \
$REPO_USER/osmo-hlr-$IMAGE_SUFFIX \
- /bin/sh -c "osmo-hlr -c /data/osmo-hlr.cfg >/data/osmo-hlr.log 2>&1"
+ $HLR_RUN_CMD
echo Starting container with HLR testsuite
docker run --rm \
@@ -34,6 +56,9 @@ docker run --rm \
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/hlr-tester:/data \
+ $ADD_TTCN_VOLUMES \
--name ${BUILD_TAG}-ttcn3-hlr-test \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-hlr-test
+ $ADD_TTCN_RUN_OPTS \
+ $REPO_USER/ttcn3-hlr-test \
+ $ADD_TTCN_RUN_CMD
diff --git a/ttcn3-hlr-test/osmo-hlr.cfg b/ttcn3-hlr-test/osmo-hlr.cfg
index 5cda49e..8ead803 100644
--- a/ttcn3-hlr-test/osmo-hlr.cfg
+++ b/ttcn3-hlr-test/osmo-hlr.cfg
@@ -2,8 +2,9 @@
! OsmoHLR example configuration
!
log gsmtap 172.18.10.103
- logging level set-all debug
logging filter all 1
+ logging level set-all debug
+ logging level linp error
!
log stderr
logging filter all 1
@@ -14,6 +15,7 @@ log stderr
logging print file basename last
logging print extended-timestamp 1
logging level set-all debug
+ logging level linp error
!
line vty
bind 0.0.0.0
diff --git a/ttcn3-mgw-test/Dockerfile b/ttcn3-mgw-test/Dockerfile
index 087dc09..e94ff82 100644
--- a/ttcn3-mgw-test/Dockerfile
+++ b/ttcn3-mgw-test/Dockerfile
@@ -9,5 +9,6 @@ RUN ttcn3-docker-prepare "$OSMO_TTCN3_BRANCH" mgw
VOLUME /data
COPY MGCP_Test.cfg /data/MGCP_Test.cfg
+COPY Makefile.within-docker-img /Makefile
-CMD ttcn3-docker-run mgw MGCP_Test
+CMD cd / && make test
diff --git a/ttcn3-mgw-test/Makefile.within-docker-img b/ttcn3-mgw-test/Makefile.within-docker-img
new file mode 100644
index 0000000..afaae6a
--- /dev/null
+++ b/ttcn3-mgw-test/Makefile.within-docker-img
@@ -0,0 +1,14 @@
+.PHONY: compile test log
+
+default: compile test
+
+compile:
+ $(MAKE) -C /osmo-ttcn3-hacks mgw/compile
+ $(MAKE) -C /osmo-ttcn3-hacks mgw -j
+
+test:
+ cd /data && \
+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/mgw/MGCP_Test; \
+ exit_code=$$?; \
+ /osmo-ttcn3-hacks/log_merge.sh MGCP_Test --rm; \
+ exit $$exit_code
diff --git a/ttcn3-mgw-test/jenkins.sh b/ttcn3-mgw-test/jenkins.sh
index f9d0133..6dc5e97 100755
--- a/ttcn3-mgw-test/jenkins.sh
+++ b/ttcn3-mgw-test/jenkins.sh
@@ -9,6 +9,25 @@ docker_images_require \
set_clean_up_trap
set -e
+ADD_TTCN_RUN_OPTS=""
+ADD_TTCN_RUN_CMD=""
+ADD_TTCN_VOLUMES=""
+ADD_MGW_VOLUMES=""
+ADD_MGW_ARGS=""
+
+if [ "x$1" = "x-h" ]; then
+ ADD_TTCN_RUN_OPTS="-ti"
+ ADD_TTCN_RUN_CMD="bash"
+ if [ -d "$2" ]; then
+ ADD_TTCN_VOLUMES="$ADD_TTCN_VOLUMES -v $2:/osmo-ttcn3-hacks"
+ fi
+ if [ -d "$3" ]; then
+ ADD_MGW_RUN_CMD="sleep 9999999"
+ ADD_MGW_VOLUMES="$ADD_MGW_VOLUMES -v $3:/src"
+ ADD_MGW_RUN_OPTS="--privileged"
+ fi
+fi
+
mkdir $VOL_BASE_DIR/mgw-tester
cp MGCP_Test.cfg $VOL_BASE_DIR/mgw-tester/
@@ -23,16 +42,22 @@ docker run --rm \
$(docker_network_params $SUBNET 180) \
--ulimit core=-1 \
-v $VOL_BASE_DIR/mgw:/data \
+ $ADD_MGW_VOLUMES \
--name ${BUILD_TAG}-mgw -d \
$DOCKER_ARGS \
- $REPO_USER/osmo-mgw-$IMAGE_SUFFIX
+ $ADD_MGW_RUN_OPTS \
+ $REPO_USER/osmo-mgw-$IMAGE_SUFFIX \
+ $ADD_MGW_RUN_CMD
# start docker container with testsuite in foreground
docker run --rm \
$(docker_network_params $SUBNET 181) \
--ulimit core=-1 \
-v $VOL_BASE_DIR/mgw-tester:/data \
+ $ADD_TTCN_VOLUMES \
-e "TTCN3_PCAP_PATH=/data" \
--name ${BUILD_TAG}-ttcn3-mgw-test \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-mgw-test
+ $ADD_TTCN_RUN_OPTS \
+ $REPO_USER/ttcn3-mgw-test \
+ $ADD_TTCN_RUN_CMD
diff --git a/ttcn3-msc-test/Dockerfile b/ttcn3-msc-test/Dockerfile
index 05610a4..3aaf0f9 100644
--- a/ttcn3-msc-test/Dockerfile
+++ b/ttcn3-msc-test/Dockerfile
@@ -9,5 +9,7 @@ RUN ttcn3-docker-prepare "$OSMO_TTCN3_BRANCH" msc
VOLUME /data
COPY MSC_Tests.cfg /data/MSC_Tests.cfg
+COPY Makefile.within-docker-img /Makefile
-CMD ttcn3-docker-run msc MSC_Tests
+WORKDIR /
+CMD make test
diff --git a/ttcn3-msc-test/Makefile.within-docker-img b/ttcn3-msc-test/Makefile.within-docker-img
new file mode 100644
index 0000000..4ec9a6c
--- /dev/null
+++ b/ttcn3-msc-test/Makefile.within-docker-img
@@ -0,0 +1,13 @@
+.PHONY: compile test log
+
+all: compile test
+
+compile:
+ $(MAKE) -C /osmo-ttcn3-hacks msc/all
+
+test:
+ cd /data && \
+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/msc/MSC_Tests MSC_Tests.cfg $(TEST); \
+ exit_code=$$?; \
+ /osmo-ttcn3-hacks/log_merge.sh MSC_Tests --rm; \
+ exit $$exit_code
diff --git a/ttcn3-msc-test/jenkins.sh b/ttcn3-msc-test/jenkins.sh
index dd91e24..91ab3a5 100755
--- a/ttcn3-msc-test/jenkins.sh
+++ b/ttcn3-msc-test/jenkins.sh
@@ -13,6 +13,26 @@ set -e
SUBNET=20
network_create $SUBNET
+ADD_TTCN_RUN_OPTS=""
+ADD_TTCN_RUN_CMD=""
+ADD_TTCN_VOLUMES=""
+ADD_MSC_VOLUMES=""
+ADD_MSC_RUN_OPTS=""
+MSC_RUN_CMD="/bin/sh -c \"osmo-msc -c /data/osmo-msc.cfg >>/data/osmo-msc.log 2>&1\""
+
+if [ "x$1" = "x-h" ]; then
+ ADD_TTCN_RUN_OPTS="-ti"
+ ADD_TTCN_RUN_CMD="bash"
+ if [ -d "$2" ]; then
+ ADD_TTCN_VOLUMES="$ADD_TTCN_VOLUMES -v $2:/osmo-ttcn3-hacks"
+ fi
+ if [ -d "$3" ]; then
+ ADD_MSC_VOLUMES="$ADD_MSC_VOLUMES -v $3:/src"
+ MSC_RUN_CMD="sleep 9999999"
+ ADD_MSC_RUN_OPTS="--privileged"
+ fi
+fi
+
mkdir $VOL_BASE_DIR/msc-tester
mkdir $VOL_BASE_DIR/msc-tester/unix
cp MSC_Tests.cfg $VOL_BASE_DIR/msc-tester/
@@ -40,10 +60,12 @@ docker run --rm \
--ulimit core=-1 \
-v $VOL_BASE_DIR/msc:/data \
-v $VOL_BASE_DIR/unix:/data/unix \
+ $ADD_MSC_VOLUMES \
--name ${BUILD_TAG}-msc -d \
$DOCKER_ARGS \
+ $ADD_MSC_RUN_OPTS \
$REPO_USER/osmo-msc-$IMAGE_SUFFIX \
- /bin/sh -c "osmo-msc -c /data/osmo-msc.cfg >>/data/osmo-msc.log 2>&1"
+ $MSC_RUN_CMD
echo Starting container with MSC testsuite
docker run --rm \
@@ -52,6 +74,9 @@ docker run --rm \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/msc-tester:/data \
-v $VOL_BASE_DIR/unix:/data/unix \
+ $ADD_TTCN_VOLUMES \
--name ${BUILD_TAG}-ttcn3-msc-test \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-msc-test
+ $ADD_TTCN_RUN_OPTS \
+ $REPO_USER/ttcn3-msc-test \
+ $ADD_TTCN_RUN_CMD
diff --git a/ttcn3-sgsn-test/Dockerfile b/ttcn3-sgsn-test/Dockerfile
index 333b5ed..8a6712b 100644
--- a/ttcn3-sgsn-test/Dockerfile
+++ b/ttcn3-sgsn-test/Dockerfile
@@ -9,5 +9,6 @@ RUN ttcn3-docker-prepare "$OSMO_TTCN3_BRANCH" sgsn
VOLUME /data
COPY SGSN_Tests.cfg /data/SGSN_Tests.cfg
+COPY Makefile.within-docker-img /Makefile
-CMD ttcn3-docker-run sgsn SGSN_Tests
+CMD cd / && make test
diff --git a/ttcn3-sgsn-test/Makefile.within-docker-img b/ttcn3-sgsn-test/Makefile.within-docker-img
new file mode 100644
index 0000000..20f9643
--- /dev/null
+++ b/ttcn3-sgsn-test/Makefile.within-docker-img
@@ -0,0 +1,18 @@
+.PHONY: compile test log
+
+default: compile
+ $(MAKE) test; $(MAKE) log
+
+compile:
+ $(MAKE) -C /osmo-ttcn3-hacks sgsn/compile
+ $(MAKE) -C /osmo-ttcn3-hacks sgsn -j
+
+test:
+ cd /data && \
+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sgsn/SGSN_Tests; \
+ exit_code=$$?; \
+ /osmo-ttcn3-hacks/log_merge.sh SGSN_Tests --rm; \
+ exit $$exit_code
+
+log:
+ cd /data; /osmo-ttcn3-hacks/log_merge.sh SGSN_Tests --rm
diff --git a/ttcn3-sgsn-test/jenkins.sh b/ttcn3-sgsn-test/jenkins.sh
index df500af..d456638 100755
--- a/ttcn3-sgsn-test/jenkins.sh
+++ b/ttcn3-sgsn-test/jenkins.sh
@@ -10,6 +10,41 @@ docker_images_require \
set_clean_up_trap
set -e
+ADD_TTCN_RUN_OPTS=""
+ADD_TTCN_RUN_CMD=""
+ADD_TTCN_VOLUMES=""
+SGSN_RUN_CMD="osmo-sgsn -c /data/osmo-sgsn.cfg"
+ADD_SGSN_VOLUMES=""
+ADD_SGSN_ARGS=""
+ADD_SGSN_RUN_OPTS=""
+
+if [ "x$1" = "x-h" ]; then
+ ADD_TTCN_RUN_OPTS="-ti"
+ ADD_TTCN_RUN_CMD="bash"
+ if [ -d "$2" ]; then
+ ADD_TTCN_VOLUMES="$ADD_TTCN_VOLUMES -v $2:/osmo-ttcn3-hacks"
+ fi
+ if [ -d "$3" ]; then
+ SGSN_RUN_CMD="sleep 9999999"
+ ADD_SGSN_VOLUMES="$ADD_SGSN_VOLUMES -v $3:/src"
+ set +x
+ echo "
+
+===== ATTENTION =====
+Starting the osmo-sgsn-master docker image in hacking mode.
+That means to launch the SGSN, you need to attach to it and start it manually:
+
+ docker exec -ti nonjenkins-sgsn bash
+ /# make
+
+=====
+"
+ set -x
+ fi
+else
+ ADD_TTCN_RUN_CMD="$@"
+fi
+
SUBNET=8
network_create $SUBNET
@@ -38,10 +73,12 @@ docker run --rm \
$(docker_network_params $SUBNET 10) \
--ulimit core=-1 \
-v $VOL_BASE_DIR/sgsn:/data \
+ $ADD_SGSN_VOLUMES \
--name ${BUILD_TAG}-sgsn -d \
$DOCKER_ARGS \
+ $ADD_SGSN_RUN_OPTS \
$REPO_USER/osmo-sgsn-$IMAGE_SUFFIX \
- /bin/sh -c "osmo-sgsn -c /data/osmo-sgsn.cfg >/data/osmo-sgsn.log 2>&1"
+ $SGSN_RUN_CMD
echo Starting container with SGSN testsuite
docker run --rm \
@@ -49,6 +86,9 @@ docker run --rm \
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/sgsn-tester:/data \
+ $ADD_TTCN_VOLUMES \
--name ${BUILD_TAG}-ttcn3-sgsn-test \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-sgsn-test
+ $ADD_TTCN_RUN_OPTS \
+ $REPO_USER/ttcn3-sgsn-test \
+ $ADD_TTCN_RUN_CMD
diff --git a/ttcn3-sgsn-test/osmo-sgsn.cfg b/ttcn3-sgsn-test/osmo-sgsn.cfg
index 25cb224..1dcac1a 100644
--- a/ttcn3-sgsn-test/osmo-sgsn.cfg
+++ b/ttcn3-sgsn-test/osmo-sgsn.cfg
@@ -9,10 +9,11 @@ log gsmtap 172.18.8.103
log stderr
logging filter all 1
logging color 1
+ logging print level 1
logging print category 1
- logging timestamp 1
+ logging print category-hex 0
logging print extended-timestamp 1
- logging print file 1
+ logging print file basename last
logging level all everything
logging level mm debug
logging level pag notice
diff --git a/ttcn3-sip-test/jenkins.sh b/ttcn3-sip-test/jenkins.sh
index ffec3d2..4ffb58b 100755
--- a/ttcn3-sip-test/jenkins.sh
+++ b/ttcn3-sip-test/jenkins.sh
@@ -9,6 +9,26 @@ docker_images_require \
set_clean_up_trap
set -e
+ADD_TTCN_RUN_OPTS=""
+ADD_TTCN_RUN_CMD=""
+ADD_TTCN_VOLUMES=""
+ADD_SIP_VOLUMES=""
+ADD_SIP_ARGS=""
+SIP_RUN_CMD="/bin/sh -c \"osmo-sip-connector -c /data/osmo-sip-connector.cfg >>/data/osmo-sip-connector.log 2>&1\""
+
+if [ "x$1" = "x-h" ]; then
+ ADD_TTCN_RUN_OPTS="-ti"
+ ADD_TTCN_RUN_CMD="bash"
+ if [ -d "$2" ]; then
+ ADD_TTCN_VOLUMES="$ADD_TTCN_VOLUMES -v $2:/osmo-ttcn3-hacks"
+ fi
+ if [ -d "$3" ]; then
+ SIP_RUN_CMD="sleep 9999999"
+ ADD_SIP_VOLUMES="$ADD_SIP_VOLUMES -v $3:/src"
+ ADD_SIP_RUN_OPTS="--privileged"
+ fi
+fi
+
SUBNET=11
network_create $SUBNET
@@ -28,10 +48,12 @@ docker run --rm \
--ulimit core=-1 \
-v $VOL_BASE_DIR/sip:/data \
-v $VOL_BASE_DIR/unix:/data/unix \
+ $ADD_SIP_VOLUMES \
--name ${BUILD_TAG}-sip-connector -d \
$DOCKER_ARGS \
+ $ADD_SIP_RUN_OPTS \
$REPO_USER/osmo-sip-$IMAGE_SUFFIX \
- /bin/sh -c "osmo-sip-connector -c /data/osmo-sip-connector.cfg >>/data/osmo-sip-connector.log 2>&1"
+ $SIP_RUN_CMD
echo Starting container with SIP testsuite
docker run --rm \
@@ -40,6 +62,9 @@ docker run --rm \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/sip-tester:/data \
-v $VOL_BASE_DIR/unix:/data/unix \
+ $ADD_TTCN_VOLUMES \
--name ${BUILD_TAG}-ttcn3-sip-test \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-sip-test
+ $ADD_TTCN_RUN_OPTS \
+ $REPO_USER/ttcn3-sip-test \
+ $ADD_TTCN_RUN_CMD