Change in ...osmo-ttcn3-hacks[master]: sgsn: make the ranap interface optional

lynxis lazus gerrit-no-reply at lists.osmocom.org
Mon Aug 12 16:07:45 UTC 2019


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15162


Change subject: sgsn: make the ranap interface optional
......................................................................

sgsn: make the ranap interface optional

Allows to use the test cases without STP

Change-Id: I43df456c2d5aa3ba3ea9e34da3f0f96b55f7c9a1
---
M sgsn/SGSN_Tests.ttcn
M sgsn/SGSN_Tests_Iu.ttcn
2 files changed, 20 insertions(+), 9 deletions(-)



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

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index d7ee587..d96d3d9 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -129,6 +129,7 @@
 type component test_CT {
 	var GbInstances g_gb;
 	var RAN_Adapter g_ranap[NUM_RNC];
+	var boolean g_ranap_enable := false;
 
 	var GSUP_Emulation_CT vc_GSUP;
 	var IPA_Emulation_CT vc_GSUP_IPA;
@@ -174,8 +175,8 @@
 	SGSN_ConnHdlrNetworkPars net,
 	float t_guard,
 	/* only in IuPS / RANAP case */
-	SCCP_PAR_Address sccp_addr_local,
-	SCCP_PAR_Address sccp_addr_peer
+	SCCP_PAR_Address sccp_addr_local optional,
+	SCCP_PAR_Address sccp_addr_peer optional
 };
 
 private function f_cellid_to_RAI(in BssgpCellId cell_id) return RoutingAreaIdentificationV {
@@ -321,9 +322,11 @@
 	f_init_gb(g_gb[1], "SGSN_Test-Gb1", 1);
 	f_init_gb(g_gb[2], "SGSN_Test-Gb2", 2);
 
-	for (i := 0; i < NUM_RNC; i := i+1) {
-		f_ran_adapter_init(g_ranap[i], mp_ranap_cfg[i], "SGSN_Test_" & int2str(i), RNC_RanOps);
-		f_ran_adapter_start(g_ranap[i]);
+	if (g_ranap_enable) {
+		for (i := 0; i < NUM_RNC; i := i+1) {
+			f_ran_adapter_init(g_ranap[i], mp_ranap_cfg[i], "SGSN_Test_" & int2str(i), RNC_RanOps);
+			f_ran_adapter_start(g_ranap[i]);
+		}
 	}
 	f_init_gsup("SGSN_Test");
 	f_init_gtp("SGSN_Test");
@@ -383,10 +386,15 @@
 		vec := omit,
 		net := net_pars,
 		t_guard := t_guard,
-		sccp_addr_local := g_ranap[0].sccp_addr_own,
-		sccp_addr_peer := g_ranap[0].sccp_addr_peer
+		sccp_addr_local := omit,
+		sccp_addr_peer := omit
 	};
 
+	if (g_ranap_enable) {
+		pars.sccp_addr_local := g_ranap[0].sccp_addr_own;
+		pars.sccp_addr_peer := g_ranap[0].sccp_addr_peer;
+	}
+
 	vc_conn := BSSGP_ConnHdlr.create(id);
 	connect(vc_conn:BSSGP[0], gb[0].vc_BSSGP:BSSGP_SP);
 	connect(vc_conn:BSSGP_PROC[0], gb[0].vc_BSSGP:BSSGP_PROC);
@@ -396,8 +404,10 @@
 	connect(vc_conn:BSSGP_PROC[2], gb[2].vc_BSSGP:BSSGP_PROC);
 
 	/* FIXME: support multiple RNCs */
-	connect(vc_conn:BSSAP, g_ranap[0].vc_RAN:CLIENT);
-	connect(vc_conn:BSSAP_PROC, g_ranap[0].vc_RAN:PROC);
+	if (g_ranap_enable) {
+		connect(vc_conn:BSSAP, g_ranap[0].vc_RAN:CLIENT);
+		connect(vc_conn:BSSAP_PROC, g_ranap[0].vc_RAN:PROC);
+	}
 
 	connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT);
 	connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC);
diff --git a/sgsn/SGSN_Tests_Iu.ttcn b/sgsn/SGSN_Tests_Iu.ttcn
index 2c2a8af..43d1965 100644
--- a/sgsn/SGSN_Tests_Iu.ttcn
+++ b/sgsn/SGSN_Tests_Iu.ttcn
@@ -20,6 +20,7 @@
 }
 testcase TC_iu_attach() runs on test_CT {
 	var BSSGP_ConnHdlr vc_conn;
+	g_ranap_enable := true;
 	f_init();
 	f_sleep(1.0);
 	vc_conn := f_start_handler(refers(f_TC_iu_attach), testcasename(), g_gb, 1001);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15162
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: I43df456c2d5aa3ba3ea9e34da3f0f96b55f7c9a1
Gerrit-Change-Number: 15162
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190812/e270a4cd/attachment.html>


More information about the gerrit-log mailing list