Change in osmo-ttcn3-hacks[master]: BTS: refactor f_get_si3(), so it can be used to get SI4

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
Tue May 5 19:30:43 UTC 2020


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

Change subject: BTS: refactor f_get_si3(), so it can be used to get SI4
......................................................................

BTS: refactor f_get_si3(), so it can be used to get SI4

This is needed for the follow up change(s) verifying the GPRS
indicator in the Rest Octets of RR System Information Type 4.

Change-Id: I540b43bbe886f8ca3e9a7eb49a4d30d391d45f49
Signed-off-by: Vadim Yanitskiy <axilirator at gmail.com>
Related: OS#3075
---
M bts/BTS_Tests.ttcn
1 file changed, 15 insertions(+), 13 deletions(-)

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



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 4466ad4..bd6785e 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -4899,7 +4899,8 @@
 }
 
 /* Ensure that GPRS capability is not advertised before PCU socket conncet */
-private function f_get_si3(L1CTL_PT pt) runs on test_CT return SystemInformationType3 {
+private function f_get_si(L1CTL_PT pt, RrMessageType si_type)
+runs on test_CT return SystemInformation {
 	var L1ctlDlMessage l1_dl;
 	var SystemInformation si;
 	timer T := 5.0;
@@ -4912,7 +4913,7 @@
 			repeat;
 		}
 		si := dec_SystemInformation(l1_dl.payload.data_ind.payload)
-		if (not ischosen(si.payload.si3)) {
+		if (si.header.message_type != si_type) {
 			repeat;
 		}
 		}
@@ -4920,10 +4921,11 @@
 		repeat;
 		}
 	[] T.timeout {
-		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for SI3");
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+					log2str("Timeout waiting for ", si_type));
 		}
 	}
-	return si.payload.si3;
+	return si;
 }
 
 private function f_si3_has_gprs_indicator(RestOctets ro) return boolean {
@@ -4932,7 +4934,7 @@
 }
 
 testcase TC_pcu_socket_noconnect_nosi3gprs() runs on test_CT {
-	var SystemInformationType3 si3;
+	var SystemInformation si;
 	timer T := 5.0;
 
 	/* don't call f_init() as this would connect PCU socket */
@@ -4951,8 +4953,8 @@
 
 	f_sleep(2.0);
 	L1CTL.clear;
-	si3 := f_get_si3(L1CTL);
-	if (f_si3_has_gprs_indicator(si3.rest_octets)) {
+	si := f_get_si(L1CTL, SYSTEM_INFORMATION_TYPE_3);
+	if (f_si3_has_gprs_indicator(si.payload.si3.rest_octets)) {
 		setverdict(fail, "SI3 indicates GPRS even before PCU socket connected");
 	} else {
 		setverdict(pass);
@@ -4962,7 +4964,7 @@
 
 /* Ensure that GPRS capability is advertised after PCU socket connect */
 testcase TC_pcu_socket_connect_si3gprs() runs on test_CT {
-	var SystemInformationType3 si3;
+	var SystemInformation si;
 
 	/* this (among other things) establishes the first connection to the PCUIF socket */
 	f_init();
@@ -4971,8 +4973,8 @@
 
 	f_sleep(2.0);
 	L1CTL.clear;
-	si3 := f_get_si3(L1CTL);
-	if (not f_si3_has_gprs_indicator(si3.rest_octets)) {
+	si := f_get_si(L1CTL, SYSTEM_INFORMATION_TYPE_3);
+	if (not f_si3_has_gprs_indicator(si.payload.si3.rest_octets)) {
 		setverdict(fail, "SI3 indicates no GPRS despite PCU socket connected");
 	} else {
 		setverdict(pass);
@@ -4982,7 +4984,7 @@
 
 /* Ensure that GPRS capability is no longer advertised after PCU socket disconnect */
 testcase TC_pcu_socket_disconnect_nosi3gprs() runs on test_CT {
-	var SystemInformationType3 si3;
+	var SystemInformation si;
 
 	/* this (among other things) establishes the first connection to the PCUIF socket */
 	f_init();
@@ -5000,8 +5002,8 @@
 
 	f_sleep(2.0);
 	L1CTL.clear;
-	si3 := f_get_si3(L1CTL);
-	if (f_si3_has_gprs_indicator(si3.rest_octets)) {
+	si := f_get_si(L1CTL, SYSTEM_INFORMATION_TYPE_3);
+	if (f_si3_has_gprs_indicator(si.payload.si3.rest_octets)) {
 		setverdict(fail, "SI3 indicates GPRS after PCU socket disconnected");
 	} else {
 		setverdict(pass);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18029
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: I540b43bbe886f8ca3e9a7eb49a4d30d391d45f49
Gerrit-Change-Number: 18029
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
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/20200505/96feaf58/attachment.htm>


More information about the gerrit-log mailing list