Change in osmo-ttcn3-hacks[master]: BTS_Tests: introduce and use as_pcuif_check_pdch_mask()

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

fixeria gerrit-no-reply at lists.osmocom.org
Sun Jul 19 10:46:14 UTC 2020


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


Change subject: BTS_Tests: introduce and use as_pcuif_check_pdch_mask()
......................................................................

BTS_Tests: introduce and use as_pcuif_check_pdch_mask()

This altstep would reduce code duplication.

Change-Id: Ic66598e3d2706da7caca7b27b9880562b0fcb9bd
---
M bts/BTS_Tests.ttcn
1 file changed, 17 insertions(+), 32 deletions(-)



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

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 574d47b..1c8127b 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -5438,9 +5438,21 @@
  * Osmocom Style Dynamic Timeslot Support
  ***********************************************************************/
 
-private function f_dyn_osmo_pdch_act(integer pcu_conn_id, integer bts_nr, integer trx_nr)
+private altstep as_pcuif_check_pdch_mask(integer pcu_conn_id, BIT1 exp,
+					 integer bts_nr, integer trx_nr)
 runs on ConnHdlr {
 	var PCUIF_send_data sd;
+
+	[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd {
+		var bitstring pdch_mask := sd.data.u.info_ind.trx[trx_nr].pdch_mask;
+		if (substr(pdch_mask, g_chan_nr.tn, 1) != exp) {
+			repeat;
+		}
+	}
+}
+
+private function f_dyn_osmo_pdch_act(integer pcu_conn_id, integer bts_nr, integer trx_nr)
+runs on ConnHdlr {
 	/* Expect BTS to immediately acknowledge activation as PDCH */
 	PCU.clear;
 	f_rsl_chan_act(g_pars.chan_mode);
@@ -5448,13 +5460,7 @@
 	timer T_wait := 2.0;
 	T_wait.start;
 	alt {
-	[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd {
-		if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '1'B) {
-			log("PCUIF_INFO_IND PDCH_MASK not yet '1' after PDCH ACT on TS", g_chan_nr.tn,
-			    " mask:", sd.data.u.info_ind.trx[trx_nr].pdch_mask);
-			repeat;
-		}
-		}
+	[] as_pcuif_check_pdch_mask(pcu_conn_id, '1'B, bts_nr, trx_nr);
 	[] PCU.receive { repeat; }
 	[] T_wait.timeout {
 		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
@@ -5468,7 +5474,6 @@
 
 private function f_dyn_osmo_pdch_deact(integer pcu_conn_id, integer bts_nr, integer trx_nr)
 runs on ConnHdlr {
-	var PCUIF_send_data sd;
 	/* Send RSL CHAN REL (deactivate) */
 	PCU.clear;
 	RSL.send(ts_RSL_RF_CHAN_REL(g_chan_nr));
@@ -5476,13 +5481,7 @@
 	timer T_wait := 2.0;
 	T_wait.start;
 	alt {
-	[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd {
-		if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '0'B) {
-			log("PCUIF_INFO_IND PDCH_MASK not yet '0' after PDCH DEACT on TS", g_chan_nr.tn,
-			    " mask:", sd.data.u.info_ind.trx[trx_nr].pdch_mask);
-			repeat;
-		}
-		}
+	[] as_pcuif_check_pdch_mask(pcu_conn_id, '0'B, bts_nr, trx_nr);
 	[] PCU.receive { repeat; }
 	[] T_wait.timeout {
 		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
@@ -5638,7 +5637,6 @@
 
 private function f_dyn_ipa_pdch_act(integer pcu_conn_id, integer bts_nr, integer trx_nr)
 runs on ConnHdlr {
-	var PCUIF_send_data sd;
 	/* Expect BTS to immediately acknowledge activation as PDCH */
 	PCU.clear;
 	RSL.send(ts_RSL_IPA_PDCH_ACT(g_chan_nr));
@@ -5646,13 +5644,7 @@
 	timer T_wait := 2.0;
 	T_wait.start;
 	alt {
-	[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd {
-		if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '1'B) {
-			log("PCUIF_INFO_IND PDCH_MASK not yet '1' after PDCH ACT on TS", g_chan_nr.tn,
-			    " mask:", sd.data.u.info_ind.trx[trx_nr].pdch_mask);
-			repeat;
-		}
-		}
+	[] as_pcuif_check_pdch_mask(pcu_conn_id, '1'B, bts_nr, trx_nr);
 	[] PCU.receive { repeat; }
 	[] T_wait.timeout {
 	        Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
@@ -5668,7 +5660,6 @@
 
 private function f_dyn_ipa_pdch_deact(integer pcu_conn_id, integer bts_nr, integer trx_nr)
 runs on ConnHdlr {
-	var PCUIF_send_data sd;
 	/* Send RSL CHAN REL (deactivate) */
 	RSL.send(ts_RSL_IPA_PDCH_DEACT(g_chan_nr));
 	PCU.clear;
@@ -5676,13 +5667,7 @@
 	timer T_wait := 2.0;
 	T_wait.start;
 	alt {
-	[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd {
-		if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '0'B) {
-			log("PCUIF_INFO_IND PDCH_MASK not yet '0' after PDCH DEACT on TS", g_chan_nr.tn,
-			    " mask:", sd.data.u.info_ind.trx[trx_nr].pdch_mask);
-			repeat;
-		}
-		}
+	[] as_pcuif_check_pdch_mask(pcu_conn_id, '0'B, bts_nr, trx_nr);
 	[] PCU.receive { repeat; }
 	[] T_wait.timeout {
 	        Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,

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


More information about the gerrit-log mailing list