aboutsummaryrefslogtreecommitdiffstats
path: root/mgw
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-10-01 13:21:28 +0200
committerlaforge <laforge@osmocom.org>2019-10-07 20:02:21 +0000
commit9ff0f8afda8f9b46bbc4cf7f0d3bbed456ad0d06 (patch)
tree8308fab0ba357cd192c41296fa871bb93b637954 /mgw
parentcf47a920e5611fa983bb1570196e6ca7c8927ac5 (diff)
MGCP_Test: Make RTP bwe/oa format conversation tests more robust
The following testcases are carried out using two bidirectional connections on one MGW endpoint. MGCP_Test.TC_amr_oa_bwe_rtp_conversion MGCP_Test.TC_amr_oa_oa_rtp_conversion MGCP_Test.TC_amr_bwe_bwe_rtp_conversion The test is programmed in a way that the TTCN3 side of the RTP emulation also works in bidirectional mode. This is prone to run into a race condition when the RX side is activated but the TX side is already transmitting. However, in order to test if the RTP format conversion works we do not need to test both directions at the same time. Its perfectly fine to do the one direction first and then do the other afterwards. Lets also add some guard time while switching the RTP flows. Change-Id: Idf257cfc1ab45a7f0fb6e1a2f6426f1b3145879b
Diffstat (limited to 'mgw')
-rw-r--r--mgw/MGCP_Test.ttcn24
1 files changed, 19 insertions, 5 deletions
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 7ddb6ea6..41def037 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -2012,7 +2012,7 @@ module MGCP_Test {
f_init(ep);
- /* from us to MGW */
+ /* Connection #0 (Bidirectional) */
flow[0] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 112, "AMR/8000"));
/* bind local RTP emulation sockets */
flow[0].em.portnr := 10000;
@@ -2023,7 +2023,7 @@ module MGCP_Test {
flow[0].fmtp := fmtp0;
f_flow_create(RTPEM[0], ep, call_id, "sendrecv", flow[0]);
- /* from MGW back to us */
+ /* Connection #1 (Bidirectional) */
flow[1] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 112, "AMR/8000"));
flow[1].em.portnr := 20000;
flow[1].rtp_cfg := c_RtpemDefaultCfg;
@@ -2033,17 +2033,31 @@ module MGCP_Test {
flow[1].fmtp := fmtp1;
f_flow_create(RTPEM[1], ep, call_id, "sendrecv", flow[1]);
- f_rtpem_mode(RTPEM[1], RTPEM_MODE_BIDIR);
- f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);
+ /* Send RTP packets to connection #0, receive on connection #1 */
+ f_rtpem_mode(RTPEM[1], RTPEM_MODE_RXONLY);
+ f_sleep(0.5);
+ f_rtpem_mode(RTPEM[0], RTPEM_MODE_TXONLY);
+ f_sleep(1.0);
+ f_rtpem_mode(RTPEM[0], RTPEM_MODE_NONE);
+ f_sleep(0.5);
+ f_rtpem_mode(RTPEM[1], RTPEM_MODE_NONE);
+ /* Send RTP packets to connection #1, receive on connection #0 */
+ f_rtpem_mode(RTPEM[0], RTPEM_MODE_RXONLY);
+ f_sleep(0.5);
+ f_rtpem_mode(RTPEM[1], RTPEM_MODE_TXONLY);
f_sleep(1.0);
+ f_rtpem_mode(RTPEM[1], RTPEM_MODE_NONE);
+ f_sleep(0.5);
+ f_rtpem_mode(RTPEM[0], RTPEM_MODE_NONE);
+ /* Remove RTP flows and check statistics */
f_flow_delete(RTPEM[0]);
f_flow_delete(RTPEM[1], ep, call_id);
+ /* Check for errors */
stats[0] := f_rtpem_stats_get(RTPEM[0]);
stats[1] := f_rtpem_stats_get(RTPEM[1]);
-
f_rtpem_stats_err_check(stats[0]);
f_rtpem_stats_err_check(stats[1]);