<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16649">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BTS_Tests: tolerate empty measurement result on chan est.<br><br>On channel establishment the first measurement result may lack the<br>measurement reports from the MS. This is normal behavior, so lets<br>tolerate that.<br><br>Change-Id: Ib2f511991349ab15e02db9c5e45f0df3645835a4<br>Related: OS#2975<br>---<br>M bts/BTS_Tests.ttcn<br>M library/RSL_Types.ttcn<br>2 files changed, 75 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/49/16649/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn</span><br><span>index 779f7c3..50cb7bb 100644</span><br><span>--- a/bts/BTS_Tests.ttcn</span><br><span>+++ b/bts/BTS_Tests.ttcn</span><br><span>@@ -1730,10 +1730,49 @@</span><br><span>                                    ?, t_toffs);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* build a template for matching measurement results that do not contain any</span><br><span style="color: hsl(120, 100%, 40%);">+ * MS related measurement (l1_info, l3_info and ms timing offset. */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_build_meas_res_tmpl_empty() runs on ConnHdlr return template RSL_Message {</span><br><span style="color: hsl(120, 100%, 40%);">+  var ConnL1Pars l1p := g_pars.l1_pars;</span><br><span style="color: hsl(120, 100%, 40%);">+ var template RSL_IE_UplinkMeas ul_meas := {</span><br><span style="color: hsl(120, 100%, 40%);">+           len := 3,</span><br><span style="color: hsl(120, 100%, 40%);">+             rfu := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+          dtx_d := l1p.dtx_enabled,</span><br><span style="color: hsl(120, 100%, 40%);">+             rxlev_f_u := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+               reserved1 := '00'B,</span><br><span style="color: hsl(120, 100%, 40%);">+           rxlev_s_u := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+               reserved2 := '00'B,</span><br><span style="color: hsl(120, 100%, 40%);">+           rxq_f_u := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+         rxq_s_u := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+         supp_meas_info := omit</span><br><span style="color: hsl(120, 100%, 40%);">+        };</span><br><span style="color: hsl(120, 100%, 40%);">+    if (l1p.toa256_enabled) {</span><br><span style="color: hsl(120, 100%, 40%);">+             ul_meas.len := (3+8);</span><br><span style="color: hsl(120, 100%, 40%);">+         ul_meas.supp_meas_info := {</span><br><span style="color: hsl(120, 100%, 40%);">+                   toa256_mean := f_tolerance(l1p.timing_offset_256syms, -63*256, 192*256, mp_tolerance_timing_offset_256syms),</span><br><span style="color: hsl(120, 100%, 40%);">+                  toa256_min := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                      toa256_max := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                      toa256_std_dev := ?</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%);">+     var template RSL_IE_BS_Power bs_power := {</span><br><span style="color: hsl(120, 100%, 40%);">+            reserved := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+                epc := false,</span><br><span style="color: hsl(120, 100%, 40%);">+         fpc := false,</span><br><span style="color: hsl(120, 100%, 40%);">+         power_level := l1p.bs_power_level</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%);">+  return tr_RSL_MEAS_RES_EMPTY(g_chan_nr, g_next_meas_res_nr, ul_meas, bs_power);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* verify we regularly receive measurement reports with incrementing numbers */</span><br><span> altstep as_meas_res(boolean verify_meas := true) runs on ConnHdlr {</span><br><span>       var RSL_Message rsl;</span><br><span>         [not verify_meas] RSL.receive(tr_RSL_MEAS_RES(?)) { repeat; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Receive osmocom specific measurement reports. This is the normal</span><br><span style="color: hsl(120, 100%, 40%);">+    * case. Here we verify that the measurement reports we sent are</span><br><span style="color: hsl(120, 100%, 40%);">+       * comming back as we expect them. */</span><br><span>        [] RSL.receive(f_build_meas_res_tmpl()) -> value rsl {</span><br><span>            /* increment counter of next to-be-expected meas rep */</span><br><span>              g_next_meas_res_nr := (g_next_meas_res_nr + 1) mod 256;</span><br><span>@@ -1741,9 +1780,29 @@</span><br><span>             f_timer_safe_restart(g_Tmeas_exp);</span><br><span>           repeat;</span><br><span>              }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* When the BTS has established the channel, the MS might need slightly</span><br><span style="color: hsl(120, 100%, 40%);">+        * more time to establish the channel and actually start sending. The</span><br><span style="color: hsl(120, 100%, 40%);">+  * result is then a measurement report that just lacks the measurement</span><br><span style="color: hsl(120, 100%, 40%);">+         * information of the MS. This is normal and we tolerate this behavior. */</span><br><span style="color: hsl(120, 100%, 40%);">+    [] RSL.receive(f_build_meas_res_tmpl_empty()) -> value rsl {</span><br><span style="color: hsl(120, 100%, 40%);">+               /* increment counter of next to-be-expected meas rep */</span><br><span style="color: hsl(120, 100%, 40%);">+               g_next_meas_res_nr := (g_next_meas_res_nr + 1) mod 256;</span><br><span style="color: hsl(120, 100%, 40%);">+               /* Re-start the timer expecting the next MEAS RES */</span><br><span style="color: hsl(120, 100%, 40%);">+          f_timer_safe_restart(g_Tmeas_exp);</span><br><span style="color: hsl(120, 100%, 40%);">+            repeat;</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%);">+   /* Due to the TDMA nature of GSM, TRXCON implements a way to emit dummy</span><br><span style="color: hsl(120, 100%, 40%);">+        * measurements if the TTCN3 side does not supply measurement input in</span><br><span style="color: hsl(120, 100%, 40%);">+         * time. In those cases TRXCON will either use a cached measurement</span><br><span style="color: hsl(120, 100%, 40%);">+    * report or a hardcoded one. If TRXCON picks the hardcoded measurement</span><br><span style="color: hsl(120, 100%, 40%);">+        * report the templates above will not match. We tolerate this</span><br><span style="color: hsl(120, 100%, 40%);">+         * behavior, but only once. */</span><br><span>       [] RSL.receive(tr_RSL_MEAS_RES(g_chan_nr, g_next_meas_res_nr)) -> value rsl {</span><br><span>             /* increment counter of next to-be-expected meas rep */</span><br><span>              g_next_meas_res_nr := (g_next_meas_res_nr + 1) mod 256;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>            if (g_first_meas_res) {</span><br><span>                      g_first_meas_res := false;</span><br><span>                   repeat;</span><br><span>diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn</span><br><span>index d982e02..f905973 100644</span><br><span>--- a/library/RSL_Types.ttcn</span><br><span>+++ b/library/RSL_Types.ttcn</span><br><span>@@ -1363,6 +1363,22 @@</span><br><span>                }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* Receive template for a measurement report that lacks the measurement report</span><br><span style="color: hsl(120, 100%, 40%);">+         * from the MS (l1_info, l3_info and ms timing offset */</span><br><span style="color: hsl(120, 100%, 40%);">+      template RSL_Message tr_RSL_MEAS_RES_EMPTY(template RslChannelNr chan_nr,</span><br><span style="color: hsl(120, 100%, 40%);">+                                          template uint8_t meas_res_nr := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                            template RSL_IE_UplinkMeas ul_meas := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+                                      template RSL_IE_BS_Power bs_power := ?) := {</span><br><span style="color: hsl(120, 100%, 40%);">+             msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),</span><br><span style="color: hsl(120, 100%, 40%);">+           msg_type := RSL_MT_MEAS_RES,</span><br><span style="color: hsl(120, 100%, 40%);">+          ies := {</span><br><span style="color: hsl(120, 100%, 40%);">+                      tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),</span><br><span style="color: hsl(120, 100%, 40%);">+                  tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),</span><br><span style="color: hsl(120, 100%, 40%);">+                  tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),</span><br><span style="color: hsl(120, 100%, 40%);">+                      tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})</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>  /* Osmocom specific template, require lots of optional fields to be present */</span><br><span>       template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,</span><br><span>                                          template uint8_t meas_res_nr := ?,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16649">change 16649</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/+/16649"/><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: Ib2f511991349ab15e02db9c5e45f0df3645835a4 </div>
<div style="display:none"> Gerrit-Change-Number: 16649 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>