Change in osmo-ttcn3-hacks[master]: bsc: Add CommonID Test: Send CommonID from MSC and check it is processed

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Jun 23 20:08:58 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18945 )

Change subject: bsc: Add CommonID Test: Send CommonID from MSC and check it is processed
......................................................................

bsc: Add CommonID Test: Send CommonID from MSC and check it is processed

Related: OS#2969
Change-Id: I501108bc6c19b17d3fc680211c7290a31770a159
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
M library/BSSMAP_Templates.ttcn
3 files changed, 60 insertions(+), 3 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



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;
diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn
index 406dfc5..776e8be 100644
--- a/library/BSSMAP_Templates.ttcn
+++ b/library/BSSMAP_Templates.ttcn
@@ -1599,6 +1599,31 @@
 	}
 }
 
+template PDU_BSSAP ts_BSSMAP_CommonId(hexstring imsi_digits)
+modifies ts_BSSAP_BSSMAP := {
+	pdu := {
+		bssmap := {
+			commonID := {
+				messageType := '2F'O,
+				iMSI := ts_BSSMAP_Imsi(imsi_digits),
+				sNAAccessInformation := omit
+			}
+		}
+	}
+}
+
+template PDU_BSSAP tr_BSSMAP_CommonId(template hexstring imsi_digits)
+modifies tr_BSSAP_BSSMAP := {
+	pdu := {
+		bssmap := {
+			commonID := {
+				messageType := '2F'O,
+				iMSI := tr_BSSMAP_Imsi(imsi_digits),
+				sNAAccessInformation := *
+			}
+		}
+	}
+}
 
 
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18945
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I501108bc6c19b17d3fc680211c7290a31770a159
Gerrit-Change-Number: 18945
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200623/826fb067/attachment.htm>


More information about the gerrit-log mailing list