Change in ...osmo-ttcn3-hacks[master]: BTS: BS power tests

Hoernchen gerrit-no-reply at lists.osmocom.org
Tue Jun 18 15:08:47 UTC 2019


Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14507


Change subject: BTS: BS power tests
......................................................................

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
---
M bts/BTS_Tests.ttcn
M library/RSL_Types.ttcn
2 files changed, 115 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/07/14507/1

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 @@
 	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 @@
 	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 @@
 		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 @@
 		}
 	}
 
+	/* 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),

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14507
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: If91fb57b4070c60bb277d0b55d69ee3dde47ee48
Gerrit-Change-Number: 14507
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190618/21551a93/attachment.html>


More information about the gerrit-log mailing list