bsc: Add CommonID Test: Send CommonID from MSC and check it is processed
Related: OS#2969
Change-Id: I501108bc6c19b17d3fc680211c7290a31770a159
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 84f8eaf..9cb15f2 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -2777,6 +2777,33 @@
vc_conn.done;
}
+/* Send a CommonID from the simulated MSC and verify that the information is used to
+ * fill BSC-internal data structures (specifically, bsc_subscr associated with subscr_conn) */
+private function f_tc_common_id(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ f_MscConnHdlr_init_vty();
+
+ f_create_chan_and_exp();
+ /* we should now have a COMPL_L3 at the MSC */
+ BSSAP.receive(tr_BSSMAP_ComplL3);
+
+ /* Send CommonID */
+ BSSAP.send(ts_BSSMAP_CommonId(g_pars.imsi));
+
+ /* Use VTY to verify that the IMSI of the subscr_conn is set */
+ var charstring regex := "*(IMSI: " & hex2str(g_pars.imsi) & ")*";
+ f_vty_transceive_match_regexp_retry(BSCVTY, "show conns", regex, 0, 4, 1.0);
+
+ setverdict(pass);
+}
+testcase TC_common_id() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ vc_conn := f_start_handler(refers(f_tc_common_id));
+ vc_conn.done;
+}
+
private function f_est_single_l3(template PDU_ML3_MS_NW l3) runs on MSC_ConnHdlr {
g_pars := f_gen_test_hdlr_pars();
f_create_chan_and_exp();
@@ -5206,6 +5233,7 @@
execute( TC_oml_unknown_unit_id() );
execute( TC_classmark() );
+ execute( TC_common_id() );
execute( TC_unsol_ass_fail() );
execute( TC_unsol_ass_compl() );
execute( TC_unsol_ho_fail() );
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 0d4c81b..7d8fce1 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -431,9 +431,7 @@
var boolean g_vty_initialized := false;
}
-/* initialize all parameters */
-function f_MscConnHdlr_init(integer i, HostName bts, HostName mgw, BSSMAP_FIELD_CodecType codecType) runs on MSC_ConnHdlr {
- f_MediaState_init(g_media, i, bts, mgw, codecType);
+function f_MscConnHdlr_init_vty() runs on MSC_ConnHdlr {
if (not g_vty_initialized) {
map(self:BSCVTY, system:BSCVTY);
f_vty_set_prompts(BSCVTY);
@@ -442,6 +440,12 @@
}
}
+/* initialize all parameters */
+function f_MscConnHdlr_init(integer i, HostName bts, HostName mgw, BSSMAP_FIELD_CodecType codecType) runs on MSC_ConnHdlr {
+ f_MediaState_init(g_media, i, bts, mgw, codecType);
+ f_MscConnHdlr_init_vty();
+}
+
private function get_next_trans_id() runs on MSC_ConnHdlr return MgcpTransId {
var MgcpTransId tid := int2str(g_trans_id);
g_trans_id := g_trans_id + 1;