aboutsummaryrefslogtreecommitdiffstats
path: root/ttcn3-gbproxy-test
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2020-10-14 19:20:41 +0200
committerDaniel Willmann <dwillmann@sysmocom.de>2020-10-15 17:02:14 +0200
commit687ea83fc6925bc933694c2355d775cf61d88d1e (patch)
tree1271da12017eb09988f382d69096d3f9eab220ab /ttcn3-gbproxy-test
parentf567542874e42729351c1f6f7963a9e304df6fcb (diff)
Add GBProxy_Test
Diffstat (limited to 'ttcn3-gbproxy-test')
-rw-r--r--ttcn3-gbproxy-test/Dockerfile35
-rw-r--r--ttcn3-gbproxy-test/GBProxy_Tests.cfg59
-rw-r--r--ttcn3-gbproxy-test/Makefile1
-rwxr-xr-xttcn3-gbproxy-test/jenkins.sh60
-rw-r--r--ttcn3-gbproxy-test/osmo-gbproxy.cfg39
5 files changed, 194 insertions, 0 deletions
diff --git a/ttcn3-gbproxy-test/Dockerfile b/ttcn3-gbproxy-test/Dockerfile
new file mode 100644
index 0000000..05cd65d
--- /dev/null
+++ b/ttcn3-gbproxy-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 gbproxy
+
+VOLUME /data
+
+RUN ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-start.sh / && \
+ ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-stop.sh /
+
+COPY GBProxy_Tests.cfg /data/GBProxy_Tests.cfg
+
+CMD cd /data && \
+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/gbproxy/GBProxy_Tests; \
+ exit_code=$?; \
+ /osmo-ttcn3-hacks/log_merge.sh GBProxy_Tests --rm; \
+ exit $exit_code
diff --git a/ttcn3-gbproxy-test/GBProxy_Tests.cfg b/ttcn3-gbproxy-test/GBProxy_Tests.cfg
new file mode 100644
index 0000000..97b1ff2
--- /dev/null
+++ b/ttcn3-gbproxy-test/GBProxy_Tests.cfg
@@ -0,0 +1,59 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"/osmo-ttcn3-hacks/Common.cfg"
+# testsuite specific configuration, not expected to change
+"/osmo-ttcn3-hacks/gbproxy/GBProxy_Tests.default"
+
+# Local configuration below
+
+[LOGGING]
+
+[TESTPORT_PARAMETERS]
+*.GBPVTY.CTRL_HOSTNAME := "172.18.24.10"
+
+[MODULE_PARAMETERS]
+GBProxy_Tests.mp_nsconfig_sgsn := {
+ {
+ provider := {
+ ip := {
+ address_family := AF_INET,
+ local_ip := "172.18.24.103",
+ remote_ip := "172.18.24.10"
+ }
+ }
+ }
+}
+GBProxy_Tests.mp_nsconfig_pcu := {
+ {
+ provider := {
+ ip := {
+ address_family := AF_INET,
+ local_ip := "172.18.24.103",
+ remote_ip := "172.18.24.10"
+ }
+ }
+ },
+ {
+ provider := {
+ ip := {
+ address_family := AF_INET,
+ local_ip := "172.18.24.103",
+ remote_ip := "172.18.24.10"
+ }
+ }
+ },
+ {
+ provider := {
+ ip := {
+ address_family := AF_INET,
+ local_ip := "172.18.24.103",
+ remote_ip := "172.18.24.10"
+ }
+ }
+ }
+}
+
+[MAIN_CONTROLLER]
+
+[EXECUTE]
+GBProxy_Tests.control
diff --git a/ttcn3-gbproxy-test/Makefile b/ttcn3-gbproxy-test/Makefile
new file mode 100644
index 0000000..8d0e10b
--- /dev/null
+++ b/ttcn3-gbproxy-test/Makefile
@@ -0,0 +1 @@
+include ../make/Makefile
diff --git a/ttcn3-gbproxy-test/jenkins.sh b/ttcn3-gbproxy-test/jenkins.sh
new file mode 100755
index 0000000..acc7350
--- /dev/null
+++ b/ttcn3-gbproxy-test/jenkins.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+. ../jenkins-common.sh
+IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
+docker_images_require \
+ "osmo-sgsn-$IMAGE_SUFFIX" \
+ "ttcn3-gbproxy-test"
+
+SUBNET=24
+network_create $SUBNET
+
+mkdir $VOL_BASE_DIR/gbproxy-tester
+cp GBProxy_Tests.cfg $VOL_BASE_DIR/gbproxy-tester/
+
+mkdir $VOL_BASE_DIR/sgsn
+cp osmo-gbproxy.cfg $VOL_BASE_DIR/sgsn/
+
+# Disable features not in latest yet
+if [ "$IMAGE_SUFFIX" = "latest" ]; then
+ true;
+fi
+
+mkdir $VOL_BASE_DIR/unix
+
+echo Starting container with SGSN
+docker run --rm \
+ $(docker_network_params $SUBNET 10) \
+ --ulimit core=-1 \
+ -v $VOL_BASE_DIR/sgsn:/data \
+ --name ${BUILD_TAG}-sgsn -d \
+ $DOCKER_ARGS \
+ $REPO_USER/osmo-sgsn-$IMAGE_SUFFIX \
+ /bin/sh -c "osmo-gbproxy -c /data/osmo-gbproxy.cfg >/data/osmo-gbproxy.log 2>&1"
+
+echo Starting container with SGSN testsuite
+docker run --rm \
+ $(docker_network_params $SUBNET 103) \
+ --ulimit core=-1 \
+ -e "TTCN3_PCAP_PATH=/data" \
+ -v $VOL_BASE_DIR/gbproxy-tester:/data \
+ --name ${BUILD_TAG}-ttcn3-gbproxy-test \
+ $DOCKER_ARGS \
+ $REPO_USER/ttcn3-gbproxy-test $@
+
+echo Starting container to merge logs
+docker run --rm \
+ $(docker_network_params $SUBNET 103) \
+ --ulimit core=-1 \
+ -e "TTCN3_PCAP_PATH=/data" \
+ -v $VOL_BASE_DIR/gbproxy-tester:/data \
+ --name ${BUILD_TAG}-ttcn3-gbproxy-test-logmerge \
+ --entrypoint /osmo-ttcn3-hacks/log_merge.sh GBProxy_Tests --rm \
+ $DOCKER_ARGS \
+ $REPO_USER/ttcn3-gbproxy-test
+
+echo Stopping containers
+docker container kill ${BUILD_TAG}-sgsn
+
+network_remove
+collect_logs
diff --git a/ttcn3-gbproxy-test/osmo-gbproxy.cfg b/ttcn3-gbproxy-test/osmo-gbproxy.cfg
new file mode 100644
index 0000000..b1f2c3d
--- /dev/null
+++ b/ttcn3-gbproxy-test/osmo-gbproxy.cfg
@@ -0,0 +1,39 @@
+!
+! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty
+!!
+!
+log gsmtap 172.18.24.103
+ logging level set-all debug
+ logging filter all 1
+!
+log stderr
+ logging filter all 1
+ logging color 1
+ logging print category 1
+ logging timestamp 1
+ logging print extended-timestamp 1
+ logging print file 1
+ logging level all everything
+!
+line vty
+ no login
+ bind 0.0.0.0
+!
+gbproxy
+ sgsn nsei 101
+ns
+ nse 101 nsvci 101
+ nse 101 remote-role sgsn
+ nse 101 encapsulation udp
+ nse 101 remote-ip 172.18.24.103
+ nse 101 remote-port 23000
+ timer tns-block 3
+ timer tns-block-retries 3
+ timer tns-reset 3
+ timer tns-reset-retries 3
+ timer tns-test 30
+ timer tns-alive 3
+ timer tns-alive-retries 10
+ encapsulation udp local-ip 172.18.24.10
+ encapsulation udp local-port 23000
+ encapsulation framerelay-gre enabled 0