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
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 6c47e27..9632e79 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -518,6 +518,58 @@
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 @@
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());