pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28273 )
Change subject: bsc-cbsp: Test BTS Failure+Restart when BTS becomes (un)available ......................................................................
bsc-cbsp: Test BTS Failure+Restart when BTS becomes (un)available
Related: SYS#5910 Change-Id: I35ddde7bc2e39d35c301f1153416b549ba1630cd --- M bsc/BSC_Tests_CBSP.ttcn M library/CBSP_Templates.ttcn 2 files changed, 89 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/73/28273/1
diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn index a933b24..6a785e8 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 set 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() ); diff --git a/library/CBSP_Templates.ttcn b/library/CBSP_Templates.ttcn index d166bcf..2d70256 100644 --- a/library/CBSP_Templates.ttcn +++ b/library/CBSP_Templates.ttcn @@ -134,6 +134,18 @@ list := items }});
+template (present) CBSP_FailureListItem CBSP_FailureListItem_LAC_CI( + template (present) BSSMAP_FIELD_CellIdentification_LAC_CI lac_ci := ?, + template (present) CBSP_Cause cause := ?) := +{ + spare1_4 := '0000'B, + cell_id_discr := '0001'B, + cell_id := { + cI_LAC_CI := lac_ci + }, + cause := cause +}; + template (value) CBSP_IE ts_CbspNumComplList(template (value) CBSP_IE_NumBcastComplList list) := ts_CBSP_IE(CBSP_IEI_NUM_BCAST_COMPL_LIST, {num_bcast_compl_list := list}); template CBSP_IE tr_CbspNumComplList(template CBSP_IE_NumBcastComplList list := ?) :=