From 284a8816f2e7b7617a65abbff41bed6fa9073145 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 27 Mar 2018 08:24:21 +0200 Subject: [PATCH] add ttcn3-sip-test container Change-Id: Ibfe2a2b47c266788d51e98d64bca7017caf19e29 --- ttcn3-sip-test/.release | 2 ++ ttcn3-sip-test/Dockerfile | 31 ++++++++++++++++++ ttcn3-sip-test/Makefile | 1 + ttcn3-sip-test/SIP_Tests.cfg | 20 ++++++++++++ ttcn3-sip-test/jenkins.sh | 44 +++++++++++++++++++++++++ ttcn3-sip-test/osmo-sip-connector.cfg | 46 +++++++++++++++++++++++++++ 6 files changed, 144 insertions(+) create mode 100644 ttcn3-sip-test/.release create mode 100644 ttcn3-sip-test/Dockerfile create mode 100644 ttcn3-sip-test/Makefile create mode 100644 ttcn3-sip-test/SIP_Tests.cfg create mode 100755 ttcn3-sip-test/jenkins.sh create mode 100644 ttcn3-sip-test/osmo-sip-connector.cfg diff --git a/ttcn3-sip-test/.release b/ttcn3-sip-test/.release new file mode 100644 index 00000000..b23db5ce --- /dev/null +++ b/ttcn3-sip-test/.release @@ -0,0 +1,2 @@ +release=0.0.0 +tag=ttcn3-sip-test-0.0.0 diff --git a/ttcn3-sip-test/Dockerfile b/ttcn3-sip-test/Dockerfile new file mode 100644 index 00000000..b03d4943 --- /dev/null +++ b/ttcn3-sip-test/Dockerfile @@ -0,0 +1,31 @@ +FROM laforge/debian-stretch-titan + +RUN mkdir /root/projects && (cd /root/projects && ln -sf / git) +RUN git clone git://git.osmocom.org/osmo-ttcn3-hacks.git + +RUN cd osmo-ttcn3-hacks && \ + git checkout -f -B master origin/master && \ + make deps + +RUN git config --global user.email docker@dock.er && \ + git config --global user.name "Dock Er" + +ARG OSMO_TTCN3_BRANCH="master" + +ADD http://git.osmocom.org/osmo-ttcn3-hacks/patch?h=$OSMO_TTCN3_BRANCH /tmp/commit +RUN cd osmo-ttcn3-hacks && \ + git fetch && \ + git checkout -f -B $OSMO_TTCN3_BRANCH origin/$OSMO_TTCN3_BRANCH && \ + git cherry-pick 5ce5241d6d460e9b36a908ac7072d8ea68df08db && \ + make sip + +VOLUME /data + +RUN ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-start.sh / && \ + ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-stop.sh / + +COPY SIP_Tests.cfg /data/SIP_Tests.cfg + +CMD cd /data && \ + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sip/SIP_Tests && \ + /osmo-ttcn3-hacks/log_merge.sh SIP_Tests --rm diff --git a/ttcn3-sip-test/Makefile b/ttcn3-sip-test/Makefile new file mode 100644 index 00000000..8d0e10b4 --- /dev/null +++ b/ttcn3-sip-test/Makefile @@ -0,0 +1 @@ +include ../make/Makefile diff --git a/ttcn3-sip-test/SIP_Tests.cfg b/ttcn3-sip-test/SIP_Tests.cfg new file mode 100644 index 00000000..2904e76e --- /dev/null +++ b/ttcn3-sip-test/SIP_Tests.cfg @@ -0,0 +1,20 @@ +[ORDERED_INCLUDE] +"/osmo-ttcn3-hacks/Common.cfg" +"/osmo-ttcn3-hacks/sip/SIP_Tests.default" + +[LOGGING] + +[TESTPORT_PARAMETERS] +*.SIPVTY.CTRL_HOSTNAME := "172.18.11.10" +*.SIP.default_local_address := "172.18.11.103" +*.SIP.default_dest_address := "172.18.11.10" + +[MODULE_PARAMETERS] +SIP_Tests.mp_local_host := "172.18.11.103" +SIP_Tests.mp_osmosip_host := "172.18.11.10" +SIP_Tests.mp_mncc := "/data/unix/mncc" + +[MAIN_CONTROLLER] + +[EXECUTE] +SIP_Tests.control diff --git a/ttcn3-sip-test/jenkins.sh b/ttcn3-sip-test/jenkins.sh new file mode 100755 index 00000000..63e6c8a7 --- /dev/null +++ b/ttcn3-sip-test/jenkins.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +. ../jenkins-common.sh + +network_create 172.18.11.0/24 + +mkdir $VOL_BASE_DIR/sip-tester +mkdir $VOL_BASE_DIR/sip-tester/unix +cp SIP_Tests.cfg $VOL_BASE_DIR/sip-tester/ + +mkdir $VOL_BASE_DIR/sip +mkdir $VOL_BASE_DIR/sip/unix +cp osmo-sip-connector.cfg $VOL_BASE_DIR/sip/ + +mkdir $VOL_BASE_DIR/unix + +echo Starting container with osmo-sip-connector +docker run --rm \ + --network $NET_NAME --ip 172.18.11.10 \ + -v $VOL_BASE_DIR/sip:/data \ + -v $VOL_BASE_DIR/unix:/data/unix \ + --name ${BUILD_TAG}-sip-connector -d \ + $REPO_USER/osmo-sip-master \ + /usr/local/bin/osmo-sip-connector -M /data/unix/mncc + +echo Starting container with SIP testsuite +docker run --rm \ + --network $NET_NAME --ip 172.18.11.103 \ + -e "TTCN3_PCAP_PATH=/data" \ + -v $VOL_BASE_DIR/sip-tester:/data \ + -v $VOL_BASE_DIR/unix:/data/unix \ + --name ${BUILD_TAG}-ttcn3-sip-test \ + $REPO_USER/ttcn3-sip-test + +echo Stopping containers +docker container kill ${BUILD_TAG}-sip-connector + +network_remove + +rm -rf $WORKSPACE/logs +mkdir -p $WORKSPACE/logs +rm -rf $VOL_BASE_DIR/unix +cp -a $VOL_BASE_DIR/* $WORKSPACE/logs/ +cat $WORKSPACE/logs/sip-tester/junit-*.log || true diff --git a/ttcn3-sip-test/osmo-sip-connector.cfg b/ttcn3-sip-test/osmo-sip-connector.cfg new file mode 100644 index 00000000..db212aee --- /dev/null +++ b/ttcn3-sip-test/osmo-sip-connector.cfg @@ -0,0 +1,46 @@ +! +! OsmoMNCC (1.1.0-dirty) configuration saved from vty +!! +! +log file /data/osmo-sip-connector.log + logging filter all 1 + logging color 0 + logging print category 1 + logging timestamp 0 + logging print file basename + logging level all everything + logging level sip debug + logging level mncc debug + logging level app debug + logging level call notice + logging level lglobal notice + logging level llapd notice + logging level linp notice + 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 notice + logging level lsccp notice + logging level lsua notice + logging level lm3ua notice + logging level lmgcp notice + logging level ljibuf notice +! +stats interval 5 +! +line vty + no login + bind 0.0.0.0 +! +sip + local 172.18.11.10 5060 + remote 172.18.11.103 5060 +mncc + socket-path /data/unix/mncc +app