Change in osmo-ttcn3-hacks[master]: bsc: Introduce test TC_srvcc_eutran_to_geran_ho_out

pespin gerrit-no-reply at lists.osmocom.org
Mon Apr 19 14:44:48 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23798 )


Change subject: bsc: Introduce test TC_srvcc_eutran_to_geran_ho_out
......................................................................

bsc: Introduce test TC_srvcc_eutran_to_geran_ho_out

Related: SYS#5337
Change-Id: Id34924bbf0a5cf08b4b6f5ea56a10cef6b69c877
---
M bsc/BSC_Tests.ttcn
M library/BSSMAP_Templates.ttcn
2 files changed, 88 insertions(+), 23 deletions(-)



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 869343a..ffef409 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -4767,19 +4767,12 @@
 	BSSAP.receive(tr_BSSMAP_ClearComplete);
 }
 
-private function f_tc_ho_out_of_this_bsc(charstring id) runs on MSC_ConnHdlr {
-	g_pars := f_gen_test_hdlr_pars();
-
-	var PDU_BSSAP ass_req := f_gen_ass_req();
-	ass_req.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
-	ass_req.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
-	var template PDU_BSSAP exp_compl := f_gen_exp_compl();
-	f_establish_fully(ass_req, exp_compl);
+private function f_ho_out_of_this_bsc(template (omit) BSSMAP_oldToNewBSSIEs exp_oldToNewBSSIEs := omit) runs on MSC_ConnHdlr {
 
 	f_bts_0_cfg(BSCVTY, {"neighbor lac 99 arfcn 123 bsic any"});
 	f_vty_transceive(BSCVTY, "handover any to arfcn 123 bsic any");
 
-	BSSAP.receive(tr_BSSMAP_HandoverRequired);
+	BSSAP.receive(tr_BSSMAP_HandoverRequired(exp_oldToNewBSSIEs));
 
 	f_sleep(0.5);
 	/* The MSC negotiates Handover Request and Handover Request Ack with
@@ -4820,7 +4813,18 @@
 
 	f_expect_dlcx_conns();
 	setverdict(pass);
-	f_sleep(1.0);
+}
+
+private function f_tc_ho_out_of_this_bsc(charstring id) runs on MSC_ConnHdlr {
+		g_pars := f_gen_test_hdlr_pars();
+		var PDU_BSSAP ass_req := f_gen_ass_req();
+		ass_req.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+		ass_req.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
+		var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+		f_establish_fully(ass_req, exp_compl);
+
+		f_ho_out_of_this_bsc();
+		f_sleep(1.0);
 }
 testcase TC_ho_out_of_this_bsc() runs on test_CT {
 	var MSC_ConnHdlr vc_conn;
@@ -5105,14 +5109,12 @@
 	f_shutdown_helper();
 }
 
-private function f_tc_ho_into_this_bsc(charstring id) runs on MSC_ConnHdlr {
+private function f_ho_into_this_bsc(charstring id, template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit) runs on MSC_ConnHdlr {
 	/* Hack: the proper way would be to wait for the BSSMAP Handover Request ACK and extract the
 	 * actual assigned chan_nr from its L3 (RR Handover Command) message. But osmo-bsc starts acting
 	 * on the lchan even before we get a chance to evaluate the BSSMAP Handover Request ACK. So we
 	 * need to assume that osmo-bsc will activate TS 1 and already set up this lchan's RSL emulation
 	 * before we get started. */
-	var template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit;
-	var template PDU_ML3_NW_MS exp_rr_rel_tmpl := tr_RRM_RR_RELEASE;
 	var RslChannelNr new_chan_nr := valueof(t_RslChanNr0(1, RSL_CHAN_NR_Bm_ACCH));
 	f_rslem_register(0, new_chan_nr);
 	g_chan_nr := new_chan_nr;
@@ -5122,11 +5124,6 @@
 	f_MscConnHdlr_init(g_pars.media_nr, "127.0.0.2", "127.0.0.3", FR_AMR);
 	activate(as_Media());
 
-	if (not istemplatekind(g_pars.last_used_eutran_plmn, "omit")) {
-		oldToNewBSSIEs := f_ts_BSSMAP_oldToNewBSSIEs(ts_BSSMAP_LastUsedEUTRANPLMNId(g_pars.last_used_eutran_plmn));
-		exp_rr_rel_tmpl := tr_RRM_RR_RELEASE_CellSelectInd;
-	}
-
 	BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_bsc, g_pars.sccp_addr_msc,
 				     f_gen_handover_req(aoip_tla := g_pars.host_aoip_tla,
 							oldToNewBSSIEs := oldToNewBSSIEs)));
@@ -5174,7 +5171,17 @@
 				enc_PDU_ML3_MS_NW(l3_tx)));
 
 	BSSAP.receive(tr_BSSMAP_HandoverComplete);
+	setverdict(pass);
+}
 
+private function f_tc_ho_into_this_bsc(charstring id) runs on MSC_ConnHdlr {
+	var template PDU_ML3_NW_MS exp_rr_rel_tmpl := tr_RRM_RR_RELEASE;
+	var template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit;
+	if (not istemplatekind(g_pars.last_used_eutran_plmn, "omit")) {
+		oldToNewBSSIEs := f_ts_BSSMAP_oldToNewBSSIEs(ts_BSSMAP_LastUsedEUTRANPLMNId(g_pars.last_used_eutran_plmn));
+		exp_rr_rel_tmpl := tr_RRM_RR_RELEASE_CellSelectInd;
+	}
+	f_ho_into_this_bsc(id, oldToNewBSSIEs);
 	f_perform_clear(RSL, exp_rr_rel_tmpl);
 	setverdict(pass);
 }
@@ -5213,7 +5220,7 @@
 }
 
 /* Similar to TC_ho_into_this_bsc, but when in SRVCC, HO Req contains "Old BSS
-   to New BSS Information" IE with "Last Used E-UTRAN PLMN Id", whihch, when the
+   to New BSS Information" IE with "Last Used E-UTRAN PLMN Id", which, when the
    channel is later released (RR CHannel Release), should trigger inclusion of
    IE "Cell Selection Indicator after Release of all TCH and SDCCH" with E-UTRAN
    neighbors. */
@@ -5224,6 +5231,43 @@
 	f_shutdown_helper();
 }
 
+private function f_tc_srvcc_eutran_to_geran_ho_out(charstring id) runs on MSC_ConnHdlr {
+	var template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs;
+	oldToNewBSSIEs := f_ts_BSSMAP_oldToNewBSSIEs(ts_BSSMAP_LastUsedEUTRANPLMNId(g_pars.last_used_eutran_plmn));
+	f_ho_into_this_bsc(id, oldToNewBSSIEs);
+	f_ho_out_of_this_bsc(oldToNewBSSIEs);
+	setverdict(pass);
+}
+/* First, HO into BSC from EUTRAN (SRVCC): HO Request contains "Old BSS to New
+   BSS Information" IE with "Last Used E-UTRAN PLMN Id".
+   Second, HO to another BSC: HO Required contains "Old BSS to New BSS Information"
+   IE with "Last Used E-UTRAN PLMN Id" from first step. */
+testcase TC_srvcc_eutran_to_geran_ho_out() runs on test_CT {
+	var MSC_ConnHdlr vc_conn;
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
+
+	f_init(1, true);
+	f_sleep(1.0);
+
+	f_ctrs_bsc_and_bts_init();
+
+	pars.last_used_eutran_plmn := '323454'O;
+	pars.sccp_addr_msc := g_bssap[0].sccp_addr_own;
+	pars.sccp_addr_bsc := g_bssap[0].sccp_addr_peer;
+
+	vc_conn := f_start_handler(refers(f_tc_srvcc_eutran_to_geran_ho_out), pars);
+	vc_conn.done;
+
+	f_ctrs_bsc_and_bts_add(0, "handover:attempted", 2);
+	f_ctrs_bsc_and_bts_add(0, "handover:completed", 2);
+	f_ctrs_bsc_and_bts_add(0, "interbsc_ho_in:attempted", 1);
+	f_ctrs_bsc_and_bts_add(0, "interbsc_ho_in:completed", 1);
+	f_ctrs_bsc_and_bts_add(0, "interbsc_ho_out:attempted", 1);
+	f_ctrs_bsc_and_bts_add(0, "interbsc_ho_out:completed", 1);
+	f_ctrs_bsc_and_bts_verify();
+	f_shutdown_helper();
+}
+
 private function f_tc_ho_in_fail_msc_clears(charstring id) runs on MSC_ConnHdlr {
 	var RslChannelNr new_chan_nr := valueof(t_RslChanNr0(1, RSL_CHAN_NR_Bm_ACCH));
 	f_rslem_register(0, new_chan_nr);
@@ -8673,6 +8717,7 @@
 		execute( TC_ho_into_this_bsc_tla_v6() );
 	}
 	execute( TC_srvcc_eutran_to_geran() );
+	execute( TC_srvcc_eutran_to_geran_ho_out() );
 	execute( TC_ho_in_fail_msc_clears() );
 	execute( TC_ho_in_fail_msc_clears_after_ho_detect() );
 	execute( TC_ho_in_fail_no_detect() );
diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn
index 8049bb0..2b99a5b 100644
--- a/library/BSSMAP_Templates.ttcn
+++ b/library/BSSMAP_Templates.ttcn
@@ -232,6 +232,24 @@
 	}
 }
 
+template BSSMAP_IE_OldToNewBSSInfo tr_BSSMAP_IE_OldToNewBSSInfo(template (value) BSSMAP_oldToNewBSSIEs val) := {
+	elementIdentifier := '3A'O,
+	lengthIndicator := ?,	/* overwritten by codec */
+	oldToNewBSSIEs := enc_BSSMAP_oldToNewBSSIEs(valueof(val))
+}
+function f_tr_BSSMAP_IE_OldToNewBSSInfo(template BSSMAP_oldToNewBSSIEs val := *)
+	 return template BSSMAP_IE_OldToNewBSSInfo {
+	if (istemplatekind(val, "*")) {
+		return *;
+	} else if (istemplatekind(val, "?")) {
+		return ?;
+	} else if (istemplatekind(val, "omit")) {
+		return omit;
+	} else {
+		return tr_BSSMAP_IE_OldToNewBSSInfo(val);
+	}
+}
+
 template (value) BSSMAP_IE_Osmo_OsmuxSupport tr_BSSMAP_IE_Osmo_OsmuxSupport := {
 	elementIdentifier := 'F0'O
 }
@@ -815,7 +833,8 @@
 }
 
 template PDU_BSSAP ts_BSSMAP_HandoverRequired(BssmapCause cause,
-					      template BSSMAP_FIELD_CellIdentificationList cid_list)
+					      template BSSMAP_FIELD_CellIdentificationList cid_list,
+					      template (omit) BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := omit)
 modifies ts_BSSAP_BSSMAP := {
 	pdu := {
 		bssmap := {
@@ -828,7 +847,7 @@
 				currentChannelType1 := omit,
 				speechVersion := omit,
 				queueingIndicator := omit,
-				oldToNewBSSInfo := omit,
+				oldToNewBSSInfo := f_ts_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs),
 				sourceToTargetRNCTransparentInfo := omit,
 				sourceToTargetRNCTransparentInfoCDMA := omit,
 				gERANClassmark := omit,
@@ -841,11 +860,12 @@
 }
 
 
-template PDU_BSSAP tr_BSSMAP_HandoverRequired modifies tr_BSSAP_BSSMAP := {
+template PDU_BSSAP tr_BSSMAP_HandoverRequired(template BSSMAP_oldToNewBSSIEs oldToNewBSSIEs := *) modifies tr_BSSAP_BSSMAP := {
 	pdu := {
 		bssmap := {
 			handoverRequired := {
-				messageType := '11'O
+				messageType := '11'O,
+                                oldToNewBSSInfo := f_tr_BSSMAP_IE_OldToNewBSSInfo(oldToNewBSSIEs)
 			}
 		}
 	}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23798
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: Id34924bbf0a5cf08b4b6f5ea56a10cef6b69c877
Gerrit-Change-Number: 23798
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210419/a0399651/attachment.htm>


More information about the gerrit-log mailing list