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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gbproxy: Test BVC bringup with conflicting BVCs<br><br>Different pcus try to establish the same BVC. Ensure that all the other<br>BVCs still remain functional.<br><br>Change-Id: I46eb0205b4c86b5f1bdc241ef0b2e12135c028e4<br>---<br>M gbproxy/GBProxy_Tests.ttcn<br>1 file changed, 115 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 5f5d835..ddf98a9 100644</span><br><span>--- a/gbproxy/GBProxy_Tests.ttcn</span><br><span>+++ b/gbproxy/GBProxy_Tests.ttcn</span><br><span>@@ -1069,6 +1069,117 @@</span><br><span>      f_cleanup();</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_BVC_bringup_conflicting() runs on test_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+        var float t_guard := 15.0;</span><br><span style="color: hsl(120, 100%, 40%);">+    var BssgpStatusIndication bsi;</span><br><span style="color: hsl(120, 100%, 40%);">+        var integer 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%);">+    g_Tguard.start(t_guard);</span><br><span style="color: hsl(120, 100%, 40%);">+      activate(as_gTguard(g_Tguard));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     f_ipa_ctrl_start_client(mp_gbproxy_ip, mp_gbproxy_ctrl_port);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       var BssgpBvcConfigs bvcs := { };</span><br><span style="color: hsl(120, 100%, 40%);">+      for (i := 0; i < lengthof(mp_gbconfigs); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+               g_pcu[i].cfg := mp_gbconfigs[i];</span><br><span style="color: hsl(120, 100%, 40%);">+              g_pcu[i].cfg.bvc[0].bvci := 23;</span><br><span style="color: hsl(120, 100%, 40%);">+               /* make sure all have a proper create_cb, which cannot be specified in config file */</span><br><span style="color: hsl(120, 100%, 40%);">+         f_fix_create_cb(g_pcu[i].cfg);</span><br><span style="color: hsl(120, 100%, 40%);">+                /* concatenate all the PCU-side BVCs for the SGSN side */</span><br><span style="color: hsl(120, 100%, 40%);">+             bvcs := bvcs & g_pcu[i].cfg.bvc;</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%);">+   for (i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+           g_sgsn[i].cfg := {</span><br><span style="color: hsl(120, 100%, 40%);">+                    nsei := mp_nsconfig_sgsn[i].nsei,</span><br><span style="color: hsl(120, 100%, 40%);">+                     sgsn_role := true,</span><br><span style="color: hsl(120, 100%, 40%);">+                    bvc := bvcs</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%);">+   f_init_vty();</span><br><span style="color: hsl(120, 100%, 40%);">+ for (i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+           f_vty_transceive(GBPVTY, "nsvc nsei " & int2str(g_sgsn[i].cfg.nsei) & " force-unconfigured");</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+     for (i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+            f_vty_transceive(GBPVTY, "nsvc nsei " & int2str(g_pcu[i].cfg.nsei) & " force-unconfigured");</span><br><span style="color: hsl(120, 100%, 40%);">+              f_vty_transceive(GBPVTY, "delete-gbproxy-peer " & int2str(g_pcu[i].cfg.nsei) & " only-bvc");</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%);">+   for (i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+           f_init_gb_sgsn(g_sgsn[i], "GbProxy_Test", i);</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+     f_sleep(4.0);</span><br><span style="color: hsl(120, 100%, 40%);">+ for (i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+            f_init_gb_pcu(g_pcu[i], "GbProxy_Test", 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%);">+   /* wait until all BVC are unblocked on both sides */</span><br><span style="color: hsl(120, 100%, 40%);">+  timer T := 10.0;</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%);">+ [] SGSN_MGMT.receive(BssgpStatusIndication:{*, ?, ?}) {</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%);">+     [] SGSN_MGMT.receive(BssgpResetIndication:?) {</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%);">+     [] SGSN_MGMT.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+                f_shutdown(__FILE__, __LINE__, fail, "Received unexpected message on SGSN_MGMT");</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span style="color: hsl(120, 100%, 40%);">+     [] PCU_MGMT.receive(BssgpStatusIndication:{*, ?, BVC_S_UNBLOCKED}) -> value bsi {</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%);">+     [] PCU_MGMT.receive(BssgpStatusIndication:{*, ?, ?}) {</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%);">+     [] PCU_MGMT.receive(BssgpResetIndication:{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%);">+     [] PCU_MGMT.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+         f_shutdown(__FILE__, __LINE__, fail, "Received unexpected message on PCU_MGMT");</span><br><span style="color: hsl(120, 100%, 40%);">+            }</span><br><span style="color: hsl(120, 100%, 40%);">+     [] T.timeout {</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%);">+   /* Wait to ensure the gbproxy processed the RESET_ACK messages from the SGSN.</span><br><span style="color: hsl(120, 100%, 40%);">+  * Otherwise the state might still be WAIT_RESET_ACK */</span><br><span style="color: hsl(120, 100%, 40%);">+       f_sleep(0.2);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Verify BVCs, but ignore conflicting BVCI 23 */</span><br><span style="color: hsl(120, 100%, 40%);">+     /* verify SGSN-side BVC FSM in IUT are UNBLOCKED */</span><br><span style="color: hsl(120, 100%, 40%);">+   for (i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+           f_bvc_fsm_ensure_state(mp_nsconfig_sgsn[i].nsei, 0, "UNBLOCKED");</span><br><span style="color: hsl(120, 100%, 40%);">+           /* iterate over list and check all BVCI */</span><br><span style="color: hsl(120, 100%, 40%);">+            for (var integer j := 0; j < lengthof(g_sgsn[i].cfg.bvc); j := j+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      var BssgpBvci bvci := g_sgsn[i].cfg.bvc[j].bvci;</span><br><span style="color: hsl(120, 100%, 40%);">+                      if (bvci == 23) {</span><br><span style="color: hsl(120, 100%, 40%);">+                             continue;</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+                     f_bvc_fsm_ensure_state(mp_nsconfig_sgsn[i].nsei, bvci, "UNBLOCKED");</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 PCU-side BVC FSM in IUT are UNBLOCKED */</span><br><span style="color: hsl(120, 100%, 40%);">+    for (i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+            f_bvc_fsm_ensure_state(mp_nsconfig_pcu[i].nsei, 0, "UNBLOCKED");</span><br><span style="color: hsl(120, 100%, 40%);">+            /* iterate over list and check all BVCI */</span><br><span style="color: hsl(120, 100%, 40%);">+            for (var integer j := 0; j < lengthof(g_pcu[i].cfg.bvc); j := j+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       var BssgpBvci bvci := g_pcu[i].cfg.bvc[j].bvci;</span><br><span style="color: hsl(120, 100%, 40%);">+                       if (bvci == 23) {</span><br><span style="color: hsl(120, 100%, 40%);">+                             continue;</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+                     f_bvc_fsm_ensure_state(mp_nsconfig_pcu[i].nsei, bvci, "UNBLOCKED");</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%);">+   /* re-start guard timer after all BVCs are up, so it only counts the actual test case */</span><br><span style="color: hsl(120, 100%, 40%);">+      g_Tguard.start(t_guard);</span><br><span style="color: hsl(120, 100%, 40%);">+      f_start_handlers(refers(f_TC_BVC_bringup), testcasename(), 51);</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> friend function f_bssgp_suspend(integer ran_idx := 0) runs on BSSGP_ConnHdlr return OCT1 {</span><br><span>      var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0];</span><br><span>   timer T := 5.0;</span><br><span>@@ -3592,6 +3703,10 @@</span><br><span> </span><br><span> control {</span><br><span>    execute( TC_BVC_bringup() );</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Depends on osmo-gbproxy > 0.2.0 */</span><br><span style="color: hsl(120, 100%, 40%);">+      if (Misc_Helpers.f_osmo_repo_is("nightly")) {</span><br><span style="color: hsl(120, 100%, 40%);">+               execute( TC_BVC_bringup_conflicting() );</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span>    execute( TC_ul_unitdata() );</span><br><span>         execute( TC_ul_unitdata_pool_failure() );</span><br><span>    execute( TC_dl_unitdata() );</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26452">change 26452</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/+/26452"/><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: I46eb0205b4c86b5f1bdc241ef0b2e12135c028e4 </div>
<div style="display:none"> Gerrit-Change-Number: 26452 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: daniel <dwillmann@sysmocom.de> </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: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>