aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-01-16 16:24:05 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-01-17 18:00:41 +0100
commitb2f417d9a8da75b360ae3bf1966a3e10660e1606 (patch)
tree6b3d310b4b52449f173fb0fdc5749a4ed7df83f4
parentfd77c845dfd556f503f7fd4d9784d5b19768170e (diff)
Introduce ttcn-sccp dockerized setup
Since examples/sccp_demo_user (the binary used to test SCCP) is not installed by libosmo-sccp.git during make install, we need to install it manually after "make" step, and hence it's only available in osmo-stp-master, because in osmo-stp-latest we used packaged files. Related: OS#4343 Depends: osmo-ttcn3-hacks.git Ied9fbfb9bd35a99205ca13db033dd9ea03d51238 Change-Id: I5a7e6ff5f6e5f6e34d6a5ab29bd760a6f9d49c4b
-rw-r--r--osmo-stp-master/Dockerfile1
-rw-r--r--ttcn3-sccp-test/Dockerfile35
-rw-r--r--ttcn3-sccp-test/Makefile3
-rw-r--r--ttcn3-sccp-test/SCCP_Tests.cfg30
-rwxr-xr-xttcn3-sccp-test/jenkins.sh40
5 files changed, 109 insertions, 0 deletions
diff --git a/osmo-stp-master/Dockerfile b/osmo-stp-master/Dockerfile
index 622d0b9..e76e5a9 100644
--- a/osmo-stp-master/Dockerfile
+++ b/osmo-stp-master/Dockerfile
@@ -32,6 +32,7 @@ RUN cd libosmo-sccp && \
autoreconf -fi && \
./configure && \
make -j8 install && \
+ install examples/sccp_demo_user /usr/local/bin/ && \
ldconfig
VOLUME /data
diff --git a/ttcn3-sccp-test/Dockerfile b/ttcn3-sccp-test/Dockerfile
new file mode 100644
index 0000000..d9c3232
--- /dev/null
+++ b/ttcn3-sccp-test/Dockerfile
@@ -0,0 +1,35 @@
+ARG USER
+FROM $USER/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 $OSMO_TTCN3_BRANCH && \
+ (git symbolic-ref -q HEAD && git reset --hard origin/$OSMO_TTCN3_BRANCH || exit 1); \
+ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \
+ make sccp
+
+VOLUME /data
+
+RUN ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-start.sh / && \
+ ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-stop.sh /
+
+COPY SCCP_Tests.cfg /data/SCCP_Tests.cfg
+
+CMD cd /data && \
+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sccp/SCCP_Tests; \
+ exit_code=$?; \
+ /osmo-ttcn3-hacks/log_merge.sh SCCP_Tests --rm; \
+ exit $exit_code
diff --git a/ttcn3-sccp-test/Makefile b/ttcn3-sccp-test/Makefile
new file mode 100644
index 0000000..cbcd544
--- /dev/null
+++ b/ttcn3-sccp-test/Makefile
@@ -0,0 +1,3 @@
+RUN_ARGS?=--sysctl net.ipv6.conf.all.disable_ipv6=0 --rm --network sigtran --ip 172.18.2.202 -v ggsn-test-vol:/data
+
+include ../make/Makefile
diff --git a/ttcn3-sccp-test/SCCP_Tests.cfg b/ttcn3-sccp-test/SCCP_Tests.cfg
new file mode 100644
index 0000000..0d6a91b
--- /dev/null
+++ b/ttcn3-sccp-test/SCCP_Tests.cfg
@@ -0,0 +1,30 @@
+[ORDERED_INCLUDE]
+"/osmo-ttcn3-hacks/Common.cfg"
+"/osmo-ttcn3-hacks/sccp/SCCP_Tests.default"
+
+[LOGGING]
+*.JUnitLogger.testsuite_name := "SCCP_Tests"
+
+[TESTPORT_PARAMETERS]
+*.SCCP_DEMO_USER_VTY.CTRL_HOSTNAME := "172.18.22.200"
+*.SCCP_DEMO_USER_VTY.CTRL_PORTNUM := "2324"
+
+[MODULE_PARAMETERS]
+SCCP_Tests.mp_sccp_cfg := {
+ {
+ sccp_service_type := "mtp3_itu",
+ sctp_addr := { 2905, "172.18.22.203", 2905, "172.18.22.200" },
+ own_pc := 23,
+ own_ssn := 202, /* sscp_test_server.c: SSN_TEST_ECHO */
+ peer_pc := 1,
+ peer_ssn := 202, /* sscp_test_server.c: SSN_TEST_ECHO */
+ sio := '03'O, /* NI=Internal, SCCP */
+ rctx := 0
+ }
+};
+
+[MAIN_CONTROLLER]
+
+[EXECUTE]
+SCCP_Tests.control
+SCCP_Tests_RAW.control
diff --git a/ttcn3-sccp-test/jenkins.sh b/ttcn3-sccp-test/jenkins.sh
new file mode 100755
index 0000000..550dc43
--- /dev/null
+++ b/ttcn3-sccp-test/jenkins.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+. ../jenkins-common.sh
+IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
+# Always require osmo-stp-master since is the only with sccp_demo_user installed
+docker_images_require \
+ "debian-stretch-build" \
+ "osmo-stp-master" \
+ "debian-stretch-titan" \
+ "ttcn3-sccp-test"
+
+mkdir $VOL_BASE_DIR/sccp-tester
+cp SCCP_Tests.cfg $VOL_BASE_DIR/sccp-tester/
+
+mkdir $VOL_BASE_DIR/sccp
+#cp osmo-sccp.cfg $VOL_BASE_DIR/sccp/
+
+network_create 172.18.22.0/24
+
+echo Starting container with sccp_demo_user
+docker run --rm \
+ --network $NET_NAME --ip 172.18.22.200 \
+ -v $VOL_BASE_DIR/sccp:/data \
+ --name ${BUILD_TAG}-stp -d \
+ $REPO_USER/osmo-stp-master \
+ /bin/sh -c "sccp_demo_user -l 172.18.22.200 -r 172.18.22.203 >>/data/sccp_demo_user.log 2>&1"
+
+
+echo Starting container with SCCP testsuite
+docker run --rm \
+ --network $NET_NAME --ip 172.18.22.203 \
+ -e "TTCN3_PCAP_PATH=/data" \
+ -v $VOL_BASE_DIR/sccp-tester:/data \
+ --name ${BUILD_TAG}-ttcn3-sccp-test \
+ $REPO_USER/ttcn3-sccp-test
+
+docker container kill ${BUILD_TAG}-stp
+
+network_remove
+collect_logs