<p>Stefan Sperling <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/9374">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">start implementing the TC_paging() PCU test<br><br>Implement a basic paging test for the PCU, which is passing for paging<br>via TMSI (but only if osmo-pcu is started after the test is started).<br><br>Previously, this test code amounted to a debugging loop which<br>never terminated.<br><br>Change-Id: Id0384e0742ab91983615e4f1c883bb044c1c8b18<br>Related: OS#2404<br>---<br>M library/L3_Templates.ttcn<br>M pcu/PCU_Tests.ttcn<br>M pcu/expected-results.xml<br>3 files changed, 67 insertions(+), 15 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn</span><br><span>index e109fde..3918f3d 100644</span><br><span>--- a/library/L3_Templates.ttcn</span><br><span>+++ b/library/L3_Templates.ttcn</span><br><span>@@ -303,6 +303,22 @@</span><br><span>  }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Template for receiving a Paging Request Type1 message with a given TMSI in the first mobile identity. */</span><br><span style="color: hsl(120, 100%, 40%);">+template MobileL3_CommonIE_Types.MobileIdentityLV tr_PAGING_REQ1_MI1_TMSI(octetstring tmsi) := {</span><br><span style="color: hsl(120, 100%, 40%);">+     lengthIndicator := 5,</span><br><span style="color: hsl(120, 100%, 40%);">+ mobileIdentityV := {</span><br><span style="color: hsl(120, 100%, 40%);">+          typeOfIdentity := '100'B,</span><br><span style="color: hsl(120, 100%, 40%);">+             oddEvenInd_identity := {</span><br><span style="color: hsl(120, 100%, 40%);">+                      tmsi_ptmsi := {</span><br><span style="color: hsl(120, 100%, 40%);">+                               oddevenIndicator := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                             fillerDigit := '1111'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                               octets := tmsi</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%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> template PDU_ML3_NW_MS tr_PAGING_REQ2(template TMSIP_TMSI_V mi1 := ?,</span><br><span>                                  template TMSIP_TMSI_V mi2 := ?,</span><br><span>                                      template MobileIdentityTLV mi3 := *) := {</span><br><span>diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn</span><br><span>index adbc73e..6e8185d 100644</span><br><span>--- a/pcu/PCU_Tests.ttcn</span><br><span>+++ b/pcu/PCU_Tests.ttcn</span><br><span>@@ -17,6 +17,9 @@</span><br><span>     import from GPRS_Context all;</span><br><span>        import from GPRS_TBF all;</span><br><span>    import from L1CTL_PortType all;</span><br><span style="color: hsl(120, 100%, 40%);">+       import from MobileL3_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+       import from MobileL3_CommonIE_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+      import from L3_Templates all;</span><br><span> </span><br><span>    modulepar {</span><br><span>          BssgpConfig mp_gb_cfg := {</span><br><span>@@ -207,27 +210,58 @@</span><br><span>           log("BSSGP successfully initialized");</span><br><span>     }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ function f_wait_paging_req_type1(hexstring expected_tmsi) runs on dummy_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+          var LAPDm_ph_data ph_data;</span><br><span style="color: hsl(120, 100%, 40%);">+            timer T := 5.0;</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%);">+                 [] L1.receive(LAPDm_ph_data:{sacch:=?,sapi:=0,lapdm:={bbis:=?}}) -> value ph_data {</span><br><span style="color: hsl(120, 100%, 40%);">+                                var octetstring payload := substr(ph_data.lapdm.bbis.payload, 1, lengthof(ph_data.lapdm.bbis.payload) - 1);</span><br><span style="color: hsl(120, 100%, 40%);">+                           var PDU_ML3_NW_MS pdu;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+                              if (dec_PDU_ML3_NW_MS_backtrack(payload, pdu) != 0) {</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%);">+                           if (not ischosen(pdu.msgs.rrm)) {</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%);">+                           if (match(pdu, tr_PAGING_REQ1(tr_PAGING_REQ1_MI1_TMSI(hex2oct(expected_tmsi))))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                    setverdict(pass);</span><br><span style="color: hsl(120, 100%, 40%);">+                             } else {</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%);">+                     [] L1.receive { repeat; }</span><br><span style="color: hsl(120, 100%, 40%);">+                     [] T.timeout { setverdict(fail); }</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 PS-PAGING via BSSGP to PCU, expect it to show up on L1/Um */</span><br><span>         testcase TC_paging() runs on dummy_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-         var GsmTmsi tmsi := hex2int('01234567'H);</span><br><span style="color: hsl(120, 100%, 40%);">+             var hexstring tmsi_hex := '01234567'H;</span><br><span style="color: hsl(120, 100%, 40%);">+                var GsmTmsi tmsi := hex2int(tmsi_hex);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>             g_mmctx.imsi := '262420123456789'H;</span><br><span>          g_mmctx.tlli := f_random_tlli();</span><br><span>             f_init();</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-           /* Send paging on signalling BVCI 0 since osmo-pcu does not support paging on PTP yet. */</span><br><span style="color: hsl(0, 100%, 40%);">-               BSSGP_SIG[0].send(ts_BSSGP_PS_PAGING_IMSI(0, g_mmctx.imsi));</span><br><span style="color: hsl(0, 100%, 40%);">-            BSSGP_SIG[0].send(ts_BSSGP_PS_PAGING_PTMSI(0, g_mmctx.imsi, tmsi));</span><br><span style="color: hsl(120, 100%, 40%);">+           var BCCH_tune_req tune_req := { { false, 871 }, true };</span><br><span style="color: hsl(120, 100%, 40%);">+               L1.send(tune_req);</span><br><span style="color: hsl(120, 100%, 40%);">+            /* FIXME: wait for confirm */</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-               while (true) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  var BssgpDecoded bd;</span><br><span style="color: hsl(0, 100%, 40%);">-                    alt {</span><br><span style="color: hsl(0, 100%, 40%);">-                           [] BSSGP[0].receive(tr_BD_L3_MT(?)) -> value bd {</span><br><span style="color: hsl(0, 100%, 40%);">-                                    log("BSSGP Rx: ", bd);</span><br><span style="color: hsl(0, 100%, 40%);">-                                }</span><br><span style="color: hsl(0, 100%, 40%);">-                               [] BSSGP[0].receive(t_BssgpStsInd(?, ?, BVC_S_UNBLOCKED)) { repeat; }</span><br><span style="color: hsl(0, 100%, 40%);">-                           [] BSSGP[0].receive { repeat; }</span><br><span style="color: hsl(0, 100%, 40%);">-                 }</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(120, 100%, 40%);">+             /* Send paging on signalling BVCI 0 since osmo-pcu does not support paging on PTP yet. */</span><br><span style="color: hsl(120, 100%, 40%);">+             /*</span><br><span style="color: hsl(120, 100%, 40%);">+            TODO: Paging by IMSI does not work yet because osmo-pcu does not copy IMSI into paging requests.</span><br><span style="color: hsl(120, 100%, 40%);">+              BSSGP_SIG[0].send(ts_BSSGP_PS_PAGING_IMSI(0, g_mmctx.imsi));</span><br><span style="color: hsl(120, 100%, 40%);">+          f_wait_paging_req_type1(hex2oct(g_mmctx.imsi));</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%);">+          /* Page by TMSI */</span><br><span style="color: hsl(120, 100%, 40%);">+            BSSGP_SIG[0].send(ts_BSSGP_PS_PAGING_PTMSI(0, g_mmctx.imsi, tmsi));</span><br><span style="color: hsl(120, 100%, 40%);">+           f_wait_paging_req_type1(tmsi_hex);</span><br><span>   }</span><br><span> </span><br><span>        /* Establish an UL TBF: Tune to ARFCN, send RACH, receive AGCH, enable TBF Rx */</span><br><span>@@ -633,5 +667,6 @@</span><br><span>               execute(TC_selftest_ns());</span><br><span>           execute(TC_ul_tbf_single_llc_sizes());</span><br><span>               execute(TC_ul_tbf());</span><br><span style="color: hsl(120, 100%, 40%);">+         execute(TC_paging());</span><br><span>        }</span><br><span> };</span><br><span>diff --git a/pcu/expected-results.xml b/pcu/expected-results.xml</span><br><span>index aec661d..e9610bd 100644</span><br><span>--- a/pcu/expected-results.xml</span><br><span>+++ b/pcu/expected-results.xml</span><br><span>@@ -1,6 +1,7 @@</span><br><span> <?xml version="1.0"?></span><br><span style="color: hsl(0, 100%, 40%);">-<testsuite name='PCU_Tests' tests='3' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'></span><br><span style="color: hsl(120, 100%, 40%);">+<testsuite name='PCU_Tests' tests='4' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'></span><br><span>   <testcase classname='PCU_Tests' name='TC_ul_tbf_single_llc_sizes' time='MASKED'/></span><br><span>   <testcase classname='PCU_Tests' name='TC_ul_tbf' time='MASKED'/></span><br><span>   <testcase classname='PCU_Tests' name='TC_selftest_ns' time='MASKED'/></span><br><span style="color: hsl(120, 100%, 40%);">+  <testcase classname='PCU_Tests' name='TC_paging' time='MASKED'/></span><br><span> </testsuite></span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9374">change 9374</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/9374"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Id0384e0742ab91983615e4f1c883bb044c1c8b18 </div>
<div style="display:none"> Gerrit-Change-Number: 9374 </div>
<div style="display:none"> Gerrit-PatchSet: 7 </div>
<div style="display:none"> Gerrit-Owner: Stefan Sperling <ssperling@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Stefan Sperling <ssperling@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>