<p>daniel has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24442">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gbproxy: Test routing if an SGSN in a pool is down<br><br>If an SGSN in a pool is down we expect the messages to instead be sent<br>to a different SGSN in the pool. That SGSN will not necessarily know<br>what to do with those messages, but it should )implicitly) detach that<br>UE so that it can reattach at the new SGSN. Otherwise UEs on a failed<br>SGSN would simply stop working as the messages would never be forwarded<br>anywhere.<br><br>This test also adjusts the NS timers so the failed NSVCs are detected<br>faster.<br><br>Change-Id: I46a6b8082441843f428a7681566228e5de375bcb<br>Related: OS#4952<br>---<br>M gbproxy/GBProxy_Tests.ttcn<br>M gbproxy/osmo-gbproxy.cfg<br>2 files changed, 53 insertions(+), 3 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/42/24442/1</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 c496ca8..dd33106 100644</span><br><span>--- a/gbproxy/GBProxy_Tests.ttcn</span><br><span>+++ b/gbproxy/GBProxy_Tests.ttcn</span><br><span>@@ -337,6 +337,8 @@</span><br><span>     var GbInstances g_pcu;</span><br><span>       var GbInstances g_sgsn;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   port NS_CTRL_PT NS_CTRL;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   port BSSGP_CT_PROC_PT PROC;</span><br><span> </span><br><span>      port BSSGP_BVC_MGMT_PT SGSN_MGMT;</span><br><span>@@ -1130,6 +1132,53 @@</span><br><span>   f_cleanup();</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* send uplink-unitdata of a variety of different sizes; expect it to show up on the only connected SGSN */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_TC_ul_unitdata_pool_failure(charstring id) runs on BSSGP_ConnHdlr {</span><br><span style="color: hsl(120, 100%, 40%);">+  var integer ran_idx := 0;</span><br><span style="color: hsl(120, 100%, 40%);">+     var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0];</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%);">+      /* All data should arrive at the one SGSN that is still up */</span><br><span style="color: hsl(120, 100%, 40%);">+ g_pars.sgsn_idx := 0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       for (i := 0; i < max_fr_info_size-4; i := i+4) {</span><br><span style="color: hsl(120, 100%, 40%);">+           var octetstring payload := f_rnd_octstring(i);</span><br><span style="color: hsl(120, 100%, 40%);">+                var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload);</span><br><span style="color: hsl(120, 100%, 40%);">+          /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */</span><br><span style="color: hsl(120, 100%, 40%);">+                var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+              log("UL-UNITDATA(payload_size=", i);</span><br><span style="color: hsl(120, 100%, 40%);">+                f_pcu2sgsn(pdu_tx, pdu_rx);</span><br><span style="color: hsl(120, 100%, 40%);">+   }</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%);">+testcase TC_ul_unitdata_pool_failure() runs on test_CT</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     var integer i;</span><br><span style="color: hsl(120, 100%, 40%);">+        var integer j;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      f_init(60.0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       for (i := 1; i < lengthof(mp_nsconfig_sgsn); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+           connect(self:NS_CTRL, g_sgsn[i].vc_NS:NS_CTRL);</span><br><span style="color: hsl(120, 100%, 40%);">+               for (j := 0; j < lengthof(mp_nsconfig_sgsn[i].nsvc); j := j+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   var uint16_t nsvci := mp_nsconfig_sgsn[i].nsvc[j].nsvci;</span><br><span style="color: hsl(120, 100%, 40%);">+                      var NsDisableVcRequest tx_disar;</span><br><span style="color: hsl(120, 100%, 40%);">+                      tx_disar.nsvci := nsvci;</span><br><span style="color: hsl(120, 100%, 40%);">+                      NS_CTRL.send(tx_disar);</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+             disconnect(self:NS_CTRL, g_sgsn[i].vc_NS:NS_CTRL);</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+     /* Wait until gbproxy notices that the NSVCs are down */</span><br><span style="color: hsl(120, 100%, 40%);">+      f_sleep(15.0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      f_start_handlers(refers(f_TC_ul_unitdata_pool_failure), testcasename(), 1);</span><br><span style="color: hsl(120, 100%, 40%);">+   /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */</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> /* send downlink-unitdata of a variety of different sizes; expect it to show up on PCU */</span><br><span> private function f_TC_dl_unitdata(charstring id) runs on BSSGP_ConnHdlr {</span><br><span>  var integer i;</span><br><span>@@ -3461,6 +3510,7 @@</span><br><span> control {</span><br><span>  execute( TC_BVC_bringup() );</span><br><span>         execute( TC_ul_unitdata() );</span><br><span style="color: hsl(120, 100%, 40%);">+  execute( TC_ul_unitdata_pool_failure() );</span><br><span>    execute( TC_dl_unitdata() );</span><br><span>         execute( TC_ra_capability() );</span><br><span>       execute( TC_ra_capability_upd() );</span><br><span>diff --git a/gbproxy/osmo-gbproxy.cfg b/gbproxy/osmo-gbproxy.cfg</span><br><span>index dab4ef3..d269567 100644</span><br><span>--- a/gbproxy/osmo-gbproxy.cfg</span><br><span>+++ b/gbproxy/osmo-gbproxy.cfg</span><br><span>@@ -42,6 +42,6 @@</span><br><span>  timer tns-block-retries 3</span><br><span>  timer tns-reset 3</span><br><span>  timer tns-reset-retries 3</span><br><span style="color: hsl(0, 100%, 40%);">- timer tns-test 30</span><br><span style="color: hsl(0, 100%, 40%);">- timer tns-alive 3</span><br><span style="color: hsl(0, 100%, 40%);">- timer tns-alive-retries 10</span><br><span style="color: hsl(120, 100%, 40%);">+ timer tns-test 5</span><br><span style="color: hsl(120, 100%, 40%);">+ timer tns-alive 2</span><br><span style="color: hsl(120, 100%, 40%);">+ timer tns-alive-retries 3</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24442">change 24442</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/+/24442"/><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: I46a6b8082441843f428a7681566228e5de375bcb </div>
<div style="display:none"> Gerrit-Change-Number: 24442 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>