| module CBC_Tests { |
| |
| import from Osmocom_Types all; |
| import from Socket_API_Definitions all; |
| |
| import from BSSAP_Types all; |
| import from BSSMAP_Templates all; |
| import from CBSP_Types all; |
| import from CBSP_Templates all; |
| import from CBSP_Adapter all; |
| import from CBSP_CodecPort all; |
| |
| import from SABP_Types all; |
| import from SABP_Templates all; |
| import from SABP_IEs all; |
| import from SABP_PDU_Descriptions all; |
| |
| import from SBC_AP_IEs all; |
| import from SBC_AP_Constants all; |
| import from SBC_AP_PDU_Contents all; |
| import from SBC_AP_PDU_Descriptions all; |
| import from SBC_AP_Types all; |
| import from SBC_AP_Templates all; |
| import from SBC_AP_CodecPort all; |
| import from SBC_AP_Adapter all; |
| |
| import from HTTP_Adapter all; |
| import from HTTPmsg_Types all; |
| import from ECBE_Types all; |
| |
| import from CBS_Message all; |
| import from ECBE_Components all; |
| import from BSC_ConnectionHandler all; |
| import from MME_ConnectionHandler all; |
| |
| const integer MAX_BSC := 2; |
| const integer MAX_MME := 2; |
| |
| type record BSC_modulepar_cfg { |
| boolean tcp_is_client |
| }; |
| type record of BSC_modulepar_cfg BSC_modulepar_cfgs; |
| |
| type record MME_modulepar_cfg { |
| boolean sctp_is_client |
| }; |
| type record of MME_modulepar_cfg MME_modulepar_cfgs; |
| |
| modulepar { |
| charstring mp_local_host := "127.0.0.2"; |
| charstring mp_cbc_host := "127.0.0.1"; |
| integer mp_cbc_cbsp_port := 48049; |
| integer mp_cbc_sbcap_port := c_SBC_AP_PORT; |
| integer mp_cbc_ecbe_port := 12345; |
| integer mp_local_cbsp_port := 15000; |
| integer mp_local_sbcap_port := 16000; |
| /* Must match osmo-cbc.cfg: */ |
| BSC_modulepar_cfgs mp_bsc_cfg := { |
| { tcp_is_client := true }, |
| { tcp_is_client := false } |
| }; |
| MME_modulepar_cfgs mp_mme_cfg := { |
| { sctp_is_client := true }, |
| { sctp_is_client := false } |
| }; |
| }; |
| |
| type component test_CT extends CBSP_Adapter_CT, http_CT { |
| timer g_Tguard := 60.0; |
| var integer g_num_bsc; |
| var integer g_num_mme; |
| var BSC_ConnHdlr g_vc_conn_BSC[MAX_BSC]; |
| var MME_ConnHdlr g_vc_conn_MME[MAX_MME]; |
| var BSC_ConnHdlrPars g_pars_BSC[MAX_BSC]; |
| var MME_ConnHdlrPars g_pars_MME[MAX_MME]; |
| port BSC_ConnHdlr_Coord_PT COORD_BSC[MAX_BSC]; |
| port MME_ConnHdlr_Coord_PT COORD_MME[MAX_BSC]; |
| }; |
| |
| private function f_shutdown_helper() runs on test_CT { |
| /* Wait for all BSC cons to terminate */ |
| for (var integer i := 0; i < g_num_bsc; i := i + 1) { |
| g_vc_conn_BSC[i].done; |
| } |
| /* Wait for all MME cons to terminate */ |
| for (var integer i := 0; i < g_num_mme; i := i + 1) { |
| g_vc_conn_MME[i].done; |
| } |
| all component.stop; |
| setverdict(pass); |
| mtc.stop; |
| } |
| |
| /* altstep for the global guard timer */ |
| private altstep as_Tguard() runs on test_CT { |
| [] g_Tguard.timeout { |
| setverdict(fail, "Tguard timeout"); |
| all component.stop; |
| mtc.stop; |
| } |
| } |
| |
| /* |
| * BSC Conn Handler: |
| */ |
| private function f_BSC_ConnHdlr_start_fn_void() runs on BSC_ConnHdlr { |
| log("Default start_fn() function called!"); |
| } |
| private function f_init_pars_bsc(charstring bsc_host, integer bsc_cbsp_port, |
| charstring cbc_host, integer cbc_cbsp_port, |
| boolean tcp_is_client) |
| runs on test_CT return BSC_ConnHdlrPars { |
| var BSC_ConnHdlrPars pars := { |
| bsc_host := bsc_host, |
| bsc_cbsp_port := bsc_cbsp_port, |
| cbc_host := cbc_host, |
| cbc_cbsp_port := cbc_cbsp_port, |
| tcp_is_client := tcp_is_client, |
| start_fn := refers(f_BSC_ConnHdlr_start_fn_void), |
| exp_cbs_msg := omit, |
| cell_list_success := omit |
| }; |
| return pars; |
| } |
| |
| private function f_init_bsc(integer idx, charstring id) runs on test_CT return BSC_ConnHdlr { |
| var BSC_ConnHdlr vc_conn; |
| id := id & "-BSC" & int2str(idx); |
| vc_conn := BSC_ConnHdlr.create(id) alive; |
| g_pars_BSC[idx] := f_init_pars_bsc(mp_local_host, mp_local_cbsp_port + idx, |
| mp_cbc_host, mp_cbc_cbsp_port, |
| mp_bsc_cfg[idx].tcp_is_client); |
| connect(self:COORD_BSC[idx], vc_conn:COORD); |
| return vc_conn; |
| } |
| |
| private function f_start_bsc(integer idx, charstring id, BSC_ConnHdlrPars pars) |
| runs on test_CT { |
| id := id & "-BSC" & int2str(idx); |
| g_vc_conn_BSC[idx] := f_init_bsc(idx, id); |
| g_vc_conn_BSC[idx].start(f_BSC_ConnHdlr_main(id, pars)); |
| } |
| |
| /* |
| * MME Conn Handler: |
| */ |
| private function f_MME_ConnHdlr_start_fn_void() runs on MME_ConnHdlr { |
| log("Default start_fn() function called!"); |
| } |
| private function f_init_pars_mme(charstring mme_host, integer mme_sbcap_port, |
| charstring cbc_host, integer cbc_sbcap_port, |
| boolean sctp_is_client) |
| runs on test_CT return MME_ConnHdlrPars { |
| var MME_ConnHdlrPars pars := { |
| mme_host := mme_host, |
| mme_sbcap_port := mme_sbcap_port, |
| cbc_host := cbc_host, |
| cbc_sbcap_port := cbc_sbcap_port, |
| sctp_is_client := sctp_is_client, |
| start_fn := refers(f_MME_ConnHdlr_start_fn_void), |
| exp_cbs_msg := omit, |
| write_replace_warning_ind_cause := omit, |
| write_repl_unknown_TAIs := omit, |
| bcast_cell_id_list := omit |
| }; |
| return pars; |
| } |
| |
| private function f_init_mme(integer idx, charstring id) runs on test_CT return MME_ConnHdlr { |
| var MME_ConnHdlr vc_conn; |
| id := id & "-MME" & int2str(idx); |
| vc_conn := MME_ConnHdlr.create(id) alive; |
| g_pars_MME[idx] := f_init_pars_mme(mp_local_host, mp_local_sbcap_port + idx, |
| mp_cbc_host, mp_cbc_sbcap_port, |
| mp_mme_cfg[idx].sctp_is_client); |
| connect(self:COORD_MME[idx], vc_conn:COORD); |
| return vc_conn; |
| } |
| |
| private function f_start_mme(integer idx, charstring id, MME_ConnHdlrPars pars) |
| runs on test_CT { |
| id := id & "-MME" & int2str(idx); |
| g_vc_conn_MME[idx] := f_init_mme(idx, id); |
| g_vc_conn_MME[idx].start(f_MME_ConnHdlr_main(id, pars)); |
| } |
| |
| private function f_init(integer num_bsc := 0, integer num_mme := 0) runs on test_CT { |
| f_http_init(mp_cbc_host, mp_cbc_ecbe_port); |
| |
| g_num_bsc := num_bsc; |
| for (var integer i := 0; i < g_num_bsc; i := i + 1) { |
| g_vc_conn_BSC[i] := f_init_bsc(i, testcasename()); |
| } |
| |
| g_num_mme := num_mme; |
| for (var integer i := 0; i < g_num_mme; i := i + 1) { |
| g_vc_conn_MME[i] := f_init_mme(i, testcasename()); |
| } |
| } |
| |
| function f_start(float t_guard := 60.0) runs on test_CT { |
| /* Start guard timer and activate it as default */ |
| g_Tguard.start(t_guard); |
| activate(as_Tguard()); |
| |
| for (var integer i := 0; i < g_num_bsc; i := i + 1) { |
| f_start_bsc(i, testcasename(), g_pars_BSC[i]); |
| } |
| for (var integer i := 0; i < g_num_mme; i := i + 1) { |
| f_start_mme(i, testcasename(), g_pars_MME[i]); |
| } |
| |
| /* Now wait for conns to be ready: */ |
| for (var integer i := 0; i < g_num_bsc; i := i + 1) { |
| COORD_BSC[i].receive(COORD_MSG_CONNECTED); |
| } |
| for (var integer i := 0; i < g_num_mme; i := i + 1) { |
| COORD_MME[i].receive(COORD_MSG_CONNECTED); |
| } |
| } |
| |
| /* test whether or not we receive a valid KEEP-ALIVE from the CBC */ |
| private function f_bsc_TC_rx_keepalive() runs on BSC_ConnHdlr { |
| var CBSP_PDU rx; |
| var CBSP_IE ie; |
| rx := f_cbsp_exp(tr_CBSP_KEEP_ALIVE(?)); |
| f_cbsp_find_ie(rx, CBSP_IEI_KEEP_ALIVE_REP_PERIOD, ie); |
| } |
| testcase TC_rx_keepalive() runs on test_CT { |
| |
| f_init(num_bsc := 1); |
| g_pars_BSC[0].start_fn := refers(f_bsc_TC_rx_keepalive); |
| f_start(); |
| f_shutdown_helper(); |
| } |
| |
| /* test whether CBC terminates connection if KEEP-ALIVE is not answered by BSC */ |
| private function f_bsc_TC_rx_keepalive_timeout() runs on BSC_ConnHdlr { |
| var CBSP_PDU rx; |
| var CBSP_IE ie; |
| var integer ka_rep_per_s; |
| |
| rx := f_cbsp_exp(tr_CBSP_KEEP_ALIVE(?)); |
| f_cbsp_find_ie(rx, CBSP_IEI_KEEP_ALIVE_REP_PERIOD, ie); |
| |
| /* sleep for longer than the keep-alive period */ |
| ka_rep_per_s := f_cbsp_period2s(ie.body.keep_alive_rep_period); |
| f_sleep(int2float(ka_rep_per_s + 5)); |
| |
| /* expect the CBSP connection to be closed */ |
| CBSP[0].receive(PortEvent:{connClosed:=?}) |
| } |
| testcase TC_rx_keepalive_timeout() runs on test_CT { |
| f_init(num_bsc := 1); |
| g_pars_BSC[0].start_fn := refers(f_bsc_TC_rx_keepalive_timeout); |
| f_start(t_guard := 100.0); |
| f_shutdown_helper(); |
| } |
| |
| private const BSSMAP_FIELD_CellIdentificationList cil_BSS := { |
| cIl_allInBSS := ''O |
| }; |
| private function f_bsc_TC_write_replace() runs on BSC_ConnHdlr { |
| f_cbsp_handle_write(g_pars.exp_cbs_msg); |
| f_sleep(100.0); |
| } |
| testcase TC_write_replace() runs on test_CT { |
| var CBS_Message msg := { |
| msg_id := 42, |
| ser_nr := 16752, |
| old_ser_nr := omit, |
| cell_list := cil_BSS, |
| channel_ind := 0, |
| category := CBSP_CATEG_NORMAL, |
| rep_period := 5, |
| num_bcast_req := 3, |
| dcs := 1, |
| content := { |
| { '00'O, 1 } |
| } |
| }; |
| |
| f_init(num_bsc := 1); |
| g_pars_BSC[0].exp_cbs_msg := msg; |
| g_pars_BSC[0].start_fn := refers(f_bsc_TC_write_replace); |
| f_start(); |
| f_shutdown_helper(); |
| } |
| |
| testcase TC_selftest() runs on test_CT { |
| const octetstring c_load_q := '0700000d0400080000f110012345671200'O; |
| const octetstring c_load_q_compl := '0800000f0a000a0000f1100123456700001200'O; |
| const octetstring c_reset := '1000000b0400080000f11001234567'O; |
| const octetstring c_reset_compl := '1100000b0400080000f11001234567'O; |
| const octetstring c_msg_sts_q := '0a0000130e022b0200000400080000f110012345671200'O; |
| const octetstring c_msg_sts_q_fail := '0c0000140e022b0200000900090000f11001234567021200'O; |
| const octetstring c_kill := '040000110e00000200000400080000f11001234567'O; |
| const octetstring c_kill_fail := '060000120e00000200000900090000f1100123456702'O; |
| const octetstring c_write_repl := '010000c70e022b0300300400080000f110012345671200050006000407000613020c400107f4f29c9e769f5de337b90c921d1b8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d100'O; |
| const octetstring c_write_repl_compl := '020000130e022b0300300400080000f110012345671200'O; |
| const octetstring c_write_repl_fail := '030000140e022b0300300900090000f110012345670d1200'O; |
| const octetstring c_msg_s_q := '0a0000130e022b0200900400080000f110012345671200'O; |
| const octetstring c_msg_s_q_compl := '0b0000160e022b02009008000b0000f110012345670008001200'O; |
| const octetstring c_kill_compl := '050000160e022b02008008000b0000f110012345670006001200'O; |
| |
| log(dec_CBSP_PDU(c_load_q)); |
| log(dec_CBSP_PDU(c_load_q_compl)); |
| log(dec_CBSP_PDU(c_reset)); |
| log(dec_CBSP_PDU(c_reset_compl)); |
| log(dec_CBSP_PDU(c_msg_sts_q)); |
| log(dec_CBSP_PDU(c_msg_sts_q_fail)); |
| log(dec_CBSP_PDU(c_kill)); |
| log(dec_CBSP_PDU(c_kill_fail)); |
| log(dec_CBSP_PDU(c_write_repl)); |
| log(dec_CBSP_PDU(c_write_repl_compl)); |
| log(dec_CBSP_PDU(c_write_repl_fail)); |
| log(dec_CBSP_PDU(c_msg_s_q)); |
| log(dec_CBSP_PDU(c_msg_s_q_compl)); |
| log(dec_CBSP_PDU(c_kill_compl)); |
| } |
| |
| testcase TC_selftest_sabp() runs on test_CT { |
| const octetstring c_write := '00000080930000080006000211120007000240c0000f0010000113f0030282ec0613f0030282ec070001400100000d0002012a000900020000000400010100000056029f01b4d90d064297d9ec37e8fe96b3c9a0303bdd68341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d168341a8d46a3d10012'O; |
| |
| log(dec_SABP_PDU(c_write)); |
| log(enc_SABP_PDU(dec_SABP_PDU(c_write))); |
| |
| var template (value) Service_Areas_List sa_list := { |
| ts_SabpSai('62F224'O, '0023'O, '0042'O) |
| }; |
| var template (value) SABP_PDU tx; |
| |
| tx := ts_SABP_Write(int2bit(1, 16), int2bit(1, 16), sa_list, 23, 42, '00000000'B, '01011010'B); |
| log("Write: ", enc_SABP_PDU(valueof(tx))) |
| |
| var Service_Areas_List sa_list2 := { valueof(ts_SabpSai('62F224'O, '1000'O, '0042'O)) }; |
| for (var integer i := 0; i < 2500; i := i+1) { |
| sa_list2 := sa_list2 & {valueof(ts_SabpSai('62F224'O, '2000'O, int2oct(i,2))) }; |
| } |
| tx := ts_SABP_Write(int2bit(2, 16), int2bit(2, 16), sa_list2, 23, 42, '00000000'B, '01011010'B); |
| log("Write: ", enc_SABP_PDU(valueof(tx))) |
| |
| tx := ts_SABP_Restart(sa_list); |
| log("Restart: ", enc_SABP_PDU(valueof(tx))); |
| } |
| |
| private function f_bsc_create_and_delete() runs on BSC_ConnHdlr { |
| f_cbsp_handle_write(g_pars.exp_cbs_msg, 0, g_pars.cell_list_success); |
| f_cbsp_handle_kill(0, g_pars.exp_cbs_msg.msg_id, g_pars.exp_cbs_msg.ser_nr, |
| exp_list:=g_pars.cell_list_success, tx_list:=g_pars.cell_list_success, |
| tx_fail_list:=omit, tx_compl_list:=omit, |
| channel_ind:=g_pars.exp_cbs_msg.channel_ind); |
| } |
| |
| private function f_mme_create_and_delete() runs on MME_ConnHdlr { |
| f_sbcap_handle_write_replace_warn_req(g_pars.exp_cbs_msg, 0); |
| if (ispresent(g_pars.write_replace_warning_ind_cause) and |
| ispresent(g_pars.bcast_cell_id_list)) { |
| f_sbcap_tx_write_replace_warn_ind(0, g_pars.exp_cbs_msg, |
| g_pars.write_replace_warning_ind_cause, |
| g_pars.bcast_cell_id_list) |
| } |
| f_sbcap_handle_stop_warn_req(0, g_pars.exp_cbs_msg); |
| } |
| |
| function f_create_and_delete(CBS_Message msg) |
| runs on test_CT { |
| var EcbeCbcMessage ecbe := f_cbs2ecbe(msg, "TTCN-3"); |
| f_ecbe_tx_post_cbs(ecbe); |
| f_ecbe_rx_resp(201); |
| |
| f_sleep(2.0); |
| |
| f_ecbe_tx_delete_cbs(msg.msg_id); |
| f_ecbe_rx_resp(200); |
| } |
| |
| private template (value) CBS_Message t_CBSmsg(uint16_t msg_id, uint16_t ser_nr) := { |
| msg_id := msg_id, |
| ser_nr := ser_nr, |
| old_ser_nr := omit, |
| cell_list := cil_BSS, |
| channel_ind := 0, |
| category := CBSP_CATEG_NORMAL, |
| rep_period := 5, |
| num_bcast_req := 3, |
| dcs := 1, |
| content := { |
| { '00'O, 1 } |
| } |
| }; |
| |
| /* specify a variety of different Cell Identifier formats to extend test coverage */ |
| testcase TC_ecbe_create_delete_cgi() runs on test_CT { |
| f_init(num_bsc := 1); |
| var template (value) BSSMAP_FIELD_CellIdentificationList cell_list_success; |
| var template (value) CBS_Message msg := t_CBSmsg(43, 16752); |
| |
| cell_list_success := ts_BSSMAP_CIL_CGI({ |
| ts_BSSMAP_CI_CGI('901'H, '70'H, 23, 42), |
| ts_BSSMAP_CI_CGI('901'H, '70'H, 24, 42), |
| ts_BSSMAP_CI_CGI('901'H, '70'H, 24, 43) |
| }); |
| g_pars_BSC[0].start_fn := refers(f_bsc_create_and_delete); |
| g_pars_BSC[0].exp_cbs_msg := valueof(msg); |
| g_pars_BSC[0].cell_list_success := valueof(cell_list_success); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| testcase TC_ecbe_create_delete_lac_ci() runs on test_CT { |
| f_init(num_bsc := 1); |
| var template (value) BSSMAP_FIELD_CellIdentificationList cell_list_success; |
| var template (value) CBS_Message msg := t_CBSmsg(44, 16752); |
| cell_list_success := ts_BSSMAP_CIL_LAC_CI({ |
| ts_BSSMAP_CI_LAC_CI(10001, 50001), |
| ts_BSSMAP_CI_LAC_CI(10002, 50002), |
| ts_BSSMAP_CI_LAC_CI(10003, 50003) |
| }); |
| g_pars_BSC[0].start_fn := refers(f_bsc_create_and_delete); |
| g_pars_BSC[0].exp_cbs_msg := valueof(msg); |
| g_pars_BSC[0].cell_list_success := valueof(cell_list_success); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| testcase TC_ecbe_create_delete_lac() runs on test_CT { |
| f_init(num_bsc := 1); |
| var template (value) BSSMAP_FIELD_CellIdentificationList cell_list_success; |
| var template (value) CBS_Message msg := t_CBSmsg(45, 16752); |
| cell_list_success := ts_BSSMAP_CIL_LAC({ |
| ts_BSSMAP_CI_LAC(10001), |
| ts_BSSMAP_CI_LAC(10002), |
| ts_BSSMAP_CI_LAC(10003) |
| }); |
| g_pars_BSC[0].start_fn := refers(f_bsc_create_and_delete); |
| g_pars_BSC[0].exp_cbs_msg := valueof(msg); |
| g_pars_BSC[0].cell_list_success := valueof(cell_list_success); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| testcase TC_ecbe_create_delete_ci() runs on test_CT { |
| f_init(num_bsc := 1); |
| var template (value) BSSMAP_FIELD_CellIdentificationList cell_list_success; |
| var template (value) CBS_Message msg := t_CBSmsg(46, 16752); |
| cell_list_success := ts_BSSMAP_CIL_CI({ |
| ts_BSSMAP_CI_CI(50001), |
| ts_BSSMAP_CI_CI(50002), |
| ts_BSSMAP_CI_CI(50003) |
| }); |
| g_pars_BSC[0].start_fn := refers(f_bsc_create_and_delete); |
| g_pars_BSC[0].exp_cbs_msg := valueof(msg); |
| g_pars_BSC[0].cell_list_success := valueof(cell_list_success); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| testcase TC_ecbe_create_delete_lai() runs on test_CT { |
| f_init(num_bsc := 1); |
| var template (value) BSSMAP_FIELD_CellIdentificationList cell_list_success; |
| var template (value) CBS_Message msg := t_CBSmsg(47, 16752); |
| cell_list_success := ts_BSSMAP_CIL_LAI({ |
| ts_BSSMAP_CI_LAI('901'H, '70'H, 25), |
| ts_BSSMAP_CI_LAI('901'H, '70'H, 26), |
| ts_BSSMAP_CI_LAI('901'H, '70'H, 27) |
| }); |
| g_pars_BSC[0].start_fn := refers(f_bsc_create_and_delete); |
| g_pars_BSC[0].exp_cbs_msg := valueof(msg); |
| g_pars_BSC[0].cell_list_success := valueof(cell_list_success); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| |
| /* Create and delete message with MME available. MME reports |
| * Write-Replace-Warning-Indication and Stop-Warning-Indication to CBC |
| */ |
| testcase TC_ecbe_create_delete_mme_indication() runs on test_CT { |
| var template (value) CellId_Broadcast_List bcast_cell_id_li; |
| var template (value) CBS_Message msg := t_CBSmsg(48, 16752); |
| |
| f_init(num_bsc := 0, num_mme := 1); |
| |
| bcast_cell_id_li := { |
| ts_SBCAP_CellId_Broadcast_List_Item(ts_SBCAP_ECGI(f_enc_mcc_mnc('901'H, '70'H), 1234)), |
| ts_SBCAP_CellId_Broadcast_List_Item(ts_SBCAP_ECGI(f_enc_mcc_mnc('901'H, '70'H), 5678)) |
| }; |
| g_pars_MME[0].start_fn := refers(f_mme_create_and_delete); |
| g_pars_MME[0].exp_cbs_msg := valueof(msg); |
| g_pars_MME[0].write_replace_warning_ind_cause := SBC_AP_Cause_message_accepted; |
| g_pars_MME[0].bcast_cell_id_list := valueof(bcast_cell_id_li); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| |
| /* Create and delete message with MME available. MME reports |
| * Write-Replace-Response with Unknown TAI IE. |
| */ |
| testcase TC_ecbe_create_delete_mme_unknown_tai() runs on test_CT { |
| var template (value) List_of_TAIs write_repl_unknown_TAIs; |
| var template (value) CBS_Message msg := t_CBSmsg(48, 16752); |
| |
| f_init(num_bsc := 0, num_mme := 1); |
| |
| write_repl_unknown_TAIs := {{ts_SBCAP_TAI(f_enc_mcc_mnc('901'H, '70'H), 1234)}}; |
| g_pars_MME[0].start_fn := refers(f_mme_create_and_delete); |
| g_pars_MME[0].exp_cbs_msg := valueof(msg); |
| g_pars_MME[0].write_replace_warning_ind_cause := SBC_AP_Cause_message_accepted; |
| g_pars_MME[0].write_repl_unknown_TAIs := valueof(write_repl_unknown_TAIs); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| |
| /* Create and delete message with both BSC and MME available */ |
| testcase TC_ecbe_create_delete_bsc_and_mme() runs on test_CT { |
| f_init(num_bsc := 1, num_mme := 1); |
| var template (value) BSSMAP_FIELD_CellIdentificationList cell_list_success; |
| var template (value) CellId_Broadcast_List bcast_cell_id_li; |
| var template (value) CBS_Message msg := t_CBSmsg(43, 16752); |
| |
| cell_list_success := ts_BSSMAP_CIL_CGI({ |
| ts_BSSMAP_CI_CGI('901'H, '70'H, 23, 42), |
| ts_BSSMAP_CI_CGI('901'H, '70'H, 24, 42), |
| ts_BSSMAP_CI_CGI('901'H, '70'H, 24, 43) |
| }); |
| g_pars_BSC[0].start_fn := refers(f_bsc_create_and_delete); |
| g_pars_BSC[0].exp_cbs_msg := valueof(msg); |
| g_pars_BSC[0].cell_list_success := valueof(cell_list_success); |
| |
| bcast_cell_id_li := { |
| ts_SBCAP_CellId_Broadcast_List_Item(ts_SBCAP_ECGI(f_enc_mcc_mnc('901'H, '70'H), 1234)) |
| }; |
| g_pars_MME[0].start_fn := refers(f_mme_create_and_delete); |
| g_pars_MME[0].exp_cbs_msg := valueof(msg); |
| g_pars_MME[0].write_replace_warning_ind_cause := SBC_AP_Cause_message_accepted; |
| g_pars_MME[0].bcast_cell_id_list := valueof(bcast_cell_id_li); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| |
| /* Create and delete message with BSC acting as TCP server */ |
| testcase TC_ecbe_create_delete_bsc_server() runs on test_CT { |
| var template (value) BSSMAP_FIELD_CellIdentificationList cell_list_success; |
| var template (value) CBS_Message msg := t_CBSmsg(46, 16752); |
| |
| /* The 2nd BSC is the one configured as server, but we only want to test |
| * that one, so initialize both but copy over config of the 2nd one to |
| * the first one, to start only one BSC: */ |
| f_init(num_bsc := 2); |
| g_num_bsc := 1; |
| g_pars_BSC[0] := g_pars_BSC[1]; |
| |
| cell_list_success := ts_BSSMAP_CIL_CI({ |
| ts_BSSMAP_CI_CI(50001), |
| ts_BSSMAP_CI_CI(50002), |
| ts_BSSMAP_CI_CI(50003) |
| }); |
| g_pars_BSC[0].start_fn := refers(f_bsc_create_and_delete); |
| g_pars_BSC[0].exp_cbs_msg := valueof(msg); |
| g_pars_BSC[0].cell_list_success := valueof(cell_list_success); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| |
| /* Create and delete message with MME acting as SCTP server */ |
| testcase TC_ecbe_create_delete_mme_server() runs on test_CT { |
| var template (value) CellId_Broadcast_List bcast_cell_id_li; |
| var template (value) CBS_Message msg := t_CBSmsg(48, 16752); |
| |
| /* The 2nd MME is the one configured as server, but we only want to test |
| * that one, so initialize both but copy over config of the 2nd one to |
| * the first one, to start only one MME: */ |
| f_init(num_bsc := 0, num_mme := 2); |
| g_num_mme := 1; |
| g_pars_MME[0] := g_pars_MME[1]; |
| |
| bcast_cell_id_li := { |
| ts_SBCAP_CellId_Broadcast_List_Item(ts_SBCAP_ECGI(f_enc_mcc_mnc('901'H, '70'H), 1234)), |
| ts_SBCAP_CellId_Broadcast_List_Item(ts_SBCAP_ECGI(f_enc_mcc_mnc('901'H, '70'H), 5678)) |
| }; |
| g_pars_MME[0].start_fn := refers(f_mme_create_and_delete); |
| g_pars_MME[0].exp_cbs_msg := valueof(msg); |
| g_pars_MME[0].write_replace_warning_ind_cause := SBC_AP_Cause_message_accepted; |
| g_pars_MME[0].bcast_cell_id_list := valueof(bcast_cell_id_li); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| |
| /* Create 2 concurrent messages against an MME, then delete them */ |
| private function f_mme_TC_concurrent_cbs_msg_mme() runs on MME_ConnHdlr { |
| var CBS_Message msg[2]; |
| msg[0] := g_pars.exp_cbs_msg; |
| msg[1] := msg[0]; |
| msg[1].msg_id := msg[0].msg_id + 1; |
| |
| for (var integer i := 0; i < lengthof(msg); i := i + 1) { |
| f_sbcap_handle_write_replace_warn_req(msg[i], 0); |
| if (ispresent(g_pars.write_replace_warning_ind_cause) and |
| ispresent(g_pars.bcast_cell_id_list)) { |
| f_sbcap_tx_write_replace_warn_ind(0, msg[i], |
| g_pars.write_replace_warning_ind_cause, |
| g_pars.bcast_cell_id_list) |
| } |
| } |
| /* Now handle Stop: */ |
| for (var integer i := 0; i < lengthof(msg); i := i + 1) { |
| f_sbcap_handle_stop_warn_req(0, msg[i]); |
| } |
| } |
| testcase TC_concurrent_cbs_msg_mme() runs on test_CT { |
| var template (value) CellId_Broadcast_List bcast_cell_id_li; |
| var CBS_Message msg[2]; |
| var EcbeCbcMessage ecbe; |
| |
| msg[0] := valueof(t_CBSmsg(49, 16752)); |
| msg[1] := msg[0]; |
| msg[1].msg_id := msg[0].msg_id + 1; |
| |
| f_init(num_bsc := 0, num_mme := 1); |
| |
| bcast_cell_id_li := { |
| ts_SBCAP_CellId_Broadcast_List_Item(ts_SBCAP_ECGI(f_enc_mcc_mnc('901'H, '70'H), 1234)) |
| }; |
| g_pars_MME[0].start_fn := refers(f_mme_TC_concurrent_cbs_msg_mme); |
| g_pars_MME[0].exp_cbs_msg := msg[0]; |
| g_pars_MME[0].write_replace_warning_ind_cause := SBC_AP_Cause_message_accepted; |
| g_pars_MME[0].bcast_cell_id_list := valueof(bcast_cell_id_li); |
| f_start(); |
| |
| for (var integer i := 0; i < lengthof(msg); i := i + 1) { |
| ecbe := f_cbs2ecbe(msg[i], "TTCN-3"); |
| f_ecbe_tx_post_cbs(ecbe); |
| f_ecbe_rx_resp(201); |
| } |
| |
| f_sleep(2.0); |
| |
| for (var integer i := 0; i < lengthof(msg); i := i + 1) { |
| f_ecbe_tx_delete_cbs(msg[i].msg_id); |
| f_ecbe_rx_resp(200); |
| } |
| |
| f_shutdown_helper(); |
| } |
| |
| /* Test ETWS message over CBSP. TS 23.041 9.4.1.2.2 */ |
| testcase TC_ecbe_create_delete_etws_bsc() runs on test_CT { |
| f_init(num_bsc := 1); |
| var template (value) BSSMAP_FIELD_CellIdentificationList cell_list_success; |
| var template (value) CBS_Message msg := t_CBSmsg(4352 /* Earthquake */, 16752); |
| msg.channel_ind := omit; |
| |
| cell_list_success := ts_BSSMAP_CIL_CGI({ |
| ts_BSSMAP_CI_CGI('901'H, '70'H, 23, 42), |
| ts_BSSMAP_CI_CGI('901'H, '70'H, 24, 42) |
| }); |
| g_pars_BSC[0].start_fn := refers(f_bsc_create_and_delete); |
| g_pars_BSC[0].exp_cbs_msg := valueof(msg); |
| g_pars_BSC[0].cell_list_success := valueof(cell_list_success); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| |
| /* Test ETWS message over SBc-AP. TS 23.041 9.4.1.2.2 */ |
| testcase TC_ecbe_create_delete_etws_mme() runs on test_CT { |
| f_init(num_mme := 1); |
| var template (value) CBS_Message msg := t_CBSmsg(4352 /* Earthquake */, 16753); |
| msg.channel_ind := omit; |
| |
| g_pars_MME[0].start_fn := refers(f_mme_create_and_delete); |
| g_pars_MME[0].exp_cbs_msg := valueof(msg); |
| f_start(); |
| f_create_and_delete(valueof(msg)); |
| f_shutdown_helper(); |
| } |
| |
| control { |
| execute( TC_rx_keepalive() ); |
| execute( TC_rx_keepalive_timeout() ); |
| execute( TC_ecbe_create_delete_cgi() ); |
| execute( TC_ecbe_create_delete_lac_ci() ); |
| execute( TC_ecbe_create_delete_lac() ); |
| execute( TC_ecbe_create_delete_ci() ); |
| execute( TC_ecbe_create_delete_lai() ); |
| execute( TC_ecbe_create_delete_mme_indication() ); |
| execute( TC_ecbe_create_delete_mme_unknown_tai() ); |
| execute( TC_ecbe_create_delete_bsc_and_mme() ); |
| execute( TC_ecbe_create_delete_bsc_server() ); |
| execute( TC_ecbe_create_delete_mme_server() ); |
| execute( TC_concurrent_cbs_msg_mme() ); |
| |
| execute( TC_ecbe_create_delete_etws_bsc() ); |
| execute( TC_ecbe_create_delete_etws_mme() ); |
| } |
| |
| } |