summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-09-05 11:15:20 +0200
committerHarald Welte <laforge@gnumonks.org>2019-09-05 14:23:35 +0200
commitca78c8d15a3e95347d50a24e4d36b4a2b8f8227f (patch)
treee84c594f98c72b0ea6591e39ece90edbc945971b
parent396d46a640a5cbe0e1be461d92b059ff426a7d10 (diff)
bsc: Add test for Emergency broadcast of ETWS Primary Notification
-rw-r--r--bsc/BSC_Tests_CBSP.ttcn40
-rw-r--r--library/CBSP_Templates.ttcn1
2 files changed, 40 insertions, 1 deletions
diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn
index 3d6040e..1922102 100644
--- a/bsc/BSC_Tests_CBSP.ttcn
+++ b/bsc/BSC_Tests_CBSP.ttcn
@@ -155,6 +155,35 @@ function f_cbsp_reset_bss(integer idx) runs on CBSP_Adapter_CT {
}
/* send a WRITE CBS to the BSC; expect either COMPLETE or FAILURE in response*/
+function f_cbsp_write_emerg(uint16_t msg_id, uint16_t 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_WRITE_EMERG(msg_id, 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_WRITE_CBS_COMPL(msg_id, ser_no, success_list, omit);
+ } else {
+ rx := tr_CBSP_WRITE_CBS_FAIL(msg_id, 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");
+ }
+ }
+}
+
+/* send a WRITE CBS to the BSC; expect either COMPLETE or FAILURE in response*/
function f_cbsp_write(uint16_t msg_id, uint16_t ser_no,
template (value) BSSMAP_FIELD_CellIdentificationList cell_list := ts_BSSMAP_CIL_BSS,
template (value) CBSP_Category category := CBSP_CATEG_NORMAL,
@@ -478,6 +507,17 @@ testcase TC_cbsp_write_then_reset() runs on cbsp_test_CT {
f_cbsp_reset_bss(0);
}
+/* Write to single BTS supporting CBCH: success */
+testcase TC_cbsp_emerg_write_bts_cgi() runs on cbsp_test_CT {
+ var CBSP_IEs pages := {f_gen_page()};
+ var template (value) BSSMAP_FIELD_CellIdentificationList cell_list;
+ cell_list := ts_BSSMAP_CIL_CGI({bssmap_cgi(mp_cgi_bts0)});
+ f_cbsp_init_server();
+ f_cbsp_write_emerg(15, 1015, cell_list);
+ f_sleep(5.0);
+}
+
+
control {
execute( TC_cbsp_bsc_server() );
execute( TC_cbsp_bsc_client() );
diff --git a/library/CBSP_Templates.ttcn b/library/CBSP_Templates.ttcn
index 2283e6f..911b905 100644
--- a/library/CBSP_Templates.ttcn
+++ b/library/CBSP_Templates.ttcn
@@ -283,7 +283,6 @@ template (value) CBSP_PDU ts_CBSP_WRITE_EMERG(uint16_t msg_id, uint16_t new_ser_
template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
template (value) uint8_t emerg_ind,
template (value) uint16_t warn_type,
- template (value) uint16_t num_bcast_req,
template (value) uint8_t warn_per
) :=
ts_CBSP(CBSP_MSGT_WRITE_REPLACE, {