pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/docker-playground/+/35994?usp=email )
Change subject: ttcn3-epdg: Use new 'pre-create tundev' feature from gtp_u_kmod
......................................................................
ttcn3-epdg: Use new 'pre-create tundev' feature from gtp_u_kmod
This way osmo-epdg doesn't need to create the gtp tun device, and it can
be pre-created and configured by other tools, like gtp-link from
libgtpnl.git.
Change-Id: Ie7e2b4fadef69c889b12792fc2b8050f1ef5c684
---
M osmo-epdg-master/Dockerfile
M ttcn3-epdg-test/jenkins.sh
M ttcn3-epdg-test/osmo-epdg.config
A ttcn3-epdg-test/osmo-epdg.sh
4 files changed, 47 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/94/35994/1
diff --git a/osmo-epdg-master/Dockerfile b/osmo-epdg-master/Dockerfile
index a5e9b14..a73279b 100644
--- a/osmo-epdg-master/Dockerfile
+++ b/osmo-epdg-master/Dockerfile
@@ -4,6 +4,15 @@
# Arguments used after FROM must be specified again
ARG DISTRO
+# $distro-erlang switched to user build, but we need to install more stuff beforehand:
+USER root
+RUN apt-get update && \
+ apt-get install -y --no-install-recommends \
+ iproute2 \
+ libgtpnl-tools && \
+ apt-get clean
+USER build
+
WORKDIR /tmp
ARG OSMO_EPDG_BRANCH="master"
diff --git a/ttcn3-epdg-test/jenkins.sh b/ttcn3-epdg-test/jenkins.sh
index eb596dc..0241be0 100755
--- a/ttcn3-epdg-test/jenkins.sh
+++ b/ttcn3-epdg-test/jenkins.sh
@@ -15,6 +15,7 @@
mkdir $VOL_BASE_DIR/epdg
cp osmo-epdg.config $VOL_BASE_DIR/epdg/
+cp osmo-epdg.sh $VOL_BASE_DIR/epdg/
network_create
network_replace_subnet_in_configs
@@ -29,7 +30,11 @@
-v $VOL_BASE_DIR/epdg:/data \
--name ${BUILD_TAG}-epdg -d \
$DOCKER_ARGS \
- $REPO_USER/osmo-epdg-$IMAGE_SUFFIX
+ $REPO_USER/osmo-epdg-$IMAGE_SUFFIX \
+ /bin/sh -c "/data/osmo-epdg.sh >/data/osmo-epdg.log 2>&1"
+
+# Give some time to osmo-epdg to be fully started; it's a bit slow...
+sleep 2
echo Starting container with EPDG testsuite
docker run --rm \
diff --git a/ttcn3-epdg-test/osmo-epdg.config b/ttcn3-epdg-test/osmo-epdg.config
index 6c65172..abcd864 100644
--- a/ttcn3-epdg-test/osmo-epdg.config
+++ b/ttcn3-epdg-test/osmo-epdg.config
@@ -43,12 +43,14 @@
%% gtp_u_kmod config
%% ===========================================
{gtp_u_kmod, [
- {sockets, [{grx, [%% ip: IP Address assigned at the tunnel:
- {ip, {172,18,10,20}},
- %% Allow binding to an IP address that is nonlocal or does not
(yet) exist (IP_FREEBIND):
- freebind,
- % Create gtp tundev with role SGSN:
- {role, sgsn}
+ %% gtp0: Iface name, also used to identify the process handling the tunnel.
+ {sockets, [{gtp0, [{create_mode, nocreate},
+ %% ip: IP Address assigned at the tunnel:
+ {ip, {172,18,10,20}},
+ %% Allow binding to an IP address that is nonlocal or does not
(yet) exist (IP_FREEBIND):
+ freebind,
+ % Create gtp tundev with role SGSN:
+ {role, sgsn}
]
}]
}
diff --git a/ttcn3-epdg-test/osmo-epdg.sh b/ttcn3-epdg-test/osmo-epdg.sh
new file mode 100755
index 0000000..2b58ff9
--- /dev/null
+++ b/ttcn3-epdg-test/osmo-epdg.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+set +e
+set -x
+
+gtp-link add gtp0 &
+MYPID=$!
+echo "gtp-link pid ${MYPID}"
+sleep 1
+kill ${MYPID}
+
+ERL_FLAGS='-config /data/osmo-epdg.config'
/tmp/osmo-epdg/_build/default/bin/osmo-epdg
--
To view, visit
https://gerrit.osmocom.org/c/docker-playground/+/35994?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: Ie7e2b4fadef69c889b12792fc2b8050f1ef5c684
Gerrit-Change-Number: 35994
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange