dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9479


Change subject: MGCP_Test: Test non LCO crcx
......................................................................

MGCP_Test: Test non LCO crcx

When a CRCX without an LCO option (codec) is sent, then older versions
of osmo-mgw will omit the port number in the SDP part of the response.
Also no default codec is selected and reported back. This testcase
pinpoints the problem.

Change-Id: Ie16cdab936ce468fe378d4ec9e1c61f81c07fb4e
Related: OS#2658
---
M library/MGCP_Templates.ttcn
M mgw/MGCP_Test.ttcn
M mgw/expected-results.xml
3 files changed, 49 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/79/9479/1

diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn
index e509da8..9d6dea6 100644
--- a/library/MGCP_Templates.ttcn
+++ b/library/MGCP_Templates.ttcn
@@ -80,6 +80,15 @@
                sdp := sdp
        }

+       template MgcpCommand ts_CRCX_no_lco(MgcpTransId trans_id, charstring 
ep, MgcpConnectionMode mode, MgcpCallId call_id, template SDP_Message sdp := 
omit) := {
+               line := t_MgcpCmdLine("CRCX", trans_id, ep),
+               params := {
+                       t_MgcpParConnMode(mode),
+                       ts_MgcpParCallId(call_id)
+               },
+               sdp := sdp
+       }
+
        template MgcpCommand tr_CRCX(template MgcpEndpoint ep := ?) := {
                line := t_MgcpCmdLine("CRCX", ?, ep),
                params := *,
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 1892a42..26a0701 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -307,12 +307,48 @@
                f_dlcx_ok(ep, call_id);
        }

+       function f_crcx_no_lco(charstring ep_prefix) runs on dummy_CT {
+               var MgcpEndpoint ep := ep_prefix & "2@" & c_mgw_domain;
+               var template MgcpCommand cmd;
+               var MgcpResponse resp;
+               var MgcpCallId call_id := '1234'H;
+
+               f_init(ep);
+
+               /* create the connection on the MGW */
+               cmd := ts_CRCX_no_lco(get_next_trans_id(), ep, "recvonly", 
call_id);
+               resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+               extract_conn_id(resp);
+
+               /* clean-up */
+               f_dlcx_ok(ep, call_id);
+
+               /* See also OS#2658: Even when we omit the LCO information, we
+                  expect the MGW to pick a sane payload type for us. This
+                  payload type should be visible in the SDP of the response. */
+               if (resp.sdp.media_list[0].attributes[0].rtpmap.attr_value != 
"0 PCMU/8000/1") {
+                       setverdict(fail, "SDP contains unexpected codec");
+               }
+
+               /* See also OS#2658: We also expect the MGW to assign a port
+                  number to us. */
+               if 
(isbound(resp.sdp.media_list[0].media_field.ports.port_number) == false) {
+                       setverdict(fail, "SDP does not contain a port number");
+               }
+       }
+
        /* test valid CRCX without SDP */
        testcase TC_crcx() runs on dummy_CT {
                f_crcx(c_mgw_ep_rtpbridge);
                setverdict(pass);
        }

+       /* test valid CRCX without SDP and LCO */
+       testcase TC_crcx_no_lco() runs on dummy_CT {
+               f_crcx_no_lco(c_mgw_ep_rtpbridge);
+               setverdict(pass);
+       }
+
        /* test valid CRCX without SDP (older method without endpoint prefix) */
        testcase TC_crcx_noprefix() runs on dummy_CT {
                f_crcx("");
@@ -881,6 +917,7 @@
        control {
                execute(TC_selftest());
                execute(TC_crcx());
+               execute(TC_crcx_no_lco());
                execute(TC_crcx_noprefix());
                execute(TC_crcx_unsupp_mode());
                execute(TC_crcx_early_bidir_mode());
diff --git a/mgw/expected-results.xml b/mgw/expected-results.xml
index b85a2b1..03c8fd2 100644
--- a/mgw/expected-results.xml
+++ b/mgw/expected-results.xml
@@ -4,6 +4,9 @@
     <skipped>no verdict</skipped>
   </testcase>
   <testcase classname='MGCP_Test' name='TC_crcx' time='MASKED'/>
+  <testcase classname='MGCP_Test' name='TC_crcx_no_lco' time='MASKED'>
+    <error type='DTE'>Dynamic test case error: Using the value of an optional 
field containing omit.</error>
+  </testcase>
   <testcase classname='MGCP_Test' name='TC_crcx_noprefix' time='MASKED'/>
   <testcase classname='MGCP_Test' name='TC_crcx_unsupp_mode' time='MASKED'/>
   <testcase classname='MGCP_Test' name='TC_crcx_early_bidir_mode' 
time='MASKED'/>

--
To view, visit https://gerrit.osmocom.org/9479
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie16cdab936ce468fe378d4ec9e1c61f81c07fb4e
Gerrit-Change-Number: 9479
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>

Reply via email to