Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: Use explicit AoIP flag

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Oct 10 14:23:41 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11289 )

Change subject: MSC_ConnectionHandler: Use explicit AoIP flag
......................................................................

MSC_ConnectionHandler: Use explicit AoIP flag

Most differences between sccplite and AoIP are visible during the
assignment. The current implementation checks for the presence of a CIC
in the ASSIGNMENT REQUEST in order to detect if the communication should
be modeled by AoIP or sccplite. This method is error prone and does not
work very well in situations where only signalling is used, because
there in sccplite and AoIP no CIC or AoIP trasp. identifier is present,
so there is nothing to check on. To resolve this we need an explicit way
to tell the MSC_ConnectionHandler that it has to behave like an AoIP MSC
or like an sccplite MSC.

- Add an aoip flag to TestHdlrParams
- Make sure BSC_Tests.ttcn sets the AoIP depending on mp_bssap_cfg.transport

Change-Id: I800249e783deb018d99e81d814843e0574a5c69b
Related: OS#3639
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
2 files changed, 43 insertions(+), 33 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 9a85a1f..754f7b3 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -119,6 +119,18 @@
 	};
 }
 
+private function f_gen_test_hdlr_pars() return TestHdlrParams {
+
+	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	if (mp_bssap_cfg.transport == BSSAP_TRANSPORT_AoIP) {
+		pars.aoip := true;
+	} else {
+		pars.aoip := false;
+	}
+
+	return pars;
+}
+
 private function f_shutdown_helper() runs on test_CT {
 	all component.stop;
 	setverdict(pass);
@@ -1571,7 +1583,7 @@
 }
 testcase TC_ciph_mode_a5_0() runs on test_CT {
 	var MSC_ConnHdlr vc_conn;
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	pars.encr := valueof(t_EncrParams('01'O, f_rnd_octstring(8)));
 
 	f_init(1, true);
@@ -1581,7 +1593,7 @@
 }
 testcase TC_ciph_mode_a5_1() runs on test_CT {
 	var MSC_ConnHdlr vc_conn;
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	pars.encr := valueof(t_EncrParams('02'O, f_rnd_octstring(8)));
 
 	f_init(1, true);
@@ -1591,7 +1603,7 @@
 }
 testcase TC_ciph_mode_a5_3() runs on test_CT {
 	var MSC_ConnHdlr vc_conn;
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	pars.encr := valueof(t_EncrParams('08'O, f_rnd_octstring(8)));
 
 	f_init(1, true);
@@ -1613,7 +1625,7 @@
 }
 testcase TC_assignment_fr_a5_0() runs on test_CT {
 	var MSC_ConnHdlr vc_conn;
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	pars.encr := valueof(t_EncrParams('01'O, f_rnd_octstring(8)));
 
 	f_init(1, true);
@@ -1623,7 +1635,7 @@
 }
 testcase TC_assignment_fr_a5_1() runs on test_CT {
 	var MSC_ConnHdlr vc_conn;
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	pars.encr := valueof(t_EncrParams('02'O, f_rnd_octstring(8)));
 
 	f_init(1, true);
@@ -1633,7 +1645,7 @@
 }
 testcase TC_assignment_fr_a5_3() runs on test_CT {
 	var MSC_ConnHdlr vc_conn;
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	pars.encr := valueof(t_EncrParams('08'O, f_rnd_octstring(8)));
 
 	f_init(1, true);
@@ -1644,7 +1656,7 @@
 
 /* Expect ASSIGNMENT FAIL if mandatory IE is missing */
 private function f_tc_assignment_fr_a5_1_codec_missing(charstring id) runs on MSC_ConnHdlr {
-	g_pars := valueof(t_def_TestHdlrPars);
+	g_pars := f_gen_test_hdlr_pars();
 	var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail;
 	var PDU_BSSAP ass_cmd := f_gen_ass_req();
 	const OCT8 kc := '0001020304050607'O;
@@ -1665,7 +1677,7 @@
 }
 
 private function f_tc_assignment_fr_a5_4(charstring id) runs on MSC_ConnHdlr {
-	g_pars := valueof(t_def_TestHdlrPars);
+	g_pars := f_gen_test_hdlr_pars();
 	var template PDU_BSSAP exp_compl := f_gen_exp_compl();
 	var PDU_BSSAP ass_cmd := f_gen_ass_req();
 	const OCT8 kc := '0001020304050607'O;
@@ -1689,10 +1701,9 @@
 
 
 private function f_tc_assignment_sign(charstring id) runs on MSC_ConnHdlr {
-	g_pars := valueof(t_def_TestHdlrPars);
+	g_pars := f_gen_test_hdlr_pars();
 	var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, omit);
-	var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, omit));
-
+	var PDU_BSSAP ass_cmd := f_gen_ass_req();
 	ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeSIGNAL);
 	f_establish_fully(ass_cmd, exp_compl);
 }
@@ -1886,7 +1897,7 @@
 }
 
 testcase TC_assignment_codec_fr() runs on test_CT {
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	var MSC_ConnHdlr vc_conn;
 
 	f_init(1, true);
@@ -1898,7 +1909,7 @@
 }
 
 testcase TC_assignment_codec_hr() runs on test_CT {
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	var MSC_ConnHdlr vc_conn;
 
 	f_init(1, true);
@@ -1910,7 +1921,7 @@
 }
 
 testcase TC_assignment_codec_efr() runs on test_CT {
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	var MSC_ConnHdlr vc_conn;
 
 	f_init(1, true);
@@ -1922,7 +1933,7 @@
 }
 
 testcase TC_assignment_codec_amr_f() runs on test_CT {
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	var MSC_ConnHdlr vc_conn;
 
 	/* Note: This setups the codec configuration. The parameter payload in
@@ -1948,7 +1959,7 @@
 }
 
 testcase TC_assignment_codec_amr_h() runs on test_CT {
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	var MSC_ConnHdlr vc_conn;
 
 	/* See note above */
@@ -1975,7 +1986,8 @@
  * a) BSSMAP Classmark Request should result in RR CLASSMARK ENQUIRY,
  * b) L3 RR CLASSMARK CHANGE should result in BSSMAP CLASSMARK UPDATE */
 private function f_tc_classmark(charstring id) runs on MSC_ConnHdlr {
-	g_pars := valueof(t_def_TestHdlrPars);
+	g_pars := f_gen_test_hdlr_pars();
+
 	f_create_chan_and_exp();
 	/* we should now have a COMPL_L3 at the MSC */
 	BSSAP.receive(tr_BSSMAP_ComplL3);
@@ -1996,7 +2008,7 @@
 }
 
 private function f_est_single_l3(template PDU_ML3_MS_NW l3) runs on MSC_ConnHdlr {
-	g_pars := valueof(t_def_TestHdlrPars);
+	g_pars := f_gen_test_hdlr_pars();
 	f_create_chan_and_exp();
 	/* we should now have a COMPL_L3 at the MSC */
 	BSSAP.receive(tr_BSSMAP_ComplL3);
@@ -2064,7 +2076,7 @@
 
 /* short message from MS should be ignored */
 private function f_tc_err_82_short_msg(charstring id) runs on MSC_ConnHdlr {
-	g_pars := valueof(t_def_TestHdlrPars);
+	g_pars := f_gen_test_hdlr_pars();
 	f_create_chan_and_exp();
 	/* we should now have a COMPL_L3 at the MSC */
 	BSSAP.receive(tr_BSSMAP_ComplL3);
@@ -2146,7 +2158,7 @@
 
 /* intra-BSC hand-over between BTS0 and BTS1 */
 private function f_tc_ho_int(charstring id) runs on MSC_ConnHdlr {
-	g_pars := valueof(t_def_TestHdlrPars);
+	g_pars := f_gen_test_hdlr_pars();
 	var template PDU_BSSAP exp_compl := f_gen_exp_compl();
 	var PDU_BSSAP ass_cmd := f_gen_ass_req();
 	const OCT8 kc := '0001020304050607'O;
@@ -2189,7 +2201,7 @@
 }
 
 private function f_tc_ho_out_of_this_bsc(charstring id) runs on MSC_ConnHdlr {
-	g_pars := valueof(t_def_TestHdlrPars);
+	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);
@@ -2327,7 +2339,7 @@
 }
 testcase TC_ho_into_this_bsc() runs on test_CT {
 	var MSC_ConnHdlr vc_conn;
-	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 
 	f_init(1, true);
 	f_sleep(1.0);
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 079cc74..dfdf10c 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -426,9 +426,13 @@
 	RSL_IE_Body	expect_mr_conf_ie optional, /* typically present for AMR codecs */
 	TestHdlrEncrParams encr optional,
 	TestHdlrParamsLcls lcls,
-	TestHdlrParamsHandover handover optional
+	TestHdlrParamsHandover handover optional,
+	boolean		aoip
 };
 
+/* Note: Do not use valueof() to get a value of this template, use
+ * f_gen_test_hdlr_pars() instead in order to get a configuration that is
+ * matched to the current test sitation (aoio vs. sccplite) */
 template (value) TestHdlrParams t_def_TestHdlrPars := {
 	ra := '23'O,
 	fn := 23,
@@ -444,7 +448,8 @@
 		csc := omit,
 		exp_sts := omit
 	},
-	handover := omit
+	handover := omit,
+	aoip := true
 }
 
 function f_create_chan_and_exp() runs on MSC_ConnHdlr {
@@ -828,15 +833,8 @@
 runs on MSC_ConnHdlr {
 
 	var BSSMAP_FIELD_CodecType codecType;
-	var boolean sccplite := false;
 	timer T := 10.0;
 
-	/* Check if we run on SCCPLITE instead of SCCP by looking if a CIC is
-	 * present or not. */
-	if (isvalue(ass_tpl.pdu.bssmap.assignmentRequest.circuitIdentityCode)) {
-		sccplite := true;
-	}
-
 	if (isvalue(ass_tpl.pdu.bssmap.assignmentRequest.codecList)) {
 		codecType := valueof(ass_tpl.pdu.bssmap.assignmentRequest.codecList.codecElements[0].codecType);
 	} else {
@@ -855,7 +853,7 @@
 
 	var template PDU_BSSAP exp_l3_compl;
 	exp_l3_compl := tr_BSSMAP_ComplL3()
-	if (sccplite) {
+	if (g_pars.aoip == false) {
 		exp_l3_compl.pdu.bssmap.completeLayer3Information.codecList := omit;
 	} else {
 		exp_l3_compl.pdu.bssmap.completeLayer3Information.codecList := ?;
@@ -930,7 +928,7 @@
 		g_media.mgcp_conn[1].mdcx_seen_exp := 0;
 	} else if (st.voice_call) {
 		/* For voice calls we expect the following MGCP activity */
-		if (sccplite) {
+		if (g_pars.aoip == false) {
 			g_media.mgcp_conn[0].crcx_seen_exp := 1;
 			g_media.mgcp_conn[0].mdcx_seen_exp := 1;
 			g_media.mgcp_conn[1].crcx_seen_exp := 0;

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I800249e783deb018d99e81d814843e0574a5c69b
Gerrit-Change-Number: 11289
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181010/cee3a161/attachment.htm>


More information about the gerrit-log mailing list