summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-06-25 12:09:01 +0200
committerOliver Smith <osmith@sysmocom.de>2019-06-26 16:16:20 +0200
commit021141e6dc6e7a7f77d1ffad86b88c6691c2f74d (patch)
tree38712ad752b1e213859d59b859e11875343b95ed
parent216019fdd036b7be71b064d7ad633131477b1024 (diff)
mgw: add connection timeout test
-rw-r--r--mgw/MGCP_Test.ttcn40
1 files changed, 40 insertions, 0 deletions
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 31c2a1d..aeb6ef8 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -91,6 +91,7 @@ module MGCP_Test {
f_vty_transceive(MGWVTY, "enable");
f_vty_enable_osmux(osmux_on);
+ f_vty_config(MGWVTY, "mgcp", "conn-timeout 0");
}
private function f_rtpem_init(inout RTP_Emulation_CT comp_ref, integer i)
@@ -2066,6 +2067,43 @@ module MGCP_Test {
/* 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"); /* reset in f_init_vty() */
+
+ log("Sending RTP 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]);
+
+ setverdict(pass);
+ }
+
control {
execute(TC_selftest());
execute(TC_crcx());
@@ -2119,5 +2157,7 @@ module MGCP_Test {
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());
}
}