<p>pespin <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20034">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mgw: Fix logic in test TC_two_crcx_mdcx_and_rtp<br><br>rtpem should be set to BIDIR at the same time where MDCX "sendrecv" is<br>sent, otherwise if MGW sends us RTP packets (because we set the conn to<br>sendrecv) they will be counted incorrectly in<br>stats[0].num_pkts_rx_err_disabled.<br><br>This issue doesn't trigger in current code because the MGW doesn't know<br>anyway the remote IP address of the other connection until an MDCX is<br>sent to it. However, if for whatever reason the IP address is known (for<br>instance because it is set during CRCX, which will be done in next<br>commits), then RTP messages would be sent and the error counter would<br>be > 0.<br><br>Change-Id: I653eb75439321f9a488dc56dca5d3fc5a8811547<br>---<br>M mgw/MGCP_Test.ttcn<br>1 file changed, 13 insertions(+), 14 deletions(-)<br><br></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 deb9f3e..429d337 100644</span><br><span>--- a/mgw/MGCP_Test.ttcn</span><br><span>+++ b/mgw/MGCP_Test.ttcn</span><br><span>@@ -1754,12 +1754,12 @@</span><br><span>             f_sleep(0.5);</span><br><span>                stats[0] := f_rtpem_stats_get(RTPEM[0]);</span><br><span>             if (stats[0].num_pkts_rx_err_disabled != 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   setverdict(fail, "received packets from MGW on recvonly connection");</span><br><span style="color: hsl(120, 100%, 40%);">+                       setverdict(fail, "received packets from MGW on recvonly connection 0");</span><br><span>                    mtc.stop;</span><br><span>            }</span><br><span>            stats[1] := f_rtpem_stats_get(RTPEM[1]);</span><br><span>             if (stats[1].num_pkts_rx_err_disabled != 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   setverdict(fail, "received packets from MGW on recvonly connection");</span><br><span style="color: hsl(120, 100%, 40%);">+                       setverdict(fail, "received packets from MGW on recvonly connection 1");</span><br><span>                    mtc.stop;</span><br><span>            }</span><br><span> </span><br><span>@@ -1768,40 +1768,39 @@</span><br><span>              f_sleep(1.0);</span><br><span>                stats[0] := f_rtpem_stats_get(RTPEM[0]);</span><br><span>             if (stats[0].num_pkts_rx_err_disabled != 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   setverdict(fail, "received packets from MGW on recvonly connection");</span><br><span style="color: hsl(120, 100%, 40%);">+                       setverdict(fail, "received packets from MGW on recvonly connection 0");</span><br><span>                    mtc.stop;</span><br><span>            }</span><br><span>            stats[1] := f_rtpem_stats_get(RTPEM[1]);</span><br><span>             if (stats[1].num_pkts_rx_err_disabled != 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   setverdict(fail, "received packets from MGW on recvonly connection");</span><br><span style="color: hsl(120, 100%, 40%);">+                       setverdict(fail, "received packets from MGW on recvonly connection 1");</span><br><span>                    mtc.stop;</span><br><span>            }</span><br><span> </span><br><span>                /* The first leg will now be switched into bidirectional</span><br><span>              * mode, but we do not expect any data comming back yet. */</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%);">+             stats[1] := f_rtpem_stats_get(RTPEM[1]);</span><br><span style="color: hsl(120, 100%, 40%);">+              num_pkts_tx[1] := stats[1].num_pkts_tx;</span><br><span>              f_flow_modify(RTPEM[0], ep, call_id, "sendrecv", flow[0]);</span><br><span>                 f_sleep(0.5);</span><br><span>                stats[0] := f_rtpem_stats_get(RTPEM[0]);</span><br><span style="color: hsl(0, 100%, 40%);">-                if (stats[1].num_pkts_rx_err_disabled != 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   setverdict(fail, "received packets from MGW on recvonly connection");</span><br><span style="color: hsl(120, 100%, 40%);">+               if (stats[0].num_pkts_rx_err_disabled != 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 setverdict(fail, "received packets from MGW on recvonly connection 0");</span><br><span>                    mtc.stop;</span><br><span>            }</span><br><span>            stats[1] := f_rtpem_stats_get(RTPEM[1]);</span><br><span>             if (stats[1].num_pkts_rx_err_disabled != 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   setverdict(fail, "received packets from MGW on recvonly connection");</span><br><span style="color: hsl(120, 100%, 40%);">+                       setverdict(fail, "received packets from MGW on recvonly connection 1");</span><br><span>                    mtc.stop;</span><br><span>            }</span><br><span> </span><br><span>                /* When the second leg is switched into bidirectional mode</span><br><span>            * as well, then the MGW will connect the two together and</span><br><span>            * we should see RTP streams passing through from both ends. */</span><br><span style="color: hsl(0, 100%, 40%);">-         f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);</span><br><span>            f_rtpem_mode(RTPEM[1], RTPEM_MODE_BIDIR);</span><br><span>            stats[0] := f_rtpem_stats_get(RTPEM[0]);</span><br><span style="color: hsl(0, 100%, 40%);">-                num_pkts_tx[0] := stats[0].num_pkts_tx</span><br><span style="color: hsl(0, 100%, 40%);">-          stats[1] := f_rtpem_stats_get(RTPEM[1]);</span><br><span style="color: hsl(0, 100%, 40%);">-                num_pkts_tx[1] := stats[1].num_pkts_tx</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(120, 100%, 40%);">+                num_pkts_tx[0] := stats[0].num_pkts_tx;</span><br><span>              f_flow_modify(RTPEM[1], ep, call_id, "sendrecv", flow[1]);</span><br><span>                 f_sleep(2.0);</span><br><span> </span><br><span>@@ -1810,13 +1809,13 @@</span><br><span> </span><br><span>              temp := stats[0].num_pkts_tx - num_pkts_tx[0] - stats[1].num_pkts_rx;</span><br><span>                if (temp > 3 or temp < -3) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      setverdict(fail, "number of packets not within normal parameters");</span><br><span style="color: hsl(120, 100%, 40%);">+                 setverdict(fail, "number of packets not within normal parameters:", temp);</span><br><span>                         mtc.stop;</span><br><span>            }</span><br><span> </span><br><span>                temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx;</span><br><span>                if (temp > 3 or temp < -3) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      setverdict(fail, "number of packets not within normal parameters");</span><br><span style="color: hsl(120, 100%, 40%);">+                 setverdict(fail, "number of packets not within normal parameters:", temp);</span><br><span>                         mtc.stop;</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/+/20034">change 20034</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/+/20034"/><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: I653eb75439321f9a488dc56dca5d3fc5a8811547 </div>
<div style="display:none"> Gerrit-Change-Number: 20034 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>