Change in osmo-ttcn3-hacks[master]: library/RSL_Emulation: optional IPA stream ID patching

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
Tue Jun 9 14:29:04 UTC 2020


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

Change subject: library/RSL_Emulation: optional IPA stream ID patching
......................................................................

library/RSL_Emulation: optional IPA stream ID patching

Unfortunately, the latest release of osmo-bts still has a bug,
that has been fixed [1] in the recent master. Because of that,
most of the test cases in ttcn3-bts-test-latest currently fail.

The problem is that all transceivers use IPAC_PROTO_RSL_TRX0,
regardless of what the BSC tells them to use. Let's work this
around by patching IPA stream ID in ASP_RSL_Unitdata messages
coming from the IPA emulation.

[1] I5927f59a49724170a63e87be604973f7c9d5d8be

Change-Id: I66cecc9ea24ba79e1a03492e3fda2874951d37a0
---
M library/RSL_Emulation.ttcn
1 file changed, 25 insertions(+), 0 deletions(-)

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



diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn
index 9a07417..bb11340 100644
--- a/library/RSL_Emulation.ttcn
+++ b/library/RSL_Emulation.ttcn
@@ -35,6 +35,12 @@
 import from IPA_Emulation all;
 
 
+modulepar {
+	/* Work around switch for ttcn3-bts-test-latest, enables patching of IPA
+	 * stream ID in the "BSC" mode. See I5927f59a49724170a63e87be604973f7c9d5d8be. */
+	boolean mp_rslem_patch_ipa_cid := false;
+};
+
 /* General "base class" component definition, of which specific implementations
  * derive themselves by means of the "extends" feature */
 type component RSL_DchanHdlr {
@@ -396,6 +402,19 @@
 	return TrxConnMap[trx_nr];
 }
 
+/* Work around for a bug in osmo-bts when all transceivers use IPAC_PROTO_RSL_TRX0 */
+private function f_trx_conn_map_patch_ud(inout ASP_RSL_Unitdata ud)
+runs on RSL_Emulation_CT {
+	for (var integer i := 0; i < sizeof(TrxConnMap); i := i + 1) {
+		if (ud.conn_id == TrxConnMap[i]) {
+			ud.streamId := f_streamId_by_trx(i);
+			return; /* We're done */
+		}
+	}
+
+	testcase.stop("Failed to patch IPA stream ID in ASP RSL UD: ", ud);
+}
+
 type component RSL_Emulation_CT {
 	/* port facing down towards IPA emulation */
 	port IPA_RSL_PT IPA_PT;
@@ -537,11 +556,17 @@
 
 		/* Forward common channel management to the special port for it */
 		[] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeT(?), sid := ?)) -> value rx_rsl {
+			if (not bts_role and mp_rslem_patch_ipa_cid) {
+				f_trx_conn_map_patch_ud(rx_rsl);
+			}
 			CCHAN_PT.send(rx_rsl);
 		}
 
 		/* Forward common channel management to the special port for it */
 		[] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeC(?), sid := ?)) -> value rx_rsl {
+			if (not bts_role and mp_rslem_patch_ipa_cid) {
+				f_trx_conn_map_patch_ud(rx_rsl);
+			}
 			CCHAN_PT.send(rx_rsl);
 		}
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18741
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: I66cecc9ea24ba79e1a03492e3fda2874951d37a0
Gerrit-Change-Number: 18741
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
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/20200609/27048fdc/attachment.htm>


More information about the gerrit-log mailing list