Change in osmo-ttcn3-hacks[master]: BTS_Tests: verify NSVC IPv4/IPv6 in the INFO.ind message

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

laforge gerrit-no-reply at lists.osmocom.org
Fri Sep 11 12:58:00 UTC 2020


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

Change subject: BTS_Tests: verify NSVC IPv4/IPv6 in the INFO.ind message
......................................................................

BTS_Tests: verify NSVC IPv4/IPv6 in the INFO.ind message

Change-Id: Iae854875a45dbc29cd46a267ccaf60f1f2ac2973
Tweaked-By: Vadim Yanitskiy <vyanitskiy at sysmocom.de>
Related: SYS#4915
---
M bts/BTS_Tests.ttcn
1 file changed, 52 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index d9ad45b..6412022 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -35,6 +35,7 @@
 import from L1CTL_Types all;
 import from LAPDm_Types all;
 import from LAPDm_RAW_PT all;
+import from Native_Functions all;
 import from Osmocom_CTRL_Adapter all;
 import from Osmocom_CTRL_Functions all;
 
@@ -5435,6 +5436,55 @@
 	}
 }
 
+/* Verify IPv4 NSVC address in the INFO.ind message (version >= 10) */
+testcase TC_pcu_socket_nsvc_ipv4() runs on test_CT {
+	f_init_vty_bsc();
+	f_vty_config2(BSCVTY, {"network", "bts 0"} , "gprs nsvc 0 remote ip 127.127.127.127");
+	f_vty_transceive(BSCVTY, "drop bts connection 0 oml");
+
+	f_init();
+
+	var PCUIF_RemoteAddr remote_addr := g_pcu_last_info.u.info_ind.remote_addr;
+	if (not ischosen(remote_addr.v10)) {
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+					log2str("Unexpected remote_addr: ", remote_addr));
+	}
+
+	if (remote_addr.v10.addr_type[0] != PCUIF_ADDR_TYPE_IPV4) {
+		setverdict(fail, "Received address family is not IPv4");
+	}
+
+	if (substr(remote_addr.v10.addr[0], 0, 4) != f_inet_addr("127.127.127.127")) {
+		setverdict(fail, "Unexpected address: ", remote_addr.v10.addr[0]);
+	}
+
+	setverdict(pass);
+}
+
+/* Verify IPv4 NSVC address in the INFO.ind message (version >= 10) */
+testcase TC_pcu_socket_nsvc_ipv6() runs on test_CT {
+	f_init_vty_bsc();
+	f_vty_config2(BSCVTY, {"network", "bts 0"} , "gprs nsvc 0 remote ip fd00::ca:ff:ee");
+
+	f_init();
+
+	var PCUIF_RemoteAddr remote_addr := g_pcu_last_info.u.info_ind.remote_addr;
+	if (not ischosen(remote_addr.v10)) {
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+					log2str("Unexpected remote_addr: ", remote_addr));
+	}
+
+	if (remote_addr.v10.addr_type[0] != PCUIF_ADDR_TYPE_IPV6) {
+		setverdict(fail, "Received address family is not IPv6");
+	}
+
+	if (remote_addr.v10.addr[0] != f_inet6_addr("fd00::ca:ff:ee")) {
+		setverdict(fail, "Unexpected address: ", remote_addr.v10.addr[0]);
+	}
+
+	setverdict(pass);
+}
+
 /***********************************************************************
  * Osmocom Style Dynamic Timeslot Support
  ***********************************************************************/
@@ -6839,6 +6889,8 @@
 
 		if (PCUIF_Types.mp_pcuif_version >= 10) {
 			execute( TC_pcu_info_ind_fh_params() );
+			execute( TC_pcu_socket_nsvc_ipv4() );
+			execute( TC_pcu_socket_nsvc_ipv6() );
 		}
 	} else {
 		log("PCU socket path not available, skipping PCU tests");

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19421
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: Iae854875a45dbc29cd46a267ccaf60f1f2ac2973
Gerrit-Change-Number: 19421
Gerrit-PatchSet: 8
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200911/a68ee40a/attachment.htm>


More information about the gerrit-log mailing list