<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19554">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix mscpool cleanup (fixes LCLS tests)<br><br>osmo-bsc takes a while to notice that a connected MSC is no longer connected.<br>Once the mscpool tests have run, the additional msc 1 and msc 2 still linger<br>around even though the BSSMAP link is no longer served by the bsc-tester.<br><br>The easiest way to ensure that only expected MSCs are contacted is to set<br>'no allow-attach' for each MSC that should not be in use.<br><br>So, the default setup is 'allow-attach' on msc 0, and 'no allow-attach' on mscs<br>1 and 2. In f_init(), allow attach on those MSCs indicated by the nr_msc<br>amount. The entire vty transaction to configure attach/no attach for all three<br>MSCs takes about 4 micro seconds in my test setup, so it is fine to do this<br>during f_init() for each BSC test.<br><br>After this, tests running after the MSC pooling tests (the LCLS tests) no<br>longer round-robin their subscribers across disconnected MSCs.<br><br>NOTE: it would be good to somehow detect more reliably in osmo-bsc that an MSC<br>is gone and not use it anymore. That is however not so trivial. To get the LCLS<br>tests back online, this is a workaround to avoid that complexity for now.<br><br>Change-Id: I02ad58ed7d0d0aac61e393b415e09c6c5c8a70ca<br>---<br>M bsc/BSC_Tests.ttcn<br>1 file changed, 27 insertions(+), 22 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/54/19554/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn</span><br><span>index 5bd0e4f..c35100e 100644</span><br><span>--- a/bsc/BSC_Tests.ttcn</span><br><span>+++ b/bsc/BSC_Tests.ttcn</span><br><span>@@ -832,6 +832,23 @@</span><br><span>                 }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* TODO: use BooleanList from COMMON/src/General_Types.ttcn */</span><br><span style="color: hsl(120, 100%, 40%);">+private type record of boolean my_BooleanList;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_vty_msc_allow_attach(TELNETasp_PT pt, my_BooleanList allow_attach_list)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+   for (var integer msc_nr := 0; msc_nr < sizeof(allow_attach_list); msc_nr := msc_nr+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+            f_vty_enter_cfg_msc(pt, msc_nr);</span><br><span style="color: hsl(120, 100%, 40%);">+              if (allow_attach_list[msc_nr]) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      f_vty_transceive(pt, "allow-attach");</span><br><span style="color: hsl(120, 100%, 40%);">+               } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      f_vty_transceive(pt, "no allow-attach");</span><br><span style="color: hsl(120, 100%, 40%);">+            }</span><br><span style="color: hsl(120, 100%, 40%);">+             f_vty_transceive(pt, "exit");</span><br><span style="color: hsl(120, 100%, 40%);">+               f_vty_transceive(pt, "exit");</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> /* global initialization function</span><br><span>  * \param nr_bts Number of BTSs we should start/bring up</span><br><span>  * \param handler_mode Start an RSL_Emulation_CT component (true) or not (false).</span><br><span>@@ -854,7 +871,9 @@</span><br><span>           f_vty_allow_osmux(allow_osmux);</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ var my_BooleanList allow_attach := { false, false, false };</span><br><span>  for (bssap_idx := 0; bssap_idx < nr_msc; bssap_idx := bssap_idx+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+               allow_attach[bssap_idx] := true;</span><br><span>             /* Call a function of our 'parent component' RAN_Adapter_CT to start the</span><br><span>              * MSC-side BSSAP emulation */</span><br><span>               if (handler_mode) {</span><br><span>@@ -871,6 +890,9 @@</span><br><span>            }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* start the test with exactly all enabled MSCs allowed to attach */</span><br><span style="color: hsl(120, 100%, 40%);">+  f_vty_msc_allow_attach(BSCVTY, allow_attach);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>      f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port);</span><br><span> </span><br><span>   f_init_mgcp("VirtMSC");</span><br><span>@@ -5850,17 +5872,13 @@</span><br><span> </span><br><span>      f_init(nr_bts := 3, handler_mode := true, nr_msc := 3);</span><br><span>      f_sleep(1.0);</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Mark the second MSC as offloading, round-robin should skip this MSC now. */</span><br><span style="color: hsl(120, 100%, 40%);">+        f_vty_msc_allow_attach(BSCVTY, {true, false, true});</span><br><span> </span><br><span>     /* Control which MSC gets chosen next by the round-robin, otherwise</span><br><span>   * would be randomly affected by which other tests ran before this. */</span><br><span>       f_vty_transceive(BSCVTY, "mscpool roundrobin next 0");</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    /* Mark the second MSC as offloading, round-robin should skip this MSC now. */</span><br><span style="color: hsl(0, 100%, 40%);">-  f_vty_enter_cfg_msc(BSCVTY, 1);</span><br><span style="color: hsl(0, 100%, 40%);">- f_vty_transceive(BSCVTY, "no allow-attach");</span><br><span style="color: hsl(0, 100%, 40%);">-  f_vty_transceive(BSCVTY, "exit");</span><br><span style="color: hsl(0, 100%, 40%);">-     f_vty_transceive(BSCVTY, "exit");</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>  f_ctrs_msc_init();</span><br><span> </span><br><span>       var MSC_ConnHdlr vc_conn1;</span><br><span>@@ -5886,11 +5904,6 @@</span><br><span>  vc_conn3 := f_start_handler(refers(f_tc_mscpool_compl_l3), pars3);</span><br><span>   vc_conn3.done;</span><br><span>       f_ctrs_msc_expect(0, "mscpool:subscr:new");</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   f_vty_enter_cfg_msc(BSCVTY, 1);</span><br><span style="color: hsl(0, 100%, 40%);">- f_vty_transceive(BSCVTY, "allow-attach");</span><br><span style="color: hsl(0, 100%, 40%);">-     f_vty_transceive(BSCVTY, "exit");</span><br><span style="color: hsl(0, 100%, 40%);">-     f_vty_transceive(BSCVTY, "exit");</span><br><span> }</span><br><span> </span><br><span> /* An MSC that has 'no allow-attach' set should still serve subscribers that are already attached according to their</span><br><span>@@ -5900,16 +5913,13 @@</span><br><span>       f_init(nr_bts := 3, handler_mode := true, nr_msc := 3);</span><br><span>      f_sleep(1.0);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     /* Mark the second MSC as offloading, round-robin should skip this MSC now. */</span><br><span style="color: hsl(120, 100%, 40%);">+        f_vty_msc_allow_attach(BSCVTY, {true, false, true});</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>       /* Control which MSC gets chosen next by the round-robin, otherwise</span><br><span>   * would be randomly affected by which other tests ran before this. */</span><br><span>       f_vty_transceive(BSCVTY, "mscpool roundrobin next 0");</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    /* Mark the second MSC as offloading, round-robin should skip this MSC now. */</span><br><span style="color: hsl(0, 100%, 40%);">-  f_vty_enter_cfg_msc(BSCVTY, 1);</span><br><span style="color: hsl(0, 100%, 40%);">- f_vty_transceive(BSCVTY, "no allow-attach");</span><br><span style="color: hsl(0, 100%, 40%);">-  f_vty_transceive(BSCVTY, "exit");</span><br><span style="color: hsl(0, 100%, 40%);">-     f_vty_transceive(BSCVTY, "exit");</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>  f_ctrs_msc_init();</span><br><span> </span><br><span>       /* Round robin points at msc 0, but the valid NRI directs to msc 1, even though msc 1 has 'no allow-attach'. */</span><br><span>@@ -5937,11 +5947,6 @@</span><br><span>     vc_conn3 := f_start_handler(refers(f_tc_mscpool_compl_l3), pars3);</span><br><span>   vc_conn3.done;</span><br><span>       f_ctrs_msc_expect(2, "mscpool:subscr:new");</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   f_vty_enter_cfg_msc(BSCVTY, 1);</span><br><span style="color: hsl(0, 100%, 40%);">- f_vty_transceive(BSCVTY, "allow-attach");</span><br><span style="color: hsl(0, 100%, 40%);">-     f_vty_transceive(BSCVTY, "exit");</span><br><span style="color: hsl(0, 100%, 40%);">-     f_vty_transceive(BSCVTY, "exit");</span><br><span> }</span><br><span> </span><br><span> /* Dyn PDCH todo:</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19554">change 19554</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/+/19554"/><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: I02ad58ed7d0d0aac61e393b415e09c6c5c8a70ca </div>
<div style="display:none"> Gerrit-Change-Number: 19554 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>