Change in osmo-ttcn3-hacks[master]: bts: Introduce test TC_tx_power_start_ramp_up_bcch

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/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Jun 9 10:54:05 UTC 2020


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18654 )

Change subject: bts: Introduce test TC_tx_power_start_ramp_up_bcch
......................................................................

bts: Introduce test TC_tx_power_start_ramp_up_bcch

This test verifies power ramping (up) is working fine during BTS
startup.

config files are updated to make sense:
* "nominal power" in osmo-bsc.cfg reflects correct default nominal tx
  power of fake_trx.
* "osmotrx tx-attenuation" in osmo-bts.cfg is removed to let osmo-bts
  use the value received through OML (max_power_red 20).
* "power-ramp step-size" in osmo-bts.cfg is increased to speed up the
  test. There's no good reason to keep it lower.

Change-Id: Ieb7444c6312bbeab64da2732393b3facf3e1f003
---
M bts/BTS_Tests.ttcn
M bts/osmo-bsc.cfg
M bts/osmo-bts.cfg
3 files changed, 82 insertions(+), 3 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 8a297fb..012327e 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -100,6 +100,8 @@
 	integer mp_rxlev_exp := 57;
 	integer mp_ul_rxlev_exp := 10;
 	integer mp_ms_power_level_exp := 7;
+	integer mp_bts_tx_nom_pwr_exp := 50; /* Expected Tx Nominal Output Power of the BTS, in dBm */
+	integer mp_bts_tx_pwr_att_exp := 20; /* Expected Tx Power attenuation wrt to Tx Nominal Output Power, in dB */
 	integer mp_ms_actual_ta_exp := 0;
 	integer mp_timing_offset_256syms_exp := 512;
 	/* Time to wait for RSL conn from BTS during startup of test */
@@ -2017,6 +2019,83 @@
 	f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
 }
 
+/* Verify Tx power reduction and ramping up during BTS bring up */
+function f_TC_tx_power_start_ramp_up_bcch(charstring id) runs on ConnHdlr {
+	var L1ctlDlMessage l1_dl;
+	f_l1_tune(L1CTL);
+	RSL.clear;
+
+	var integer initial_rx_lvl := -1;
+	var integer last_rx_lvl := -1;
+	var integer max_rx_lvl := mp_bts_tx_nom_pwr_exp - mp_bts_tx_pwr_att_exp;
+
+	timer T := 2.0;
+	alt {
+	[] L1CTL.receive(tr_L1CTL_DATA_IND(t_RslChanNr_BCCH(0), ?)) -> value l1_dl {
+		var GsmRxLev rx_lvl := l1_dl.dl_info.rx_level;
+		log("Received rx_level=", rx_lvl);
+		if (initial_rx_lvl == -1) {
+			initial_rx_lvl := rx_lvl;
+			last_rx_lvl := rx_lvl;
+
+			/* Expect a somehow low value during first received messages */
+			if (initial_rx_lvl >= max_rx_lvl / 2) {
+				Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+							log2str("Detected high initial tx power during ramp up: ",
+								initial_rx_lvl , ", full power is", max_rx_lvl));
+			}
+		}
+
+		/* received Rx level bigger than maximum allowed power by CN */
+		if (rx_lvl > max_rx_lvl) {
+			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+						log2str("Detected Tx power higher than full power: ",
+							rx_lvl , " > ", max_rx_lvl));
+		}
+
+		/* Make sure it never decreases, since we are rumping up */
+		if (last_rx_lvl > rx_lvl) {
+			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+						log2str("Detected Tx power decrease during ramp up: ",
+							last_rx_lvl , " -> ", rx_lvl));
+		}
+
+		if (rx_lvl == max_rx_lvl and not T.running) {
+			/* We reached the maximum power, start timer and receive
+			/* a few more to make sure we don't surpass it */
+			log("Reached full power, wating a bit more until success");
+			T.start;
+		}
+
+		last_rx_lvl := rx_lvl;
+		repeat;
+		}
+	[] L1CTL.receive { repeat; }
+	[] T.timeout { }
+	}
+
+	/* We didn't increase tx power during ramp up */
+	if (initial_rx_lvl < last_rx_lvl) {
+		log("Tx power increased during ramp up: ", initial_rx_lvl , " -> ", last_rx_lvl);
+	} else {
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+					log2str("No Tx power increase during whole ramp up: ",
+						initial_rx_lvl , " -> ", last_rx_lvl));
+	}
+
+	setverdict(pass);
+}
+testcase TC_tx_power_start_ramp_up_bcch() runs on test_CT {
+	var ConnHdlr vc_conn;
+	var ConnHdlrPars pars;
+	f_init();
+	pars := valueof(t_Pars(t_RslChanNr_Bm(0), ts_RSL_ChanMode_SIGN));
+	vc_conn := f_start_handler(refers(f_TC_tx_power_start_ramp_up_bcch), pars,
+				   pcu_comp := false, trxc_comp := true);
+	vc_conn.done;
+	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
+
 function f_check_meas_bs_power_level(integer level) runs on ConnHdlr {
 	timer T := 8.0;
 	T.start;
@@ -6434,6 +6513,7 @@
 	execute( TC_meas_res_sign_sdcch4() );
 	execute( TC_meas_res_sign_sdcch8() );
 	execute( TC_meas_res_sign_tchh_toa256() );
+	execute( TC_tx_power_start_ramp_up_bcch() );
 	execute( TC_rsl_bs_pwr_static_ass() );
 	execute( TC_rsl_bs_pwr_static_power_control() );
 	execute( TC_rsl_ms_pwr_ctrl() );
diff --git a/bts/osmo-bsc.cfg b/bts/osmo-bsc.cfg
index 3b31eb7..9025fe4 100644
--- a/bts/osmo-bsc.cfg
+++ b/bts/osmo-bsc.cfg
@@ -106,7 +106,7 @@
   trx 0
    rf_locked 0
    arfcn 871
-   nominal power 23
+   nominal power 50
    max_power_red 20
    rsl e1 tei 0
    timeslot 0
diff --git a/bts/osmo-bts.cfg b/bts/osmo-bts.cfg
index a9867bf..c2cd0bd 100644
--- a/bts/osmo-bts.cfg
+++ b/bts/osmo-bts.cfg
@@ -28,7 +28,6 @@
  osmotrx rts-advance 5
  instance 0
   osmotrx rx-gain 10
-  osmotrx tx-attenuation 0
 bts 0
  band DCS1800
  ipa unit-id 1234 0
@@ -49,7 +48,7 @@
  pcu-socket /tmp/pcu_sock
  trx 0
   power-ramp max-initial 0 mdBm
-  power-ramp step-size 2000 mdB
+  power-ramp step-size 8000 mdB
   power-ramp step-interval 1
   ms-power-control dsp
   phy 0 instance 0

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18654
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: Ieb7444c6312bbeab64da2732393b3facf3e1f003
Gerrit-Change-Number: 18654
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200609/735f956c/attachment.htm>


More information about the gerrit-log mailing list