aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-02-02 14:55:12 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2018-02-02 16:14:37 +0100
commit8a3dc925da5f6249659012df005a5c6ece9f38a3 (patch)
tree4611c4a2a1d872279c7f5e34bd4aeefb77b76f5e
parentdffa6a46e63a217032395b7a9d3b20bdb195588b (diff)
MGCP_Test: test illegal wildcarded DLCX and MDCX
- Add tests to check the behaviour on wildcarded DLCX and MDCX, both commands not supported by the MGW and should fail. Change-Id: I140c6d9e337cd16d6147bb582a9474cf76b5170b
-rw-r--r--mgw/MGCP_Test.cfg2
-rw-r--r--mgw/MGCP_Test.ttcn54
2 files changed, 56 insertions, 0 deletions
diff --git a/mgw/MGCP_Test.cfg b/mgw/MGCP_Test.cfg
index 6eeb9c2f..da45761b 100644
--- a/mgw/MGCP_Test.cfg
+++ b/mgw/MGCP_Test.cfg
@@ -30,6 +30,8 @@ MGCP_Test.TC_crcx_wildcarded
MGCP_Test.TC_crcx_wildcarded_exhaust
MGCP_Test.TC_mdcx_without_crcx
MGCP_Test.TC_dlcx_without_crcx
+MGCP_Test.TC_mdcx_wildcarded
+MGCP_Test.TC_dlcx_wildcarded
MGCP_Test.TC_crcx_and_dlcx_ep_callid_connid
MGCP_Test.TC_crcx_and_dlcx_ep_callid
MGCP_Test.TC_crcx_and_dlcx_ep
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 6c47e27b..9632e798 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -518,6 +518,58 @@ module MGCP_Test {
setverdict(pass);
}
+ /* test valid wildcarded MDCX */
+ testcase TC_mdcx_wildcarded() runs on dummy_CT {
+ /* Note: A wildcarded MDCX is not allowed, so we expect the
+ * MGW to reject this request */
+ var template MgcpCommand cmd;
+ var MgcpResponse resp;
+ var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "*@" & c_mgw_domain;
+ var MgcpCallId call_id := '1225'H;
+ var template MgcpResponse rtmpl := {
+ line := {
+ /* TODO: accept/enforce better error? */
+ code := "507",
+ string := ?
+ },
+ params:= { },
+ sdp := omit
+ };
+
+ f_init(ep);
+
+ cmd := ts_MDCX(get_next_trans_id(), ep, "sendrecv", call_id, call_id);
+ cmd.sdp := ts_SDP("127.0.0.1", "127.0.0.2", "23", "42", 2344, { "98" },
+ { valueof(ts_SDP_rtpmap(98, "AMR/8000")),
+ valueof(ts_SDP_ptime(20)) });
+ resp := mgcp_transceive_mgw(cmd, rtmpl);
+ setverdict(pass);
+ }
+
+ /* test valid wildcarded DLCX */
+ testcase TC_dlcx_wildcarded() runs on dummy_CT {
+ /* Note: A wildcarded DLCX is specified, but our MGW does not
+ * support this feature so we expect the MGW to reject the
+ * request */
+ var template MgcpCommand cmd;
+ var MgcpResponse resp;
+ var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "*@" & c_mgw_domain;
+ var template MgcpResponse rtmpl := {
+ line := {
+ code := "507",
+ string := ?
+ },
+ params:= { },
+ sdp := omit
+ };
+
+ f_init(ep);
+
+ cmd := ts_DLCX(get_next_trans_id(), ep, '41234'H);
+ resp := mgcp_transceive_mgw(cmd, rtmpl);
+ setverdict(pass);
+ }
+
/* Test (valid) CRCX followed by (valid) DLCX containig EP+CallId+ConnId */
testcase TC_crcx_and_dlcx_ep_callid_connid() runs on dummy_CT {
var template MgcpCommand cmd;
@@ -688,6 +740,8 @@ module MGCP_Test {
execute(TC_crcx_wildcarded_exhaust());
execute(TC_mdcx_without_crcx());
execute(TC_dlcx_without_crcx());
+ execute(TC_mdcx_wildcarded());
+ execute(TC_dlcx_wildcarded());
execute(TC_crcx_and_dlcx_ep_callid_connid());
execute(TC_crcx_and_dlcx_ep_callid());
execute(TC_crcx_and_dlcx_ep());