Change in osmo-ttcn3-hacks[master]: mgw: Test IPv6 RTP streams in osmo-mgw

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
Tue Sep 8 16:21:11 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20039 )


Change subject: mgw: Test IPv6 RTP streams in osmo-mgw
......................................................................

mgw: Test IPv6 RTP streams in osmo-mgw

Change-Id: I2a47926757af84ffa190a954aac0dcc5369528b3
---
M mgw/MGCP_Test.ttcn
1 file changed, 83 insertions(+), 17 deletions(-)



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

diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index b767dd4..4be034b 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -65,8 +65,10 @@
 	modulepar {
 		PortNumber mp_local_udp_port := 2727;
 		charstring mp_local_ipv4 := "127.0.0.1";
+		charstring mp_local_ipv6 := "::1";
 		PortNumber mp_remote_udp_port := 2427;
 		charstring mp_remote_ipv4 := "127.0.0.1";
+		charstring mp_remote_ipv6 := "::1";
 		PortNumber mp_local_rtp_port_base := 10000;
 		PortNumber mp_local_osmux_port := 1985;
 	}
@@ -1186,7 +1188,9 @@
 		return true;
 	}
 
-	function f_TC_two_crcx_and_rtp_osmux(boolean bidir) runs on dummy_CT {
+	function f_TC_two_crcx_and_rtp_osmux(boolean bidir,
+					     charstring local_ip_rtp, charstring remote_ip_rtp,
+					     charstring local_ip_osmux, charstring remote_ip_osmux) runs on dummy_CT {
 		var RtpFlowData flow[2];
 		var RtpemStats stats_rtp;
 		var OsmuxemStats stats_osmux;
@@ -1198,7 +1202,7 @@
 		f_init(ep, true);
 
 		/* from us to MGW */
-		flow[0] := valueof(t_RtpFlow(mp_local_ipv4, mp_remote_ipv4, 112, "AMR/8000"));
+		flow[0] := valueof(t_RtpFlow(local_ip_rtp, remote_ip_rtp, 112, "AMR/8000"));
 		flow[0].rtp_cfg := c_RtpemDefaultCfg
 		flow[0].rtp_cfg.tx_payload_type := flow[0].pt;
 		/* 0014 is the ToC (CMR=AMR4.75) in front of AMR Payload in RTP Payload */
@@ -1209,7 +1213,7 @@
 		f_flow_create(RTPEM[0], ep, call_id, "sendrecv", flow[0]);
 
 		/* from MGW back to us */
-		flow[1] := valueof(t_RtpFlow(mp_local_ipv4, mp_remote_ipv4, 110, "AMR/8000"));
+		flow[1] := valueof(t_RtpFlow(local_ip_osmux, remote_ip_osmux, 110, "AMR/8000"));
 		flow[1].em.portnr := mp_local_osmux_port;
 		flow[1].osmux_cid := 2;
 		flow[1].osmux_cfg := c_OsmuxemDefaultCfg;
@@ -1254,17 +1258,37 @@
 
 	/* create one RTP and one OSmux emulations; create two connections on MGW EP, exchange some data */
 	testcase TC_two_crcx_and_rtp_osmux() runs on dummy_CT {
-		 f_TC_two_crcx_and_rtp_osmux(false);
+		 f_TC_two_crcx_and_rtp_osmux(false, mp_local_ipv4, mp_remote_ipv4,
+					     mp_local_ipv4, mp_remote_ipv4);
 	}
 
 	/* create one RTP and one OSmux emulations; create two connections on MGW EP,
 	 * exchange some data in both directions */
 	testcase TC_two_crcx_and_rtp_osmux_bidir() runs on dummy_CT {
-		 f_TC_two_crcx_and_rtp_osmux(true);
+		 f_TC_two_crcx_and_rtp_osmux(true, mp_local_ipv4, mp_remote_ipv4,
+					     mp_local_ipv4, mp_remote_ipv4);
+	}
+
+	/* Same as TC_two_crcx_and_rtp_osmux_bidir, but using IPv6 */
+	testcase TC_two_crcx_and_rtp_osmux_bidir_ipv6() runs on dummy_CT {
+		 f_TC_two_crcx_and_rtp_osmux(true, mp_local_ipv6, mp_remote_ipv6,
+					     mp_local_ipv6, mp_remote_ipv6);
+	}
+	/* Same as TC_two_crcx_and_rtp_osmux_bidir, but using IPv4 (RTP) and IPv6 (Osmux) */
+	testcase TC_two_crcx_and_rtp_osmux_bidir_ipv4_ipv6() runs on dummy_CT {
+		 f_TC_two_crcx_and_rtp_osmux(true, mp_local_ipv4, mp_remote_ipv4,
+					     mp_local_ipv6, mp_remote_ipv6);
+	}
+	/* Same as TC_two_crcx_and_rtp_osmux_bidir, but using IPv6 (RTP) and IPv4 (Osmux) */
+	testcase TC_two_crcx_and_rtp_osmux_bidir_ipv6_ipv4() runs on dummy_CT {
+		 f_TC_two_crcx_and_rtp_osmux(true, mp_local_ipv6, mp_remote_ipv6,
+					     mp_local_ipv4, mp_remote_ipv4);
 	}
 
 
-	function f_two_crcx_mdcx_and_rtp_osmux(boolean crcx_osmux_wildcard) runs on dummy_CT {
+	function f_two_crcx_mdcx_and_rtp_osmux(boolean crcx_osmux_wildcard,
+					       charstring local_ip_rtp, charstring remote_ip_rtp,
+					       charstring local_ip_osmux, charstring remote_ip_osmux) runs on dummy_CT {
 		var RtpFlowData flow[2];
 		var RtpemStats stats_rtp;
 		var OsmuxemStats stats_osmux;
@@ -1277,7 +1301,7 @@
 		f_init(ep, true);
 
 		/* Create the first connection in receive only mode */
-		flow[0] := valueof(t_RtpFlow(mp_local_ipv4, mp_remote_ipv4, 112, "AMR/8000"));
+		flow[0] := valueof(t_RtpFlow(local_ip_rtp, remote_ip_rtp, 112, "AMR/8000"));
 		flow[0].rtp_cfg := c_RtpemDefaultCfg
 		flow[0].rtp_cfg.tx_payload_type := flow[0].pt;
 		/* 0014 is the ToC (CMR=AMR4.75) in front of AMR Payload in RTP Payload */
@@ -1285,12 +1309,12 @@
 		flow[0].rtp_cfg.tx_fixed_payload := flow[0].rtp_cfg.rx_fixed_payload;
 		/* bind local RTP emulation sockets */
 		flow[0].em.portnr := 10000;
-		f_flow_create(RTPEM[0], ep, call_id, "recvonly", flow[0], false);
+		f_flow_create(RTPEM[0], ep, call_id, "recvonly", flow[0], true);
 
 
 		/* Create the second connection. This connection will be also
 		 * in receive only mode */
-		flow[1] := valueof(t_RtpFlow(mp_local_ipv4, mp_remote_ipv4, 110, "AMR/8000"));
+		flow[1] := valueof(t_RtpFlow(local_ip_osmux, remote_ip_osmux, 110, "AMR/8000"));
 		flow[1].em.portnr := mp_local_osmux_port;
 		if (crcx_osmux_wildcard) {
 			flow[1].osmux_cid := -1;
@@ -1298,7 +1322,7 @@
 			flow[1].osmux_cid := 2;
 		}
 		flow[1].osmux_cfg := c_OsmuxemDefaultCfg;
-		f_flow_create_osmux(OsmuxEM, ep, call_id, "recvonly", flow[1], false);
+		f_flow_create_osmux(OsmuxEM, ep, call_id, "recvonly", flow[1], true);
 
 
 		/* The first leg starts transmitting */
@@ -1393,14 +1417,32 @@
 	    directions. Create CRCX with wildcard Osmux CID and set it later
 	    during MDCX. This is similar to how MSC sets up the call in AoIP. */
 	testcase TC_two_crcx_mdcx_and_rtp_osmux_wildcard() runs on dummy_CT {
-		f_two_crcx_mdcx_and_rtp_osmux(true);
+		f_two_crcx_mdcx_and_rtp_osmux(true, mp_local_ipv4, mp_remote_ipv4,
+					      mp_local_ipv4, mp_remote_ipv4);
 	}
 
 	/*  create one RTP and one OSmux emulations and pass data in both
 	    directions. Create CRCX with fixed Osmux CID and keep it during
 	    MDCX. This is similar to how BSC sets up the call in AoIP. */
 	testcase TC_two_crcx_mdcx_and_rtp_osmux_fixed() runs on dummy_CT {
-		f_two_crcx_mdcx_and_rtp_osmux(false);
+		f_two_crcx_mdcx_and_rtp_osmux(false, mp_local_ipv4, mp_remote_ipv4,
+					      mp_local_ipv4, mp_remote_ipv4);
+	}
+
+	/*  Same as TC_two_crcx_mdcx_and_rtp_osmux_wildcard, but using IPv6. */
+	testcase TC_two_crcx_mdcx_and_rtp_osmux_ipv6() runs on dummy_CT {
+		f_two_crcx_mdcx_and_rtp_osmux(false, mp_local_ipv6, mp_remote_ipv6,
+					      mp_local_ipv6, mp_remote_ipv6);
+	}
+	/*  Same as TC_two_crcx_mdcx_and_rtp_osmux_wildcard, but using IPv4 (RTP) and IPv6 (Osmux). */
+	testcase TC_two_crcx_mdcx_and_rtp_osmux_ipv4_ipv6() runs on dummy_CT {
+		f_two_crcx_mdcx_and_rtp_osmux(false, mp_local_ipv4, mp_remote_ipv4,
+					      mp_local_ipv6, mp_remote_ipv6);
+	}
+	/*  Same as TC_two_crcx_mdcx_and_rtp_osmux_wildcard, but using IPv6 (RTP) and IPv4 (Osmux). */
+	testcase TC_two_crcx_mdcx_and_rtp_osmux_ipv6_ipv4() runs on dummy_CT {
+		f_two_crcx_mdcx_and_rtp_osmux(false, mp_local_ipv6, mp_remote_ipv6,
+					      mp_local_ipv4, mp_remote_ipv4);
 	}
 
 	function f_crcx_and_dlcx_ep_callid_connid(MgcpEndpoint ep, MgcpCallId call_id) runs on dummy_CT {
@@ -1727,7 +1769,8 @@
 	}
 
 	/* create two local RTP emulations and pass data in both directions */
-	testcase TC_two_crcx_mdcx_and_rtp() runs on dummy_CT {
+	function f_tc_two_crcx_mdcx_and_rtp(charstring local_ip_a, charstring remote_ip_a,
+					    charstring local_ip_b, charstring remote_ip_b) runs on dummy_CT {
 		var RtpFlowData flow[2];
 		var RtpemStats stats[2];
 		var MgcpResponse resp;
@@ -1739,15 +1782,15 @@
 		f_init(ep);
 
 		/* Create the first connection in receive only mode */
-		flow[0] := valueof(t_RtpFlow(mp_local_ipv4, mp_remote_ipv4, 3, "GSM/8000/1"));
+		flow[0] := valueof(t_RtpFlow(local_ip_a, remote_ip_a, 3, "GSM/8000/1"));
 		flow[0].em.portnr := 10000;
-		f_flow_create(RTPEM[0], ep, call_id, "recvonly", flow[0], false);
+		f_flow_create(RTPEM[0], ep, call_id, "recvonly", flow[0], true);
 
 		/* Create the second connection. This connection will be also
 		 * in receive only mode */
-		flow[1] := valueof(t_RtpFlow(mp_local_ipv4, mp_remote_ipv4, 3, "GSM/8000/1"));
+		flow[1] := valueof(t_RtpFlow(local_ip_b, remote_ip_b, 3, "GSM/8000/1"));
 		flow[1].em.portnr := 20000;
-		f_flow_create(RTPEM[1], ep, call_id, "recvonly", flow[1], false);
+		f_flow_create(RTPEM[1], ep, call_id, "recvonly", flow[1], true);
 
 		/* The first leg starts transmitting */
 		f_rtpem_mode(RTPEM[0], RTPEM_MODE_TXONLY);
@@ -1828,6 +1871,21 @@
 		setverdict(pass);
 	}
 
+	testcase TC_two_crcx_mdcx_and_rtp() runs on dummy_CT {
+		f_tc_two_crcx_mdcx_and_rtp(mp_local_ipv4, mp_remote_ipv4,
+					   mp_local_ipv4, mp_remote_ipv4);
+	}
+
+	testcase TC_two_crcx_mdcx_and_rtp_ipv6() runs on dummy_CT {
+		f_tc_two_crcx_mdcx_and_rtp(mp_local_ipv6, mp_remote_ipv6,
+					   mp_local_ipv6, mp_remote_ipv6);
+	}
+
+	testcase TC_two_crcx_mdcx_and_rtp_ipv4_ipv6() runs on dummy_CT {
+		f_tc_two_crcx_mdcx_and_rtp(mp_local_ipv4, mp_remote_ipv4,
+					   mp_local_ipv6, mp_remote_ipv6);
+	}
+
 	/* Test what happens when two RTP streams from different sources target
 	 * a single connection. Is the unsolicited stream properly ignored? */
 	testcase TC_two_crcx_and_unsolicited_rtp() runs on dummy_CT {
@@ -2358,5 +2416,13 @@
 
 		execute(TC_crcx_mdcx_ip4());
 		execute(TC_crcx_mdcx_ip6());
+		execute(TC_two_crcx_mdcx_and_rtp_ipv4_ipv6());
+		execute(TC_two_crcx_mdcx_and_rtp_ipv6());
+		execute(TC_two_crcx_and_rtp_osmux_bidir_ipv6());
+		execute(TC_two_crcx_and_rtp_osmux_bidir_ipv4_ipv6());
+		execute(TC_two_crcx_and_rtp_osmux_bidir_ipv6_ipv4());
+		execute(TC_two_crcx_mdcx_and_rtp_osmux_ipv6());
+		execute(TC_two_crcx_mdcx_and_rtp_osmux_ipv4_ipv6());
+		execute(TC_two_crcx_mdcx_and_rtp_osmux_ipv6_ipv4());
 	}
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20039
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: I2a47926757af84ffa190a954aac0dcc5369528b3
Gerrit-Change-Number: 20039
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200908/723fb002/attachment.htm>


More information about the gerrit-log mailing list