Change in osmo-ttcn3-hacks[master]: MSC_Tests: Allow test cases to specify RAN index

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Apr 21 15:45:52 UTC 2019


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13730


Change subject: MSC_Tests: Allow test cases to specify RAN index
......................................................................

MSC_Tests: Allow test cases to specify RAN index

This allows to start ConnHdlr on specific RAN connections, i.e.
on different emulated BSCs (and soon RNCs).

Change-Id: I3d7ec567a7b69d8c6f79d26971bf1c94e077d5f5
---
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
2 files changed, 12 insertions(+), 9 deletions(-)



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

diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index db0e683..4534a9b 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -74,7 +74,8 @@
 	boolean ipa_ctrl_enable,
 	boolean mm_info,
 	boolean sgsap_enable,
-	boolean gsup_enable
+	boolean gsup_enable,
+	integer ran_idx
 };
 
 /* 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 6ad8860..8c221dc 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -485,7 +485,8 @@
 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, boolean gsup := true) runs on MTC_CT return BSC_ConnHdlrPars {
+function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true, integer ran_idx := 0)
+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,
@@ -493,8 +494,8 @@
 		expect_ciph := false
 	};
 	var BSC_ConnHdlrPars pars := {
-		sccp_addr_own := g_bssap[0].sccp_addr_own,
-		sccp_addr_peer := g_bssap[0].sccp_addr_peer,
+		sccp_addr_own := g_bssap[ran_idx].sccp_addr_own,
+		sccp_addr_peer := g_bssap[ran_idx].sccp_addr_peer,
 		cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 23, 42)),
 		imei := f_gen_imei(imsi_suffix),
 		imsi := f_gen_imsi(imsi_suffix),
@@ -511,7 +512,8 @@
 		ipa_ctrl_enable := true,
 		mm_info := mp_mm_info,
 		sgsap_enable := sgsap,
-		gsup_enable := gsup
+		gsup_enable := gsup,
+		ran_idx := ran_idx
 	};
 	return pars;
 }
@@ -522,8 +524,8 @@
 
 	vc_conn := BSC_ConnHdlr.create(id);
 	/* BSSMAP part / A interface */
-	connect(vc_conn:BSSAP, g_bssap[0].vc_RAN:CLIENT);
-	connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_RAN:PROC);
+	connect(vc_conn:BSSAP, g_bssap[pars.ran_idx].vc_RAN:CLIENT);
+	connect(vc_conn:BSSAP_PROC, g_bssap[pars.ran_idx].vc_RAN:PROC);
 	/* MNCC part */
 	connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT);
 	connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC);
@@ -550,8 +552,8 @@
 	return vc_conn;
 }
 
-function f_start_handler(void_fn fn, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr {
-	return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix));
+function f_start_handler(void_fn fn, integer imsi_suffix, integer ran_idx := 0) runs on MTC_CT return BSC_ConnHdlr {
+	return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix, ran_idx := ran_idx));
 }
 
 private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d7ec567a7b69d8c6f79d26971bf1c94e077d5f5
Gerrit-Change-Number: 13730
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190421/30972946/attachment.html>


More information about the gerrit-log mailing list