Change in ...osmo-ttcn3-hacks[master]: pcu: Allow tests to overwrite pcuif INFO_IND params

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

pespin gerrit-no-reply at lists.osmocom.org
Fri Oct 4 17:42:06 UTC 2019


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


Change subject: pcu: Allow tests to overwrite pcuif INFO_IND params
......................................................................

pcu: Allow tests to overwrite pcuif INFO_IND params

Change-Id: I75c746b822184fdcc966d77a7c6a0a6918c236e6
---
M library/PCUIF_Types.ttcn
M pcu/PCU_Tests_RAW.ttcn
2 files changed, 60 insertions(+), 98 deletions(-)



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

diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index a36e261..ae0762a 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -677,62 +677,13 @@
 		ts_PCUIF_InfoTrx, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL,
 		ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL };
 
-
 template (value) PCUIF_Message ts_PCUIF_INFO_IND(template (value) uint8_t bts_nr,
-						 template (value) uint16_t nsei,
-						 template (value) uint16_t nsvci,
-						 template (value) uint16_t bvci,
-						 template (value) uint16_t local_port,
-						 template (value) uint16_t remote_port,
-						 template (value) OCT4 remote_ip,
-						 template (value) PCUIF_Flags flags := c_PCUIF_Flags_default,
-						 template (value) uint16_t mcc := 262,
-						 template (value) uint16_t mnc := 42,
-						 template (value) uint16_t lac := 13135,
-						 template (value) uint8_t rac := 0,
-						 template (value) uint16_t cell_id := 20960,
-						 template (value) uint8_t bsic := 7,
-						 template (value) PCUIF_InfoTrxs trx := ts_PCUIF_InfoTrxs_def,
-						 template (value) uint32_t version := PCU_IF_VERSION) := {
+						 template (value) PCUIF_info_ind info_ind) := {
 	msg_type := PCU_IF_MSG_INFO_IND,
 	bts_nr := bts_nr,
 	spare := '0000'O,
 	u := {
-		info_ind := {
-			version := version,
-			flags := flags,
-			trx := trx,
-			bsic := bsic,
-			mcc := mcc,
-			mnc := mnc,
-			mnc_3_digits := 0,
-			lac := lac,
-			rac := rac,
-			nsei := nsei,
-			nse_timer := { 3, 3, 3, 3, 30, 3, 10 },
-			cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 },
-			cell_id := cell_id,
-			repeat_time := 5 * 50,
-			repeat_count := 3,
-			bvci := bvci,
-			t3142 := 20,
-			t3169 := 5,
-			t3191 := 5,
-			t3193_10ms := 160,
-			t3195 := 5,
-			t3101 := 10,
-			t3103 := 4,
-			t3105 := 8,
-			cv_countdown := 15,
-			dl_tbf_ext := 250 * 10, /* ms */
-			ul_tbf_ext := 250 * 10, /* ms */
-			initial_cs := 2,
-			initial_mcs := 6,
-			nsvci := { nsvci, 0 },
-			local_pprt := { local_port, 0 },
-			remote_port := { remote_port, 0 },
-			remote_ip := { remote_ip , '00000000'O }
-		}
+		info_ind := info_ind
 	}
 }
 template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?,
diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 4a8d8b6..a464562 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -69,9 +69,58 @@
 		}
 }
 
-function f_init_pcuif() runs on RAW_PCU_CT {
+function f_default_pcuif_info_ind() return PCUIF_info_ind
+{
+	var PCUIF_info_ind info_ind;
+	info_ind := {
+		version := PCU_IF_VERSION,
+		flags := c_PCUIF_Flags_default,
+		trx := valueof(ts_PCUIF_InfoTrxs_def),
+		bsic := 7,
+		mcc := 262,
+		mnc := 42,
+		mnc_3_digits := 0,
+		lac := 13135,
+		rac := 0,
+		nsei := mp_nsconfig.nsei,
+		nse_timer := { 3, 3, 3, 3, 30, 3, 10 },
+		cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 },
+		cell_id := 20960,
+		repeat_time := 5 * 50,
+		repeat_count := 3,
+		bvci := mp_gb_cfg.bvci,
+		t3142 := 20,
+		t3169 := 5,
+		t3191 := 5,
+		t3193_10ms := 160,
+		t3195 := 5,
+		t3101 := 10,
+		t3103 := 4,
+		t3105 := 8,
+		cv_countdown := 15,
+		dl_tbf_ext := 250 * 10, /* ms */
+		ul_tbf_ext := 250 * 10, /* ms */
+		initial_cs := 2,
+		initial_mcs := 6,
+		nsvci := { mp_nsconfig.nsvci, 0 },
+		local_pprt := { mp_nsconfig.remote_udp_port, 0 },
+		remote_port := { mp_nsconfig.local_udp_port, 0 },
+		remote_ip := { f_inet_haddr(mp_nsconfig.local_ip) , '00000000'O }
+	}
+
+	return info_ind;
+}
+
+function f_init_pcuif(template (omit) PCUIF_info_ind info_ind_tpl := omit) runs on RAW_PCU_CT {
+	var PCUIF_info_ind info_ind;
 	map(self:PCU, system:PCU);
 
+	if (istemplatekind(info_ind_tpl, "omit")) {
+		info_ind := f_default_pcuif_info_ind();
+	} else {
+		info_ind := valueof(info_ind_tpl);
+	}
+
 	/* Connect the Unix Domain Socket */
 	g_pcu_conn_id := f_pcuif_listen(PCU, mp_pcu_sock_path);
 	PCU.receive(UD_connected:?);
@@ -79,15 +128,8 @@
 	/* Wait for PCU_VERSION and return INFO_IND */
 	PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(0, PCU_VERSION, ?)));
 	/* FIXME: make sure to use parameters from mp_gb_cfg.cell_id in the PCU INFO IND */
-	var template PCUIF_Message info_ind := ts_PCUIF_INFO_IND(bts_nr := 0,
-								nsei := mp_nsconfig.nsei,
-								nsvci := mp_nsconfig.nsvci,
-								bvci := mp_gb_cfg.bvci,
-								local_port := mp_nsconfig.remote_udp_port,
-								remote_port := mp_nsconfig.local_udp_port,
-								remote_ip := f_inet_haddr(mp_nsconfig.local_ip)
-								);
-	PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind));
+	var template PCUIF_Message info_ind_msg := ts_PCUIF_INFO_IND(0, info_ind);
+	PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind_msg));
 }
 
 function f_pcuif_tx(template (value) PCUIF_Message msg) runs on RAW_PCU_CT {
@@ -439,7 +481,7 @@
 		}
 }
 
-private function f_init_raw(charstring id)
+private function f_init_raw(charstring id, template (omit) PCUIF_info_ind info_ind_tpl := omit)
 runs on RAW_PCU_Test_CT {
 	var PCUIF_info_ind info_ind;
 	var RAW_PCUIF_CT vc_PCUIF;
@@ -459,42 +501,11 @@
 	connect(vc_BTS:PCUIF, vc_PCUIF:BTS);
 	connect(vc_BTS:TC, self:BTS);
 
-	/* FIXME: make sure to use parameters from mp_gb_cfg.cell_id in the PCU INFO IND */
-	info_ind := {
-		version := PCU_IF_VERSION,
-		flags := c_PCUIF_Flags_default,
-		trx := valueof(ts_PCUIF_InfoTrxs_def),
-		/* TODO: make this configurable */
-		bsic := 7, mcc := 262, mnc := 42,
-		mnc_3_digits := 0,
-		/* TODO: make this configurable */
-		lac := 13135, rac := 0,
-		nsei := mp_nsconfig.nsei,
-		nse_timer := { 3, 3, 3, 3, 30, 3, 10 },
-		cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 },
-		cell_id := 20960,
-		repeat_time := 5 * 50,
-		repeat_count := 3,
-		bvci := mp_gb_cfg.bvci,
-		t3142 := 20,
-		t3169 := 5,
-		t3191 := 5,
-		t3193_10ms := 160,
-		t3195 := 5,
-		t3101 := 10,
-		t3103 := 4,
-		t3105 := 8,
-		cv_countdown := 15,
-		dl_tbf_ext := 250 * 10, /* ms */
-		ul_tbf_ext := 250 * 10, /* ms */
-		initial_cs := 2,
-		initial_mcs := 6,
-		nsvci := { mp_nsconfig.nsvci, 0 },
-		local_pprt := { mp_nsconfig.remote_udp_port, 0 },
-		remote_port := { mp_nsconfig.local_udp_port, 0 },
-		remote_ip := { f_inet_haddr(mp_nsconfig.local_ip), '00000000'O }
-	};
-
+	if (istemplatekind(info_ind_tpl, "omit")) {
+		info_ind := f_default_pcuif_info_ind();
+	} else {
+		info_ind := valueof(info_ind_tpl);
+	}
 	vc_PCUIF.start(f_PCUIF_CT_handler(mp_pcu_sock_path));
 	vc_BTS.start(f_BTS_CT_handler(0, info_ind));
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15674
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: I75c746b822184fdcc966d77a7c6a0a6918c236e6
Gerrit-Change-Number: 15674
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191004/cea3276b/attachment.htm>


More information about the gerrit-log mailing list