<p>fixeria <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18741">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  fixeria: Verified
  pespin: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">library/RSL_Emulation: optional IPA stream ID patching<br><br>Unfortunately, the latest release of osmo-bts still has a bug,<br>that has been fixed [1] in the recent master. Because of that,<br>most of the test cases in ttcn3-bts-test-latest currently fail.<br><br>The problem is that all transceivers use IPAC_PROTO_RSL_TRX0,<br>regardless of what the BSC tells them to use. Let's work this<br>around by patching IPA stream ID in ASP_RSL_Unitdata messages<br>coming from the IPA emulation.<br><br>[1] I5927f59a49724170a63e87be604973f7c9d5d8be<br><br>Change-Id: I66cecc9ea24ba79e1a03492e3fda2874951d37a0<br>---<br>M library/RSL_Emulation.ttcn<br>1 file changed, 25 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn</span><br><span>index 9a07417..bb11340 100644</span><br><span>--- a/library/RSL_Emulation.ttcn</span><br><span>+++ b/library/RSL_Emulation.ttcn</span><br><span>@@ -35,6 +35,12 @@</span><br><span> import from IPA_Emulation all;</span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+modulepar {</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Work around switch for ttcn3-bts-test-latest, enables patching of IPA</span><br><span style="color: hsl(120, 100%, 40%);">+       * stream ID in the "BSC" mode. See I5927f59a49724170a63e87be604973f7c9d5d8be. */</span><br><span style="color: hsl(120, 100%, 40%);">+   boolean mp_rslem_patch_ipa_cid := false;</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* General "base class" component definition, of which specific implementations</span><br><span>  * derive themselves by means of the "extends" feature */</span><br><span> type component RSL_DchanHdlr {</span><br><span>@@ -396,6 +402,19 @@</span><br><span>  return TrxConnMap[trx_nr];</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Work around for a bug in osmo-bts when all transceivers use IPAC_PROTO_RSL_TRX0 */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_trx_conn_map_patch_ud(inout ASP_RSL_Unitdata ud)</span><br><span style="color: hsl(120, 100%, 40%);">+runs on RSL_Emulation_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+   for (var integer i := 0; i < sizeof(TrxConnMap); i := i + 1) {</span><br><span style="color: hsl(120, 100%, 40%);">+             if (ud.conn_id == TrxConnMap[i]) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    ud.streamId := f_streamId_by_trx(i);</span><br><span style="color: hsl(120, 100%, 40%);">+                  return; /* We're done */</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   testcase.stop("Failed to patch IPA stream ID in ASP RSL UD: ", ud);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> type component RSL_Emulation_CT {</span><br><span>      /* port facing down towards IPA emulation */</span><br><span>         port IPA_RSL_PT IPA_PT;</span><br><span>@@ -537,11 +556,17 @@</span><br><span> </span><br><span>          /* Forward common channel management to the special port for it */</span><br><span>           [] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeT(?), sid := ?)) -> value rx_rsl {</span><br><span style="color: hsl(120, 100%, 40%);">+                   if (not bts_role and mp_rslem_patch_ipa_cid) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                f_trx_conn_map_patch_ud(rx_rsl);</span><br><span style="color: hsl(120, 100%, 40%);">+                      }</span><br><span>                    CCHAN_PT.send(rx_rsl);</span><br><span>               }</span><br><span> </span><br><span>                /* Forward common channel management to the special port for it */</span><br><span>           [] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeC(?), sid := ?)) -> value rx_rsl {</span><br><span style="color: hsl(120, 100%, 40%);">+                   if (not bts_role and mp_rslem_patch_ipa_cid) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                f_trx_conn_map_patch_ud(rx_rsl);</span><br><span style="color: hsl(120, 100%, 40%);">+                      }</span><br><span>                    CCHAN_PT.send(rx_rsl);</span><br><span>               }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18741">change 18741</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18741"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I66cecc9ea24ba79e1a03492e3fda2874951d37a0 </div>
<div style="display:none"> Gerrit-Change-Number: 18741 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>