summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-12-20 11:11:56 +0100
committerHarald Welte <laforge@gnumonks.org>2018-12-23 10:36:58 +0000
commit4d1e9c92541606459923031d53247ad9fe625650 (patch)
tree9d3dfa4635f32aa801febf9915292c54794d281e
parenta069d38b617be019a94c92cc4af064ba732b5052 (diff)
BTS_Tests: Verify RSL MS POWER CONTROL and SACCH MS POWER LEVEL
Usually the MS power is controlled by the BTS and there is no continous supervison by the BSC needed. However, a scheme where the BSC takes care of the power control loop exists. The power is then set via RSL using an RSL MS POWER CONTROL message. This tests establishes a dchan and then sends MS POWER CONTROL messages with differen power levels and then checks the presence of the power level set in the MS POWER LEVEL field of the SACCH L1 header. Change-Id: I82b04a3bf94d355175f7f6ff3fdc43672e8080a2 Related: OS#1622
-rw-r--r--bts/BTS_Tests.ttcn72
-rw-r--r--bts/expected-results.xml1
-rw-r--r--library/RSL_Types.ttcn12
3 files changed, 84 insertions, 1 deletions
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 753d89b..0de787a 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -1502,6 +1502,76 @@ testcase TC_meas_res_sign_tchh_toa256() runs on test_CT {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
}
+/* establish DChan, and send MS POWER CONTROL messages via RSL, verify that
+ * the BTS is forwarding those values to the MS via the SACCH L1 header. */
+function f_tc_rsl_ms_pwr_ctrl(charstring id) runs on ConnHdlr {
+ var L1ctlDlMessage l1_dl;
+ var RSL_IE_MS_Power ms_power;
+ var RSL_Message rsl;
+ var uint5_t power_level := 0;
+
+ f_l1_tune(L1CTL);
+ RSL.clear;
+
+ f_est_dchan();
+
+ ms_power.reserved := 0;
+ ms_power.fpc_epc := false;
+
+ /* Send the first power control command. This will disable any BTS/TRX
+ * internal power control and switch the MS (which is not in scope of
+ * this test) to a constant power level. We start with a power level
+ * of 0 */
+ ms_power.power_level := power_level;
+ rsl := valueof(ts_RSL_MS_PWR_CTRL(g_chan_nr, ms_power));
+ RSL.send(rsl);
+
+ alt {
+
+ /* Pick all SACCH blocks for checking */
+ [] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) -> value l1_dl {
+
+ /* The first byte of the L1 header contains the power level.
+ * The reserved bits and the fpc bit is set to 0, so we may
+ * compare directly. */
+ if (not (l1_dl.payload.data_ind.payload[0] == int2oct(power_level, 1))) {
+ setverdict(fail, "Power level in L1 header does not match the signaled (RSL) power level.");
+ }
+
+ /* Signal a new power level via RSL for the next turn. */
+ if (power_level < 31) {
+ power_level := power_level + 1;
+ ms_power.power_level := power_level;
+ rsl := valueof(ts_RSL_MS_PWR_CTRL(g_chan_nr, ms_power));
+ RSL.send(rsl);
+ repeat;
+ }
+
+ }
+
+ /* Ignore all other blocks */
+ [] L1CTL.receive { repeat; }
+
+ }
+
+ f_rsl_chan_deact();
+ f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
+
+ setverdict(pass);
+}
+
+testcase TC_rsl_ms_pwr_ctrl() runs on test_CT {
+ var ConnHdlr vc_conn;
+ var ConnHdlrPars pars;
+ f_init(testcasename());
+
+ for (var integer tn := 1; tn <= 4; tn := tn+1) {
+ pars := valueof(t_Pars(t_RslChanNr_Bm(tn), ts_RSL_ChanMode_SIGN));
+ vc_conn := f_start_handler(refers(f_tc_rsl_ms_pwr_ctrl), pars);
+ vc_conn.done;
+ }
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
/* Test if a channel without valid uplink bursts generates RSL CONN FAIL IND (TS 48.058 4.10) */
private function f_TC_conn_fail_crit(charstring id) runs on ConnHdlr {
@@ -4128,7 +4198,6 @@ testcase TC_chopped_ipa_payload() runs on test_CT {
* check DEACTIVATE SACCH
** unsupported algorithm
* handover detection
-* MS Power Control
* BS Power Control
* Physical Context
* CCCH Load Indication for RACH
@@ -4164,6 +4233,7 @@ control {
execute( TC_meas_res_sign_sdcch4() );
execute( TC_meas_res_sign_sdcch8() );
execute( TC_meas_res_sign_tchh_toa256() );
+ execute( TC_rsl_ms_pwr_ctrl() );
execute( TC_conn_fail_crit() );
execute( TC_paging_imsi_80percent() );
execute( TC_paging_tmsi_80percent() );
diff --git a/bts/expected-results.xml b/bts/expected-results.xml
index 73de1fb..bad4d6f 100644
--- a/bts/expected-results.xml
+++ b/bts/expected-results.xml
@@ -17,6 +17,7 @@
<testcase classname='BTS_Tests' name='TC_meas_res_sign_sdcch4' time='MASKED'/>
<testcase classname='BTS_Tests' name='TC_meas_res_sign_sdcch8' time='MASKED'/>
<testcase classname='BTS_Tests' name='TC_meas_res_sign_tchh_toa256' time='MASKED'/>
+ <testcase classname='BTS_Tests' name='TC_rsl_ms_pwr_ctrl' time='MASKED'/>
<testcase classname='BTS_Tests' name='TC_conn_fail_crit' time='MASKED'/>
<testcase classname='BTS_Tests' name='TC_paging_imsi_80percent' time='MASKED'/>
<testcase classname='BTS_Tests' name='TC_paging_tmsi_80percent' time='MASKED'/>
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index cd4ba58..3b1a311 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -1318,6 +1318,18 @@ template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifie
}
}
+ /* 8.4.15: BTS <- BSC */
+ template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
+ template (value) RSL_IE_MS_Power ms_power) := {
+ msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+ msg_type := RSL_MT_MS_POWER_CONTROL,
+ ies := {
+ t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
+ t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
+ /* One optional IE: MS POWER PARAMETERS */
+ }
+ }
+
/* 8.4.19 BTS -> BSC */
template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),