<p>lynxis lazus has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20923">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">PCU_Tests_SNS: improve SGSN originated BVC-RESETs<br><br>The BVC-RESETs are a little bit more complicated. The PCU will send<br>a BVC-RESET after the NSE become available.<br>Ensure the RESET is received and ignored so there is no race condition<br>if both sides send a BVC-RESET at the same time.<br><br>The test case TC_sns_1c1u_so_bvc_reset is still failing because the PCU can't<br>handle BVC-RESETs properly (both PTP and signalling).<br><br>Change-Id: Id681749d75073c1d50a4b0a2e86f0a2dd0955b45<br>---<br>M library/RAW_NS.ttcn<br>M pcu/PCU_Tests_SNS.ttcn<br>2 files changed, 24 insertions(+), 4 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/23/20923/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/RAW_NS.ttcn b/library/RAW_NS.ttcn</span><br><span>index 314bf31..02ed9de 100644</span><br><span>--- a/library/RAW_NS.ttcn</span><br><span>+++ b/library/RAW_NS.ttcn</span><br><span>@@ -67,15 +67,16 @@</span><br><span> </span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-function f_ns_exp(template PDU_NS exp_rx, integer idx := 0) runs on RAW_NS_CT return PDU_NS {</span><br><span style="color: hsl(120, 100%, 40%);">+function f_ns_exp(template PDU_NS exp_rx, integer idx := 0, boolean ignore_other_pdu := false) runs on RAW_NS_CT return PDU_NS {</span><br><span>      var NS_RecvFrom nrf;</span><br><span>         log("f_ns_exp() expecting ", exp_rx);</span><br><span>      alt {</span><br><span>        [] NSCP[idx].receive(t_NS_RecvFrom(exp_rx)) -> value nrf { }</span><br><span style="color: hsl(0, 100%, 40%);">- [] NSCP[idx].receive(t_NS_RecvFrom(?)) -> value nrf {</span><br><span style="color: hsl(120, 100%, 40%);">+      [not ignore_other_pdu] NSCP[idx].receive(t_NS_RecvFrom(?)) -> value nrf {</span><br><span>                 setverdict(fail, "Received unexpected NS: ", nrf);</span><br><span>                 mtc.stop;</span><br><span>            }</span><br><span style="color: hsl(120, 100%, 40%);">+     [ignore_other_pdu] NSCP[idx].receive { repeat; }</span><br><span>     }</span><br><span>    return nrf.msg;</span><br><span> }</span><br><span>diff --git a/pcu/PCU_Tests_SNS.ttcn b/pcu/PCU_Tests_SNS.ttcn</span><br><span>index 86b83c2..20e0fde 100644</span><br><span>--- a/pcu/PCU_Tests_SNS.ttcn</span><br><span>+++ b/pcu/PCU_Tests_SNS.ttcn</span><br><span>@@ -287,11 +287,21 @@</span><br><span>    f_outgoing_ns_alive(1);</span><br><span> </span><br><span>  if (sgsn_originated_reset) {</span><br><span style="color: hsl(120, 100%, 40%);">+          /* Expect BVC-RESET, but ignore it to prevent a race condition of BVC RESETs */</span><br><span style="color: hsl(120, 100%, 40%);">+               var template PDU_NS pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, 0, omit));</span><br><span style="color: hsl(120, 100%, 40%);">+          f_ns_exp(pdu, ignore_other_pdu := true);</span><br><span style="color: hsl(120, 100%, 40%);">+              /* SGSN originated BVC-RESET on an uninitialized signalling BVC */</span><br><span>           f_tx_bvc_reset_rx_ack(0, omit, omit);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+               /* Expect BVC-RESET PTP BVC, but ignore it to prevent a race condition of BVC RESETs */</span><br><span style="color: hsl(120, 100%, 40%);">+               pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id));</span><br><span style="color: hsl(120, 100%, 40%);">+              f_ns_exp(pdu, ignore_other_pdu := true);</span><br><span style="color: hsl(120, 100%, 40%);">+              /* SGSN originated BVC-RESET on an uninitialized PTP BVC */</span><br><span>          f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, omit, mp_gb_cfg.bvc[0].cell_id);</span><br><span>        } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                /* Expect BVC-RESET for signaling (0) and ptp BVCI */</span><br><span style="color: hsl(120, 100%, 40%);">+         /* Expect BVC-RESET for signaling BVCI=0 */</span><br><span>          as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+               /* Expect BVC-RESET from the PCU on PTP BVC */</span><br><span>               as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, omit, oneshot := true);</span><br><span>      }</span><br><span>    /* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==0) */</span><br><span>@@ -337,11 +347,20 @@</span><br><span>        f_outgoing_ns_alive_no_ack(idx := 0);</span><br><span> </span><br><span>    if (sgsn_originated_reset) {</span><br><span style="color: hsl(120, 100%, 40%);">+          /* Expect BVC-RESET, but ignore it to prevent a race condition of BVC RESETs */</span><br><span style="color: hsl(120, 100%, 40%);">+               var template PDU_NS pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, 0, omit));</span><br><span style="color: hsl(120, 100%, 40%);">+          f_ns_exp(pdu, idx := 1, ignore_other_pdu := true);</span><br><span style="color: hsl(120, 100%, 40%);">+            /* SGSN originated BVC-RESET on an uninitialized sign BVC */</span><br><span>                 f_tx_bvc_reset_rx_ack(0, omit, omit, idx := 1);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+             /* Expect BVC-RESET PTP BVC, but ignore it to prevent a race condition of BVC RESETs */</span><br><span style="color: hsl(120, 100%, 40%);">+               pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id));</span><br><span style="color: hsl(120, 100%, 40%);">+              f_ns_exp(pdu, idx := 1, ignore_other_pdu := true);</span><br><span>           f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, omit, mp_gb_cfg.bvc[0].cell_id, idx := 1);</span><br><span>      } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                /* Expect BVC-RESET for signaling BVCI=0 and ptp BVCI */</span><br><span style="color: hsl(120, 100%, 40%);">+              /* Expect BVC-RESET for signaling BVCI=0 */</span><br><span>          as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true, idx := 1);</span><br><span style="color: hsl(120, 100%, 40%);">+             /* Expect BVC-RESET from the PCU on PTP BVC */</span><br><span>               as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, omit, oneshot := true, idx := 1);</span><br><span>    }</span><br><span>    /* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==1) */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20923">change 20923</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/+/20923"/><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: Id681749d75073c1d50a4b0a2e86f0a2dd0955b45 </div>
<div style="display:none"> Gerrit-Change-Number: 20923 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>