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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gbproxy: Add TC_bvc_reset_ptp_from_{bss,sgsn}<br><br>This tests BSS-originated and SGSN-originated BVC-RESET procedure of a PTP BVC.<br><br>Change-Id: Ie0a4899b6e793e3d69f117f350c5a2542fc4d402<br>---<br>M gbproxy/GBProxy_Tests.ttcn<br>1 file changed, 75 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn</span><br><span>index 78eb389..064d1ea 100644</span><br><span>--- a/gbproxy/GBProxy_Tests.ttcn</span><br><span>+++ b/gbproxy/GBProxy_Tests.ttcn</span><br><span>@@ -1891,6 +1891,79 @@</span><br><span>         f_cleanup();</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+private altstep as_ignore_status(BSSGP_BVC_MGMT_PT pt) {</span><br><span style="color: hsl(120, 100%, 40%);">+[] pt.receive(BssgpStatusIndication:?) { repeat; }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_get_sgsn_bvc_ct(integer sgsn_idx, BssgpBvci bvci) runs on test_CT return BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+    for (var integer i := 0; i < lengthof(g_sgsn[sgsn_idx].cfg.bvc); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+               if (g_sgsn[sgsn_idx].cfg.bvc[i].bvci == bvci) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       return g_sgsn[sgsn_idx].vc_BSSGP_BVC[i];</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 null;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_reset_ptp_bvc_from_pcu(integer pcu_idx, integer bvc_idx) runs on test_CT</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       var BSSGP_BVC_CT pcu_bvc_ct := g_pcu[pcu_idx].vc_BSSGP_BVC[bvc_idx];</span><br><span style="color: hsl(120, 100%, 40%);">+  var BssgpBvcConfig bvc_cfg := g_pcu[pcu_idx].cfg.bvc[bvc_idx];</span><br><span style="color: hsl(120, 100%, 40%);">+        var Nsei nsei_pcu := g_pcu[pcu_idx].cfg.nsei;</span><br><span style="color: hsl(120, 100%, 40%);">+ var BSSGP_BVC_CT sgsn_bvc_ct := f_get_sgsn_bvc_ct(0, bvc_cfg.bvci);</span><br><span style="color: hsl(120, 100%, 40%);">+   var default d;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      SGSN_MGMT.clear;</span><br><span style="color: hsl(120, 100%, 40%);">+      PCU_MGMT.clear;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /* block the PTP BVC from the PCU side */</span><br><span style="color: hsl(120, 100%, 40%);">+     PCU_MGMT.send(BssgpResetRequest:{cause:=BSSGP_CAUSE_OM_INTERVENTION}) to pcu_bvc_ct;</span><br><span style="color: hsl(120, 100%, 40%);">+  /* expect state on both PCU and SGSN side to change */</span><br><span style="color: hsl(120, 100%, 40%);">+        d := activate(as_ignore_status(SGSN_MGMT));</span><br><span style="color: hsl(120, 100%, 40%);">+   interleave {</span><br><span style="color: hsl(120, 100%, 40%);">+  [] PCU_MGMT.receive(tr_BssgpStsInd(nsei_pcu, bvc_cfg.bvci, BVC_S_BLOCKED)) from pcu_bvc_ct;</span><br><span style="color: hsl(120, 100%, 40%);">+   [] SGSN_MGMT.receive(BssgpResetIndication:{bvc_cfg.bvci}) from sgsn_bvc_ct;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+     deactivate(d);</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%);">+/* Send a BVC-RESET for a PTP BVC from the BSS side: expect it to propagate */</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_bvc_reset_ptp_from_bss() runs on test_CT</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ f_init();</span><br><span style="color: hsl(120, 100%, 40%);">+     f_sleep(3.0);</span><br><span style="color: hsl(120, 100%, 40%);">+ f_reset_ptp_bvc_from_pcu(0, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+       f_cleanup();</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%);">+private function f_reset_ptp_bvc_from_sgsn(integer pcu_idx, integer bvc_idx) runs on test_CT</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    var BSSGP_BVC_CT pcu_bvc_ct := g_pcu[pcu_idx].vc_BSSGP_BVC[bvc_idx];</span><br><span style="color: hsl(120, 100%, 40%);">+  var BssgpBvcConfig bvc_cfg := g_pcu[pcu_idx].cfg.bvc[bvc_idx];</span><br><span style="color: hsl(120, 100%, 40%);">+        var Nsei nsei_pcu := g_pcu[pcu_idx].cfg.nsei;</span><br><span style="color: hsl(120, 100%, 40%);">+ var BSSGP_BVC_CT sgsn_bvc_ct := f_get_sgsn_bvc_ct(0, bvc_cfg.bvci);</span><br><span style="color: hsl(120, 100%, 40%);">+   var default d;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      SGSN_MGMT.clear;</span><br><span style="color: hsl(120, 100%, 40%);">+      PCU_MGMT.clear;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /* block the PTP BVC from the PCU side */</span><br><span style="color: hsl(120, 100%, 40%);">+     SGSN_MGMT.send(BssgpResetRequest:{cause:=BSSGP_CAUSE_OM_INTERVENTION}) to sgsn_bvc_ct;</span><br><span style="color: hsl(120, 100%, 40%);">+        /* expect state on both PCU and SGSN side to change */</span><br><span style="color: hsl(120, 100%, 40%);">+        d := activate(as_ignore_status(PCU_MGMT));</span><br><span style="color: hsl(120, 100%, 40%);">+    interleave {</span><br><span style="color: hsl(120, 100%, 40%);">+  [] SGSN_MGMT.receive(tr_BssgpStsInd(?, bvc_cfg.bvci, BVC_S_BLOCKED)) from sgsn_bvc_ct;</span><br><span style="color: hsl(120, 100%, 40%);">+        [] PCU_MGMT.receive(BssgpResetIndication:{bvc_cfg.bvci}) from pcu_bvc_ct;</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+     deactivate(d);</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%);">+/* Send a BVC-RESET for a PTP BVC from the SGSN side: expect it to propagate */</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_bvc_reset_ptp_from_sgsn() runs on test_CT</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       f_init();</span><br><span style="color: hsl(120, 100%, 40%);">+     f_sleep(3.0);</span><br><span style="color: hsl(120, 100%, 40%);">+ f_reset_ptp_bvc_from_sgsn(0, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+      f_cleanup();</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> control {</span><br><span>       execute( TC_BVC_bringup() );</span><br><span>         execute( TC_ul_unitdata() );</span><br><span>@@ -1902,6 +1975,8 @@</span><br><span>         execute( TC_resume() );</span><br><span>      execute( TC_bvc_block_ptp() );</span><br><span>       execute( TC_bvc_unblock_ptp() );</span><br><span style="color: hsl(120, 100%, 40%);">+      execute( TC_bvc_reset_ptp_from_bss() );</span><br><span style="color: hsl(120, 100%, 40%);">+       execute( TC_bvc_reset_ptp_from_sgsn() );</span><br><span>     if (false) {</span><br><span>                 /* don't enable this by default, as we don't yet have any automatic test setup for FR with 4 NS-VC */</span><br><span>                execute( TC_load_sharing_dl() );</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21338">change 21338</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/+/21338"/><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: Ie0a4899b6e793e3d69f117f350c5a2542fc4d402 </div>
<div style="display:none"> Gerrit-Change-Number: 21338 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>