sgsn: make the ranap interface optional
Allows to use the test cases without STP
Change-Id: I43df456c2d5aa3ba3ea9e34da3f0f96b55f7c9a1
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index adbcf19..501bec8 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -130,6 +130,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;
@@ -177,8 +178,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 {
@@ -327,9 +328,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");
@@ -338,8 +341,10 @@
function f_cleanup() runs on test_CT {
var integer i;
- for (i := 0; i < NUM_RNC; i := i+1) {
- f_ran_adapter_cleanup(g_ranap[i]);
+ if (g_ranap_enable) {
+ for (i := 0; i < NUM_RNC; i := i+1) {
+ f_ran_adapter_cleanup(g_ranap[i]);
+ }
}
self.stop;
}
@@ -398,10 +403,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);
@@ -411,8 +421,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);