summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-07-28 15:39:04 +0200
committerlaforge <laforge@osmocom.org>2020-09-11 12:58:00 +0000
commit5283f55777baf7410dc08d60c42edd317e57e4e0 (patch)
treec24614071d62d079059a7d22d9fd3ee9c578bcc0
parenta93088ae6400c5ea73a4ca01206eb73c0b07eb2e (diff)
BTS_Tests: verify NSVC IPv4/IPv6 in the INFO.ind message
Change-Id: Iae854875a45dbc29cd46a267ccaf60f1f2ac2973 Tweaked-By: Vadim Yanitskiy <vyanitskiy@sysmocom.de> Related: SYS#4915
-rw-r--r--bts/BTS_Tests.ttcn52
1 files changed, 52 insertions, 0 deletions
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_PortType all;
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 @@ testcase TC_pcu_info_ind_fh_params() runs on test_CT {
}
}
+/* 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 @@ control {
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");