MSC_Tests: Allow test cases to specify RAN index

This allows to start ConnHdlr on specific RAN connections, i.e.
on different emulated BSCs (and soon RNCs).

Change-Id: I3d7ec567a7b69d8c6f79d26971bf1c94e077d5f5
This commit is contained in:
Harald Welte 2019-04-21 13:07:17 +02:00
parent a89fecf08c
commit f9abf8d26c
2 changed files with 12 additions and 9 deletions

View File

@ -74,7 +74,8 @@ type record BSC_ConnHdlrPars {
boolean ipa_ctrl_enable, boolean ipa_ctrl_enable,
boolean mm_info, boolean mm_info,
boolean sgsap_enable, boolean sgsap_enable,
boolean gsup_enable boolean gsup_enable,
integer ran_idx
}; };
/* get a one-octet bitmaks of supported algorithms based on Classmark information */ /* get a one-octet bitmaks of supported algorithms based on Classmark information */

View File

@ -485,7 +485,8 @@ modifies ts_BSSAP_BSSMAP := {
type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr;
/* FIXME: move into BSC_ConnectionHandler? */ /* FIXME: move into BSC_ConnectionHandler? */
function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true) runs on MTC_CT return BSC_ConnHdlrPars { function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true, integer ran_idx := 0)
runs on MTC_CT return BSC_ConnHdlrPars {
var BSC_ConnHdlrNetworkPars net_pars := { var BSC_ConnHdlrNetworkPars net_pars := {
kc_support := '0A'O, /* A5/1 and A5/3 enabled */ kc_support := '0A'O, /* A5/1 and A5/3 enabled */
expect_tmsi := true, expect_tmsi := true,
@ -493,8 +494,8 @@ function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup :
expect_ciph := false expect_ciph := false
}; };
var BSC_ConnHdlrPars pars := { var BSC_ConnHdlrPars pars := {
sccp_addr_own := g_bssap[0].sccp_addr_own, sccp_addr_own := g_bssap[ran_idx].sccp_addr_own,
sccp_addr_peer := g_bssap[0].sccp_addr_peer, sccp_addr_peer := g_bssap[ran_idx].sccp_addr_peer,
cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 23, 42)), cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 23, 42)),
imei := f_gen_imei(imsi_suffix), imei := f_gen_imei(imsi_suffix),
imsi := f_gen_imsi(imsi_suffix), imsi := f_gen_imsi(imsi_suffix),
@ -511,7 +512,8 @@ function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup :
ipa_ctrl_enable := true, ipa_ctrl_enable := true,
mm_info := mp_mm_info, mm_info := mp_mm_info,
sgsap_enable := sgsap, sgsap_enable := sgsap,
gsup_enable := gsup gsup_enable := gsup,
ran_idx := ran_idx
}; };
return pars; return pars;
} }
@ -522,8 +524,8 @@ function f_start_handler_with_pars(void_fn fn, BSC_ConnHdlrPars pars) runs on MT
vc_conn := BSC_ConnHdlr.create(id); vc_conn := BSC_ConnHdlr.create(id);
/* BSSMAP part / A interface */ /* BSSMAP part / A interface */
connect(vc_conn:BSSAP, g_bssap[0].vc_RAN:CLIENT); connect(vc_conn:BSSAP, g_bssap[pars.ran_idx].vc_RAN:CLIENT);
connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_RAN:PROC); connect(vc_conn:BSSAP_PROC, g_bssap[pars.ran_idx].vc_RAN:PROC);
/* MNCC part */ /* MNCC part */
connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT);
connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC);
@ -550,8 +552,8 @@ function f_start_handler_with_pars(void_fn fn, BSC_ConnHdlrPars pars) runs on MT
return vc_conn; return vc_conn;
} }
function f_start_handler(void_fn fn, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { function f_start_handler(void_fn fn, integer imsi_suffix, integer ran_idx := 0) runs on MTC_CT return BSC_ConnHdlr {
return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix)); return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix, ran_idx := ran_idx));
} }
private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {