Change in osmo-ttcn3-hacks[master]: mgw: Test IPv6 addresses in MGCP messages

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/.

pespin gerrit-no-reply at lists.osmocom.org
Wed Sep 9 13:54:43 UTC 2020


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20038 )

Change subject: mgw: Test IPv6 addresses in MGCP messages
......................................................................

mgw: Test IPv6 addresses in MGCP messages

These tests verify that osmo-mgw handles requests no matter of IP
version used in the remote address.

Change-Id: Ib134dda5a8f7c8f50968b6ce330f9986ae72575d
---
M mgw/MGCP_Test.ttcn
M mgw/osmo-mgw.cfg
2 files changed, 69 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index c41466a..b767dd4 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -2230,6 +2230,72 @@
 		setverdict(pass);
 	}
 
+	/* test valid CRCX then MDCX with IPv4 address, MGW provides a local IPv4 too */
+	testcase TC_crcx_mdcx_ip4() runs on dummy_CT {
+		var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "2@" & c_mgw_domain;
+		var template MgcpCommand cmd;
+		var MgcpResponse resp;
+		var MgcpCallId call_id := '1234'H;
+		var MgcpConnectionId conn_id;
+
+		f_init(ep);
+
+		/* create the connection on the MGW */
+		cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", call_id);
+		resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+		conn_id := extract_conn_id(resp);
+
+		cmd := ts_MDCX(get_next_trans_id(), ep, "sendrecv", call_id, conn_id);
+		cmd.sdp := ts_SDP("127.0.0.2", "127.0.0.1", "23", "42", 2344, { "98" },
+				  { valueof(ts_SDP_rtpmap(98, "AMR/8000")),
+				    valueof(ts_SDP_ptime(20)) });
+		resp := mgcp_transceive_mgw(cmd, tr_MDCX_ACK);
+
+		if (not ispresent(resp.sdp) or not ispresent(resp.sdp.connection)) {
+			setverdict(fail, "No RemoteConnection info found in MDCX ACK!");
+		}
+		if (not match(resp.sdp.connection, ts_SDP_connection_IP("127.0.0.1", "IP4"))) {
+			setverdict(fail, "Wrong RemoteConnection in MDCX ACK!", resp.sdp.connection);
+		}
+
+		/* clean-up */
+		f_dlcx_ok(ep, call_id);
+		setverdict(pass);
+	}
+
+	/* test valid CRCX then MDCX with IPv6 address, MGW provides a local IPv6 too */
+	testcase TC_crcx_mdcx_ip6() runs on dummy_CT {
+		var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "2@" & c_mgw_domain;
+		var template MgcpCommand cmd;
+		var MgcpResponse resp;
+		var MgcpCallId call_id := '1234'H;
+		var MgcpConnectionId conn_id;
+
+		f_init(ep);
+
+		/* create the connection on the MGW */
+		cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", call_id);
+		resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+		conn_id := extract_conn_id(resp);
+
+		cmd := ts_MDCX(get_next_trans_id(), ep, "sendrecv", call_id, conn_id);
+		cmd.sdp := ts_SDP("::2", "::1", "23", "42", 2344, { "98" },
+				  { valueof(ts_SDP_rtpmap(98, "AMR/8000")),
+				    valueof(ts_SDP_ptime(20)) });
+		resp := mgcp_transceive_mgw(cmd, tr_MDCX_ACK);
+
+		if (not ispresent(resp.sdp) or not ispresent(resp.sdp.connection)) {
+			setverdict(fail, "No RemoteConnection info found in MDCX ACK!");
+		}
+		if (not match(resp.sdp.connection, ts_SDP_connection_IP("::1", "IP6"))) {
+			setverdict(fail, "Wrong RemoteConnection in MDCX ACK!", resp.sdp.connection);
+		}
+
+		/* clean-up */
+		f_dlcx_ok(ep, call_id);
+		setverdict(pass);
+	}
+
 	control {
 		execute(TC_selftest());
 		execute(TC_crcx());
@@ -2290,5 +2356,7 @@
 		execute(TC_e1_crcx_with_overlap());
 		execute(TC_e1_crcx_loopback());
 
+		execute(TC_crcx_mdcx_ip4());
+		execute(TC_crcx_mdcx_ip6());
 	}
 }
diff --git a/mgw/osmo-mgw.cfg b/mgw/osmo-mgw.cfg
index edc8190..beb6fdf 100644
--- a/mgw/osmo-mgw.cfg
+++ b/mgw/osmo-mgw.cfg
@@ -22,6 +22,7 @@
   bind port 2427
   rtp port-range 4002 16000
   rtp bind-ip 127.0.0.1
+  rtp bind-ip-v6 ::1
   rtp ip-probing
   rtp ip-dscp 184
   no rtp keep-alive

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20038
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib134dda5a8f7c8f50968b6ce330f9986ae72575d
Gerrit-Change-Number: 20038
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200909/a257c48f/attachment.htm>


More information about the gerrit-log mailing list