<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/9479">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">MGCP_Test: Test non LCO crcx<br><br>When a CRCX without an LCO option (codec) is sent, then older versions<br>of osmo-mgw will omit the port number in the SDP part of the response.<br>Also no default codec is selected and reported back. This testcase<br>pinpoints the problem.<br><br>Change-Id: Ie16cdab936ce468fe378d4ec9e1c61f81c07fb4e<br>Related: OS#2658<br>---<br>M library/MGCP_Templates.ttcn<br>M mgw/MGCP_Test.ttcn<br>M mgw/expected-results.xml<br>3 files changed, 49 insertions(+), 0 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/79/9479/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn</span><br><span>index e509da8..9d6dea6 100644</span><br><span>--- a/library/MGCP_Templates.ttcn</span><br><span>+++ b/library/MGCP_Templates.ttcn</span><br><span>@@ -80,6 +80,15 @@</span><br><span>               sdp := sdp</span><br><span>   }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ template MgcpCommand ts_CRCX_no_lco(MgcpTransId trans_id, charstring ep, MgcpConnectionMode mode, MgcpCallId call_id, template SDP_Message sdp := omit) := {</span><br><span style="color: hsl(120, 100%, 40%);">+          line := t_MgcpCmdLine("CRCX", trans_id, ep),</span><br><span style="color: hsl(120, 100%, 40%);">+                params := {</span><br><span style="color: hsl(120, 100%, 40%);">+                   t_MgcpParConnMode(mode),</span><br><span style="color: hsl(120, 100%, 40%);">+                      ts_MgcpParCallId(call_id)</span><br><span style="color: hsl(120, 100%, 40%);">+             },</span><br><span style="color: hsl(120, 100%, 40%);">+            sdp := sdp</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  template MgcpCommand tr_CRCX(template MgcpEndpoint ep := ?) := {</span><br><span>             line := t_MgcpCmdLine("CRCX", ?, ep),</span><br><span>              params := *,</span><br><span>diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn</span><br><span>index 1892a42..26a0701 100644</span><br><span>--- a/mgw/MGCP_Test.ttcn</span><br><span>+++ b/mgw/MGCP_Test.ttcn</span><br><span>@@ -307,12 +307,48 @@</span><br><span>            f_dlcx_ok(ep, call_id);</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ function f_crcx_no_lco(charstring ep_prefix) runs on dummy_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+               var MgcpEndpoint ep := ep_prefix & "2@" & c_mgw_domain;</span><br><span style="color: hsl(120, 100%, 40%);">+             var template MgcpCommand cmd;</span><br><span style="color: hsl(120, 100%, 40%);">+         var MgcpResponse resp;</span><br><span style="color: hsl(120, 100%, 40%);">+                var MgcpCallId call_id := '1234'H;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+          f_init(ep);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+         /* create the connection on the MGW */</span><br><span style="color: hsl(120, 100%, 40%);">+                cmd := ts_CRCX_no_lco(get_next_trans_id(), ep, "recvonly", call_id);</span><br><span style="color: hsl(120, 100%, 40%);">+                resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);</span><br><span style="color: hsl(120, 100%, 40%);">+                extract_conn_id(resp);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+              /* clean-up */</span><br><span style="color: hsl(120, 100%, 40%);">+                f_dlcx_ok(ep, call_id);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+             /* See also OS#2658: Even when we omit the LCO information, we</span><br><span style="color: hsl(120, 100%, 40%);">+                   expect the MGW to pick a sane payload type for us. This</span><br><span style="color: hsl(120, 100%, 40%);">+               payload type should be visible in the SDP of the response. */</span><br><span style="color: hsl(120, 100%, 40%);">+              if (resp.sdp.media_list[0].attributes[0].rtpmap.attr_value != "0 PCMU/8000/1") {</span><br><span style="color: hsl(120, 100%, 40%);">+                    setverdict(fail, "SDP contains unexpected codec");</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%);">+           /* See also OS#2658: We also expect the MGW to assign a port</span><br><span style="color: hsl(120, 100%, 40%);">+             number to us. */</span><br><span style="color: hsl(120, 100%, 40%);">+           if (isbound(resp.sdp.media_list[0].media_field.ports.port_number) == false) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 setverdict(fail, "SDP does not contain a port number");</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%);">+</span><br><span>  /* test valid CRCX without SDP */</span><br><span>    testcase TC_crcx() runs on dummy_CT {</span><br><span>                f_crcx(c_mgw_ep_rtpbridge);</span><br><span>          setverdict(pass);</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* test valid CRCX without SDP and LCO */</span><br><span style="color: hsl(120, 100%, 40%);">+     testcase TC_crcx_no_lco() runs on dummy_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+          f_crcx_no_lco(c_mgw_ep_rtpbridge);</span><br><span style="color: hsl(120, 100%, 40%);">+            setverdict(pass);</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  /* test valid CRCX without SDP (older method without endpoint prefix) */</span><br><span>     testcase TC_crcx_noprefix() runs on dummy_CT {</span><br><span>               f_crcx("");</span><br><span>@@ -881,6 +917,7 @@</span><br><span>  control {</span><br><span>            execute(TC_selftest());</span><br><span>              execute(TC_crcx());</span><br><span style="color: hsl(120, 100%, 40%);">+           execute(TC_crcx_no_lco());</span><br><span>           execute(TC_crcx_noprefix());</span><br><span>                 execute(TC_crcx_unsupp_mode());</span><br><span>              execute(TC_crcx_early_bidir_mode());</span><br><span>diff --git a/mgw/expected-results.xml b/mgw/expected-results.xml</span><br><span>index b85a2b1..03c8fd2 100644</span><br><span>--- a/mgw/expected-results.xml</span><br><span>+++ b/mgw/expected-results.xml</span><br><span>@@ -4,6 +4,9 @@</span><br><span>     <skipped>no verdict</skipped></span><br><span>   </testcase></span><br><span>   <testcase classname='MGCP_Test' name='TC_crcx' time='MASKED'/></span><br><span style="color: hsl(120, 100%, 40%);">+  <testcase classname='MGCP_Test' name='TC_crcx_no_lco' time='MASKED'></span><br><span style="color: hsl(120, 100%, 40%);">+    <error type='DTE'>Dynamic test case error: Using the value of an optional field containing omit.</error></span><br><span style="color: hsl(120, 100%, 40%);">+  </testcase></span><br><span>   <testcase classname='MGCP_Test' name='TC_crcx_noprefix' time='MASKED'/></span><br><span>   <testcase classname='MGCP_Test' name='TC_crcx_unsupp_mode' time='MASKED'/></span><br><span>   <testcase classname='MGCP_Test' name='TC_crcx_early_bidir_mode' time='MASKED'/></span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9479">change 9479</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/9479"/><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: Ie16cdab936ce468fe378d4ec9e1c61f81c07fb4e </div>
<div style="display:none"> Gerrit-Change-Number: 9479 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>