aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2024-06-22 03:50:45 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2024-06-22 03:52:16 +0700
commit9ca9bed0acf4fbf82fa56ada8be7f62cbbc9190d (patch)
tree3c07578eb7dfbe0de9b64c625a1ad77b215da434
parentc9ba646255ee31b93618ae1b358e42d615c69ae0 (diff)
ttcn3-s1gw-test: fix using unassigned addr for osmo-s1gw
The S1GW container gets assigned the primary addr 172.18.10.100/24 by docker_network_params(). The secondary addr 172.18.10.200/24, which is used for eNB connections, needs to be assigned manually. This patch finally makes ttcn3-s1gw-test pass. Change-Id: I109a5feaca5acf050008e883cc8b4e1e28beebab Related: SYS#6772
-rwxr-xr-xttcn3-s1gw-test/jenkins.sh6
-rwxr-xr-xttcn3-s1gw-test/s1gw.sh8
2 files changed, 13 insertions, 1 deletions
diff --git a/ttcn3-s1gw-test/jenkins.sh b/ttcn3-s1gw-test/jenkins.sh
index 9fcf5f1..78a9624 100755
--- a/ttcn3-s1gw-test/jenkins.sh
+++ b/ttcn3-s1gw-test/jenkins.sh
@@ -14,6 +14,7 @@ cp S1GW_Tests.cfg $VOL_BASE_DIR/s1gw-tester/
write_mp_osmo_repo "$VOL_BASE_DIR/s1gw-tester/S1GW_Tests.cfg"
mkdir $VOL_BASE_DIR/s1gw
+cp s1gw.sh $VOL_BASE_DIR/s1gw/
cp osmo-s1gw.config $VOL_BASE_DIR/s1gw/
network_create
@@ -23,10 +24,13 @@ echo "Starting container with osmo-s1gw"
docker run --rm \
$(docker_network_params $SUBNET 100) \
--ulimit core=-1 \
+ --cap-add=NET_ADMIN \
+ -e "ERL_FLAGS=-config /data/osmo-s1gw.config" \
-v $VOL_BASE_DIR/s1gw:/data \
--name ${BUILD_TAG}-s1gw -d \
$DOCKER_ARGS \
- $REPO_USER/osmo-s1gw-$IMAGE_SUFFIX
+ $REPO_USER/osmo-s1gw-$IMAGE_SUFFIX \
+ /bin/sh -c "/data/s1gw.sh > /data/osmo-s1gw.log 2>&1"
# Give some time to osmo-s1gw to be fully started; it's a bit slow...
sleep 2
diff --git a/ttcn3-s1gw-test/s1gw.sh b/ttcn3-s1gw-test/s1gw.sh
new file mode 100755
index 0000000..e212aa2
--- /dev/null
+++ b/ttcn3-s1gw-test/s1gw.sh
@@ -0,0 +1,8 @@
+#!/bin/sh -ex
+
+# the subnet prefix is to be modified by network_replace_subnet_in_configs()
+ip addr add 172.18.10.100/24 dev eth0 || true # primary address already set by docker_network_params()
+ip addr add 172.18.10.200/24 dev eth0 # secondary address for eNB -> S1GW connections
+
+# drop the root privileges and finally start osmo-s1gw
+su build -c "/tmp/osmo-s1gw/_build/default/bin/osmo-s1gw"