<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14660">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BTS_Tests.ttcn: introduce TC_pcu_data_ind_lqual_cb<br><br>The idea of this test case is to verify that the link quality<br>measurements, in particular C/I (Carrier-to-Interference ratio),<br>are delivered to the PCU (as a part of PCUIF_DATA.ind).<br><br>The C/I ratio needs to be calculated by the transceiver from the<br>training sequence of each burst, where we can compare the "ideal"<br>training sequence with the actual training sequence and then<br>express that in cB (centiBels).<br><br>This test case can only be executed with fake_trx.py and trxcon,<br>because this pair allows us to simulate C/I values. Also, the<br>new TRXD header format needs to be supported (see OS#4006).<br><br>Change-Id: I67d89b2f0e13a7a6f74f001b19d37add77ec06f5<br>Depends: (OsmocomBB) I7080effbbc1022d1884c6d6f0cb580eba8e514ff<br>Related: OS#1855<br>---<br>M bts/BTS_Tests.ttcn<br>1 file changed, 77 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/60/14660/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 3b27469..2ab4acc 100644</span><br><span>--- a/bts/BTS_Tests.ttcn</span><br><span>+++ b/bts/BTS_Tests.ttcn</span><br><span>@@ -422,6 +422,8 @@</span><br><span>          /* Start with a default moderate timing offset equalling TA=2, and RSSI=-60 */</span><br><span>               ret := f_TRXC_transceive(BTS_TRXC, g_bts_trxc_conn_id, valueof(ts_TRXC_FAKE_TIMING(2*256)));</span><br><span>                 ret := f_TRXC_transceive(BTS_TRXC, g_bts_trxc_conn_id, valueof(ts_TRXC_FAKE_RSSI(-60)));</span><br><span style="color: hsl(120, 100%, 40%);">+              /* FIXME: OsmoBTS may have different AB / NB threshold (see MIN_QUAL_NORM, MIN_QUAL_RACH) */</span><br><span style="color: hsl(120, 100%, 40%);">+          ret := f_TRXC_transceive(BTS_TRXC, g_bts_trxc_conn_id, valueof(ts_TRXC_FAKE_CI(0)));</span><br><span>         }</span><br><span> </span><br><span>        /* Wait some extra time to make sure the BTS emits a stable carrier.</span><br><span>@@ -4312,6 +4314,80 @@</span><br><span>        setverdict(pass);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+private function f_TC_pcu_data_ind_lqual_cb(int16_t lqual_cb_exp, int16_t thresh)</span><br><span style="color: hsl(120, 100%, 40%);">+runs on test_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+      var template PCUIF_send_data sdt;</span><br><span style="color: hsl(120, 100%, 40%);">+     var PCUIF_send_data sd;</span><br><span style="color: hsl(120, 100%, 40%);">+       var int16_t lqual_cb;</span><br><span style="color: hsl(120, 100%, 40%);">+ timer T := 1.0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /* PCUIF_DATA.ind is encapsulated into a supplementary record */</span><br><span style="color: hsl(120, 100%, 40%);">+      sdt := t_SD_PCUIF_MSGT(g_pcu_conn_id, PCU_IF_MSG_DATA_IND);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Send a random PDTCH frame over Um */</span><br><span style="color: hsl(120, 100%, 40%);">+       L1CTL.send(ts_L1CTL_TRAFFIC_REQ(ts_RslChanNr_PDCH(7), ts_RslLinkID_DCCH(0),</span><br><span style="color: hsl(120, 100%, 40%);">+                                   '0000'O & f_rnd_octstring(21)));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        T.start;</span><br><span style="color: hsl(120, 100%, 40%);">+      alt {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* If expected link quality is above the threshold */</span><br><span style="color: hsl(120, 100%, 40%);">+ [lqual_cb_exp >= thresh] PCU.receive(sdt) -> value sd {</span><br><span style="color: hsl(120, 100%, 40%);">+         lqual_cb := sd.data.u.data_ind.lqual_cb;</span><br><span style="color: hsl(120, 100%, 40%);">+              log("Rx PCUIF_DATA.ind (lqual_cb=", lqual_cb, ")");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+             /* Make sure the actual link quality matches the expected value */</span><br><span style="color: hsl(120, 100%, 40%);">+            if (not match(lqual_cb, lqual_cb_exp)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      setverdict(fail, log2str("Link quality ", lqual_cb, " does not match ",</span><br><span style="color: hsl(120, 100%, 40%);">+                                            "expected value ", lqual_cb_exp));</span><br><span style="color: hsl(120, 100%, 40%);">+         } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      setverdict(pass);</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%);">+     /* If expected link quality is below the threshold */</span><br><span style="color: hsl(120, 100%, 40%);">+ [lqual_cb_exp < thresh] PCU.receive(sdt) -> value sd {</span><br><span style="color: hsl(120, 100%, 40%);">+          Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,</span><br><span style="color: hsl(120, 100%, 40%);">+                                    log2str("Rx unexpected PCUIF_DATA.ind: ", sd.data));</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     /* Ignore PCUIF_RTS.req and PCUIF_TIME.ind */</span><br><span style="color: hsl(120, 100%, 40%);">+ [] PCU.receive { repeat; }</span><br><span style="color: hsl(120, 100%, 40%);">+    [lqual_cb_exp < thresh] T.timeout {</span><br><span style="color: hsl(120, 100%, 40%);">+                log("Rx nothing, as expected");</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(pass);</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     [lqual_cb_exp >= thresh] T.timeout {</span><br><span style="color: hsl(120, 100%, 40%);">+               Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,</span><br><span style="color: hsl(120, 100%, 40%);">+                                    "Timeout waiting for PCUIF_DATA.ind");</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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Verify C/I (Carrier-to-Interference ratio) processing of PDTCH frames */</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_pcu_data_ind_lqual_cb() runs on test_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+    f_init_pcu_test();</span><br><span style="color: hsl(120, 100%, 40%);">+    PCU.clear;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  f_init_l1ctl();</span><br><span style="color: hsl(120, 100%, 40%);">+       f_l1_tune(L1CTL);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Activate a PDCH channel on TS7 */</span><br><span style="color: hsl(120, 100%, 40%);">+  f_TC_pcu_act_req(0, 0, 7, true);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    /* Tune trxcon to that PDCH channel on TS7 */</span><br><span style="color: hsl(120, 100%, 40%);">+ f_L1CTL_DM_EST_REQ(L1CTL, { false, mp_trx0_arfcn },</span><br><span style="color: hsl(120, 100%, 40%);">+                      valueof(ts_RslChanNr_PDCH(7)), 7);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       /* C/I in centiBels, test range: -256 .. +1280, step 128 */</span><br><span style="color: hsl(120, 100%, 40%);">+   for (var int16_t i := -256; i <= 1280; i := i + 128) {</span><br><span style="color: hsl(120, 100%, 40%);">+             var TrxcMessage ret;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+                ret := f_TRXC_transceive(BTS_TRXC, g_bts_trxc_conn_id,</span><br><span style="color: hsl(120, 100%, 40%);">+                                         valueof(ts_TRXC_FAKE_CI(i)));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+              /* FIXME: OsmoBTS may have different threshold (see MIN_QUAL_NORM) */</span><br><span style="color: hsl(120, 100%, 40%);">+         f_TC_pcu_data_ind_lqual_cb(i, thresh := 0);</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> /* Send PAGING via RSL, expect it to shw up on PCU socket */</span><br><span> testcase TC_pcu_paging_from_rsl() runs on test_CT {</span><br><span>        f_init_pcu_test();</span><br><span>@@ -6160,6 +6236,7 @@</span><br><span>           execute( TC_pcu_data_req_imm_ass_pch() );</span><br><span>            execute( TC_pcu_rach_content() );</span><br><span>            execute( TC_pcu_ext_rach_content() );</span><br><span style="color: hsl(120, 100%, 40%);">+         execute( TC_pcu_data_ind_lqual_cb() );</span><br><span>               execute( TC_pcu_paging_from_rsl() );</span><br><span>                 execute( TC_pcu_time_ind() );</span><br><span>                execute( TC_pcu_rts_req() );</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14660">change 14660</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/+/14660"/><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: I67d89b2f0e13a7a6f74f001b19d37add77ec06f5 </div>
<div style="display:none"> Gerrit-Change-Number: 14660 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>