<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10155">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">MGCP_Test: Test what happens when two ends use different PT<br><br>It is legal that two connections use the same codec but negotiate<br>different dynamic payload types for both connections. Then the MGW is<br>expected to receive packets with one PT and send them with the other PT.<br>This is currently not done in osmo-mgw so the two tests that this commit<br>adds are expected to fail for now.<br><br>- add testcase TC_two_crcx_diff_pt_and_rtp<br>- add testcase TC_two_crcx_diff_pt_and_rtp_bidir<br><br>Change-Id: Ib4606dfc08764410ee9e450949361544adb07cd3<br>Related: OS#3384<br>---<br>M mgw/MGCP_Test.ttcn<br>M mgw/expected-results.xml<br>2 files changed, 24 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/55/10155/1</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 a6d3460..494e8bb 100644</span><br><span>--- a/mgw/MGCP_Test.ttcn</span><br><span>+++ b/mgw/MGCP_Test.ttcn</span><br><span>@@ -998,7 +998,8 @@</span><br><span>          setverdict(pass);</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   function f_TC_two_crcx_and_rtp(boolean bidir) runs on dummy_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+      function f_TC_two_crcx_and_rtp(boolean bidir, charstring codec_name_a, integer pt_a,</span><br><span style="color: hsl(120, 100%, 40%);">+                                  charstring codec_name_b, integer pt_b) runs on dummy_CT {</span><br><span>            var RtpFlowData flow[2];</span><br><span>             var RtpemStats stats[2];</span><br><span>             var MgcpResponse resp;</span><br><span>@@ -1009,13 +1010,13 @@</span><br><span>             f_init(ep);</span><br><span> </span><br><span>              /* from us to MGW */</span><br><span style="color: hsl(0, 100%, 40%);">-            flow[0] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 98, "AMR/8000"));</span><br><span style="color: hsl(120, 100%, 40%);">+           flow[0] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, pt_a, codec_name_a));</span><br><span>                /* bind local RTP emulation sockets */</span><br><span>               flow[0].em.portnr := 10000;</span><br><span>          f_flow_create(RTPEM[0], ep, call_id, "sendrecv", flow[0]);</span><br><span> </span><br><span>             /* from MGW back to us */</span><br><span style="color: hsl(0, 100%, 40%);">-               flow[1] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 98, "AMR/8000"));</span><br><span style="color: hsl(120, 100%, 40%);">+           flow[1] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, pt_b, codec_name_b));</span><br><span>                flow[1].em.portnr := 20000;</span><br><span>          f_flow_create(RTPEM[1], ep, call_id, "sendrecv", flow[1]);</span><br><span> </span><br><span>@@ -1053,13 +1054,23 @@</span><br><span> </span><br><span>       /* create two local RTP emulations; create two connections on MGW EP, exchange some data */</span><br><span>  testcase TC_two_crcx_and_rtp() runs on dummy_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-                f_TC_two_crcx_and_rtp(false);</span><br><span style="color: hsl(120, 100%, 40%);">+                 f_TC_two_crcx_and_rtp(false, "AMR/8000", 98, "AMR/8000", 98);</span><br><span>   }</span><br><span> </span><br><span>        /* create two local RTP emulations; create two connections on MGW EP,</span><br><span>         * exchange some data in both directions */</span><br><span>  testcase TC_two_crcx_and_rtp_bidir() runs on dummy_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-          f_TC_two_crcx_and_rtp(true);</span><br><span style="color: hsl(120, 100%, 40%);">+          f_TC_two_crcx_and_rtp(true, "AMR/8000", 98, "AMR/8000", 98);</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* same as TC_two_crcx_and_rtp, but with different PT number on both ends */</span><br><span style="color: hsl(120, 100%, 40%);">+  testcase TC_two_crcx_diff_pt_and_rtp() runs on dummy_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+              f_TC_two_crcx_and_rtp(false, "AMR/8000", 98, "AMR/8000", 112);</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* same as TC_two_crcx_and_rtp, but with different PT number on both ends */</span><br><span style="color: hsl(120, 100%, 40%);">+  testcase TC_two_crcx_diff_pt_and_rtp_bidir() runs on dummy_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+                f_TC_two_crcx_and_rtp(true, "AMR/8000", 98, "AMR/8000", 112);</span><br><span>   }</span><br><span> </span><br><span>        /* create two local RTP emulations and pass data in both directions */</span><br><span>@@ -1328,6 +1339,8 @@</span><br><span>               execute(TC_one_crcx_loopback_rtp());</span><br><span>                 execute(TC_two_crcx_and_rtp());</span><br><span>              execute(TC_two_crcx_and_rtp_bidir());</span><br><span style="color: hsl(120, 100%, 40%);">+         execute(TC_two_crcx_diff_pt_and_rtp());</span><br><span style="color: hsl(120, 100%, 40%);">+               execute(TC_two_crcx_diff_pt_and_rtp_bidir());</span><br><span>                execute(TC_two_crcx_mdcx_and_rtp());</span><br><span>                 execute(TC_two_crcx_and_unsolicited_rtp());</span><br><span>          execute(TC_two_crcx_and_one_mdcx_rtp_ho());</span><br><span>diff --git a/mgw/expected-results.xml b/mgw/expected-results.xml</span><br><span>index f201099..92b9351 100644</span><br><span>--- a/mgw/expected-results.xml</span><br><span>+++ b/mgw/expected-results.xml</span><br><span>@@ -34,6 +34,12 @@</span><br><span>   <testcase classname='MGCP_Test' name='TC_one_crcx_receive_only_rtp' time='MASKED'/></span><br><span>   <testcase classname='MGCP_Test' name='TC_one_crcx_loopback_rtp' time='MASKED'/></span><br><span>   <testcase classname='MGCP_Test' name='TC_two_crcx_and_rtp_bidir' time='MASKED'/></span><br><span style="color: hsl(120, 100%, 40%);">+  <testcase classname='MGCP_Test' name='TC_two_crcx_diff_pt_and_rtp' time='MASKED'></span><br><span style="color: hsl(120, 100%, 40%);">+    <failure type='fail-verdict'>RTP packet payload type errors occurred</failure></span><br><span style="color: hsl(120, 100%, 40%);">+  </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+  <testcase classname='MGCP_Test' name='TC_two_crcx_diff_pt_and_rtp_bidir' time='MASKED'></span><br><span style="color: hsl(120, 100%, 40%);">+    <failure type='fail-verdict'>RTP packet payload type errors occurred</failure></span><br><span style="color: hsl(120, 100%, 40%);">+  </testcase></span><br><span>   <testcase classname='MGCP_Test' name='TC_two_crcx_mdcx_and_rtp' time='MASKED'/></span><br><span>   <testcase classname='MGCP_Test' name='TC_two_crcx_and_unsolicited_rtp' time='MASKED'/></span><br><span>   <testcase classname='MGCP_Test' name='TC_two_crcx_and_one_mdcx_rtp_ho' time='MASKED'/></span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10155">change 10155</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/10155"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib4606dfc08764410ee9e450949361544adb07cd3 </div>
<div style="display:none"> Gerrit-Change-Number: 10155 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>