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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stp: Move logic to create unknwon dynamic ASP to f_connect_ipa()<br><br>This type of scenario is used in several tests and will be used in more<br>tests in the future, so let's move there for easiness.<br><br>Change-Id: Ic65ff2ff9dc3cc82ae3fefcf3caf406279cd6b97<br>---<br>M stp/STP_Tests_IPA.ttcn<br>1 file changed, 11 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/stp/STP_Tests_IPA.ttcn b/stp/STP_Tests_IPA.ttcn</span><br><span>index 946a950..beb2aa9 100644</span><br><span>--- a/stp/STP_Tests_IPA.ttcn</span><br><span>+++ b/stp/STP_Tests_IPA.ttcn</span><br><span>@@ -106,9 +106,15 @@</span><br><span>       }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-friend function f_connect_ipa(integer idx) runs on IPA_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+friend function f_connect_ipa(integer idx, boolean use_unknown_asp_port := false) runs on IPA_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+     var integer port_offset := 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (use_unknown_asp_port) {</span><br><span style="color: hsl(120, 100%, 40%);">+           /* Add 100 to the port since we know that port is not configured in any</span><br><span style="color: hsl(120, 100%, 40%);">+                 ASP only up to NR_IPA are configured. */</span><br><span style="color: hsl(120, 100%, 40%);">+            port_offset := 100;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span>    vc_IPA[idx].start(IPA_Emulation.main_client(mp_stp_ip, mp_stp_ipa_port, mp_local_ip,</span><br><span style="color: hsl(0, 100%, 40%);">-                    mp_local_ipa_port+idx, g_ccm_pars[idx]));</span><br><span style="color: hsl(120, 100%, 40%);">+                     mp_local_ipa_port + idx + port_offset, g_ccm_pars[idx]));</span><br><span> }</span><br><span> </span><br><span> </span><br><span>@@ -118,10 +124,7 @@</span><br><span>        f_vty_config2(VTY, {"cs7 instance 0", "listen ipa 5000"},</span><br><span>                      "accept-asp-connections pre-configured");</span><br><span>    f_init_ipa();</span><br><span style="color: hsl(0, 100%, 40%);">-   /* Add 100 to the port since we know that port is not configured in any</span><br><span style="color: hsl(0, 100%, 40%);">-   ASP only up to NR_IPA are configured. */</span><br><span style="color: hsl(0, 100%, 40%);">-      vc_IPA[0].start(IPA_Emulation.main_client(mp_stp_ip, mp_stp_ipa_port, mp_local_ip,</span><br><span style="color: hsl(0, 100%, 40%);">-                      mp_local_ipa_port+100, g_ccm_pars[0]));</span><br><span style="color: hsl(120, 100%, 40%);">+       f_connect_ipa(0, true);</span><br><span>      f_sleep(1.0);</span><br><span>        if (IPA[0].checkstate("Connected")) {</span><br><span>              setverdict(fail, "Expected IPA port to be disconnected");</span><br><span>@@ -139,7 +142,7 @@</span><br><span>    f_vty_config2(VTY, {"cs7 instance 0", "listen ipa 5000"},</span><br><span>                      "accept-asp-connections pre-configured");</span><br><span>    f_init_ipa();</span><br><span style="color: hsl(0, 100%, 40%);">-   f_connect_ipa(0);</span><br><span style="color: hsl(120, 100%, 40%);">+     f_connect_ipa(0, false);</span><br><span>     f_sleep(1.0);</span><br><span>        if (not IPA[0].checkstate("Connected")) {</span><br><span>          setverdict(fail, "Expected IPA port to be connected");</span><br><span>@@ -156,10 +159,7 @@</span><br><span> testcase TC_unknown_client_dynamic() runs on IPA_CT {</span><br><span>     f_init_common();</span><br><span>     f_init_ipa();</span><br><span style="color: hsl(0, 100%, 40%);">-   /* Add 100 to the port since we know that port is not configured in any</span><br><span style="color: hsl(0, 100%, 40%);">-   ASP only up to NR_IPA are configured. */</span><br><span style="color: hsl(0, 100%, 40%);">-      vc_IPA[0].start(IPA_Emulation.main_client(mp_stp_ip, mp_stp_ipa_port, mp_local_ip,</span><br><span style="color: hsl(0, 100%, 40%);">-                      mp_local_ipa_port+100, g_ccm_pars[0]));</span><br><span style="color: hsl(120, 100%, 40%);">+       f_connect_ipa(0, true);</span><br><span>      f_sleep(1.0);</span><br><span>        if (not IPA[0].checkstate("Connected")) {</span><br><span>          setverdict(fail, "Expected IPA port to be connected");</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16044">change 16044</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/+/16044"/><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: Ic65ff2ff9dc3cc82ae3fefcf3caf406279cd6b97 </div>
<div style="display:none"> Gerrit-Change-Number: 16044 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>