diff --git a/osmo-stp-master/Dockerfile b/osmo-stp-master/Dockerfile index 622d0b92..e76e5a91 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 00000000..d9c32323 --- /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 00000000..cbcd5445 --- /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 00000000..0d6a91bb --- /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 00000000..550dc430 --- /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