Change in osmo-ttcn3-hacks[master]: stp: Support testing multi-home SCTP features with IPv4+IPv6

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
Fri Aug 21 15:54:09 UTC 2020


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


Change subject: stp: Support testing multi-home SCTP features with IPv4+IPv6
......................................................................

stp: Support testing multi-home SCTP features with IPv4+IPv6

The IP addr module parameters are split now, IPA module has its own set
of configurable addresses, and M3UA its own. Moreover, in M3UA there's
an IPv4 and an IPv6 which can be configured, both locally and remotely.
If no IPv6 is set (=""), then only IPv4 will be used for the M3UA
connection.

Change-Id: Ib1925ed1df5cea3fa66f28b5625532d454a2c338
---
M stp/STP_Tests_Common.ttcn
M stp/STP_Tests_IPA.ttcn
M stp/STP_Tests_M3UA.ttcn
3 files changed, 50 insertions(+), 19 deletions(-)



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

diff --git a/stp/STP_Tests_Common.ttcn b/stp/STP_Tests_Common.ttcn
index aee5a88..a540b10 100644
--- a/stp/STP_Tests_Common.ttcn
+++ b/stp/STP_Tests_Common.ttcn
@@ -19,19 +19,6 @@
 
 import from IPL4asp_Types all;
 
-modulepar {
-	charstring mp_stp_ip := "127.0.0.1";
-	charstring mp_local_ip := "127.0.0.1";
-}
-
-friend template (value) SctpTuple ts_SCTP(template (omit) integer ppid := 3,
-					   template (omit) integer stream := 0) := {
-	sinfo_stream := stream,
-	sinfo_ppid := ppid,
-	remSocks := omit,
-	assocId := omit
-}
-
 type component Test_CT {
 	port TELNETasp_PT VTY;
 	timer g_Tguard := 30.0;
diff --git a/stp/STP_Tests_IPA.ttcn b/stp/STP_Tests_IPA.ttcn
index c67bc4a..26abc80 100644
--- a/stp/STP_Tests_IPA.ttcn
+++ b/stp/STP_Tests_IPA.ttcn
@@ -38,6 +38,8 @@
 type record of charstring AspNameArray;
 
 modulepar {
+	charstring mp_stp_ipa_ip := "127.0.0.1";
+	charstring mp_local_ipa_ip := "127.0.0.1";
 	integer mp_stp_ipa_port := 5000;
 	integer mp_local_ipa_port := 20000;
 	AspNameArray mp_ipa_as_names := {"ipa-as-loadshare-sender",
@@ -113,7 +115,7 @@
 		  ASP only up to NR_IPA are configured. */
 		port_offset := 100;
 	}
-	vc_IPA[idx].start(IPA_Emulation.main_client(mp_stp_ip, mp_stp_ipa_port, mp_local_ip,
+	vc_IPA[idx].start(IPA_Emulation.main_client(mp_stp_ipa_ip, mp_stp_ipa_port, mp_local_ipa_ip,
 			mp_local_ipa_port + idx + port_offset, g_ccm_pars[idx]));
 }
 
diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 68cea2a..4f2c9a5 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -35,6 +35,10 @@
 import from STP_Tests_Common all;
 
 modulepar {
+	charstring mp_stp_m3ua_ip4 := "127.0.0.1";
+	charstring mp_stp_m3ua_ip6 := "::1";
+	charstring mp_local_m3ua_ip4 := "127.0.0.1";
+	charstring mp_local_m3ua_ip6 := "::1";
 	integer mp_stp_m3ua_port := 2905;
 	integer mp_stp_m3ua_clnt_port := 2906;
 	integer mp_local_m3ua_port := 9999;
@@ -92,11 +96,41 @@
 	}
 }
 
+private template (value) Socket ts_Socket(HostName hostName, PortNumber portNumber) := {
+	hostName := hostName,
+        portNumber := portNumber
+};
+
+private template (value) SctpTuple ts_SCTP(template (omit) integer ppid := 3,
+					   template (omit) integer stream := 0,
+					   template (omit) SocketList remSocks := omit) := {
+	sinfo_stream := stream,
+	sinfo_ppid := ppid,
+	remSocks := remSocks,
+	assocId := omit
+};
+
 friend function f_M3UA_connect(integer i) runs on RAW_M3UA_CT {
 	var Result res;
-	res := M3UA_CodecPort_CtrlFunct.f_IPL4_connect(M3UA[i], mp_stp_ip, mp_stp_m3ua_port,
-						       mp_local_ip, mp_local_m3ua_port+i, 0,
-							{sctp:=valueof(ts_SCTP)});
+	var Option opt_add_local_addrs;
+	var OptionList opt_list := {};
+	var template SocketList opt_add_remote_addrs;
+
+	if (mp_local_m3ua_ip6 != "") {
+		opt_add_local_addrs.sctpAdditionalLocalAddresses := {mp_local_m3ua_ip6};
+		opt_list := {opt_add_local_addrs};
+	}
+
+	if (mp_stp_m3ua_ip6 == "") {
+		opt_add_remote_addrs := omit;
+	} else {
+		opt_add_remote_addrs := {valueof(ts_Socket(mp_stp_m3ua_ip6, mp_stp_m3ua_port))};
+	}
+
+	res := M3UA_CodecPort_CtrlFunct.f_IPL4_connect(M3UA[i], mp_stp_m3ua_ip4, mp_stp_m3ua_port,
+						       mp_local_m3ua_ip4, mp_local_m3ua_port+i, 0,
+						       {sctp:=valueof(ts_SCTP(3, 0, opt_add_remote_addrs))},
+						       opt_list);
 	if (not ispresent(res.connId)) {
 		setverdict(fail, "Could not connect M3UA socket, check your configuration");
 	mtc.stop;
@@ -112,8 +146,16 @@
 
 friend function f_M3UA_listen(integer i) runs on RAW_M3UA_CT {
 	var Result res;
-	res := M3UA_CodecPort_CtrlFunct.f_IPL4_listen(M3UA[i], mp_local_ip, mp_local_m3ua_port+i,
-							{sctp:=valueof(ts_SCTP)});
+	var Option opt_add_local_addrs;
+	var OptionList opt_list := {};
+
+	if (mp_local_m3ua_ip6 != "") {
+		opt_add_local_addrs.sctpAdditionalLocalAddresses := {mp_local_m3ua_ip6};
+		opt_list := {opt_add_local_addrs};
+	}
+
+	res := M3UA_CodecPort_CtrlFunct.f_IPL4_listen(M3UA[i], mp_local_m3ua_ip4, mp_local_m3ua_port+i,
+						      {sctp:=valueof(ts_SCTP)}, opt_list);
 	if (not ispresent(res.connId)) {
 		setverdict(fail, "Could not bind M3UA socket, check your configuration");
 	mtc.stop;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19770
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: Ib1925ed1df5cea3fa66f28b5625532d454a2c338
Gerrit-Change-Number: 19770
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/20200821/685ccef5/attachment.htm>


More information about the gerrit-log mailing list