<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26617">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bsc: make perform_clear() work when VTY is not initialized<br><br>To be able to invoke perform_clear() also in tests where the VTY isn't<br>used, only invoke the f_logp() when the VTY is ready. Otherwise this<br>causes an error and a failed test, for no good reason.<br><br>Related: OS#5337<br>Change-Id: I8116075f32937bd06ba14b426010bf6fec2ef402<br>---<br>M bsc/BSC_Tests.ttcn<br>1 file changed, 12 insertions(+), 5 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/17/26617/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 97aff9e..b1deaf5 100644</span><br><span>--- a/bsc/BSC_Tests.ttcn</span><br><span>+++ b/bsc/BSC_Tests.ttcn</span><br><span>@@ -1064,6 +1064,13 @@</span><br><span>         f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+private function f_logp_if_vty_inited(charstring msg) runs on MSC_ConnHdlr</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ if (g_vty_initialized) {</span><br><span style="color: hsl(120, 100%, 40%);">+              f_logp(BSCVTY, msg);</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> private function f_sysinfo_seen(integer rsl_idx, RSL_Message rsl) runs on test_CT</span><br><span> {</span><br><span>     if (rsl_idx >= lengthof(g_system_information)) {</span><br><span>@@ -7771,22 +7778,22 @@</span><br><span> friend function f_perform_clear(RSL_DCHAN_PT rsl_pt := RSL, RSLEM_PROC_PT rsl_proc_pt := RSL_PROC,</span><br><span>                                 template PDU_ML3_NW_MS exp_rr_rel_tmpl := tr_RRM_RR_RELEASE)</span><br><span> runs on MSC_ConnHdlr {</span><br><span style="color: hsl(0, 100%, 40%);">-   f_logp(BSCVTY, "MSC instructs BSC to clear channel");</span><br><span style="color: hsl(120, 100%, 40%);">+       f_logp_if_vty_inited("MSC instructs BSC to clear channel");</span><br><span>        BSSAP.send(ts_BSSMAP_ClearCommand(0));</span><br><span>       interleave {</span><br><span>         [] rsl_pt.receive(tr_RSL_DATA_REQ(g_chan_nr, ?, decmatch exp_rr_rel_tmpl)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    f_logp(BSCVTY, "Got RSL RR Release");</span><br><span style="color: hsl(120, 100%, 40%);">+                       f_logp_if_vty_inited("Got RSL RR Release");</span><br><span>                }</span><br><span>    [] rsl_pt.receive(tr_RSL_DEACT_SACCH(g_chan_nr)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      f_logp(BSCVTY, "Got RSL Deact SACCH");</span><br><span style="color: hsl(120, 100%, 40%);">+                      f_logp_if_vty_inited("Got RSL Deact SACCH");</span><br><span>               }</span><br><span>    [] BSSAP.receive(tr_BSSMAP_ClearComplete) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     f_logp(BSCVTY, "Got BSSMAP Clear Complete");</span><br><span style="color: hsl(120, 100%, 40%);">+                        f_logp_if_vty_inited("Got BSSMAP Clear Complete");</span><br><span>                         /* Also drop the SCCP connection */</span><br><span>                  BSSAP.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ);</span><br><span>            }</span><br><span>    [] rsl_pt.receive(tr_RSL_RF_CHAN_REL(g_chan_nr)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      f_logp(BSCVTY, "Got RSL RF Chan Rel, sending Rel Ack");</span><br><span style="color: hsl(120, 100%, 40%);">+                     f_logp_if_vty_inited("Got RSL RF Chan Rel, sending Rel Ack");</span><br><span>                      rsl_pt.send(ts_RSL_RF_CHAN_REL_ACK(g_chan_nr));</span><br><span>                      f_rslem_unregister(0, g_chan_nr, PT := rsl_proc_pt);</span><br><span>                 }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26617">change 26617</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/+/26617"/><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: I8116075f32937bd06ba14b426010bf6fec2ef402 </div>
<div style="display:none"> Gerrit-Change-Number: 26617 </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>