Change in osmo-ttcn3-hacks[master]: bts: Extend BTS_Tests.ttcn with test for RSL error handling

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon May 20 19:40:50 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/14086 )

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

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
---
M bts/BTS_Tests.ttcn
1 file changed, 93 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index e1c64d6..5b69b5d 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -2571,6 +2571,95 @@
 	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 @@
 * 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 @@
 	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() );

-- 
To view, visit https://gerrit.osmocom.org/14086
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If507a14bbed9cdcc62cd966468222186590fc965
Gerrit-Change-Number: 14086
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190520/6ce1a75b/attachment.html>


More information about the gerrit-log mailing list