summaryrefslogtreecommitdiffstats
path: root/bts/BTS_Tests.ttcn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-11 22:29:31 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-12 16:04:54 +0100
commitea17b91e78836020cf3bacf94df02340d758d46a (patch)
tree82bd9b99d101cd81d7c33088e547af155907ae6a /bts/BTS_Tests.ttcn
parent21240e63f94fd3cb6da9c2e01b616bd5934957da (diff)
bts: Add TC_sacch_info_mod and TC_sacch_filling
Diffstat (limited to 'bts/BTS_Tests.ttcn')
-rw-r--r--bts/BTS_Tests.ttcn105
1 files changed, 105 insertions, 0 deletions
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index dcdf32b..5e0b3fb 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -636,8 +636,111 @@ testcase TC_deact_sacch() runs on test_CT {
f_shutdown();
}
+private function f_sacch_present(template octetstring l3_exp) runs on ConnHdlr {
+ var L1ctlDlMessage dl;
+ /* check that the specified SI5 value is actually sent */
+ timer T_sacch := 3.0;
+ L1CTL.clear;
+ T_sacch.start;
+ alt {
+ [] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(0))) -> value dl {
+ var octetstring l3 := substr(dl.payload.data_ind.payload, 4, 19);
+ if (match(l3, l3_exp)) {
+ setverdict(pass);
+ } else {
+ repeat;
+ }
+ }
+ [] L1CTL.receive { repeat; }
+ [] T_sacch.timeout {
+ setverdict(fail, "Timeout waiting for SACCH ", l3_exp);
+ self.stop;
+ }
+ }
+}
+
/* Test for default SACCH FILL transmitted in DL SACCH (all channel types) */
+private function f_TC_sacch_filling(charstring id) runs on ConnHdlr {
+ /* Set a known default SACCH filling for SI5 */
+ var octetstring si5 := f_rnd_octstring(19);
+ RSL.send(ts_RSL_SACCH_FILL(RSL_SYSTEM_INFO_5, si5));
+
+ f_l1_tune(L1CTL);
+ RSL.clear;
+
+ /* activate the logical channel */
+ f_est_dchan();
+
+ /* check that the specified SI5 value is actually sent */
+ f_sacch_present(si5);
+
+ /* release the channel */
+ RSL.clear;
+ f_rsl_chan_deact();
+ f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
+}
+testcase TC_sacch_filling() runs on test_CT {
+ var ConnHdlr vc_conn;
+ var ConnHdlrPars pars;
+ f_init();
+ for (var integer i := 0; i < sizeof(g_AllChannels); i := i+1) {
+ pars := valueof(t_Pars(g_AllChannels[i], ts_RSL_ChanMode_SIGN));
+ log(testcasename(), ": Starting for ", g_AllChannels[i]);
+ vc_conn := f_start_handler(refers(f_TC_sacch_filling), pars);
+ vc_conn.done;
+ }
+ /* TODO: do the above in parallel, rather than sequentially? */
+ f_shutdown();
+}
+
/* Test for lchan-specific SACCH INFO MODIFY (TS 48.058 4.12) */
+private function f_TC_sacch_info_mod(charstring id) runs on ConnHdlr {
+ /* Set a known default SACCH filling for SI5 */
+ var octetstring si5 := f_rnd_octstring(19);
+ var octetstring si5_diff := f_rnd_octstring(19);
+ RSL.send(ts_RSL_SACCH_FILL(RSL_SYSTEM_INFO_5, si5));
+
+ f_l1_tune(L1CTL);
+ RSL.clear;
+
+ log("Activating channel, expecting standard SI5");
+ /* activate the logical channel */
+ f_est_dchan();
+ /* check that the specified SI5 value is actually sent */
+ f_sacch_present(si5);
+
+ /* set channel-specific different SI5 */
+ log("Setting channel specific SACCH INFO, expecting it");
+ RSL.send(ts_RSL_SACCH_INF_MOD(g_chan_nr, RSL_SYSTEM_INFO_5, si5_diff))
+ /* check that the specified lchan-specific value is now used */
+ f_sacch_present(si5_diff);
+
+ /* deactivate the channel and re-activate it, this should result in default SI5 */
+ log("De-activating and re-activating channel, expecting standard SI5");
+ f_rsl_chan_deact();
+ f_rsl_chan_act(valueof(ts_RSL_ChanMode_SIGN));
+ /* Verify that the TRX-wide default SACCH filling is present again */
+ f_sacch_present(si5);
+
+ /* release the channel */
+ RSL.clear;
+ f_rsl_chan_deact();
+ f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
+}
+testcase TC_sacch_info_mod() runs on test_CT {
+ var ConnHdlr vc_conn;
+ var ConnHdlrPars pars;
+ f_init();
+ for (var integer i := 0; i < sizeof(g_AllChannels); i := i+1) {
+ pars := valueof(t_Pars(g_AllChannels[i], ts_RSL_ChanMode_SIGN));
+ log(testcasename(), ": Starting for ", g_AllChannels[i]);
+ vc_conn := f_start_handler(refers(f_TC_sacch_info_mod), pars);
+ vc_conn.done;
+ }
+ /* TODO: do the above in parallel, rather than sequentially? */
+ f_shutdown();
+}
+
/* Test for SACCH transmission rules in the context of special CHAN ACT (HO) */
@@ -2427,6 +2530,8 @@ control {
execute( TC_chan_deact_not_active() );
execute( TC_chan_act_wrong_nr() );
execute( TC_deact_sacch() );
+ execute( TC_sacch_filling() );
+ execute( TC_sacch_info_mod() );
execute( TC_rach_content() );
execute( TC_rach_count() );
execute( TC_rach_max_ta() );