pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37905?usp=email )
Change subject: s1gw: Add mp_enb_bind_ip module parameter ......................................................................
s1gw: Add mp_enb_bind_ip module parameter
This allows more easily understanding pcap traces by looking at the config file to identify the ip addresses.
Change-Id: I294b14e6ef119c17eec22f813d5755279560e0bc --- M s1gw/ConnHdlr.ttcn M s1gw/S1GW_Tests.cfg M s1gw/S1GW_Tests.ttcn 3 files changed, 8 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/37905/1
diff --git a/s1gw/ConnHdlr.ttcn b/s1gw/ConnHdlr.ttcn index 69c19b6..cd327ef 100644 --- a/s1gw/ConnHdlr.ttcn +++ b/s1gw/ConnHdlr.ttcn @@ -58,7 +58,7 @@
type function void_fn(ConnHdlrPars pars) runs on ConnHdlr;
-function f_ConnHdlr_connect(charstring remote_addr) runs on ConnHdlr { +function f_ConnHdlr_connect(charstring local_addr, charstring remote_addr) runs on ConnHdlr { var Result res; timer T;
@@ -67,7 +67,7 @@ /* initiate SCTP connection establishment */ res := S1AP_CodecPort_CtrlFunct.f_IPL4_connect(S1AP_ENB, remote_addr, 36412, - "0.0.0.0", 0, -1, + local_addr, 0, -1, { sctp := c_SctpTuple_S1AP }); if (not ispresent(res.connId)) { setverdict(fail, "Could not create an S1AP socket, check your configuration"); diff --git a/s1gw/S1GW_Tests.cfg b/s1gw/S1GW_Tests.cfg index 536f0ec..7e10c5c 100644 --- a/s1gw/S1GW_Tests.cfg +++ b/s1gw/S1GW_Tests.cfg @@ -13,6 +13,7 @@ [MODULE_PARAMETERS] S1GW_Tests.mp_s1gw_enb_ip := "127.0.1.1"; S1GW_Tests.mp_s1gw_mme_ip := "127.0.2.1"; +S1GW_Tests.mp_enb_bind_ip := "127.0.2.20"; S1GW_Tests.mp_mme_bind_ip := "127.0.2.10";
[MAIN_CONTROLLER] diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn index 2625799..d766ed1 100644 --- a/s1gw/S1GW_Tests.ttcn +++ b/s1gw/S1GW_Tests.ttcn @@ -35,6 +35,7 @@ modulepar { charstring mp_s1gw_enb_ip; /* eNB facing address of the S1GW */ charstring mp_s1gw_mme_ip; /* MME facing address of the S1GW */ + charstring mp_enb_bind_ip; /* eNB address to use locally when connecting to S1GW */ charstring mp_mme_bind_ip; /* MME address on which we get connections from S1GW */ }
@@ -81,7 +82,7 @@ function f_TC_setup(ConnHdlrPars pars) runs on ConnHdlr { f_ConnHdlr_register(pars.genb_id);
- f_ConnHdlr_connect(mp_s1gw_enb_ip); + f_ConnHdlr_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); f_ConnHdlr_setup(pars.genb_id); f_sleep(0.5); /* keep the connection idle for some time */ f_ConnHdlr_disconnect(); @@ -120,7 +121,7 @@ function f_TC_conn_term_by_mme(ConnHdlrPars pars) runs on ConnHdlr { f_ConnHdlr_register(pars.genb_id);
- f_ConnHdlr_connect(mp_s1gw_enb_ip); + f_ConnHdlr_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); f_ConnHdlr_setup(pars.genb_id); f_sleep(0.5); /* keep the connection idle for some time */
@@ -146,7 +147,7 @@ /* MME is not available, expect S1GW to terminate the eNB connection */ function f_TC_conn_term_mme_unavail(ConnHdlrPars pars) runs on ConnHdlr { /* establish an eNB connection to the S1GW */ - f_ConnHdlr_connect(mp_s1gw_enb_ip); + f_ConnHdlr_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); /* expect our eNB connection to be released gracefully */ f_ConnHdlr_expect_shutdown(); setverdict(pass); @@ -170,7 +171,7 @@ var S1AP_PDU pdu;
f_ConnHdlr_register(pars.genb_id); - f_ConnHdlr_connect(mp_s1gw_enb_ip); + f_ConnHdlr_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); f_ConnHdlr_setup(pars.genb_id);
log("eNB -> [S1GW] -> MME: E-RAB SETUP REQUEST");