pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/docker-playground/+/16893 )


Change subject: Introduuce ttcn-sccp dockerized setup
......................................................................

Introduuce 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.

Change-Id: I5a7e6ff5f6e5f6e34d6a5ab29bd760a6f9d49c4b
---
M osmo-stp-master/Dockerfile
A ttcn3-sccp-test/Dockerfile
A ttcn3-sccp-test/Makefile
A ttcn3-sccp-test/SCCP_Tests.cfg
A ttcn3-sccp-test/jenkins.sh
5 files changed, 111 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/docker-playground 
refs/changes/93/16893/1

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 @@
        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..0c70027
--- /dev/null
+++ b/ttcn3-sccp-test/Dockerfile
@@ -0,0 +1,37 @@
+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 doc...@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=$?; \
+       echo "pespin1: $PWD"; ls -lha .; \
+       echo "pespin2:"; ls -lha SCCP_Tests*.log; \
+       /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..7e6d9a0
--- /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 := "2325"
+
+[MODULE_PARAMETERS]
+SCCP_Tests.sccp_cfg := {
+        {
+                        sccp_service_type := "mtp3_itu",
+                        sctp_addr := { 2905, "172.18.22.203", 2905, 
"172.18.22.200" },
+                        own_pc := 185,
+                        own_ssn := 254,
+                        peer_pc := 23,
+                        peer_ssn := 254,
+                        sio := '83'O,
+                        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..21f301c
--- /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 -c -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

--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/16893
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I5a7e6ff5f6e5f6e34d6a5ab29bd760a6f9d49c4b
Gerrit-Change-Number: 16893
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to