Change in ...osmo-ttcn3-hacks[master]: PCU_Tests_RAW.ttcn: introduce TC_ta_rach_imm_ass to test initial TA

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.org
Fri Sep 27 03:17:56 UTC 2019


fixeria has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15410 )

Change subject: PCU_Tests_RAW.ttcn: introduce TC_ta_rach_imm_ass to test initial TA
......................................................................

PCU_Tests_RAW.ttcn: introduce TC_ta_rach_imm_ass to test initial TA

The aim of this test case is to test the correctness of Timing Advance
at the time of TBF establishment. In particular, the test case sends
several Access Bursts (RACH.ind) with increasing 'qta' value, what
causes OsmoPCU to allocate a TBF (Temporary Block Flow) for each
RACH.ind and send DATA.req with Immediate Assignment on AGCH,
containing the expected Timing Advance value.

Change-Id: I21f76ae723519c0eb54515922a05ca8045b00ade
Related: SYS#4606
---
M pcu/PCU_Tests_RAW.ttcn
1 file changed, 78 insertions(+), 0 deletions(-)

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



diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 8424df3..fa464a3 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -7,6 +7,7 @@
    those NS and BSSGP implementations on the BSS (PCU) side. */
 
 /* (C) 2018-2019 Harald Welte <laforge at gnumonks.org>
+ * (C) 2019 Vadim Yanitskiy <axilirator at gmail.com>
  * All rights reserved.
  *
  * Released under the terms of GNU General Public License, Version 2 or
@@ -519,6 +520,82 @@
 	BTS.receive(tr_RAW_PCU_EV(BTS_EV_SI13_NEGO));
 }
 
+/* FIXME: properly encode RA (see TS 24.060, table 11.2.5.2) */
+private function f_establish_tbf(out GsmRrMessage rr_imm_ass, uint8_t bts_nr := 0,
+				 uint16_t ra := oct2int('3A'O), uint8_t is_11bit := 0,
+				 PCUIF_BurstType burst_type := BURST_TYPE_0,
+				 TimingAdvance ta := 0)
+runs on RAW_PCU_Test_CT return boolean {
+	var PCUIF_Message pcu_msg;
+	var GsmRrMessage rr_msg;
+	var uint32_t fn;
+	timer T;
+
+	/* FIXME: ask the BTS component to give us the current TDMA fn */
+	fn := 1337 + ta;
+
+	/* Send RACH.ind */
+	log("Sending RACH.ind on fn=", fn, " with RA=", ra, ", TA=", ta);
+	BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr,
+				   ra := ra, is_11bit := is_11bit,
+				   burst_type := burst_type,
+				   fn := fn, arfcn := 871,
+				   qta := ta * 4));
+
+	/* Expect Immediate (TBF) Assignment on TS0/AGCH */
+	T.start(2.0);
+	alt {
+	[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := bts_nr, trx_nr := ?, ts_nr := 0,
+					 sapi := PCU_IF_SAPI_AGCH, data := ?))
+					-> value pcu_msg {
+		rr_imm_ass := dec_GsmRrMessage(pcu_msg.u.data_req.data);
+		log("Rx Immediate Assignment: ", rr_imm_ass);
+
+		/* Make sure this assignment is for us
+		 * TODO: Uplink or Downlink TBF? */
+		if (match(rr_imm_ass, tr_IMM_TBF_ASS(?, ra, fn))) {
+			setverdict(pass);
+			return true;
+		}
+
+		/* Not for us? Wait for more. */
+		repeat;
+		}
+	[] BTS.receive { repeat; }
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for Immediate Assignment");
+		}
+	}
+
+	return false;
+}
+
+/* Test of correct Timing Advance at the time of TBF establishment
+ * (derived from timing offset of the Access Burst). */
+testcase TC_ta_rach_imm_ass() runs on RAW_PCU_Test_CT {
+	var GsmRrMessage rr_msg;
+	var boolean ok;
+
+	/* Initialize the PCU interface abstraction */
+	f_init_raw(testcasename());
+
+	/* We cannot send too many TBF requests in a short time because
+	 * at some point the PCU will fail to allocate a new TBF. */
+	for (var TimingAdvance ta := 0; ta < 64; ta := ta + 16) {
+		/* Establish an Uplink TBF (send RACH.ind with current TA) */
+		ok := f_establish_tbf(rr_msg, bts_nr := 0, ta := ta);
+		if (not ok) {
+			setverdict(fail, "Failed to establish an Uplink TBF");
+			mtc.stop;
+		}
+
+		/* Make sure Timing Advance IE matches out expectations */
+		if (match(rr_msg, tr_IMM_TBF_ASS(dl := false, ta := ta))) {
+			setverdict(pass);
+		}
+	}
+}
+
 
 control {
 	execute( TC_ns_reset() );
@@ -531,6 +608,7 @@
 	execute( TC_ns_so_block() );
 
 	execute( TC_pcuif_suspend() );
+	execute( TC_ta_rach_imm_ass() );
 }
 
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15410
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: I21f76ae723519c0eb54515922a05ca8045b00ade
Gerrit-Change-Number: 15410
Gerrit-PatchSet: 11
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
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/20190927/f394fbf7/attachment.htm>


More information about the gerrit-log mailing list