Change in osmo-ttcn3-hacks[master]: bts: Add TC_sacch_chan_act() to test SACCH INFO at RSL CHAN ACT

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon May 20 19:40:50 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/14089 )

Change subject: bts: Add TC_sacch_chan_act() to test SACCH INFO at RSL CHAN ACT
......................................................................

bts: Add TC_sacch_chan_act() to test SACCH INFO at RSL CHAN ACT

According to 3GPP Ts 48.058, every logical channel can receive some
specific SACCH filling at the time of RSL channel activation.  This
overrides the global SACCH FILLING.

Related: OS#3750
Change-Id: I8adb371a7e0b80792dd2fa35e5204802068df5ba
---
M bts/BTS_Tests.ttcn
M library/RSL_Types.ttcn
2 files changed, 82 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 5b69b5d..0ee3cd4 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -497,7 +497,7 @@
 	var RSL_Message rx := f_rsl_transceive_ret(tx, exp_rx, id, ignore_other);
 }
 
-function f_rsl_chan_act(RSL_IE_ChannelMode mode, boolean encr_enable := false)
+function f_rsl_chan_act(RSL_IE_ChannelMode mode, boolean encr_enable := false, RSL_IE_List more_ies := {})
 runs on ConnHdlr {
 	var RSL_Message ch_act := valueof(ts_RSL_CHAN_ACT(g_chan_nr, mode));
 	if (encr_enable) {
@@ -507,6 +507,7 @@
 		ch_act.ies := ch_act.ies & { valueof(t_RSL_IE(RSL_IE_ENCR_INFO, RSL_IE_Body:{encr_info :=
 encr_info})) };
 	}
+	ch_act.ies := ch_act.ies & more_ies;
 	f_rsl_transceive(ch_act, tr_RSL_CHAN_ACT_ACK(g_chan_nr), "RSL CHAN ACT");
 }
 
@@ -960,7 +961,52 @@
 	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
 }
 
-/* TODO: Test for SACCH information present in RSL CHAN ACT (overrides FILLING) */
+/* Test for SACCH information present in RSL CHAN ACT (overrides FILLING) */
+private function f_TC_sacch_chan_act(charstring id) runs on ConnHdlr {
+	var octetstring si5 := f_rnd_octstring(19);
+	var octetstring si6 := f_rnd_octstring(19);
+	var octetstring si5_specific := f_rnd_octstring(19);
+	var octetstring si6_specific := f_rnd_octstring(19);
+
+	/* First, configure both SI5 and SI6 to be transmitted */
+	RSL.send(ts_RSL_SACCH_FILL(RSL_SYSTEM_INFO_5, si5));
+	RSL.send(ts_RSL_SACCH_FILL(RSL_SYSTEM_INFO_6, si6));
+
+	f_l1_tune(L1CTL);
+	RSL.clear;
+
+	/* activate channel with different SACCH filling */
+	var RSL_SacchInfo sacch_info := valueof(ts_RSL_SacchInfo({
+				ts_RSL_SacchInfoElem(RSL_SYSTEM_INFO_5, si5_specific),
+				ts_RSL_SacchInfoElem(RSL_SYSTEM_INFO_6, si6_specific)
+				}));
+	var RSL_IE_List addl_ies := { valueof(t_RSL_IE(RSL_IE_SACCH_INFO,
+							RSL_IE_Body:{sacch_info := sacch_info})) };
+	f_est_dchan(more_ies := addl_ies);
+
+	/* check that SACCH actually are received as expected */
+	f_sacch_present(si5_specific);
+	f_sacch_present(si6_specific);
+
+	/* release the channel */
+	f_rsl_chan_deact();
+	f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
+}
+testcase TC_sacch_chan_act() runs on test_CT {
+	var ConnHdlr vc_conn;
+	var ConnHdlrPars pars;
+	f_init();
+
+	for (var integer i := 0; i < sizeof(g_AllChannels); i := i+1) {
+		pars := valueof(t_Pars(g_AllChannels[i], ts_RSL_ChanMode_SIGN));
+		log(testcasename(), ": Starting for ", g_AllChannels[i]);
+		vc_conn := f_start_handler(refers(f_TC_sacch_chan_act), pars);
+		vc_conn.done;
+	}
+	/* TODO: do the above in parallel, rather than sequentially? */
+	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
+
 /* TODO: Test for SACCH transmission rules in the context of special CHAN ACT (HO) */
 
 
@@ -1386,7 +1432,7 @@
 }
 
 /* Establish dedicated channel: L1CTL + RSL side */
-private function f_est_dchan(boolean encr_enable := false) runs on ConnHdlr {
+private function f_est_dchan(boolean encr_enable := false, RSL_IE_List more_ies := {}) runs on ConnHdlr {
 	var GsmFrameNumber fn;
 	var ImmediateAssignment imm_ass;
 	var integer ra := 23;
@@ -1395,7 +1441,7 @@
 	fn := f_rach_req_wait_chan_rqd(ra);
 
 	/* Activate channel on BTS side */
-	f_rsl_chan_act(g_pars.chan_mode, encr_enable);
+	f_rsl_chan_act(g_pars.chan_mode, encr_enable, more_ies);
 
 	/* Send IMM.ASS via CCHAN */
 	var ChannelDescription ch_desc := {
@@ -4418,6 +4464,7 @@
 	execute( TC_sacch_info_mod() );
 	execute( TC_sacch_multi() );
 	execute( TC_sacch_multi_chg() );
+	execute( TC_sacch_chan_act() );
 	execute( TC_rach_content() );
 	execute( TC_rach_count() );
 	execute( TC_rach_max_ta() );
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index 39ba3d3..0d772b3 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -565,6 +565,35 @@
 		cause_ext := omit
 	}
 
+	/* 9.3.29 */
+	type record RSL_SacchInfo {
+		uint8_t len,
+		uint8_t num_msgs,
+		RSL_SacchInfoElements elems
+	} with {
+		variant (len) "LENGTHTO(num_msgs,elems)";
+		variant (num_msgs) "LENGTHTO(elems)";
+		variant (num_msgs) "UNIT(elements)"
+	};
+	type record RSL_SacchInfoElement {
+		RSL_IE_SysinfoType si_type,
+		uint8_t len,
+		octetstring msg
+	} with {
+		variant (len) "LENGTHTO(msg)";
+	};
+	type record of RSL_SacchInfoElement RSL_SacchInfoElements;
+	template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
+		len := 0, /* overwritten */
+		num_msgs := 0, /* overwritten */
+		elems := elems
+	}
+	template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
+		si_type := tp,
+		len := lengthof(msg),
+		msg := msg
+	}
+
 	/* 9.3.40 */
 	type enumerated RSL_ChanNeeded {
 		RSL_CHANNEED_ANY	('00'B),
@@ -703,6 +732,7 @@
 		RSL_IE_ChanNeeded	chan_needed,
 		RSL_IE_CbCommandType	cb_cmd_type,
 		RSL_LV			smscb_message,
+		RSL_SacchInfo		sacch_info,
 
 		RSL_IE_StartingTime	starting_time,
 		RSL_IE_EncryptionInfo	encr_info,
@@ -755,6 +785,7 @@
 					chan_needed, iei = RSL_IE_CHAN_NEEDED;
 					cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
 					smscb_message, iei = RSL_IE_SMSCB_MSG;
+					sacch_info, iei = RSL_IE_SACCH_INFO;
 					starting_time, iei = RSL_IE_STARTNG_TIME;
 					encr_info, iei = RSL_IE_ENCR_INFO;
 

-- 
To view, visit https://gerrit.osmocom.org/14089
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8adb371a7e0b80792dd2fa35e5204802068df5ba
Gerrit-Change-Number: 14089
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190520/82c6180a/attachment.html>


More information about the gerrit-log mailing list