aboutsummaryrefslogtreecommitdiffstats
path: root/mgw/MGCP_Test.ttcn
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-09-07 18:42:04 +0200
committerpespin <pespin@sysmocom.de>2020-09-09 12:22:42 +0000
commit89c76d2102ebb2b81d171cd3cdf10375549af4a9 (patch)
tree99d6543c6f3afc7944943934c4131b1ff7efab0f /mgw/MGCP_Test.ttcn
parent71387aac714f6123041e22148492b3b8794f8db5 (diff)
mgw: Fix logic in test TC_two_crcx_mdcx_and_rtp
rtpem should be set to BIDIR at the same time where MDCX "sendrecv" is sent, otherwise if MGW sends us RTP packets (because we set the conn to sendrecv) they will be counted incorrectly in stats[0].num_pkts_rx_err_disabled. This issue doesn't trigger in current code because the MGW doesn't know anyway the remote IP address of the other connection until an MDCX is sent to it. However, if for whatever reason the IP address is known (for instance because it is set during CRCX, which will be done in next commits), then RTP messages would be sent and the error counter would be > 0. Change-Id: I653eb75439321f9a488dc56dca5d3fc5a8811547
Diffstat (limited to 'mgw/MGCP_Test.ttcn')
-rw-r--r--mgw/MGCP_Test.ttcn27
1 files changed, 13 insertions, 14 deletions
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index deb9f3eb..429d337f 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -1754,12 +1754,12 @@ module MGCP_Test {
f_sleep(0.5);
stats[0] := f_rtpem_stats_get(RTPEM[0]);
if (stats[0].num_pkts_rx_err_disabled != 0) {
- setverdict(fail, "received packets from MGW on recvonly connection");
+ setverdict(fail, "received packets from MGW on recvonly connection 0");
mtc.stop;
}
stats[1] := f_rtpem_stats_get(RTPEM[1]);
if (stats[1].num_pkts_rx_err_disabled != 0) {
- setverdict(fail, "received packets from MGW on recvonly connection");
+ setverdict(fail, "received packets from MGW on recvonly connection 1");
mtc.stop;
}
@@ -1768,40 +1768,39 @@ module MGCP_Test {
f_sleep(1.0);
stats[0] := f_rtpem_stats_get(RTPEM[0]);
if (stats[0].num_pkts_rx_err_disabled != 0) {
- setverdict(fail, "received packets from MGW on recvonly connection");
+ setverdict(fail, "received packets from MGW on recvonly connection 0");
mtc.stop;
}
stats[1] := f_rtpem_stats_get(RTPEM[1]);
if (stats[1].num_pkts_rx_err_disabled != 0) {
- setverdict(fail, "received packets from MGW on recvonly connection");
+ setverdict(fail, "received packets from MGW on recvonly connection 1");
mtc.stop;
}
/* The first leg will now be switched into bidirectional
* mode, but we do not expect any data comming back yet. */
+ f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);
+ stats[1] := f_rtpem_stats_get(RTPEM[1]);
+ num_pkts_tx[1] := stats[1].num_pkts_tx;
f_flow_modify(RTPEM[0], ep, call_id, "sendrecv", flow[0]);
f_sleep(0.5);
stats[0] := f_rtpem_stats_get(RTPEM[0]);
- if (stats[1].num_pkts_rx_err_disabled != 0) {
- setverdict(fail, "received packets from MGW on recvonly connection");
+ if (stats[0].num_pkts_rx_err_disabled != 0) {
+ setverdict(fail, "received packets from MGW on recvonly connection 0");
mtc.stop;
}
stats[1] := f_rtpem_stats_get(RTPEM[1]);
if (stats[1].num_pkts_rx_err_disabled != 0) {
- setverdict(fail, "received packets from MGW on recvonly connection");
+ setverdict(fail, "received packets from MGW on recvonly connection 1");
mtc.stop;
}
/* When the second leg is switched into bidirectional mode
* as well, then the MGW will connect the two together and
* we should see RTP streams passing through from both ends. */
- f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);
f_rtpem_mode(RTPEM[1], RTPEM_MODE_BIDIR);
stats[0] := f_rtpem_stats_get(RTPEM[0]);
- num_pkts_tx[0] := stats[0].num_pkts_tx
- stats[1] := f_rtpem_stats_get(RTPEM[1]);
- num_pkts_tx[1] := stats[1].num_pkts_tx
-
+ num_pkts_tx[0] := stats[0].num_pkts_tx;
f_flow_modify(RTPEM[1], ep, call_id, "sendrecv", flow[1]);
f_sleep(2.0);
@@ -1810,13 +1809,13 @@ module MGCP_Test {
temp := stats[0].num_pkts_tx - num_pkts_tx[0] - stats[1].num_pkts_rx;
if (temp > 3 or temp < -3) {
- setverdict(fail, "number of packets not within normal parameters");
+ setverdict(fail, "number of packets not within normal parameters:", temp);
mtc.stop;
}
temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx;
if (temp > 3 or temp < -3) {
- setverdict(fail, "number of packets not within normal parameters");
+ setverdict(fail, "number of packets not within normal parameters:", temp);
mtc.stop;
}