bsc: Introduce test TC_si_acc_rotate
Related: SYS#4911
Change-Id: I18d0243353fce547d126d62c34415628a21cb52b
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index cc7346f..ac6b356 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1854,6 +1854,81 @@
}
}
+private function f_acc09_count_allowed(AccessControlClass acc) return uint8_t
+{
+ var uint8_t count := 0;
+ for (var integer i := 5; i < 16; i := i + 1) {
+ if (acc[i] == '0'B) { /* the list marks barred, we count allowed */
+ count := count + 1;
+ }
+ }
+ return count;
+}
+
+/* verify ACC rotate feature */
+testcase TC_si_acc_rotate() runs on test_CT {
+ var template SystemInformationConfig sic := SystemInformationConfig_default;
+ var SystemInformationConfig last_si;
+ var AccessControlClass acc;
+ var ASP_RSL_Unitdata rx_rsl_ud;
+ var uint8_t count;
+ var integer times_allowed[10] := { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ f_init(0, guard_timeout := 60.0);
+
+ f_bts_0_cfg(BSCVTY, {"rach access-control-class 5 barred",
+ "access-control-class-rotate 3",
+ "access-control-class-rotate-quantum 1"});
+
+ /* Init and get first sysinfo */
+ f_init_bts_and_check_sysinfo(0, expect_si := ?);
+
+ var integer i := 0;
+ while (i < 20) {
+ IPA_RSL[0].receive(tr_ASP_RSL_UD((tr_RSL_NO_BCCH_INFO,
+ tr_RSL_BCCH_INFO,
+ tr_RSL_NO_SACCH_FILL,
+ tr_RSL_SACCH_FILL))
+ ) -> value rx_rsl_ud;
+
+ f_sysinfo_seen(0, rx_rsl_ud.rsl);
+ last_si := g_system_information[0];
+ if (last_si.si1 == omit) {
+ continue;
+ }
+
+ g_system_information[0].si1 := omit;
+ acc := last_si.si1.rach_control.acc;
+ count := f_acc09_count_allowed(acc);
+ log("RSL: GOT SI1 ACC len=", count, ": ", acc);
+
+ if (count != 3) {
+ log("RSL: EXPECTED SI ACC len=3");
+ setverdict(fail, "received SI does not match expectations");
+ break;
+ }
+
+ for (var integer j := 0; j < 10; j := j + 1) {
+ if (acc[16 - 1 - j] == '0'B) { /* the list marks barred, we count allowed */
+ times_allowed[j] := times_allowed[j] + 1;
+ }
+ }
+
+ i := i + 1;
+ }
+
+ for (var integer j := 0; j < 10; j := j + 1) {
+ log("ACC", j, " allowed ", times_allowed[j], " times" );
+ if (j != 5 and times_allowed[j] < 3) {
+ setverdict(fail, "ACC", j, " ERROR: allowed ", times_allowed[j], " < 1 times");
+ } else if (j == 5 and times_allowed[j] > 0) {
+ setverdict(fail, "ACC", j, " ERROR: allowed ", times_allowed[j], " > 0 times");
+ }
+ }
+
+ f_bts_0_cfg(BSCVTY, {"access-control-class-rotate 10",
+ "rach access-control-class 5 allowed"});
+}
testcase TC_ctrl_msc_connection_status() runs on test_CT {
var charstring ctrl_resp;
@@ -5829,6 +5904,7 @@
execute( TC_si2quater_42_earfcns() );
execute( TC_si2quater_48_earfcns() );
execute( TC_si2quater_49_earfcns() );
+ execute( TC_si_acc_rotate() );
/* RSL DCHAN Channel ACtivation / Deactivation */
execute( TC_chan_act_noreply() );