Extend BTS_Tests.ttcn with test for RSL channel activation with static MS Power

Change-Id: Icecf18c77bfe8b049cc0896c4c5b441187be1c0e
Related: OS##3750
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 968ed6c..066aba0 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -1990,6 +1990,48 @@
 	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
 }
 
+/* establish DChan, verify that the BTS sets MS power in the first SACCH L1 header. */
+function f_tc_rsl_chan_initial_ms_pwr(charstring id) runs on ConnHdlr {
+	var L1ctlDlMessage l1_dl;
+	var uint5_t ms_power_level := 7;
+
+	var RSL_IE_MS_Power ms_power;
+	ms_power.reserved := 0;
+	ms_power.fpc_epc := false;
+	ms_power.power_level := ms_power_level;
+
+	f_l1_tune(L1CTL);
+	RSL.clear;
+
+	f_est_dchan(more_ies :={valueof(t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power}))} );
+
+	timer T := 1.0;
+	T.start;
+	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.. */
+		if (not (l1_dl.payload.data_ind.payload[0] == int2oct(ms_power_level, 1))) {
+			setverdict(fail, "Power Level in L1 header does not match the signaled (RSL) MS Power Level.");
+		}
+		}
+	/* Ignore all other blocks */
+	[] L1CTL.receive { repeat; }
+	[] T.timeout {
+		setverdict(fail, "Power Level in L1 header does not match the signaled (RSL) MS Power Level.");
+		}
+	}
+
+	f_rsl_chan_deact();
+	f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
+	setverdict(pass);
+}
+
+testcase TC_rsl_chan_initial_ms_pwr() runs on test_CT {
+	var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
+	f_testmatrix_each_chan(pars, refers(f_tc_rsl_chan_initial_ms_pwr));
+}
+
 /* 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 {
 	f_l1_tune(L1CTL);
@@ -5200,6 +5242,7 @@
 	execute( TC_meas_res_sign_sdcch8() );
 	execute( TC_meas_res_sign_tchh_toa256() );
 	execute( TC_rsl_ms_pwr_ctrl() );
+	execute( TC_rsl_chan_initial_ms_pwr() );
 	execute( TC_rsl_chan_initial_ta() );
 	execute( TC_conn_fail_crit() );
 	execute( TC_paging_imsi_80percent() );