osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14605


Change subject: mgw: add connection timeout test
......................................................................

mgw: add connection timeout test

Change-Id: I020b682b347045818fd28de240daa0aa33fe43b4
---
M mgw/MGCP_Test.ttcn
1 file changed, 41 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/05/14605/1

diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 31c2a1d..46c7a81 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -2066,6 +2066,45 @@
        /* TODO: AUCX (various) */
        /* TODO: invalid verb (various) */

+
+       testcase TC_conn_timeout() runs on dummy_CT {
+               var RtpFlowData flow;
+               var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "1@" & c_mgw_domain;
+               var MgcpCallId call_id := '1225'H;
+               var MGCP_RecvFrom mrf;
+
+               f_init(ep);
+               log("Setting conn-timeout to 1s");
+               f_vty_config(MGWVTY, "mgcp", "conn-timeout 1");
+
+               log("Sending UDP data for 1.5s");
+               flow := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 111, 
"GSM-HR-08/8000/1"));
+               flow.em.portnr := 10000;
+               f_flow_create(RTPEM[0], ep, call_id, "loopback", flow);
+               f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);
+               f_sleep(1.5);
+
+               log("Stopping for 0.5s and resuming");
+               f_rtpem_mode(RTPEM[0], RTPEM_MODE_NONE);
+               f_sleep(0.5);
+               f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);
+               f_sleep(0.1);
+
+               log("Stopping for 1.5s, expecting to run into timeout");
+               f_rtpem_mode(RTPEM[0], RTPEM_MODE_NONE);
+               f_sleep(1.5);
+
+               log("Resuming should fail now");
+               f_rtpem_conn_refuse_expect(RTPEM[0]);
+               f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);
+               f_sleep(0.2);
+               f_rtpem_conn_refuse_verify(RTPEM[0]);
+
+               f_vty_config(MGWVTY, "mgcp", "no conn-timeout");
+
+               setverdict(pass);
+       }
+
        control {
                execute(TC_selftest());
                execute(TC_crcx());
@@ -2119,5 +2158,7 @@
                execute(TC_amr_oa_bwe_rtp_conversion());
                execute(TC_amr_oa_oa_rtp_conversion());
                execute(TC_amr_bwe_bwe_rtp_conversion());
+
+               execute(TC_conn_timeout());
        }
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14605
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I020b682b347045818fd28de240daa0aa33fe43b4
Gerrit-Change-Number: 14605
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-MessageType: newchange

Reply via email to