summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wild <ewild@sysmocom.de>2019-06-18 17:05:11 +0200
committerEric Wild <ewild@sysmocom.de>2019-06-18 17:08:09 +0200
commitae8f262651ffd5b753075ea40a1685584649b985 (patch)
treea6e5daefe859af1d3d987625385bb1584b6609f1
parentbc690ffcd3da5d867a2c930b9064d736c0d82fd7 (diff)
BTS: BS power tests
osmo-bts does currently not use the signaled lchan BS power level, nor does it update the BS power IE returned in the measurement results. Change-Id: If91fb57b4070c60bb277d0b55d69ee3dde47ee48
-rw-r--r--bts/BTS_Tests.ttcn95
-rw-r--r--library/RSL_Types.ttcn20
2 files changed, 115 insertions, 0 deletions
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 9d7b8c2..3b27469 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -1892,6 +1892,99 @@ function f_TC_meas_res_periodic(charstring id) runs on ConnHdlr {
f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
}
+function f_check_meas_bs_power_level(integer level) runs on ConnHdlr {
+ timer T := 8.0;
+ T.start;
+ var RSL_Message rsl;
+ alt {
+ [] as_l1_sacch();
+ [] L1CTL.receive { repeat; }
+ [] RSL.receive(tr_RSL_MEAS_RES(g_chan_nr, ?, ?, ?)) -> value rsl {
+ if (rsl.ies[3].body.bs_power.power_level == level) {
+ setverdict(pass)
+ } else {
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Received wrong BS power level in MEAS RES ", rsl));
+ }
+ }
+ [] T.timeout {
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "No MEAS RES received at all");
+ }
+ }
+}
+
+/* see if the rsl meas res contains our expeced bs power level
+bs power set during assignment */
+function f_TC_rsl_bs_pwr_static_ass(charstring id) runs on ConnHdlr {
+ f_l1_tune(L1CTL);
+ RSL.clear;
+
+ if (mp_bts_trxc_port != -1) {
+ f_trxc_fake_rssi(rxlev2dbm(mp_ul_rxlev_exp));
+ f_trxc_fake_toffs256(g_pars.l1_pars.timing_offset_256syms);
+ }
+
+ var uint5_t pwr_var := 1;
+ var template (value) RSL_IE_BS_Power bs_power := ts_RSL_IE_BS_Power(pwr_var);
+ var template (value) RSL_IE pwr := t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power});
+
+ f_est_dchan(more_ies :={valueof(pwr)});
+
+ f_check_meas_bs_power_level(pwr_var);
+
+ f_rsl_chan_deact();
+ f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
+}
+
+/* see if the rsl meas res contains our expeced bs power level
+bs power set after assignment */
+function f_TC_rsl_bs_pwr_static_power_control(charstring id) runs on ConnHdlr {
+ f_l1_tune(L1CTL);
+ RSL.clear;
+
+ if (mp_bts_trxc_port != -1) {
+ f_trxc_fake_rssi(rxlev2dbm(mp_ul_rxlev_exp));
+ f_trxc_fake_toffs256(g_pars.l1_pars.timing_offset_256syms);
+ }
+
+ var uint5_t pwr_var := 1;
+ var template (value) RSL_IE_BS_Power bs_power := ts_RSL_IE_BS_Power(pwr_var);
+
+ f_est_dchan();
+
+ RSL.send(ts_RSL_BS_PWR_CTRL(g_chan_nr, bs_power));
+
+ f_check_meas_bs_power_level(pwr_var);
+
+ f_rsl_chan_deact();
+ f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
+}
+
+testcase TC_rsl_bs_pwr_static_ass() runs on test_CT {
+ var ConnHdlr vc_conn;
+ var ConnHdlrPars pars;
+ f_init();
+ 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_bs_pwr_static_ass), pars,
+ pcu_comp := false, trxc_comp := true);
+ vc_conn.done;
+ }
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
+
+testcase TC_rsl_bs_pwr_static_power_control() runs on test_CT {
+ var ConnHdlr vc_conn;
+ var ConnHdlrPars pars;
+ f_init();
+ 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_bs_pwr_static_power_control), pars,
+ pcu_comp := false, trxc_comp := true);
+ vc_conn.done;
+ }
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
+
/* target level -100, first rssi -90, ms power 7, expected increase to 7+6 within 6 seconds,
second rssi -110, ms power 7+6, expected decrease to 7 within 6 seconds,
These power levels are valid for all bands and require no special handling */
@@ -6012,6 +6105,8 @@ control {
execute( TC_meas_res_sign_sdcch4() );
execute( TC_meas_res_sign_sdcch8() );
execute( TC_meas_res_sign_tchh_toa256() );
+ execute( TC_rsl_bs_pwr_static_ass() );
+ execute( TC_rsl_bs_pwr_static_power_control() );
execute( TC_rsl_ms_pwr_ctrl() );
execute( TC_rsl_ms_pwr_dyn_active() );
execute( TC_rsl_ms_pwr_dyn_active2() );
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index e8bb67f..87de9a4 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -390,6 +390,14 @@ module RSL_Types {
uint5_t power_level
}
+ template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint5_t power_level,
+ boolean epc := false, boolean fpc := false) := {
+ reserved := 0,
+ epc := epc,
+ fpc := fpc,
+ power_level := power_level
+ }
+
/* 9.3.7 */
type enumerated RSL_AlgId {
RSL_ALG_ID_A5_0 ('00000001'B),
@@ -1468,6 +1476,18 @@ template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifie
}
}
+ /* 8.4.16: BTS <- BSC */
+ template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
+ template (value) RSL_IE_BS_Power bs_power) := {
+ msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+ msg_type := RSL_MT_BS_POWER_CONTROL,
+ ies := {
+ t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
+ t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
+ /* One optional IE: BS 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),