bts: Extend BTS_Tests.ttcn with test for RSL error handling

Section 7 of the RSL specification (3GPP TS 48.058) describes how the
BTS shall respond in various error situations, including wrong message
type, wrong message discriminator and invalid message sequences.

Let's add three test cases for the above three scenarios.

Change-Id: If507a14bbed9cdcc62cd966468222186590fc965
Related: OS##3750
This commit is contained in:
Harald Welte 2019-05-19 14:32:37 +02:00
parent c18fe7f651
commit ee25aaed96
1 changed files with 93 additions and 3 deletions

View File

@ -2571,6 +2571,95 @@ testcase TC_rsl_ie_content_error() runs on test_CT {
f_exp_err_rep(RSL_ERR_IE_CONTENT);
}
/* attempt to activate channel with wrong RSL Message Discriminator IE */
function f_TC_chan_act_wrong_mdisc(charstring id) runs on ConnHdlr {
var template RSL_Message rsl := ts_RSL_CHAN_ACT(g_chan_nr, g_pars.chan_mode);
rsl.msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RESERVED, false);
RSL.send(rsl);
f_rslem_unregister(0, g_chan_nr);
}
testcase TC_err_rep_wrong_mdisc() runs on test_CT {
var ConnHdlr vc_conn;
var ConnHdlrPars pars := valueof(t_Pars(ts_RslChanNr_SDCCH4(0,0), ts_RSL_ChanMode_SIGN));
f_init(testcasename());
vc_conn := f_start_handler(refers(f_TC_chan_act_wrong_mdisc), pars);
vc_conn.done;
f_exp_err_rep(RSL_ERR_MSG_DISCR);
Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
}
/* Send messages with wrong message type */
function f_TC_wrong_msg_type_dchan(charstring id) runs on ConnHdlr {
var template (value) RSL_Message rsl_tx;
rsl_tx := ts_RSL_CHAN_ACT(g_chan_nr, g_pars.chan_mode);
rsl_tx.msg_type := RSL_MT_NOT_CMD;
RSL.send(rsl_tx);
f_rslem_unregister(0, g_chan_nr);
}
function f_TC_wrong_msg_type_rll(charstring id) runs on ConnHdlr {
var template (value) RSL_Message rsl_tx;
/* we first have to activate the dedicated channel */
f_rsl_chan_act(g_pars.chan_mode);
/* ... to then send an invalid RLL message */
rsl_tx := ts_RSL_UNITDATA_REQ(g_chan_nr, ts_RslLinkID_DCCH(0), '0102'O);
rsl_tx.msg_type := RSL_MT_CBCH_LOAD_IND;
RSL.send(rsl_tx);
f_rslem_unregister(0, g_chan_nr);
}
testcase TC_err_rep_wrong_msg_type() runs on test_CT {
var ConnHdlr vc_conn;
var ConnHdlrPars pars := valueof(t_Pars(ts_RslChanNr_SDCCH4(0,0), ts_RSL_ChanMode_SIGN));
var template (value) RSL_Message rsl_tx;
f_init(testcasename());
/* Common Channel with wrong message type */
RSL_CCHAN.clear;
rsl_tx := valueof(ts_RSL_BCCH_INFO(RSL_SYSTEM_INFO_1, ''O));
rsl_tx.msg_type := RSL_MT_LOCATION_INFO;
RSL_CCHAN.send(ts_RSL_UD(rsl_tx));
f_exp_err_rep(RSL_ERR_MSG_TYPE);
/* TRX Management */
RSL_CCHAN.clear;
rsl_tx := ts_RSL_SACCH_FILL(RSL_SYSTEM_INFO_5, ''O);
rsl_tx.msg_type := RSL_MT_UNIT_DATA_IND;
RSL_CCHAN.send(ts_RSL_UD(rsl_tx));
f_exp_err_rep(RSL_ERR_MSG_TYPE);
/* Dedicated Channel */
RSL_CCHAN.clear;
vc_conn := f_start_handler(refers(f_TC_wrong_msg_type_dchan), pars);
vc_conn.done;
f_exp_err_rep(RSL_ERR_MSG_TYPE);
/* RLL */
RSL_CCHAN.clear;
vc_conn := f_start_handler(refers(f_TC_wrong_msg_type_rll), pars);
vc_conn.done;
f_exp_err_rep(RSL_ERR_MSG_TYPE);
}
/* Send messages in wrong sequence (RLL to an inactive lchan) */
function f_TC_err_rep_wrong_sequence(charstring id) runs on ConnHdlr {
RSL.send(ts_RSL_UNITDATA_REQ(g_chan_nr, ts_RslLinkID_DCCH(0), '0102'O));
f_rslem_unregister(0, g_chan_nr);
}
testcase TC_err_rep_wrong_sequence() runs on test_CT {
var ConnHdlr vc_conn;
var ConnHdlrPars pars := valueof(t_Pars(ts_RslChanNr_SDCCH4(0,0), ts_RSL_ChanMode_SIGN));
f_init(testcasename());
RSL_CCHAN.clear;
vc_conn := f_start_handler(refers(f_TC_err_rep_wrong_sequence), pars);
vc_conn.done;
f_exp_err_rep(RSL_ERR_MSG_SEQ);
}
/***********************************************************************
* IPA CRCX/MDCX/DLCS media stream handling
***********************************************************************/
@ -4311,9 +4400,6 @@ testcase TC_chopped_ipa_payload() runs on test_CT {
* SMS Broadcast Req / Cmd / CBCH LOad Ind
* RF resource ind
* error handling
** discriminator error
** type error
** sequence error
** IE duplicated?
* PCU interface
** TIME_IND from BTS->PCU
@ -4416,6 +4502,10 @@ control {
execute( TC_encr_cmd_a52() );
execute( TC_encr_cmd_a53() );
execute( TC_err_rep_wrong_mdisc() );
execute( TC_err_rep_wrong_msg_type() );
execute( TC_err_rep_wrong_sequence() );
execute( TC_lapdm_selftest() );
execute( TC_tch_sign_l2_fill_frame() );