<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14605">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mgw: add connection timeout test<br><br>Change-Id: I020b682b347045818fd28de240daa0aa33fe43b4<br>---<br>M mgw/MGCP_Test.ttcn<br>1 file changed, 41 insertions(+), 0 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/05/14605/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn</span><br><span>index 31c2a1d..46c7a81 100644</span><br><span>--- a/mgw/MGCP_Test.ttcn</span><br><span>+++ b/mgw/MGCP_Test.ttcn</span><br><span>@@ -2066,6 +2066,45 @@</span><br><span>        /* TODO: AUCX (various) */</span><br><span>   /* TODO: invalid verb (various) */</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      testcase TC_conn_timeout() runs on dummy_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+         var RtpFlowData flow;</span><br><span style="color: hsl(120, 100%, 40%);">+         var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "1@" & c_mgw_domain;</span><br><span style="color: hsl(120, 100%, 40%);">+            var MgcpCallId call_id := '1225'H;</span><br><span style="color: hsl(120, 100%, 40%);">+            var MGCP_RecvFrom mrf;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+              f_init(ep);</span><br><span style="color: hsl(120, 100%, 40%);">+           log("Setting conn-timeout to 1s");</span><br><span style="color: hsl(120, 100%, 40%);">+          f_vty_config(MGWVTY, "mgcp", "conn-timeout 1");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+         log("Sending UDP data for 1.5s");</span><br><span style="color: hsl(120, 100%, 40%);">+           flow := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 111, "GSM-HR-08/8000/1"));</span><br><span style="color: hsl(120, 100%, 40%);">+             flow.em.portnr := 10000;</span><br><span style="color: hsl(120, 100%, 40%);">+              f_flow_create(RTPEM[0], ep, call_id, "loopback", flow);</span><br><span style="color: hsl(120, 100%, 40%);">+             f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);</span><br><span style="color: hsl(120, 100%, 40%);">+             f_sleep(1.5);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+               log("Stopping for 0.5s and resuming");</span><br><span style="color: hsl(120, 100%, 40%);">+              f_rtpem_mode(RTPEM[0], RTPEM_MODE_NONE);</span><br><span style="color: hsl(120, 100%, 40%);">+              f_sleep(0.5);</span><br><span style="color: hsl(120, 100%, 40%);">+         f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);</span><br><span style="color: hsl(120, 100%, 40%);">+             f_sleep(0.1);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+               log("Stopping for 1.5s, expecting to run into timeout");</span><br><span style="color: hsl(120, 100%, 40%);">+            f_rtpem_mode(RTPEM[0], RTPEM_MODE_NONE);</span><br><span style="color: hsl(120, 100%, 40%);">+              f_sleep(1.5);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+               log("Resuming should fail now");</span><br><span style="color: hsl(120, 100%, 40%);">+            f_rtpem_conn_refuse_expect(RTPEM[0]);</span><br><span style="color: hsl(120, 100%, 40%);">+         f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);</span><br><span style="color: hsl(120, 100%, 40%);">+             f_sleep(0.2);</span><br><span style="color: hsl(120, 100%, 40%);">+         f_rtpem_conn_refuse_verify(RTPEM[0]);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+               f_vty_config(MGWVTY, "mgcp", "no conn-timeout");</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>  control {</span><br><span>            execute(TC_selftest());</span><br><span>              execute(TC_crcx());</span><br><span>@@ -2119,5 +2158,7 @@</span><br><span>          execute(TC_amr_oa_bwe_rtp_conversion());</span><br><span>             execute(TC_amr_oa_oa_rtp_conversion());</span><br><span>              execute(TC_amr_bwe_bwe_rtp_conversion());</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+           execute(TC_conn_timeout());</span><br><span>  }</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14605">change 14605</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/+/14605"/><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: I020b682b347045818fd28de240daa0aa33fe43b4 </div>
<div style="display:none"> Gerrit-Change-Number: 14605 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>