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@gmail.com>
Related: OS#3075
This commit is contained in:
Vadim Yanitskiy 2020-05-04 14:55:02 +07:00
parent ab5363f33a
commit 3c18538651
1 changed files with 15 additions and 13 deletions

View File

@ -4899,7 +4899,8 @@ testcase TC_pcu_socket_reconnect() runs on test_CT {
}
/* 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 @@ private function f_get_si3(L1CTL_PT pt) runs on test_CT return SystemInformation
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 @@ private function f_get_si3(L1CTL_PT pt) runs on test_CT return SystemInformation
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 @@ private function f_si3_has_gprs_indicator(RestOctets ro) return boolean {
}
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 @@ testcase TC_pcu_socket_noconnect_nosi3gprs() runs on test_CT {
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 @@ testcase TC_pcu_socket_noconnect_nosi3gprs() runs on test_CT {
/* 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 @@ testcase TC_pcu_socket_connect_si3gprs() runs on test_CT {
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 @@ testcase TC_pcu_socket_connect_si3gprs() runs on test_CT {
/* 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 @@ testcase TC_pcu_socket_disconnect_nosi3gprs() runs on test_CT {
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);