bsc-cbsp: Test BTS Failure+Restart when BTS becomes (un)available
Related: SYS#5910
Change-Id: I35ddde7bc2e39d35c301f1153416b549ba1630cd
diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn
index a933b24..53f7fbc 100644
--- a/bsc/BSC_Tests_CBSP.ttcn
+++ b/bsc/BSC_Tests_CBSP.ttcn
@@ -40,6 +40,10 @@
import from Osmocom_VTY_Functions all;
import from TELNETasp_PortType all;
+import from Osmocom_CTRL_Functions all;
+import from Osmocom_CTRL_Types all;
+import from Osmocom_CTRL_Adapter all;
+
modulepar {
charstring mp_cbc_ip := "127.0.0.1";
charstring mp_cbc_ip6 := "::1";
@@ -47,6 +51,8 @@
charstring mp_bsc_cbsp_ip := "127.0.0.1";
charstring mp_bsc_cbsp_ip6 := "::1";
integer mp_bsc_cbsp_port := 48050;
+ /* port number to which to establish the IPA CTRL connection */
+ integer mp_bsc_ctrl_port := 4249;
/* BTS 0: 001-01-1-0 with CBCH
* BTS 1: 001-01-1-1 with CBCH
@@ -536,6 +542,75 @@
setverdict(pass);
}
+/* Test if a LAC_CI FAILURE Ind is sent when TRX holding the CBCH is locked
+ * (becomes unavailable). LAC_CI RESTART Ind should be sent when the TRX becomes
+ * unlocked again. */
+testcase TC_cbsp_cell_rflock_failure_restart() runs on cbsp_test_CT {
+ var template CBSP_PDU rx;
+
+ g_pars := valueof(ts_CBSP_Pars_default(false, 0, 0));
+ f_init();
+
+ /* Lock the TRX, CBCH should become unavailable and BSC send FAILURE */
+ f_ctrl_set(IPA_CTRL, "bts.0.trx.0.rf_locked", "1");
+
+ rx := tr_CBSP_FAILURE({CBSP_FailureListItem_LAC_CI(bssmap_lac_ci(mp_cgi_bts0),
+ CBSP_CAUSE_CB_NOT_OPERATIONAL)},
+ CBSP_BC_MSGT_CBS);
+ alt {
+ [] CBSP[0].receive(tr_CBSP_Recv(g_cbsp_conn_id[0], rx)) {
+ setverdict(pass);
+ }
+ [] CBSP[0].receive(tr_CBSP_Recv(g_cbsp_conn_id[0], ?)) {
+ setverdict(fail, "Received unexpected CBSP");
+ mtc.stop;
+ }
+ }
+
+ /* Unlock the TRX, CBCH should become available and BSC send RESTART */
+ f_ctrl_set(IPA_CTRL, "bts.0.trx.0.rf_locked", "0");
+ rx := tr_CBSP_RESTART(ts_BSSMAP_CIL_LAC_CI({bssmap_lac_ci(mp_cgi_bts0)}),
+ CBSP_BC_MSGT_CBS, ?);
+ alt {
+ [] CBSP[0].receive(tr_CBSP_Recv(g_cbsp_conn_id[0], rx)) {
+ setverdict(pass);
+ }
+ [] CBSP[0].receive(tr_CBSP_Recv(g_cbsp_conn_id[0], ?)) {
+ setverdict(fail, "Received unexpected CBSP");
+ mtc.stop;
+ }
+ }
+
+ setverdict(pass);
+}
+
+/* Test if a LAC_CI FAILURE Ind is sent when conn of TRX holding the CBCH goes down. */
+testcase TC_cbsp_cell_rsl_down_failure() runs on cbsp_test_CT {
+ var template CBSP_PDU rx;
+
+ g_pars := valueof(ts_CBSP_Pars_default(false, 0, 0));
+ f_init();
+
+ /* Drop RSL link of the TRX holding the CBCH: */
+ f_ipa_rsl_stop(bts[0][0].rsl);
+
+ rx := tr_CBSP_FAILURE({CBSP_FailureListItem_LAC_CI(bssmap_lac_ci(mp_cgi_bts0),
+ CBSP_CAUSE_CB_NOT_OPERATIONAL)},
+ CBSP_BC_MSGT_CBS);
+ alt {
+ [] CBSP[0].receive(tr_CBSP_Recv(g_cbsp_conn_id[0], rx)) {
+ setverdict(pass);
+ }
+ [] CBSP[0].receive(tr_CBSP_Recv(g_cbsp_conn_id[0], ?)) {
+ setverdict(fail, "Received unexpected CBSP");
+ mtc.stop;
+ }
+ }
+
+ /* TODO: call f_init() again to reconnect? */
+ setverdict(pass);
+}
+
testcase TC_cbsp_write() runs on cbsp_test_CT {
var template (value) CBSP_PDU tx;
var CBSP_IEs pages := {f_gen_page()};
@@ -1081,6 +1156,8 @@
execute( TC_cbsp_bsc_client() );
execute( TC_cbsp_bsc_client_ipv6() );
execute( TC_cbsp_reset_bss() );
+ execute( TC_cbsp_cell_rflock_failure_restart() );
+ execute( TC_cbsp_cell_rsl_down_failure() );
/* test various different types of Cell Identities */
execute( TC_cbsp_write_bss() );