Change in osmo-ttcn3-hacks[master]: BTS_Tests: fix f_init_rsl(): expect all 4 transceivers to connect

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
Fri Jun 5 20:55:38 UTC 2020


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

Change subject: BTS_Tests: fix f_init_rsl(): expect all 4 transceivers to connect
......................................................................

BTS_Tests: fix f_init_rsl(): expect all 4 transceivers to connect

Fixes TC_paging_{imsi,tmsi}_{200,80}percent test cases.

Change-Id: I32bb6d37929cde420a547e18eeb2f940e833316b
Related: OS#4546
---
M bts/BTS_Tests.ttcn
1 file changed, 28 insertions(+), 18 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Verified
  laforge: Looks good to me, approved



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 80804ec..e3d4beb 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -118,6 +118,7 @@
 	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;
@@ -180,9 +181,14 @@
 	port PCUIF_CODEC_PT PCU;
 }
 
-function f_init_rsl(charstring id) runs on test_CT {
-	timer T := mp_ipa_up_timeout;
+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");
+		}
+}
 
+function f_init_rsl(charstring id) runs on test_CT {
 	vc_IPA := IPA_Emulation_CT.create(id & "-RSL-IPA");
 	vc_RSL := RSL_Emulation_CT.create(id & "-RSL");
 
@@ -193,14 +199,27 @@
 	vc_IPA.start(IPA_Emulation.main_server(mp_rsl_ip, mp_rsl_port));
 	vc_RSL.start(RSL_Emulation.main(false));
 
-	T.start;
-	alt {
-	/* TODO: handle connection events from multiple transceivers */
-	[] RSL_CCHAN.receive(tr_RSLEm_EV(RSLEM_EV_TRX_UP));
-	[] T.timeout {
-		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for ASP_IPA_EVENT_UP");
-		}
+	/* 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).
+	 * See https://gerrit.osmocom.org/q/Ib5ad31388ae25399ad09739aac3fdcb0b3a1f78b. */
+	interleave {
+	/* 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));
 	}
+
+	g_rslem_up_timer.stop;
+	deactivate(d);
 }
 
 type record ConnHdlrPars {
@@ -2956,13 +2975,6 @@
 	integer num_overload
 }
 
-/* receive + ignore RSL RF RES IND */
-altstep as_rsl_res_ind() runs on test_CT {
-	[] RSL_CCHAN.receive(tr_ASP_RSL_UD(tr_RSL_RF_RES_IND)) {
-		repeat;
-	}
-}
-
 /* Helper function for paging related testing */
 private function f_TC_paging(PagingTestCfg cfg) runs on test_CT return PagingTestState {
 	f_init();
@@ -3045,7 +3057,6 @@
 			}
 			}
 		[] T_total.timeout { }
-		[] as_rsl_res_ind();
 		}
 	}
 
@@ -3061,7 +3072,6 @@
 	[] T_wait.timeout {
 		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Waiting for empty paging queue");
 		}
-	[] as_rsl_res_ind();
 	}
 
 	log("num_paging_sent=", st.num_paging_sent, " rcvd_msgs=", st.num_paging_rcv_msgs,

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18633
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: I32bb6d37929cde420a547e18eeb2f940e833316b
Gerrit-Change-Number: 18633
Gerrit-PatchSet: 4
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/20200605/a4dec96d/attachment.htm>


More information about the gerrit-log mailing list