fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/docker-playground/+/37256?usp=email )
Change subject: ttcn3-s1gw-test: run eNB/MME domains in separate networks
......................................................................
ttcn3-s1gw-test: run eNB/MME domains in separate networks
The idea is to simulate more realistic conditions for the IUT by
creating two virtual network interfaces in each container:
one for the eNB (A) and one for the MME (B) domains.
(network A) | (network B)
|
+-------------+
| osmo-s1gw |
+-------------+
+----------------> | | <---------------+
| | | |
| +--------------> | | <-------------+ |
| | +-------------+ | |
| | | | |
==|=|=======================|======================|=|==
| | | +-----------+ | |
| | +-------------+ | | | | |
| +-> | ConnHdlr(1) | <-------> | | <--| |
| +-------------+ | | | |
| | | S1APSRV | |
| +-------------+ | | | |
|---> | ConnHdlr(N) | <-------> | | <----+
+-------------+ | | |
| +-----------+
|
This is achieved by passing multiple --network arguments to the
docker-run command. Sadly, we cannot use docker_network_params
more than once, because docker does not understand multiple
--ip / --ip6 arguments (using the most recent one).
Furthermore, we cannot use network_replace_subnet_in_configs
because it replaces subnet in all IP addresses, so we put %VAR%s
to the config files and replace them using sed manually.
Change-Id: I4c72cb58eeb2d0ccca307dcfcfb04d09bfb0834e
Related: SYS#6772
---
M ttcn3-s1gw-test/S1GW_Tests.cfg
M ttcn3-s1gw-test/jenkins.sh
M ttcn3-s1gw-test/osmo-s1gw.config
3 files changed, 75 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/56/37256/1
diff --git a/ttcn3-s1gw-test/S1GW_Tests.cfg b/ttcn3-s1gw-test/S1GW_Tests.cfg
index a81c95e..dadc393 100644
--- a/ttcn3-s1gw-test/S1GW_Tests.cfg
+++ b/ttcn3-s1gw-test/S1GW_Tests.cfg
@@ -7,9 +7,10 @@
[TESTPORT_PARAMETERS]
[MODULE_PARAMETERS]
-S1GW_Tests.mp_s1gw_enb_ip := "172.18.10.200";
-S1GW_Tests.mp_s1gw_mme_ip := "172.18.10.100";
-S1GW_Tests.mp_mme_bind_ip := "172.18.10.101";
+# %VAR%s are replaced by jenkins.sh
+S1GW_Tests.mp_s1gw_enb_ip := "%ENBNET%.2";
+S1GW_Tests.mp_s1gw_mme_ip := "%MMENET%.2";
+S1GW_Tests.mp_mme_bind_ip := "%MMENET%.3";
[MAIN_CONTROLLER]
diff --git a/ttcn3-s1gw-test/jenkins.sh b/ttcn3-s1gw-test/jenkins.sh
index 9fcf5f1..dbc3347 100755
--- a/ttcn3-s1gw-test/jenkins.sh
+++ b/ttcn3-s1gw-test/jenkins.sh
@@ -16,13 +16,29 @@
mkdir $VOL_BASE_DIR/s1gw
cp osmo-s1gw.config $VOL_BASE_DIR/s1gw/
+# create the eNB network
network_create
-network_replace_subnet_in_configs
+ENB_SUBNET=$SUBNET
+ENB_NET_NAME=$NET_NAME
+
+# create the MME network
+network_create
+MME_SUBNET=$SUBNET
+MME_NET_NAME=$NET_NAME
+
+# manually replace %VAR%s (subnet) in configs
+sed -i -e "s/%ENBNET%/172.18.$ENB_SUBNET/g" \
+ -e "s/%MMENET%/172.18.$MME_SUBNET/g" \
+ "$VOL_BASE_DIR/s1gw-tester/S1GW_Tests.cfg" \
+ "$VOL_BASE_DIR/s1gw/osmo-s1gw.config"
echo "Starting container with osmo-s1gw"
+# veth1 is assigned 172.18.$ENB_SUBNET.2 by docker
+# veth2 is assigned 172.18.$MME_SUBNET.2 by docker
docker run --rm \
- $(docker_network_params $SUBNET 100) \
--ulimit core=-1 \
+ --network $ENB_NET_NAME \
+ --network $MME_NET_NAME \
-v $VOL_BASE_DIR/s1gw:/data \
--name ${BUILD_TAG}-s1gw -d \
$DOCKER_ARGS \
@@ -32,9 +48,12 @@
sleep 2
echo "Starting container with the S1GW testsuite"
+# veth1 is assigned 172.18.$ENB_SUBNET.3 by docker
+# veth2 is assigned 172.18.$MME_SUBNET.3 by docker
docker run --rm \
- $(docker_network_params $SUBNET 101) \
--ulimit core=-1 \
+ --network $ENB_NET_NAME \
+ --network $MME_NET_NAME \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/s1gw-tester:/data \
--name ${BUILD_TAG}-ttcn3-s1gw-test \
diff --git a/ttcn3-s1gw-test/osmo-s1gw.config b/ttcn3-s1gw-test/osmo-s1gw.config
index 13b5058..0d58d9a 100644
--- a/ttcn3-s1gw-test/osmo-s1gw.config
+++ b/ttcn3-s1gw-test/osmo-s1gw.config
@@ -11,9 +11,10 @@
%% +----------------+ +-----------------+
%% ================================================================================
{osmo_s1gw,
- [{s1gw_bind_addr, "172.18.10.200"}, %% S1GW bind address for incoming eNB
connections
- {mme_loc_addr, "172.18.10.100"}, %% local address for outgoing connections
to the MME
- {mme_rem_addr, "172.18.10.101"} %% remote address for outgoing connections
to the MME
+ %% %VAR%s are replaced by jenkins.sh
+ [{s1gw_bind_addr, "%ENBNET%.2"}, %% S1GW bind address for incoming eNB
connections
+ {mme_loc_addr, "%MMENET%.2"}, %% local address for outgoing connections to
the MME
+ {mme_rem_addr, "%MMENET%.3"} %% remote address for outgoing connections to
the MME
]},
%% ================================================================================
%% kernel config
--
To view, visit
https://gerrit.osmocom.org/c/docker-playground/+/37256?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: I4c72cb58eeb2d0ccca307dcfcfb04d09bfb0834e
Gerrit-Change-Number: 37256
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange