Change in osmo-ttcn3-hacks[master]: BTS: refactor f_init_rsl(): make number of transceivers configurable

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

laforge gerrit-no-reply at lists.osmocom.org
Mon Jun 22 13:15:32 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18951 )

Change subject: BTS: refactor f_init_rsl(): make number of transceivers configurable
......................................................................

BTS: refactor f_init_rsl(): make number of transceivers configurable

Not all osmo-bts backends do support multiple transceivers, while
we still want to run test cases against them. Let's make the
number of transceivers configurable (mp_transceiver_num), so it
can be adjusted depending on osmo-bts backend to be used.

Change-Id: Ic9dd49a2fc856de593b52b3ec0c559e0e15ca173
Related: OS#3155
---
M bts/BTS_Tests.ttcn
1 file changed, 31 insertions(+), 28 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index f98419d..9ebd952 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -109,6 +109,8 @@
 	float mp_ipa_up_delay := 0.0;
 	/* false for now, as only virtphy supports it, not calypso-l1 nor trxcon */
 	boolean mp_l1_supports_gprs := false;
+	/* how many transceivers do we expect to connect */
+	integer mp_transceiver_num := 1;
 }
 
 type record of RslChannelNr ChannelNrs;
@@ -120,7 +122,6 @@
 	var RSL_Emulation_CT vc_RSL;
 	/* Direct RSL_CCHAN_PT */
 	port RSL_CCHAN_PT RSL_CCHAN;
-	timer g_rslem_up_timer;
 
 	/* L1CTL port (for classic tests) */
 	port L1CTL_PT L1CTL;
@@ -183,16 +184,12 @@
 	port PCUIF_CODEC_PT PCU;
 }
 
-private altstep as_rsl_init_guard() runs on test_CT {
-	[] g_rslem_up_timer.timeout {
-		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
-			"Timeout waiting for RSL bring up");
-		}
-	/* osmo-bts may send us CCCH LOAD INDication or whatever else */
-	[] RSL_CCHAN.receive(ASP_RSL_Unitdata:?) { repeat; }
-}
-
 function f_init_rsl(charstring id) runs on test_CT {
+	var bitstring trx_mask := '00000000'B;
+	var integer trx_count := 0;
+	var RSLEm_Event ev;
+	timer T;
+
 	vc_IPA := IPA_Emulation_CT.create(id & "-RSL-IPA");
 	vc_RSL := RSL_Emulation_CT.create(id & "-RSL");
 
@@ -203,27 +200,33 @@
 	vc_IPA.start(IPA_Emulation.main_server(mp_rsl_ip, mp_rsl_port));
 	vc_RSL.start(RSL_Emulation.main(false));
 
-	/* TTCN-3 offers no way to guard 'interleave' statements */
-	g_rslem_up_timer.start(mp_ipa_up_timeout);
-	var default d := activate(as_rsl_init_guard());
-
-	/* We expect all 4 transceivers to connect here (separate IPA/RSL connections).
+	/* We expect (N = mp_transceiver_num) IPA/RSL transceiver connections here.
 	 * See https://gerrit.osmocom.org/q/Ib5ad31388ae25399ad09739aac3fdcb0b3a1f78b. */
-	interleave {
+	T.start(mp_ipa_up_timeout);
+	alt {
 	/* These events are sent by the RSL_Emulation_CT */
-	[] RSL_CCHAN.receive(tr_RSLEm_EV(RSLEM_EV_TRX_UP, IPAC_PROTO_RSL_TRX0));
-	[] RSL_CCHAN.receive(tr_RSLEm_EV(RSLEM_EV_TRX_UP, IPAC_PROTO_RSL_TRX1));
-	[] RSL_CCHAN.receive(tr_RSLEm_EV(RSLEM_EV_TRX_UP, IPAC_PROTO_RSL_TRX2));
-	[] RSL_CCHAN.receive(tr_RSLEm_EV(RSLEM_EV_TRX_UP, IPAC_PROTO_RSL_TRX3));
-	/* These messages (RF RESource INDication) are sent by the IUT itself */
-	[] RSL_CCHAN.receive(tr_ASP_RSL_UD(tr_RSL_RF_RES_IND, IPAC_PROTO_RSL_TRX0));
-	[] RSL_CCHAN.receive(tr_ASP_RSL_UD(tr_RSL_RF_RES_IND, IPAC_PROTO_RSL_TRX1));
-	[] RSL_CCHAN.receive(tr_ASP_RSL_UD(tr_RSL_RF_RES_IND, IPAC_PROTO_RSL_TRX2));
-	[] RSL_CCHAN.receive(tr_ASP_RSL_UD(tr_RSL_RF_RES_IND, IPAC_PROTO_RSL_TRX3));
-	}
+	[] RSL_CCHAN.receive(tr_RSLEm_EV(RSLEM_EV_TRX_UP, ?)) -> value ev {
+		/* Make sure that all transceivers use unique stream ID */
+		if (trx_mask[enum2int(ev.sid)] == '1'B) {
+			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+				log2str("Duplicate RSL stream ID (", ev.sid, ")"));
+		}
 
-	g_rslem_up_timer.stop;
-	deactivate(d);
+		/* This message (RF RESource INDication) is sent by the IUT itself */
+		RSL_CCHAN.receive(tr_ASP_RSL_UD(tr_RSL_RF_RES_IND, ev.sid));
+		trx_mask[enum2int(ev.sid)] := '1'B;
+		trx_count := trx_count + 1;
+
+		log(trx_count, "/", mp_transceiver_num, " transceiver(s) connected");
+		if (trx_count < mp_transceiver_num) { repeat; }
+		}
+	/* osmo-bts may send us CCCH LOAD INDication or whatever else */
+	[] RSL_CCHAN.receive(ASP_RSL_Unitdata:?) { repeat; }
+	[] T.timeout {
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+			"Timeout waiting for RSL bring up");
+		}
+	}
 }
 
 type record ConnHdlrPars {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18951
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: Ic9dd49a2fc856de593b52b3ec0c559e0e15ca173
Gerrit-Change-Number: 18951
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200622/f96cd0dd/attachment.htm>


More information about the gerrit-log mailing list