aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-03-30 22:47:56 +0200
committerHarald Welte <laforge@osmocom.org>2021-03-30 22:49:53 +0200
commitaf26518c2132c11dacb50ba2ee4d3f85a3477d9c (patch)
tree56b45624af2aa8ecd21301ed72b73755d5eb7793
parent90bf14ed06c9c9e365dfa4a2ad784db781183458 (diff)
WIP: ttcn3-ns-test-frlaforge/ns
l---------ttcn3-ns-test-fr/fr1
l---------ttcn3-ns-test-fr/jenkins.sh1
-rw-r--r--ttcn3-ns-test/fr/NS_Tests.cfg57
-rw-r--r--ttcn3-ns-test/fr/osmo-ns-dummy.cfg55
-rwxr-xr-xttcn3-ns-test/jenkins-fr.sh70
5 files changed, 184 insertions, 0 deletions
diff --git a/ttcn3-ns-test-fr/fr b/ttcn3-ns-test-fr/fr
new file mode 120000
index 0000000..ce2797b
--- /dev/null
+++ b/ttcn3-ns-test-fr/fr
@@ -0,0 +1 @@
+../ttcn3-ns-test/fr \ No newline at end of file
diff --git a/ttcn3-ns-test-fr/jenkins.sh b/ttcn3-ns-test-fr/jenkins.sh
new file mode 120000
index 0000000..19f578b
--- /dev/null
+++ b/ttcn3-ns-test-fr/jenkins.sh
@@ -0,0 +1 @@
+../ttcn3-ns-test/jenkins-fr.sh \ No newline at end of file
diff --git a/ttcn3-ns-test/fr/NS_Tests.cfg b/ttcn3-ns-test/fr/NS_Tests.cfg
new file mode 100644
index 0000000..91fb5c5
--- /dev/null
+++ b/ttcn3-ns-test/fr/NS_Tests.cfg
@@ -0,0 +1,57 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./NS_Tests.default"
+
+[LOGGING]
+
+[MODULE_PARAMETERS]
+NS_Tests.mp_dialect := NS2_DIALECT_IPACCESS
+NS_Tests.mp_nsconfig := {
+ nsei := 2001,
+ role_sgsn := false,
+ handle_sns := false,
+ nsvc := {
+ {
+ provider := {
+ fr := {
+ netdev := "hdlc1",
+ dlci := 16
+ }
+ },
+ nsvci := 1
+ }, {
+ provider := {
+ fr := {
+ netdev := "hdlc2",
+ dlci := 17
+ }
+ },
+ nsvci := 2
+ }, {
+ provider := {
+ fr := {
+ netdev := "hdlc3",
+ dlci := 18
+ }
+ },
+ nsvci := 3
+ }, {
+ provider := {
+ fr := {
+ netdev := "hdlc4",
+ dlci := 19
+ }
+ },
+ nsvci := 4
+ }
+ }
+}
+
+[TESTPORT_PARAMETERS]
+
+[MAIN_CONTROLLER]
+
+[EXECUTE]
+NS_Tests.control
diff --git a/ttcn3-ns-test/fr/osmo-ns-dummy.cfg b/ttcn3-ns-test/fr/osmo-ns-dummy.cfg
new file mode 100644
index 0000000..0a3515d
--- /dev/null
+++ b/ttcn3-ns-test/fr/osmo-ns-dummy.cfg
@@ -0,0 +1,55 @@
+log gsmtap 172.18.30.10
+ logging level set-all debug
+
+log stderr
+ logging filter all 1
+ logging print level 1
+ logging print category 1
+ logging print category-hex 0
+ logging print file basename last
+ logging print extended-timestamp 1
+ logging level set-all debug
+!
+stats interval 0
+stats reporter statsd
+ prefix TTCN3
+ level subscriber
+ remote-ip 172.18.30.10
+ remote-port 8125
+ flush-period 1
+ mtu 1024
+ enable
+
+line vty
+ no login
+ bind 172.18.30.101
+
+ns
+ bind fr hdlcnet1
+ fr hdlcnet1 frnet
+ bind fr hdlcnet2
+ fr hdlcnet2 frnet
+ bind fr hdlcnet3
+ fr hdlcnet3 frnet
+ bind fr hdlcnet4
+ fr hdlcnet4 frnet
+ bind fr hdlcnet5
+ fr hdlcnet5 frnet
+ bind fr hdlcnet6
+ fr hdlcnet6 frnet
+ bind fr hdlcnet7
+ fr hdlcnet7 frnet
+ bind fr hdlcnet8
+ fr hdlcnet8 frnet
+ nse 2001
+ nsvc fr hdlcnet1 dlci 16 nsvci 1
+ nsvc fr hdlcnet2 dlci 17 nsvci 2
+ nsvc fr hdlcnet3 dlci 18 nsvci 3
+ nsvc fr hdlcnet4 dlci 19 nsvci 4
+ nse 2002
+ nsvc fr hdlcnet5 dlci 20 nsvci 5
+ nsvc fr hdlcnet6 dlci 21 nsvci 6
+ nse 2003
+ nsvc fr hdlcnet7 dlci 22 nsvci 7
+ nsvc fr hdlcnet8 dlci 23 nsvci 8
+
diff --git a/ttcn3-ns-test/jenkins-fr.sh b/ttcn3-ns-test/jenkins-fr.sh
new file mode 100755
index 0000000..fa2917d
--- /dev/null
+++ b/ttcn3-ns-test/jenkins-fr.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# WARNING: This cannot be executed on any random Linux machine or jenkins slave node!
+#
+# We require a kernel with HLDC net-devices, specifically eight pairs of devices named
+# hdlc1 + hdlcnet1 ... hdlc8 + hdclnet8.
+#
+# Those pairs of netdevices can e.g. be implemented by actually physically looping back
+# the related E1 interfaces, or e.g.by using DAHDI_NET + dahdi_dynamic_loc to create
+# pairs of virtual E1 spans.
+#
+# In addition, we need to use 'sudo' permissions in order to move the hdlc
+# net-devices into the docker containers. So in automatic test execution this means
+# that the user will need sudo privileges without entering a password (NOPASS)
+
+. ../jenkins-common.sh
+IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
+docker_images_require \
+ "osmo-ns-$IMAGE_SUFFIX" \
+ "ttcn3-ns-test"
+
+set_clean_up_trap
+set -e
+
+SUBNET=30
+network_create $SUBNET
+
+mkdir $VOL_BASE_DIR/ns-tester
+cp fr/NS_Tests.cfg $VOL_BASE_DIR/ns-tester/
+
+mkdir $VOL_BASE_DIR/ns
+cp fr/osmo-ns-dummy.cfg $VOL_BASE_DIR/ns/
+
+echo Starting container with osmo-ns-dummy
+docker run --rm \
+ $(docker_network_params $SUBNET 101) \
+ --ulimit core=-1 \
+ -v $VOL_BASE_DIR/ns:/data \
+ --name ${BUILD_TAG}-ns -d \
+ $DOCKER_ARGS \
+ $REPO_USER/osmo-ns-$IMAGE_SUFFIX \
+ /bin/sh -c "/usr/local/bin/osmo-ns-dummy -c /data/osmo-ns-dummy.cfg -p 4240 >>/data/osmo-ns-dummy.log 2>&1"
+
+# move all hdlcX net-devices into container
+for i in `seq 1 8`; do
+ DEV="hdlc$i"
+ #sudo sethdlc ${DEV} fr lmi none
+ sudo ./netdev-to-docker.sh ${DEV} ${BUILD_TAG}-ns
+done
+
+echo Starting container with NS testsuite
+docker run --rm \
+ $(docker_network_params $SUBNET 10) \
+ --ulimit core=-1 \
+ -e "TTCN3_PCAP_PATH=/data" \
+ -v $VOL_BASE_DIR/ns-tester:/data \
+ --name ${BUILD_TAG}-ttcn3-ns-test -d \
+ $DOCKER_ARGS \
+ $REPO_USER/ttcn3-ns-test
+
+# move all hdlcnetX net-devices into container
+for i in `seq 1 8`; do
+ DEV="hdlcnet$i"
+ #sudo sethdlc ${DEV} fr lmi none
+ sudo ./netdev-to-docker.sh ${DEV} ${BUILD_TAG}-ttcn3-ns-test
+done
+
+# emulate running container in foreground, which is no longer possible as we
+# must shift the net-devices into the container _after_ it is started
+docker logs -f ${BUILD_TAG}-ttcn3-gbproxy-test