pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40114?usp=email )
Change subject: hnbgw: Support configuring RAC and Cell ID on each hnb conn ......................................................................
hnbgw: Support configuring RAC and Cell ID on each hnb conn
Change-Id: I490e770be5e390a1f55e1dff1cf0c42e917a8d33 --- M hnbgw/ConnHdlr.ttcn M hnbgw/HNBGW_Tests.ttcn 2 files changed, 30 insertions(+), 12 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved
diff --git a/hnbgw/ConnHdlr.ttcn b/hnbgw/ConnHdlr.ttcn index efba060..d722b60 100644 --- a/hnbgw/ConnHdlr.ttcn +++ b/hnbgw/ConnHdlr.ttcn @@ -227,7 +227,9 @@
type record HnbConfig { LocationAreaIdentification lai, - integer sac + uint8_t rac, + integer sac, + integer cell_id }
type record TestHdlrParams { @@ -479,7 +481,7 @@ } var template RANAP_PDU ret; if (pars.ps_domain) { - var RANAP_IEs.RAC rac := '00'O; + var RANAP_IEs.RAC rac := int2oct(pars.hnb.rac, 1); ret := ts_RANAP_initialUE_PS(lai, rac, sai, nas, pars.sigc_id, grnc_id); } else { ret := ts_RANAP_initialUE_CS(lai, sai, nas, pars.sigc_id, grnc_id); diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index 33800f3..c223ef7 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -501,7 +501,9 @@ mcc_mnc := '00F110'H, lac := 2342 + i }, - sac := 55 + rac := 11 + i, + sac := 55, + cell_id := 1 + i }; f_init_hnodeb(testcasename(), i, rua_ops); } @@ -562,10 +564,24 @@ /* helper function to start all of the simulated hNodeBs */ function f_start_hnbs() runs on test_CT { for (var integer i:= 0; i < g_num_hnbs; i := i+1) { - f_hnbap_hnb_register(i, i); + f_hnbap_hnb_register(i); } }
+private function f_hnb_ctr_prefix(HnbConfig hnb_cfg) return charstring +{ + var GsmMcc mcc; + var GsmMnc mnc; + f_dec_mcc_mnc(hex2oct(hnb_cfg.lai.mcc_mnc), mcc, mnc); + return mp_statsd_prefix & "hnb." & + hex2str(mcc) & "-" & + hex2str(mnc) & "-" & + "L" & int2str(hnb_cfg.lai.lac) & "-" & + "R" & int2str(hnb_cfg.rac) & "-" & + "S" & int2str(hnb_cfg.sac) & "-" & + "C" & int2str(hnb_cfg.cell_id) & "."; +} + /*********************************************************************** * code running in test_CT, preparing start of per-UE ConnHdlr ***********************************************************************/ @@ -668,15 +684,15 @@ ***********************************************************************/
-function f_hnbap_hnb_register(integer hnb_idx := 0, integer cell_id := 0, boolean expect_reject := false) runs on test_CT +function f_hnbap_hnb_register(integer hnb_idx := 0, boolean expect_reject := false) runs on test_CT { timer T := 2.0;
HNBAP[hnb_idx].send(ts_HNBAP_HNBRegisterRequest(char2oct("TTCN3-HNB-" & int2str(hnb_idx)), hex2oct(g_hnb_cfg[hnb_idx].lai.mcc_mnc), - int2bit(1 + cell_id, 28), + int2bit(g_hnb_cfg[hnb_idx].cell_id, 28), int2oct(g_hnb_cfg[hnb_idx].lai.lac, 2), - int2oct(0, 1), + int2oct(g_hnb_cfg[hnb_idx].rac, 1), int2oct(g_hnb_cfg[hnb_idx].sac, 2)));
T.start; @@ -753,7 +769,7 @@ * but from different IP address (underlaying link): */ g_hnb_cfg[1] := g_hnb_cfg[0]; f_hnbap_hnb_register(0); - f_hnbap_hnb_register(1, 0, expect_reject := true); + f_hnbap_hnb_register(1, expect_reject := true);
f_verify_talloc_count(HNBGWVTY, {"struct hnb_context"}, expect_count := 1);
@@ -1056,7 +1072,7 @@ }
private function f_tc_rab_assignment(charstring id) runs on ConnHdlr { - const charstring hnb0_ctr_prefix := mp_statsd_prefix & "hnb.001-01-L2342-R0-S55-C1."; + var charstring hnb0_ctr_prefix := f_hnb_ctr_prefix(g_pars.hnb); var MgcpCommand mgcp_cmd; var RANAP_PDU tx;
@@ -1100,7 +1116,7 @@ * Stats are removed since it's difficult to count with several conns concurrently doing stuff. */ private function f_tc_rab_assignment_concurrent(charstring id) runs on ConnHdlr { - const charstring hnb0_ctr_prefix := mp_statsd_prefix & "hnb.001-01-L2342-R0-S55-C1."; + var charstring hnb0_ctr_prefix := f_hnb_ctr_prefix(g_pars.hnb); var MgcpCommand mgcp_cmd; var RANAP_PDU tx;
@@ -1134,7 +1150,7 @@ }
friend function f_tc_rab_assign_fail(charstring id) runs on ConnHdlr { - const charstring hnb0_ctr_prefix := mp_statsd_prefix & "hnb.001-01-L2342-R0-S55-C1."; + var charstring hnb0_ctr_prefix := f_hnb_ctr_prefix(g_pars.hnb); var MgcpCommand mgcp_cmd; var RANAP_PDU tx; timer T := 5.0; @@ -1188,7 +1204,7 @@ }
friend function f_tc_rab_release(charstring id) runs on ConnHdlr { - const charstring hnb0_ctr_prefix := "TTCN3.hnb.001-01-L2342-R0-S55-C1."; + var charstring hnb0_ctr_prefix := f_hnb_ctr_prefix(g_pars.hnb); var MgcpCommand mgcp_cmd; var RANAP_PDU tx; timer T := 15.0;