Change in osmo-ttcn3-hacks[master]: MSC_Tests: allow disabeling GSUP

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Apr 11 07:28:10 UTC 2019


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

Change subject: MSC_Tests: allow disabeling GSUP
......................................................................

MSC_Tests: allow disabeling GSUP

The GSUP link between testsuit and osmo-msc is currently on by default
and can not be disabled. However, there may be situations where a
missing GSUP connection must be simulated. Lets add add a parameter to
disable GSUP if necessary.

Change-Id: I7c86aa0a906a0d7e8be765f9109a65b4b4387bc6
Related: OS#3859
---
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
2 files changed, 21 insertions(+), 8 deletions(-)

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



diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index c7a4a71..8e5c5f2 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -73,7 +73,8 @@
 	integer ipa_ctrl_port,
 	boolean ipa_ctrl_enable,
 	boolean mm_info,
-	boolean sgsap_enable
+	boolean sgsap_enable,
+	boolean gsup_enable
 };
 
 /* get a one-octet bitmaks of supported algorithms based on Classmark information */
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index c7c61eb..1a6e8f7 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -210,11 +210,17 @@
 	vc_MGCP.start(MGCP_Emulation.main(ops, pars, id));
 }
 
+function ForwardUnitdataCallback(PDU_SGsAP msg)
+runs on SGsAP_Emulation_CT return template PDU_SGsAP {
+	SGsAP_CLIENT.send(msg);
+	return omit;
+}
+
 function f_init_sgsap(charstring id) runs on MTC_CT {
 	id := id & "-SGsAP";
 	var SGsAPOps ops := {
 		create_cb := refers(SGsAP_Emulation.ExpectedCreateCallback),
-		unitdata_cb := refers(SGsAP_Emulation.DummyUnitdataCallback)
+		unitdata_cb := refers(ForwardUnitdataCallback)
 	}
 	var SGsAP_conn_parameters pars := {
 		remote_ip := mp_msc_ip,
@@ -258,7 +264,7 @@
 	}
 }
 
-function f_init(integer num_bsc := 1, boolean sgsap := false) runs on MTC_CT {
+function f_init(integer num_bsc := 1, boolean sgsap := false, boolean gsup := true) runs on MTC_CT {
 
 	if (g_initialized == true) {
 		return;
@@ -281,7 +287,10 @@
 	f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port);
 	f_init_mncc("MSC_Test");
 	f_init_mgcp("MSC_Test");
-	f_init_gsup("MSC_Test");
+
+	if (gsup == true) {
+		f_init_gsup("MSC_Test");
+	}
 	f_init_smpp("MSC_Test");
 
 	if (sgsap == true) {
@@ -476,7 +485,7 @@
 type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr;
 
 /* FIXME: move into BSC_ConnectionHandler? */
-function f_init_pars(integer imsi_suffix, boolean sgsap := false) runs on MTC_CT return BSC_ConnHdlrPars {
+function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true) runs on MTC_CT return BSC_ConnHdlrPars {
 	var BSC_ConnHdlrNetworkPars net_pars := {
 		kc_support := '0A'O,	/* A5/1 and A5/3 enabled */
 		expect_tmsi := true,
@@ -501,7 +510,8 @@
 		ipa_ctrl_port := mp_msc_ctrl_port,
 		ipa_ctrl_enable := true,
 		mm_info := mp_mm_info,
-		sgsap_enable := sgsap
+		sgsap_enable := sgsap,
+		gsup_enable := gsup
 	};
 	return pars;
 }
@@ -521,8 +531,10 @@
 	connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT);
 	connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC);
 	/* GSUP part */
-	connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT);
-	connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC);
+	if (pars.gsup_enable == true) {
+		connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT);
+		connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC);
+	}
 	/* SMPP part */
 	connect(vc_conn:SMPP, vc_SMPP:SMPP_CLIENT);
 	connect(vc_conn:SMPP_PROC, vc_SMPP:SMPP_PROC);

-- 
To view, visit https://gerrit.osmocom.org/13557
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: I7c86aa0a906a0d7e8be765f9109a65b4b4387bc6
Gerrit-Change-Number: 13557
Gerrit-PatchSet: 1
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/20190411/01d3df07/attachment.html>


More information about the gerrit-log mailing list