BTS_Test_ASCI: Add UPLINK FREE / UPLINK BUSY test
A VGCS channel is activated. The BSC sends UPLINK FREE message and
UPLINK BUSY message. When the UPLINK FREE message is sent, the MS is
expected to receive several UPLINK FREE messages. Then the UPLINK BUSY
message is sent, the MS is expected to receive one UPLINK BUSY message.
Change-Id: I2f70adb4a6f71eb8972feccf9dda0f77e7a942b9
Related: OS#4851
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index d893601..d92b9c6 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -2501,7 +2501,7 @@
}
/* Tune to a dedicated channel: L1CTL only */
-private function f_l1ctl_est_dchan(L1CTL_PT pt, ConnHdlrPars pars) {
+friend function f_l1ctl_est_dchan(L1CTL_PT pt, ConnHdlrPars pars) {
if (not pars.fhp.enabled) {
var TrxParsItem trx_pars := mp_trx_pars[pars.trx_nr];
pt.send(ts_L1CTL_DM_EST_REQ_H0(pars.chan_nr, pars.tsc,
@@ -7338,7 +7338,7 @@
}
[] L1CTL.receive { repeat; }
}
-private function f_l1_exp_lapdm(template LapdmFrame exp, float t := 3.0) runs on ConnHdlr {
+friend function f_l1_exp_lapdm(template LapdmFrame exp, float t := 3.0) runs on ConnHdlr {
timer T := t;
T.start;
alt {
diff --git a/bts/BTS_Tests_ASCI.ttcn b/bts/BTS_Tests_ASCI.ttcn
index dfab7f6..680f1e2 100644
--- a/bts/BTS_Tests_ASCI.ttcn
+++ b/bts/BTS_Tests_ASCI.ttcn
@@ -127,8 +127,72 @@
Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
}
+/* Sub function to clean up MS and BTS. */
+private function f_vgcs_cleanup() runs on ConnHdlr
+{
+ /* Cleanup L1CTL. */
+ f_L1CTL_RESET(L1CTL);
+ f_l1_tune(L1CTL);
+
+ /* Cleanup VGCS Channel. */
+ f_rsl_chan_deact();
+}
+
+/* A VGCS channel is activated. The BSC sends UPLINK FREE message and UPLINK BUSY message.
+ * When the UPLINK FREE message is sent, the MS is expected to receive several UPLINK FREE messages.
+ * Then the UPLINK BUSY message is sent, the MS is expected to receive one UPLINK BUSY message.
+ */
+private function f_TC_vgcs_uplink_free_and_busy(charstring id) runs on ConnHdlr
+{
+ var octetstring uplink_free := '082B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B'O;
+ var octetstring uplink_busy := '062A'O;
+
+ f_l1_tune(L1CTL);
+ RSL.clear;
+
+ /* Activate channel on the BTS side */
+ log("Activating VGCS channel.");
+ f_rsl_chan_act(g_pars.chan_mode);
+
+ /* enable dedicated mode */
+ f_l1ctl_est_dchan(L1CTL, g_pars);
+
+ /* Send one UPLINK FREE message and expect them to be repeated. */
+ log("Send UPLINK FREE.");
+ RSL.send(ts_RSL_UNITDATA_REQ(g_chan_nr, ts_RslLinkID_DCCH(0), uplink_free));
+ for (var integer i := 0; i < 20; i := i + 1) {
+ f_l1_exp_lapdm(tr_LAPDm_Bter_UI(uplink_free));
+ log("Received UPLINK FREE.");
+ }
+
+ /* Send one UPLINK BUSY message and expect it to be received. */
+ log("Send UPLINK BUSY.");
+ RSL.send(ts_RSL_UNITDATA_REQ(g_chan_nr, ts_RslLinkID_DCCH(0), uplink_busy));
+ f_l1_exp_lapdm(tr_LAPDm_UI(0, cr_MT_CMD, uplink_busy));
+ log("Received UPLINK BUSY.");
+
+ /* Deactivate and cleanup. */
+ f_vgcs_cleanup();
+}
+testcase TC_vgcs_uplink_free_and_busy() runs on test_CT
+{
+ var template RSL_IE_ChannelMode ch_mode;
+ var ConnHdlrPars pars;
+ var ConnHdlr vc_conn;
+
+ f_init();
+
+ ch_mode := ts_RSL_ChanMode(RSL_CHRT_TCH_F_GROUP, RSL_CMOD_SP_GSM1);
+ pars := valueof(t_Pars(t_RslChanNr_Bm(1), ch_mode));
+ vc_conn := f_start_handler(refers(f_TC_vgcs_uplink_free_and_busy), pars);
+ vc_conn.done;
+
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
+
control {
execute( TC_vbs_notification() );
+ execute( TC_vgcs_uplink_free_and_busy() );
}