[MERGED] osmo-ttcn3-hacks[master]: MGCP_Test: test illegal wildcarded DLCX and MDCX

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Feb 3 14:05:51 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: MGCP_Test: test illegal wildcarded DLCX and MDCX
......................................................................


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
---
M mgw/MGCP_Test.cfg
M mgw/MGCP_Test.ttcn
2 files changed, 56 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/mgw/MGCP_Test.cfg b/mgw/MGCP_Test.cfg
index 6eeb9c2..da45761 100644
--- a/mgw/MGCP_Test.cfg
+++ b/mgw/MGCP_Test.cfg
@@ -30,6 +30,8 @@
 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 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());

-- 
To view, visit https://gerrit.osmocom.org/6264
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I140c6d9e337cd16d6147bb582a9474cf76b5170b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list