CBSP: wip

Change-Id: Ic0f0b3d620f3ca73bab3d45997d0c1b9433ac1f7
This commit is contained in:
Harald Welte 2022-04-27 16:57:24 +02:00
parent 41b18606bb
commit 5f9747fe02
2 changed files with 115 additions and 4 deletions

View File

@ -320,6 +320,36 @@ function f_cbsp_write(uint16_t msg_id, uint16_t ser_no,
} }
} }
/* send a REPLACE emergency to the BSC; expect either COMPLETE or FAILURE in response*/
function f_cbsp_replace_emerg(uint16_t msg_id, uint16_t new_ser_no, uint16_t old_ser_no,
template (value) BSSMAP_FIELD_CellIdentificationList cell_list := ts_BSSMAP_CIL_BSS,
template (value) uint8_t emerg_ind := 1,
template (value) uint16_t warn_type := oct2int('0780'O),
template (value) uint16_t warn_per := 5,
template BSSMAP_FIELD_CellIdentificationList success_list := ?,
template CBSP_FailureListItems fail_list := omit) runs on cbsp_test_CT {
var template (value) CBSP_PDU tx;
var template CBSP_PDU rx;
var CBSP_IEs pages := {f_gen_page()};
tx := ts_CBSP_REPLACE_EMERG(msg_id, new_ser_no, old_ser_no, cell_list, emerg_ind, warn_type, warn_per);
CBSP[0].send(ts_CBSP_Send(g_cbsp_conn_id[0], tx));
if (istemplatekind(fail_list, "omit")) {
rx := tr_CBSP_REPLACE_CBS_COMPL(msg_id, new_ser_no, old_ser_no, ?, success_list, omit);
} else {
rx := tr_CBSP_REPLACE_CBS_FAIL(msg_id, new_ser_no, old_ser_no, fail_list, *, success_list, omit);
}
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;
}
}
}
/* send a REPLACE CBS to the BSC; expect either COMPLETE or FAILURE in response*/ /* send a REPLACE CBS to the BSC; expect either COMPLETE or FAILURE in response*/
function f_cbsp_replace(uint16_t msg_id, uint16_t new_ser_no, uint16_t old_ser_no, function f_cbsp_replace(uint16_t msg_id, uint16_t new_ser_no, uint16_t old_ser_no,
template (value) BSSMAP_FIELD_CellIdentificationList cell_list := ts_BSSMAP_CIL_BSS, template (value) BSSMAP_FIELD_CellIdentificationList cell_list := ts_BSSMAP_CIL_BSS,
@ -933,9 +963,91 @@ testcase TC_cbsp_emerg_write_bts_cgi_cchan_disable() runs on cbsp_test_CT {
f_exp_rsl_etws(0, false); f_exp_rsl_etws(0, false);
} }
/* Write (!replace) ETWS PN to a single BTS which already has an ongoing PN; expect failure (OS#5539) */
testcase TC_cbsp_emerg_write_bts_cgi_noreplace() runs on cbsp_test_CT {
var CBSP_IEs pages := {f_gen_page()};
var template (value) BSSMAP_FIELD_CellIdentificationList cell_list;
var ASP_RSL_Unitdata rx_rsl_ud;
g_pars := valueof(ts_CBSP_Pars_default(false, 18001, 18501));
f_init();
cell_list := ts_BSSMAP_CIL_CGI({bssmap_cgi(mp_cgi_bts0)});
f_cbsp_write_emerg(g_cbsp_msg_id, g_cbsp_ser_no, cell_list);
/* first expect the PN to be enabled */
f_exp_rsl_etws(0, true);
/* write another emergency while first one is still ongoing; expect it to fail */
f_cbsp_write_emerg(g_cbsp_msg_id, g_cbsp_ser_no+1, cell_list, success_list:=omit, fail_list:=?);
/* then expect first one to be disabled after the warning period (5s) */
f_exp_rsl_etws(0, false);
/* write another emergency after the first one has expired; expect it to succeed */
g_cbsp_ser_no := g_cbsp_ser_no + 2;
f_cbsp_write_emerg(g_cbsp_msg_id, g_cbsp_ser_no, cell_list, success_list:=?, fail_list:=omit);
f_exp_rsl_etws(0, true);
}
/* Replace ETWS PN to a single BTS which already has an ongoing PN; expect success */
testcase TC_cbsp_emerg_write_bts_cgi_replace() runs on cbsp_test_CT {
var CBSP_IEs pages := {f_gen_page()};
var template (value) BSSMAP_FIELD_CellIdentificationList cell_list;
var ASP_RSL_Unitdata rx_rsl_ud;
g_pars := valueof(ts_CBSP_Pars_default(false, 18001, 18501));
f_init();
cell_list := ts_BSSMAP_CIL_CGI({bssmap_cgi(mp_cgi_bts0)});
f_cbsp_write_emerg(g_cbsp_msg_id, g_cbsp_ser_no, cell_list);
/* first expect the PN to be enabled */
f_exp_rsl_etws(0, true);
/* write another emergency while first one is still ongoing; expect it to fail */
f_cbsp_write_emerg(g_cbsp_msg_id, g_cbsp_ser_no+1, cell_list, success_list:=omit, fail_list:=?);
/* then expect first one to be disabled after the warning period (5s) */
f_exp_rsl_etws(0, false);
/* write another emergency after the first one has expired; expect it to succeed */
g_cbsp_ser_no := g_cbsp_ser_no + 2;
f_cbsp_write_emerg(g_cbsp_msg_id, g_cbsp_ser_no, cell_list, success_list:=?, fail_list:=omit);
f_exp_rsl_etws(0, true);
}
/* Write ETWS PN to a single BTS, then kill it during its lifetime (OS#5540) */
testcase TC_cbsp_emerg_write_bts_cgi_kill() runs on cbsp_test_CT {
var CBSP_IEs pages := {f_gen_page()};
var template (value) BSSMAP_FIELD_CellIdentificationList cell_list;
var ASP_RSL_Unitdata rx_rsl_ud;
g_pars := valueof(ts_CBSP_Pars_default(false, 20001, 20501));
f_init();
cell_list := ts_BSSMAP_CIL_CGI({bssmap_cgi(mp_cgi_bts0)});
f_cbsp_write_emerg(g_cbsp_msg_id, g_cbsp_ser_no, cell_list, warn_per := 10);
/* first expect the PN to be enabled */
f_exp_rsl_etws(0, true);
/* write another emergency while first one is still ongoing; expect it to fail */
g_cbsp_ser_no := g_cbsp_ser_no + 1;
f_cbsp_write_emerg(g_cbsp_msg_id, g_cbsp_ser_no, cell_list, success_list:=omit, fail_list:=?);
/* then expect second one to be transmitted */
f_exp_rsl_etws(0, true);
/* then expect it to be disabled after the warning period (5s) */
f_exp_rsl_etws(0, false);
}
/* Send a MSG STATUS QUERY for an unknown message; expect no completion list and present failure list */ /* Send a MSG STATUS QUERY for an unknown message; expect no completion list and present failure list */
testcase TC_cbsp_status_q_empty() runs on cbsp_test_CT { testcase TC_cbsp_status_q_empty() runs on cbsp_test_CT {
g_pars := valueof(ts_CBSP_Pars_default(false, 18001, 18501)); g_pars := valueof(ts_CBSP_Pars_default(false, 21001, 21501));
f_init(); f_init();
f_cbsp_msg_status_query(g_cbsp_msg_id, g_cbsp_ser_no, compl_list := omit, fail_list := ?); f_cbsp_msg_status_query(g_cbsp_msg_id, g_cbsp_ser_no, compl_list := omit, fail_list := ?);
@ -943,7 +1055,7 @@ testcase TC_cbsp_status_q_empty() runs on cbsp_test_CT {
/* Send a SMSCB to entire BSS followed by MSG_STATUS_QUERY; expect completion list and no failure list */ /* Send a SMSCB to entire BSS followed by MSG_STATUS_QUERY; expect completion list and no failure list */
testcase TC_cbsp_status_q_bts_cgi() runs on cbsp_test_CT { testcase TC_cbsp_status_q_bts_cgi() runs on cbsp_test_CT {
g_pars := valueof(ts_CBSP_Pars_default(false, 19001, 19501)); g_pars := valueof(ts_CBSP_Pars_default(false, 22001, 22501));
f_init(); f_init();
var CBSP_IEs pages := {f_gen_page()}; var CBSP_IEs pages := {f_gen_page()};
@ -1005,6 +1117,7 @@ control {
execute( TC_cbsp_emerg_write_bts_cgi_dchan() ); execute( TC_cbsp_emerg_write_bts_cgi_dchan() );
execute( TC_cbsp_emerg_write_bts_cgi_cchan() ); execute( TC_cbsp_emerg_write_bts_cgi_cchan() );
execute( TC_cbsp_emerg_write_bts_cgi_cchan_disable() ); execute( TC_cbsp_emerg_write_bts_cgi_cchan_disable() );
execute( TC_cbsp_emerg_write_bts_cgi_noreplace() );
} }

View File

@ -314,7 +314,6 @@ template (value) CBSP_PDU ts_CBSP_REPLACE_EMERG(uint16_t msg_id, uint16_t new_se
template (value) BSSMAP_FIELD_CellIdentificationList cell_list, template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
template (value) uint8_t emerg_ind, template (value) uint8_t emerg_ind,
template (value) uint16_t warn_type, template (value) uint16_t warn_type,
template (value) uint16_t num_bcast_req,
template (value) uint8_t warn_per template (value) uint8_t warn_per
) := ) :=
ts_CBSP(CBSP_MSGT_WRITE_REPLACE, { ts_CBSP(CBSP_MSGT_WRITE_REPLACE, {
@ -331,7 +330,6 @@ template CBSP_PDU tr_CBSP_REPLACE_EMERG(template uint16_t msg_id := ?, template
template BSSMAP_FIELD_CellIdentificationList cell_list := ?, template BSSMAP_FIELD_CellIdentificationList cell_list := ?,
template uint8_t emerg_ind := ?, template uint8_t emerg_ind := ?,
template uint16_t warn_type := ?, template uint16_t warn_type := ?,
template uint16_t num_bcast_req := ?,
template uint8_t warn_per := ? template uint8_t warn_per := ?
) := ) :=
tr_CBSP(CBSP_MSGT_WRITE_REPLACE, { tr_CBSP(CBSP_MSGT_WRITE_REPLACE, {