<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/docker-playground/+/16893">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Introduuce ttcn-sccp dockerized setup<br><br>Since examples/sccp_demo_user (the binary used to test SCCP) is not<br>installed by libosmo-sccp.git during make install, we need to install it<br>manually after "make" step, and hence it's only available in<br>osmo-stp-master, because in osmo-stp-latest we used packaged files.<br><br>Change-Id: I5a7e6ff5f6e5f6e34d6a5ab29bd760a6f9d49c4b<br>---<br>M osmo-stp-master/Dockerfile<br>A ttcn3-sccp-test/Dockerfile<br>A ttcn3-sccp-test/Makefile<br>A ttcn3-sccp-test/SCCP_Tests.cfg<br>A ttcn3-sccp-test/jenkins.sh<br>5 files changed, 111 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/93/16893/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/osmo-stp-master/Dockerfile b/osmo-stp-master/Dockerfile</span><br><span>index 622d0b9..e76e5a9 100644</span><br><span>--- a/osmo-stp-master/Dockerfile</span><br><span>+++ b/osmo-stp-master/Dockerfile</span><br><span>@@ -32,6 +32,7 @@</span><br><span>        autoreconf -fi && \</span><br><span>  ./configure && \</span><br><span>     make -j8 install && \</span><br><span style="color: hsl(120, 100%, 40%);">+ install examples/sccp_demo_user /usr/local/bin/ && \</span><br><span>         ldconfig</span><br><span> </span><br><span> VOLUME  /data</span><br><span>diff --git a/ttcn3-sccp-test/Dockerfile b/ttcn3-sccp-test/Dockerfile</span><br><span>new file mode 100644</span><br><span>index 0000000..0c70027</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3-sccp-test/Dockerfile</span><br><span>@@ -0,0 +1,37 @@</span><br><span style="color: hsl(120, 100%, 40%);">+ARG USER</span><br><span style="color: hsl(120, 100%, 40%);">+FROM      $USER/debian-stretch-titan</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+RUN       mkdir /root/projects && (cd /root/projects && ln -sf / git)</span><br><span style="color: hsl(120, 100%, 40%);">+RUN        git clone git://git.osmocom.org/osmo-ttcn3-hacks.git</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+RUN     cd osmo-ttcn3-hacks && \</span><br><span style="color: hsl(120, 100%, 40%);">+      git checkout -f -B master origin/master && \</span><br><span style="color: hsl(120, 100%, 40%);">+  make deps</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+RUN        git config --global user.email docker@dock.er && \</span><br><span style="color: hsl(120, 100%, 40%);">+    git config --global user.name "Dock Er"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ARG        OSMO_TTCN3_BRANCH="master"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ADD     http://git.osmocom.org/osmo-ttcn3-hacks/patch?h=$OSMO_TTCN3_BRANCH /tmp/commit</span><br><span style="color: hsl(120, 100%, 40%);">+RUN     cd osmo-ttcn3-hacks && \</span><br><span style="color: hsl(120, 100%, 40%);">+      git fetch && \</span><br><span style="color: hsl(120, 100%, 40%);">+        git checkout $OSMO_TTCN3_BRANCH && \</span><br><span style="color: hsl(120, 100%, 40%);">+  (git symbolic-ref -q HEAD && git reset --hard origin/$OSMO_TTCN3_BRANCH || exit 1); \</span><br><span style="color: hsl(120, 100%, 40%);">+ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \</span><br><span style="color: hsl(120, 100%, 40%);">+    make sccp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+VOLUME     /data</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+RUN    ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-start.sh / && \</span><br><span style="color: hsl(120, 100%, 40%);">+ ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-stop.sh /</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+COPY SCCP_Tests.cfg /data/SCCP_Tests.cfg</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+CMD      cd /data && \</span><br><span style="color: hsl(120, 100%, 40%);">+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sccp/SCCP_Tests; \</span><br><span style="color: hsl(120, 100%, 40%);">+     exit_code=$?; \</span><br><span style="color: hsl(120, 100%, 40%);">+       echo "pespin1: $PWD"; ls -lha .; \</span><br><span style="color: hsl(120, 100%, 40%);">+  echo "pespin2:"; ls -lha SCCP_Tests*.log; \</span><br><span style="color: hsl(120, 100%, 40%);">+ /osmo-ttcn3-hacks/log_merge.sh SCCP_Tests --rm; \</span><br><span style="color: hsl(120, 100%, 40%);">+     exit $exit_code</span><br><span>diff --git a/ttcn3-sccp-test/Makefile b/ttcn3-sccp-test/Makefile</span><br><span>new file mode 100644</span><br><span>index 0000000..cbcd544</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3-sccp-test/Makefile</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+RUN_ARGS?=--sysctl net.ipv6.conf.all.disable_ipv6=0 --rm --network sigtran --ip 172.18.2.202 -v ggsn-test-vol:/data</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+include ../make/Makefile</span><br><span>diff --git a/ttcn3-sccp-test/SCCP_Tests.cfg b/ttcn3-sccp-test/SCCP_Tests.cfg</span><br><span>new file mode 100644</span><br><span>index 0000000..7e6d9a0</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3-sccp-test/SCCP_Tests.cfg</span><br><span>@@ -0,0 +1,30 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[ORDERED_INCLUDE]</span><br><span style="color: hsl(120, 100%, 40%);">+"/osmo-ttcn3-hacks/Common.cfg"</span><br><span style="color: hsl(120, 100%, 40%);">+"/osmo-ttcn3-hacks/sccp/SCCP_Tests.default"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[LOGGING]</span><br><span style="color: hsl(120, 100%, 40%);">+*.JUnitLogger.testsuite_name := "SCCP_Tests"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[TESTPORT_PARAMETERS]</span><br><span style="color: hsl(120, 100%, 40%);">+*.SCCP_DEMO_USER_VTY.CTRL_HOSTNAME := "172.18.22.200"</span><br><span style="color: hsl(120, 100%, 40%);">+*.SCCP_DEMO_USER_VTY.CTRL_PORTNUM := "2325"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[MODULE_PARAMETERS]</span><br><span style="color: hsl(120, 100%, 40%);">+SCCP_Tests.sccp_cfg := {</span><br><span style="color: hsl(120, 100%, 40%);">+        {</span><br><span style="color: hsl(120, 100%, 40%);">+                        sccp_service_type := "mtp3_itu",</span><br><span style="color: hsl(120, 100%, 40%);">+                        sctp_addr := { 2905, "172.18.22.203", 2905, "172.18.22.200" },</span><br><span style="color: hsl(120, 100%, 40%);">+                        own_pc := 185,</span><br><span style="color: hsl(120, 100%, 40%);">+                        own_ssn := 254,</span><br><span style="color: hsl(120, 100%, 40%);">+                        peer_pc := 23,</span><br><span style="color: hsl(120, 100%, 40%);">+                        peer_ssn := 254,</span><br><span style="color: hsl(120, 100%, 40%);">+                        sio := '83'O,</span><br><span style="color: hsl(120, 100%, 40%);">+                        rctx := 0</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[MAIN_CONTROLLER]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[EXECUTE]</span><br><span style="color: hsl(120, 100%, 40%);">+SCCP_Tests.control</span><br><span style="color: hsl(120, 100%, 40%);">+SCCP_Tests_RAW.control</span><br><span>diff --git a/ttcn3-sccp-test/jenkins.sh b/ttcn3-sccp-test/jenkins.sh</span><br><span>new file mode 100755</span><br><span>index 0000000..21f301c</span><br><span>--- /dev/null</span><br><span>+++ b/ttcn3-sccp-test/jenkins.sh</span><br><span>@@ -0,0 +1,40 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/bin/sh</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+. ../jenkins-common.sh</span><br><span style="color: hsl(120, 100%, 40%);">+IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"</span><br><span style="color: hsl(120, 100%, 40%);">+# Always require osmo-stp-master since is the only with sccp_demo_user installed</span><br><span style="color: hsl(120, 100%, 40%);">+docker_images_require \</span><br><span style="color: hsl(120, 100%, 40%);">+        "debian-stretch-build" \</span><br><span style="color: hsl(120, 100%, 40%);">+    "osmo-stp-master" \</span><br><span style="color: hsl(120, 100%, 40%);">+ "debian-stretch-titan" \</span><br><span style="color: hsl(120, 100%, 40%);">+    "ttcn3-sccp-test"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+mkdir $VOL_BASE_DIR/sccp-tester</span><br><span style="color: hsl(120, 100%, 40%);">+cp SCCP_Tests.cfg $VOL_BASE_DIR/sccp-tester/</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+mkdir $VOL_BASE_DIR/sccp</span><br><span style="color: hsl(120, 100%, 40%);">+#cp osmo-sccp.cfg $VOL_BASE_DIR/sccp/</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+network_create 172.18.22.0/24</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+echo Starting container with sccp_demo_user</span><br><span style="color: hsl(120, 100%, 40%);">+docker run     --rm \</span><br><span style="color: hsl(120, 100%, 40%);">+                --network $NET_NAME --ip 172.18.22.200 \</span><br><span style="color: hsl(120, 100%, 40%);">+              -v $VOL_BASE_DIR/sccp:/data \</span><br><span style="color: hsl(120, 100%, 40%);">+         --name ${BUILD_TAG}-stp -d \</span><br><span style="color: hsl(120, 100%, 40%);">+          $REPO_USER/osmo-stp-master \</span><br><span style="color: hsl(120, 100%, 40%);">+          /bin/sh -c "sccp_demo_user -c -l 172.18.22.200 -r 172.18.22.203 >>/data/sccp_demo_user.log 2>&1"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+echo Starting container with SCCP testsuite</span><br><span style="color: hsl(120, 100%, 40%);">+docker run    --rm \</span><br><span style="color: hsl(120, 100%, 40%);">+                --network $NET_NAME --ip 172.18.22.203 \</span><br><span style="color: hsl(120, 100%, 40%);">+              -e "TTCN3_PCAP_PATH=/data" \</span><br><span style="color: hsl(120, 100%, 40%);">+                -v $VOL_BASE_DIR/sccp-tester:/data \</span><br><span style="color: hsl(120, 100%, 40%);">+          --name ${BUILD_TAG}-ttcn3-sccp-test \</span><br><span style="color: hsl(120, 100%, 40%);">+         $REPO_USER/ttcn3-sccp-test</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+docker container kill ${BUILD_TAG}-stp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+network_remove</span><br><span style="color: hsl(120, 100%, 40%);">+collect_logs</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/docker-playground/+/16893">change 16893</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/docker-playground/+/16893"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: docker-playground </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I5a7e6ff5f6e5f6e34d6a5ab29bd760a6f9d49c4b </div>
<div style="display:none"> Gerrit-Change-Number: 16893 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>