aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2024-07-23 19:57:21 +0200
committerpespin <pespin@sysmocom.de>2024-07-24 15:13:10 +0000
commit594e021b9b699600a2f89a16676b05446a64fbdc (patch)
treeb7819cb0be38763476c4cdd2f1171717aa1fc6e6
parentd06997537c5c93fd2624fd83b56f7b3ee0259217 (diff)
ttcn3-sgsn: Use 2nd IP address on emulated HNBGW
In 3G, both HNBGW and GGSN talk GTPv1U, and osmo-sgsn uses Direct Tunnel feature to connect both together. Since GTPv1U uses a fixed port, we need 2 IP addresses, one set for the emulated GGSN and one for the emulated HNBGW. This is a preparation towards adding tests validating creation of PDP context in 3G, which was not yet tested. Related: SYS#5435 Change-Id: I21882dc5a9f5167ac9104d4ac48d5e5631505463
-rwxr-xr-xttcn3-sgsn-test/jenkins.sh7
-rw-r--r--ttcn3-sgsn-test/osmo-stp.cfg4
-rwxr-xr-xttcn3-sgsn-test/ttcn3.sh16
3 files changed, 24 insertions, 3 deletions
diff --git a/ttcn3-sgsn-test/jenkins.sh b/ttcn3-sgsn-test/jenkins.sh
index e1f40f6..b047d80 100755
--- a/ttcn3-sgsn-test/jenkins.sh
+++ b/ttcn3-sgsn-test/jenkins.sh
@@ -11,6 +11,7 @@ set_clean_up_trap
set -e
mkdir $VOL_BASE_DIR/sgsn-tester
+cp "ttcn3.sh" "$VOL_BASE_DIR/sgsn-tester/"
cp SGSN_Tests.cfg $VOL_BASE_DIR/sgsn-tester/
write_mp_osmo_repo "$VOL_BASE_DIR/sgsn-tester/SGSN_Tests.cfg"
@@ -24,6 +25,7 @@ mkdir $VOL_BASE_DIR/unix
network_create
network_replace_subnet_in_configs
+TTCN3_RAN_IPADDR="$SUB4_PREFIX.$SUBNET.104"
echo Starting container with STP
docker run --rm \
@@ -46,12 +48,15 @@ docker run --rm \
echo Starting container with SGSN testsuite
docker run --rm \
+ --cap-add=NET_ADMIN \
$(docker_network_params $SUBNET 103) \
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
-e "OSMO_SUT_HOST=$SUB4_PREFIX.$SUBNET.10" \
-e "OSMO_SUT_PORT=4245" \
+ -e "EXTRA_IPADDR=${TTCN3_RAN_IPADDR}" \
-v $VOL_BASE_DIR/sgsn-tester:/data \
--name ${BUILD_TAG}-ttcn3-sgsn-test \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-sgsn-test
+ $REPO_USER/ttcn3-sgsn-test \
+ /data/ttcn3.sh
diff --git a/ttcn3-sgsn-test/osmo-stp.cfg b/ttcn3-sgsn-test/osmo-stp.cfg
index f1b6f49..3a7d0ab 100644
--- a/ttcn3-sgsn-test/osmo-stp.cfg
+++ b/ttcn3-sgsn-test/osmo-stp.cfg
@@ -22,8 +22,8 @@ cs7 instance 0
asp virt-rnc0-0 23908 2905 m3ua
local-ip 172.18.8.200
local-ip fd02:db8:8::200
- remote-ip 172.18.8.103
- remote-ip fd02:db8:8::103
+ remote-ip 172.18.8.104
+ remote-ip fd02:db8:8::104
role sg
sctp-role server
as virt-rnc0 m3ua
diff --git a/ttcn3-sgsn-test/ttcn3.sh b/ttcn3-sgsn-test/ttcn3.sh
new file mode 100755
index 0000000..9100bfa
--- /dev/null
+++ b/ttcn3-sgsn-test/ttcn3.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set +e
+set -x
+
+if [[ -z "${EXTRA_IPADDR}" ]]; then
+ echo "env var EXTRA_IPADDR undefined!"
+ exit 1
+fi
+
+ip addr add "${EXTRA_IPADDR}" dev eth0
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=782042
+# IPv6 addresses may take an extra while to be available ('tentative' state):
+while [ -n "$(ip -6 addr show tentative)" ]; do sleep 1; done
+
+ttcn3-docker-run sgsn SGSN_Tests