This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
fixeria gerrit-no-reply at lists.osmocom.orgfixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21491 ) Change subject: BTS_Tests: add test cases for dynamic BS power control ...................................................................... BTS_Tests: add test cases for dynamic BS power control Change-Id: Ia4c188aa923b10833162bdeb21238444193df65c Related: SYS#4918 --- M bts/BTS_Tests.ttcn 1 file changed, 168 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/91/21491/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 94bb0d6..d303257 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -103,6 +103,8 @@ integer mp_timing_offset_256syms_exp := 512; integer mp_uplink_power_target := -75; integer mp_uplink_power_hysteresis := 8; /* -83 .. -67 */ + integer mp_downlink_power_target := -80; + integer mp_downlink_power_hysteresis := 5; /* -85 .. -75 */ /* Time to wait for RSL conn from BTS during startup of test */ float mp_ipa_up_timeout := 15.0; float mp_ipa_up_delay := 0.0; @@ -1881,7 +1883,7 @@ /* According to 3GPP TS 44.018, section 10.5.2.20, we should pad with zeroes */ var octetstring l2 := f_pad_oct(enc_LapdmFrameAB(valueof(lb)), 21, '00'O); - log("Sending Measurement Report: ", l1h, l2); + log("Sending Measurement Report: ", l1h, lb); L1CTL.send(ts_L1CTL_DATA_REQ_SACCH(g_chan_nr, ts_RslLinkID_SACCH(0), l1h, l2)); if (do_loop) { repeat; } @@ -7155,6 +7157,171 @@ Misc_Helpers.f_shutdown(__BFILE__, __LINE__); } +private type record of DlPwrStep DlPwrTest; +private type record DlPwrStep { + /* Expected power reduction level */ + integer txred_exp, + /* Indicated measurement values */ + record { + boolean valid, + MeasElem full, + MeasElem sub + } meas +}; + +private template (present) DlPwrStep.meas +tp_DlPwrMeasFS(integer rxlev_full, + integer rxlev_sub, + uint3_t rxqual_full := 0, + uint3_t rxqual_sub := 0, + boolean valid := true) := { + valid := valid, + full := { rxlev_full, rxqual_full }, + sub := { rxlev_sub, rxqual_sub } +} + +/* Shortcut for FULL == SUB */ +private template (present) DlPwrStep.meas +tp_DlPwrMeas(integer rxlev, + uint3_t rxqual := 0, + boolean valid := true) := + tp_DlPwrMeasFS(rxlev, rxlev, rxqual, rxqual, valid); + +private function f_TC_bs_pwr_ctrl_common(template (present) DlPwrTest tests) +runs on ConnHdlr { + var integer num_steps := lengthof(tests); + timer T := 2.0 + 0.5 * int2float(num_steps); + var integer rxlev_sum := 0; + var integer rxlev_num := 0; + var L1ctlDlMessage l1_dl; + var integer step := -1; + + f_l1_tune(L1CTL); + RSL.clear; + + /* These IEs are needed for autonomous BS power control */ + var template (value) RSL_IE_List ies := { + t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ + /* NOTE: this is actually power reduction (2 dB steps) */ + bs_power := ts_RSL_IE_BS_Power(10) /* up to 20 dB */ + }), + t_RSL_IE(RSL_IE_BS_POWER_PARAM, RSL_IE_Body:{ + /* vendor-specific stuff */ + bs_power_params := ts_RSL_LV(''O) + }) + }; + + /* These values will be indicated in the first SACCH block */ + g_pars.l1_pars.meas_ul.full := valueof(tests[0].meas.full); + g_pars.l1_pars.meas_ul.sub := valueof(tests[0].meas.sub); + g_pars.l1_pars.meas_valid := valueof(tests[0].meas.valid); + + /* Establish a dedicated channel */ + f_est_dchan(more_ies := valueof(ies)); + + T.start; + alt { + /* Align to the first DL SACCH block, this is where we start collecting samples */ + [step == -1] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) { + log("Step #", step, ": aligned to the first DL SACCH block"); + step := step + 1; + } + /* This altstep collects RxLev samples from all received DCCH/FACCH blocks */ + [step >= 0] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_DCCH(?))) -> value l1_dl { + log("Step #", step, ": new RxLev sample ", l1_dl.dl_info.rx_level); + rxlev_sum := rxlev_sum + l1_dl.dl_info.rx_level; + rxlev_num := rxlev_num + 1; + repeat; + } + /* This altstep sends Measurement Reports with tests[step].meas */ + [step >= 0] as_l1_sacch(do_loop := false) { + log("Step #", step, ": indicated ", tests[step].meas); + + var integer rxlev_avg := rxlev_sum / rxlev_num; + var integer txred := mp_rxlev_exp - rxlev_avg; + + log("Step #", step, ": checking rxlev_avg := ", rxlev_avg, " ", + "(txred := ", txred, " vs expected ", tests[step].txred_exp, ")"); + + if (not match(txred, tests[step].txred_exp)) { + setverdict(fail, "DL attenuation ", txred, " dB does not ", + "match ", tests[step].txred_exp, " at step #", step); + } + + step := step + 1; + + if (step < num_steps) { + /* These values will be indicated in the next UL SACCH block */ + g_pars.l1_pars.meas_ul.full := valueof(tests[step].meas.full); + g_pars.l1_pars.meas_ul.sub := valueof(tests[step].meas.sub); + g_pars.l1_pars.meas_valid := valueof(tests[step].meas.valid); + + rxlev_sum := 0; + rxlev_num := 0; + repeat; + } + } + /* At this step, tests[0].meas is received by the IUT */ + [false] L1CTL.receive(tr_L1CTL_MsgType(L1CTL_DATA_CONF)) { + var integer rxlev_avg := rxlev_sum / rxlev_num; + var integer txred := mp_rxlev_exp - rxlev_avg; + + log("Step #", step, ": checking rxlev_avg := ", rxlev_avg, " ", + "(txred := ", txred, " vs expected ", tests[step].txred_exp, ")"); + + if (not match(txred, tests[step].txred_exp)) { + setverdict(fail, "DL attenuation ", txred, " dB does not ", + "match ", tests[step].txred_exp, " at step #", step); + } + + rxlev_sum := 0; + rxlev_num := 0; + } + [] L1CTL.receive { repeat; } + [] T.timeout { + setverdict(fail, "Timeout at step #", step, " ", tests[step]); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + } + + setverdict(pass); +} + +private function f_TC_bs_pwr_ctrl(charstring id) +runs on ConnHdlr { + f_TC_bs_pwr_ctrl_common(DlPwrTest:{ + { txred_exp := ?, meas := tp_DlPwrMeas(mp_rxlev_exp) }, + { txred_exp := 0, meas := tp_DlPwrMeas(mp_rxlev_exp) }, + { txred_exp := 0, meas := tp_DlPwrMeas(mp_rxlev_exp) }, + { txred_exp := 0, meas := tp_DlPwrMeas(mp_rxlev_exp) }, + { txred_exp := 0, meas := tp_DlPwrMeas(mp_rxlev_exp) } + }); +} +testcase TC_bs_pwr_ctrl() runs on test_CT { + var ConnHdlr vc_conn; + var ConnHdlrPars pars; + + f_init(trx_nr := 1); + + /* Explicitly disable DL Power filtering for this set of tests */ + f_vty_config(BTSVTY, "bts 0", "no downlink-power-filtering"); + /* Explicitly configure the Downlink power range (target and hysteresis) */ + f_vty_config(BTSVTY, "bts 0", "downlink-power-target " & int2str(mp_downlink_power_target) + & " hysteresis " & int2str(mp_downlink_power_hysteresis)); + + /* Wait until Pau ramping is completed */ + f_sleep(4.0); + + /* Pick any timeslot/subslot on TRX1 (TODO: use g_AllChanTypes) */ + pars := valueof(t_Pars(g_AllChannels[0], ts_RSL_ChanMode_SIGN, 1)); + + vc_conn := f_start_handler(refers(f_TC_bs_pwr_ctrl), pars); + vc_conn.done; + + /* No need to reset Uplink power parameters - the IUT restarts anyway */ + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); +} + private function f_TC_speech_no_rtp(charstring id) runs on ConnHdlr { var template L1ctlDlMessage tr_bad_frame; var L1ctlDlMessage l1_dl; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21491 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia4c188aa923b10833162bdeb21238444193df65c Gerrit-Change-Number: 21491 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201203/5fda9917/attachment.htm>