Change in osmo-ttcn3-hacks[master]: MSC_Tests: add test to try two LU from different BSCs

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/.

dexter gerrit-no-reply at lists.osmocom.org
Wed May 16 15:59:08 UTC 2018


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9204


Change subject: MSC_Tests: add test to try two LU from different BSCs
......................................................................

MSC_Tests: add test to try two LU from different BSCs

Currently we are only able to simulate a Location Update from a
single BSC. However, as a preperation for inter BSC handover tests
we need to be able to communicate to the MSC from two independed
BSC instances. A location update is a simple operation to try out
the multi-bsc functionality

- Add support to create multiple BSC instances in independed ports
- Add test to simulate a LU from two different BSCs

Change-Id: Ib3eabf8537066f43faed8fb983d9e1f4092ec515
Related: OS#1609
---
M library/BSSMAP_Emulation.ttcn
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
M msc/expected-results.xml
4 files changed, 69 insertions(+), 23 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/04/9204/1

diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn
index 95b39f3..74c6ed0 100644
--- a/library/BSSMAP_Emulation.ttcn
+++ b/library/BSSMAP_Emulation.ttcn
@@ -47,8 +47,11 @@
 type component BSSAP_ConnHdlr {
 	/* port towards MSC Emulator core / SCCP connection dispatchar */
 	port BSSAP_Conn_PT BSSAP;
+	port BSSAP_Conn_PT BSSAP_1;
+	
 	/* procedure based port to register for incoming connections */
 	port BSSMAPEM_PROC_PT BSSAP_PROC;
+	port BSSMAPEM_PROC_PT BSSAP_PROC_1;
 }
 
 /* Auxiliary primitive that can happen on the port between per-connection client and this dispatcher */
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index b7a4f50..69608bd 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -44,10 +44,16 @@
 	boolean	expect_ciph
 }
 
-type record BSC_ConnHdlrPars {
+type record BSC_ConnHdlrBscPars {
 	SCCP_PAR_Address sccp_addr_own,
 	SCCP_PAR_Address sccp_addr_peer,
-	BSSMAP_IE_CellIdentifier cell_id,
+	BSSMAP_IE_CellIdentifier cell_id
+}
+
+type record of BSC_ConnHdlrBscPars BSC_ConnHdlrBscParsTable;
+
+type record BSC_ConnHdlrPars {
+	BSC_ConnHdlrBscParsTable bsc,
 	hexstring imei,
 	hexstring imsi,
 	hexstring msisdn,
@@ -173,15 +179,16 @@
 };
 
 /* Encode 'l3' and ask BSSMAP_Emulation to create new connection with COMPL L3 INFO */
-function f_bssap_compl_l3(PDU_ML3_MS_NW l3)
+function f_bssap_compl_l3(PDU_ML3_MS_NW l3, integer bsc_num := 0, BSSAP_Conn_PT BSSAP_PT := BSSAP)
 runs on BSC_ConnHdlr {
 	log("Sending COMPL L3: ", l3);
 	var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3);
-	BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own,
-				     valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, l3_enc))));
+
+	BSSAP_PT.send(ts_BSSAP_Conn_Req(g_pars.bsc[bsc_num].sccp_addr_peer, g_pars.bsc[bsc_num].sccp_addr_own,
+					valueof(ts_BSSMAP_ComplL3(g_pars.bsc[bsc_num].cell_id, l3_enc))));
 	alt {
-	[] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {}
-	[] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {
+	[] BSSAP_PT.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {}
+	[] BSSAP_PT.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {
 			setverdict(fail, "DISC.ind from SCCP");
 			self.stop;
 		}
@@ -297,7 +304,7 @@
 	}
 }
 
-function f_perform_lu()
+function f_perform_lu(integer bsc_num := 0, BSSAP_Conn_PT BSSAP_PT := BSSAP)
 runs on BSC_ConnHdlr {
 	var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi)
 	var PDU_DTAP_MT dtap_mt;
@@ -306,10 +313,10 @@
 	f_create_gsup_expect(hex2str(g_pars.imsi));
 
 	/* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */
-	f_bssap_compl_l3(l3_lu);
+	f_bssap_compl_l3(l3_lu, bsc_num, BSSAP_PT);
 
 	if (g_pars.send_early_cm) {
-		BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+		BSSAP_PT.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
 	}
 
 	f_mm_common();
@@ -321,7 +328,7 @@
 	GSUP.send(ts_GSUP_UL_RES(g_pars.imsi));
 
 	alt {
-	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) -> value dtap_mt {
+	[] BSSAP_PT.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) -> value dtap_mt {
 		var PDU_ML3_LocationUpdateAccept lu_acc := dtap_mt.dtap.msgs.mm.locationUpdateAccept;
 		if (g_pars.net.expect_tmsi) {
 			if (not ispresent(lu_acc.mobileIdentityTLV) or
@@ -330,7 +337,7 @@
 				self.stop;
 			} else {
 				g_pars.tmsi := lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets;
-				BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl));
+				BSSAP_PT.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl));
 			}
 		} else {
 			if (ispresent(lu_acc.mobileIdentityTLV) and
@@ -340,15 +347,15 @@
 			}
 		}
 		}
-	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) {
+	[] BSSAP_PT.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) {
 		setverdict(fail, "Expected LU ACK, but received LU REJ");
 		self.stop;
 		}
 	}
 	/* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */
-	BSSAP.receive(tr_BSSMAP_ClearCommand);
-	BSSAP.send(ts_BSSMAP_ClearComplete);
-	BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND);
+	BSSAP_PT.receive(tr_BSSMAP_ClearCommand);
+	BSSAP_PT.send(ts_BSSMAP_ClearComplete);
+	BSSAP_PT.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND);
 	setverdict(pass);
 }
 
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index edaa61b..ebf0081 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -434,10 +434,22 @@
 		expect_auth := false,
 		expect_ciph := false
 	};
+
+	var BSC_ConnHdlrBscParsTable bsc_pars := {
+		{
+			sccp_addr_own := g_bssap[0].sccp_addr_own,
+			sccp_addr_peer := g_bssap[0].sccp_addr_peer,
+			cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 23, 42))
+		},
+		{
+			sccp_addr_own := g_bssap[1].sccp_addr_own,
+			sccp_addr_peer := g_bssap[1].sccp_addr_peer,
+			cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 24, 43))
+		}
+	}
+
 	var BSC_ConnHdlrPars pars := {
-		sccp_addr_own := g_bssap[0].sccp_addr_own,
-		sccp_addr_peer := g_bssap[0].sccp_addr_peer,
-		cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 23, 42)),
+		bsc := bsc_pars,
 		imei := f_gen_imei(imsi_suffix),
 		imsi := f_gen_imsi(imsi_suffix),
 		msisdn := f_gen_msisdn(imsi_suffix),
@@ -449,6 +461,9 @@
 		net := net_pars,
 		send_early_cm := true
 	};
+
+/* ========================= */
+
 	return pars;
 }
 
@@ -460,6 +475,8 @@
 	/* BSSMAP part / A interface */
 	connect(vc_conn:BSSAP, g_bssap[0].vc_BSSMAP:CLIENT);
 	connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_BSSMAP:PROC);
+	connect(vc_conn:BSSAP_1, g_bssap[1].vc_BSSMAP:CLIENT);
+	connect(vc_conn:BSSAP_PROC_1, g_bssap[1].vc_BSSMAP:PROC);
 	/* MNCC part */
 	connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT);
 	connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC);
@@ -1106,8 +1123,8 @@
 	f_init_handler(pars);
 
 	/* Send Complete L3 Info with empty L3 frame */
-	BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own,
-					valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, ''O))));
+	BSSAP.send(ts_BSSAP_Conn_Req(g_pars.bsc[0].sccp_addr_peer, g_pars.bsc[0].sccp_addr_own,
+					valueof(ts_BSSMAP_ComplL3(g_pars.bsc[0].cell_id, ''O))));
 
 	timer T := 5.0;
 	T.start;
@@ -1140,8 +1157,8 @@
 	var octetstring payl := f_rnd_octstring(len);
 
 	/* Send Complete L3 Info with empty L3 frame */
-	BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own,
-					valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, payl))));
+	BSSAP.send(ts_BSSAP_Conn_Req(g_pars.bsc[0].sccp_addr_peer, g_pars.bsc[0].sccp_addr_own,
+					valueof(ts_BSSMAP_ComplL3(g_pars.bsc[0].cell_id, payl))));
 
 	timer T := 5.0;
 	T.start;
@@ -1847,6 +1864,23 @@
 	setverdict(pass);
 }
 
+private function f_tc_lu_two(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+	pars.net.expect_tmsi := false;
+	f_init_handler(pars);
+	f_perform_lu(0, BSSAP);
+	f_perform_lu(1, BSSAP_1);
+}
+testcase TC_lu_two() runs on MTC_CT {
+	/* Like TC_lu_imsi_noauth_notmsi, but with two different BSC */
+	var BSC_ConnHdlr vc_conn;
+	f_init(2);
+	f_vty_config(MSCVTY, "msc", "no assign-tmsi");
+
+	vc_conn := f_start_handler(refers(f_tc_lu_two), 2);
+	vc_conn.done;
+}
+
+
 /***********************************************************************
  * SMS Testing
  ***********************************************************************/
@@ -2173,6 +2207,7 @@
 	execute( TC_mo_release_timeout() );
 	execute( TC_lu_and_mt_call_no_dlcx_resp() );
 	execute( TC_reset_two() );
+	execute( TC_lu_two() );
 
 	execute( TC_lu_and_mt_call() );
 
diff --git a/msc/expected-results.xml b/msc/expected-results.xml
index 0b192d0..cade469 100644
--- a/msc/expected-results.xml
+++ b/msc/expected-results.xml
@@ -70,6 +70,7 @@
   <testcase classname='MSC_Tests' name='TC_mo_release_timeout' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_lu_and_mt_call_no_dlcx_resp' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_reset_two' time='MASKED'/>
+  <testcase classname='MSC_Tests' name='TC_lu_two' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_lu_and_mt_call' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_lu_and_mo_sms' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_lu_and_mt_sms' time='MASKED'/>

-- 
To view, visit https://gerrit.osmocom.org/9204
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3eabf8537066f43faed8fb983d9e1f4092ec515
Gerrit-Change-Number: 9204
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180516/fb85aedc/attachment.htm>


More information about the gerrit-log mailing list