bsc: add SI2quater tests for multiple EARFCNs

Shows bug OS#4652 in osmo-bsc, fixed by
I5df269f713456a6ccbb874d6b7faac4a6f123c67

Change-Id: I45382f88686ca60e68569e93569fc4cfb63a0e0d
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index c7a6e38..f1aea75 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1710,6 +1710,154 @@
 	f_init_bts_and_check_sysinfo(0, expect_si := SystemInformationConfig_default);
 }
 
+function f_test_si2quater(integer total_earfcns, template SystemInformationConfig expect_si) runs on test_CT {
+
+	f_init(0);
+
+	/* E-ARFCN 111 is already added in the osmo-bsc.cfg, so only add more arfcns if total_earfcns > 1 */
+	for (var integer i := 1; i < total_earfcns; i := i + 1) {
+		f_bts_0_cfg(BSCVTY, {"si2quater neighbor-list add earfcn " & int2str(22 + i) & " thresh-hi 20 thresh-lo 10 prio 3 qrxlv 22 meas 3"});
+	}
+
+	f_init_bts_and_check_sysinfo(0, expect_si := expect_si);
+
+	for (var integer i := 1; i < total_earfcns; i := i + 1) {
+		f_bts_0_cfg(BSCVTY, {"si2quater neighbor-list del earfcn " & int2str(22 + i)});
+	}
+}
+
+testcase TC_si2quater_2_earfcns() runs on test_CT {
+	var template SystemInformationConfig sic := SystemInformationConfig_default;
+	sic.si2quater := {
+		tr_SI2quaterRestOctets_EUTRAN(
+			repeated_neigh_cells := {
+				tr_EUTRAN_NeighbourCells_default(
+					cell_desc_list := {
+						tr_EUTRAN_CellDesc_default(e_arfcn := 111),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 23)
+					}
+				)
+			}
+		)
+	};
+	f_test_si2quater(2, sic);
+}
+
+testcase TC_si2quater_3_earfcns() runs on test_CT {
+	var template SystemInformationConfig sic := SystemInformationConfig_default;
+	sic.si2quater := {
+		tr_SI2quaterRestOctets_EUTRAN(
+			repeated_neigh_cells := {
+				tr_EUTRAN_NeighbourCells_default(
+					cell_desc_list := {
+						tr_EUTRAN_CellDesc_default(e_arfcn := 111),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 23),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 24)
+					}
+				)
+			}
+		)
+	};
+	f_test_si2quater(3, sic);
+}
+
+testcase TC_si2quater_4_earfcns() runs on test_CT {
+	var template SystemInformationConfig sic := SystemInformationConfig_default;
+	sic.si2quater := {
+		tr_SI2quaterRestOctets_EUTRAN(
+			index := 0,
+			count := 1,
+			repeated_neigh_cells := {
+				tr_EUTRAN_NeighbourCells_default(
+					cell_desc_list := {
+						tr_EUTRAN_CellDesc_default(e_arfcn := 111),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 23),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 24)
+					}
+				)
+			}
+		),
+		tr_SI2quaterRestOctets_EUTRAN(
+			index := 1,
+			count := 1,
+			repeated_neigh_cells := {
+				tr_EUTRAN_NeighbourCells_default(
+					cell_desc_list := {
+						tr_EUTRAN_CellDesc_default(e_arfcn := 25)
+					}
+				)
+			}
+		)
+	};
+	f_test_si2quater(4, sic);
+}
+
+testcase TC_si2quater_5_earfcns() runs on test_CT {
+	var template SystemInformationConfig sic := SystemInformationConfig_default;
+	sic.si2quater := {
+		tr_SI2quaterRestOctets_EUTRAN(
+			index := 0,
+			count := 1,
+			repeated_neigh_cells := {
+				tr_EUTRAN_NeighbourCells_default(
+					cell_desc_list := {
+						tr_EUTRAN_CellDesc_default(e_arfcn := 111),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 23),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 24)
+					}
+				)
+			}
+		),
+		tr_SI2quaterRestOctets_EUTRAN(
+			index := 1,
+			count := 1,
+			repeated_neigh_cells := {
+				tr_EUTRAN_NeighbourCells_default(
+					cell_desc_list := {
+						tr_EUTRAN_CellDesc_default(e_arfcn := 25),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 26)
+					}
+				)
+			}
+		)
+	};
+	f_test_si2quater(5, sic);
+}
+
+testcase TC_si2quater_6_earfcns() runs on test_CT {
+	var template SystemInformationConfig sic := SystemInformationConfig_default;
+	sic.si2quater := {
+		tr_SI2quaterRestOctets_EUTRAN(
+			index := 0,
+			count := 1,
+			repeated_neigh_cells := {
+				tr_EUTRAN_NeighbourCells_default(
+					cell_desc_list := {
+						tr_EUTRAN_CellDesc_default(e_arfcn := 111),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 23),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 24)
+					}
+				)
+			}
+		),
+		tr_SI2quaterRestOctets_EUTRAN(
+			index := 1,
+			count := 1,
+			repeated_neigh_cells := {
+				tr_EUTRAN_NeighbourCells_default(
+					cell_desc_list := {
+						tr_EUTRAN_CellDesc_default(e_arfcn := 25),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 26),
+						tr_EUTRAN_CellDesc_default(e_arfcn := 27)
+					}
+				)
+			}
+		)
+	};
+	f_test_si2quater(6, sic);
+}
+
+
 testcase TC_ctrl_msc_connection_status() runs on test_CT {
 	var charstring ctrl_resp;
 
@@ -5672,6 +5820,11 @@
 	}
 
 	execute( TC_si_default() );
+	execute( TC_si2quater_2_earfcns() );
+	execute( TC_si2quater_3_earfcns() );
+	execute( TC_si2quater_4_earfcns() );
+	execute( TC_si2quater_5_earfcns() );
+	execute( TC_si2quater_6_earfcns() );
 
 	/* RSL DCHAN Channel ACtivation / Deactivation */
 	execute( TC_chan_act_noreply() );