fixeria has uploaded this change for review.

View Change

ttcn3-pgw-test: configure the 'ogstun' device for open5gs-upfd

Unlike osmo-ggsn, open5gs-upfd does not configure the tun interface
itself. All IPv4/IPv6 addresses must be assigned manually. This
is exactly why both PGW_Tests.TC_createSession_ping4[_256] fail:

[sock] ERROR: ogs_write() failed (5:Input/outputerror) (../lib/tun/tunio.c:84)
[upf] WARNING: ogs_tun_write() failed (../src/upf/gtp-path.c:448)

Take Harald's setup.sh from open5gs-master and execute it in the
container running open5gs-upfd. This makes both test cases pass.

Change-Id: I0730b1f69285484a0aa0ebd664dafd8e476b294f
Related: SYS#5602
---
M ttcn3-pgw-test/jenkins.sh
A ttcn3-pgw-test/ogstun-setup.sh
2 files changed, 14 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/56/27056/1
diff --git a/ttcn3-pgw-test/jenkins.sh b/ttcn3-pgw-test/jenkins.sh
index 662e49b..bd6967c 100755
--- a/ttcn3-pgw-test/jenkins.sh
+++ b/ttcn3-pgw-test/jenkins.sh
@@ -16,6 +16,7 @@
mkdir $VOL_BASE_DIR/pgw
cp freeDiameter-smf.conf $VOL_BASE_DIR/pgw/
cp open5gs-*.yaml $VOL_BASE_DIR/pgw/
+cp ogstun-setup.sh $VOL_BASE_DIR/pgw/

SUBNET=18
network_create $SUBNET
@@ -43,6 +44,9 @@
$REPO_USER/open5gs-$IMAGE_SUFFIX \
open5gs-upfd -c /data/open5gs-upf.yaml

+# configure the 'ogstun' device for open5gs-upfd
+docker exec ${BUILD_TAG}-upf /data/ogstun-setup.sh
+
# start container with open5gs-smfd in background
docker run --cap-add=NET_ADMIN \
--device /dev/net/tun:/dev/net/tun \
diff --git a/ttcn3-pgw-test/ogstun-setup.sh b/ttcn3-pgw-test/ogstun-setup.sh
new file mode 100755
index 0000000..58693fd
--- /dev/null
+++ b/ttcn3-pgw-test/ogstun-setup.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if ! grep "ogstun" /proc/net/dev > /dev/null; then
+ ip tuntap add name ogstun mode tun
+fi
+ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
+ip addr add 10.45.0.1/16 dev ogstun
+ip addr del cafe::1/64 dev ogstun 2> /dev/null
+ip addr add cafe::1/64 dev ogstun
+ip link set ogstun up

To view, visit change 27056. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I0730b1f69285484a0aa0ebd664dafd8e476b294f
Gerrit-Change-Number: 27056
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange