Change in osmo-ttcn3-hacks[master]: BTS: verify presence of GPRS Indicator in SI4 Rest Octets

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

fixeria gerrit-no-reply at lists.osmocom.org
Mon May 4 18:17:22 UTC 2020


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


Change subject: BTS: verify presence of GPRS Indicator in SI4 Rest Octets
......................................................................

BTS: verify presence of GPRS Indicator in SI4 Rest Octets

So far we only checked presence of GPRS Indicator in the Rest
Octets of System Information Type 3, but this indicator is
also included in the Rest Octets of System Information Type 4.

Let's add additional test cases to check this indicator in the
Rest Octets of both message types. In order to achieve this:

  a) refactor f_si3_has_gprs_indicator(), so it can handle
     System Information Type 4 and its Rest Octets too;

  b) separate common part from the existing test cases into
     functions and (re)use them from the new ones;

  c) in f_TC_pcu_socket_noconnect(), make sure to send
     BCCH INFO with System Information Type 4.

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



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

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 0347e05..ab0b982 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -4927,13 +4927,28 @@
 	return si;
 }
 
-private function f_si3_has_gprs_indicator(RestOctets ro) return boolean {
-	var SI3RestOctets rest := dec_SI3RestOctets(ro);
-	return rest.gprs_ind.presence == '1'B;
+/* Check if GPRS Indicator is present in RR System Information of a given type */
+private function f_si_has_gprs_indicator(RrMessageType si_type)
+runs on test_CT return boolean {
+	var SystemInformation si := f_get_si(L1CTL, si_type);
+
+	if (si_type == SYSTEM_INFORMATION_TYPE_3) {
+		var RestOctets ro := si.payload.si3.rest_octets;
+		var SI3RestOctets rest := dec_SI3RestOctets(ro);
+		return rest.gprs_ind.presence == '1'B;
+	} else if (si_type == SYSTEM_INFORMATION_TYPE_4) {
+		var RestOctets ro := si.payload.si4.rest_octets;
+		var SI4RestOctets rest := dec_SI4RestOctets(ro);
+		return rest.gprs_ind.presence == '1'B;
+	}
+
+	Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Unhandled SI type");
+	return false;
 }
 
-testcase TC_pcu_socket_noconnect_nosi3gprs() runs on test_CT {
-	var SystemInformation si;
+/* Make sure that GPRS Indicator is absent when the PCU is not connected */
+private function f_TC_pcu_socket_noconnect(RrMessageType si_type)
+runs on test_CT {
 	timer T := 5.0;
 
 	/* don't call f_init() as this would connect PCU socket */
@@ -4945,26 +4960,36 @@
 		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for ASP_IPA_EVENT_UP");
 		}
 	}
+
+	/* Send both System Information Type 3 and 4 (with GPRS Indicator) */
 	f_rsl_bcch_fill(RSL_SYSTEM_INFO_3, ts_SI3_default);
+	f_rsl_bcch_fill(RSL_SYSTEM_INFO_4, ts_SI4_default);
 
 	f_init_l1ctl();
 	f_l1_tune(L1CTL);
-
 	f_sleep(2.0);
 	L1CTL.clear;
-	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");
+
+	if (f_si_has_gprs_indicator(si_type)) {
+		setverdict(fail, si_type, " indicates GPRS even before PCU socket connected");
 	} else {
 		setverdict(pass);
 	}
+
 	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
 }
 
-/* Ensure that GPRS capability is advertised after PCU socket connect */
-testcase TC_pcu_socket_connect_si3gprs() runs on test_CT {
-	var SystemInformation si;
+testcase TC_pcu_socket_noconnect_nosi3gprs() runs on test_CT {
+	f_TC_pcu_socket_noconnect(SYSTEM_INFORMATION_TYPE_3);
+}
 
+testcase TC_pcu_socket_noconnect_nosi4gprs() runs on test_CT {
+	f_TC_pcu_socket_noconnect(SYSTEM_INFORMATION_TYPE_4);
+}
+
+/* Ensure that GPRS capability is advertised after PCU socket connect */
+private function f_TC_pcu_socket_connect(RrMessageType si_type)
+runs on test_CT {
 	/* this (among other things) establishes the first connection to the PCUIF socket */
 	f_init();
 	f_init_l1ctl();
@@ -4972,19 +4997,27 @@
 
 	f_sleep(2.0);
 	L1CTL.clear;
-	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");
+
+	if (not f_si_has_gprs_indicator(si_type)) {
+		setverdict(fail, si_type, " indicates no GPRS despite PCU socket connected");
 	} else {
 		setverdict(pass);
 	}
+
 	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
 }
 
-/* Ensure that GPRS capability is no longer advertised after PCU socket disconnect */
-testcase TC_pcu_socket_disconnect_nosi3gprs() runs on test_CT {
-	var SystemInformation si;
+testcase TC_pcu_socket_connect_si3gprs() runs on test_CT {
+	f_TC_pcu_socket_connect(SYSTEM_INFORMATION_TYPE_3);
+}
 
+testcase TC_pcu_socket_connect_si4gprs() runs on test_CT {
+	f_TC_pcu_socket_connect(SYSTEM_INFORMATION_TYPE_4);
+}
+
+/* Ensure that GPRS capability is no longer advertised after PCU socket disconnect */
+private function f_TC_pcu_socket_disconnect(RrMessageType si_type)
+runs on test_CT {
 	/* this (among other things) establishes the first connection to the PCUIF socket */
 	f_init();
 	f_init_l1ctl();
@@ -5001,9 +5034,9 @@
 
 	f_sleep(2.0);
 	L1CTL.clear;
-	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");
+
+	if (f_si_has_gprs_indicator(si_type)) {
+		setverdict(fail, si_type, " indicates GPRS after PCU socket disconnected");
 	} else {
 		setverdict(pass);
 	}
@@ -5011,6 +5044,14 @@
 	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
 }
 
+testcase TC_pcu_socket_disconnect_nosi3gprs() runs on test_CT {
+	f_TC_pcu_socket_disconnect(SYSTEM_INFORMATION_TYPE_3);
+}
+
+testcase TC_pcu_socket_disconnect_nosi4gprs() runs on test_CT {
+	f_TC_pcu_socket_disconnect(SYSTEM_INFORMATION_TYPE_4);
+}
+
 /* Verify that the cell_id of SI3 (TS 04.08 9.1.35) and other values are passed properly to the PCU socket (OS#3854) */
 testcase TC_pcu_socket_verify_info_ind() runs on test_CT {
 	var SystemInformation si3 := valueof(ts_SI3_default);
@@ -6437,8 +6478,11 @@
 		execute( TC_pcu_socket_connect_multi() );
 		execute( TC_pcu_socket_reconnect() );
 		execute( TC_pcu_socket_noconnect_nosi3gprs() );
+		execute( TC_pcu_socket_noconnect_nosi4gprs() );
 		execute( TC_pcu_socket_connect_si3gprs() );
+		execute( TC_pcu_socket_connect_si4gprs() );
 		execute( TC_pcu_socket_disconnect_nosi3gprs() );
+		execute( TC_pcu_socket_disconnect_nosi4gprs() );
 		execute( TC_pcu_socket_verify_info_ind() );
 		execute( TC_dyn_osmo_pdch_act_deact() );
 		execute( TC_dyn_osmo_pdch_double_act() );

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18030
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: Ifc589c35a52a62331b0ad4fbe2eec3fba55b5ff9
Gerrit-Change-Number: 18030
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200504/88d616e3/attachment.htm>


More information about the gerrit-log mailing list