Change in osmo-ttcn3-hacks[master]: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Tue Apr 23 14:49:38 UTC 2019


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13735 )

Change subject: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH
......................................................................

BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH

According to 3GPP TS 04.60, section 11.2.5a, the extended (11-bit)
Access Burst on RACH/PRACH is used by the MS to indicate its EGPRS
capability. One of the alternative synch. sequences (see 3GPP TS
05.02, TS1 and TS2) shall be used.

Add a test case to verify extended (11-bit) RACH decoding.

Depends: (OsmocomBB) I36fd20cd5502ce33c52f644ee4c22abb83350df8
Change-Id: I8fe156aeac9de3dc1e71a4950821d4942ba9a253
Related: OS#1854
---
M bts/BTS_Tests.ttcn
M bts/expected-results.xml
M library/L1CTL_PortType.ttcn
3 files changed, 88 insertions(+), 0 deletions(-)

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



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index e617323..711947a 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -989,6 +989,12 @@
 	return ra;
 }
 
+/* generate a random 11-bit RA (packet-switched only) */
+private function f_rnd_ra11_ps() return BIT11 {
+	var integer ra11 := f_rnd_int(bit2int('11111111111'B));
+	return int2bit(ra11, 11);
+}
+
 /* Send 1000 RACH requests and check their RA+FN on the RSL side */
 testcase TC_rach_content() runs on test_CT {
 	f_init(testcasename());
@@ -2969,6 +2975,64 @@
 	setverdict(pass);
 }
 
+/* Send extended (11-bit, TS1 & TS2) RACH bursts from the Um side,
+ * expect them to show up on PCU socket (with proper BURST_TYPE_*). */
+testcase TC_pcu_ext_rach_content() runs on test_CT {
+	var template PCUIF_Message pcu_rach_ind;
+	var GsmFrameNumber fn_last := 0;
+	var L1ctlRachSynchSeq synch_seq;
+	var PCUIF_BurstType pcu_bt;
+	var GsmFrameNumber fn;
+	var BIT11 ra11;
+
+	f_init_pcu_test();
+	f_init_l1ctl();
+	f_l1_tune(L1CTL);
+
+	for (var integer i := 0; i < 1000; i := i+1) {
+		/* We need to test both TS1 & TS2 */
+		if (i rem 2 == 0) {
+			synch_seq := RACH_SYNCH_SEQ_TS1;
+			pcu_bt := BURST_TYPE_1;
+		} else {
+			synch_seq := RACH_SYNCH_SEQ_TS2;
+			pcu_bt := BURST_TYPE_2;
+		}
+
+		ra11 := f_rnd_ra11_ps();
+		fn := f_L1CTL_EXT_RACH(L1CTL, bit2int(ra11), synch_seq);
+		if (fn == fn_last) {
+			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+						"Two RACH in same FN?!?");
+		}
+		fn_last := fn;
+
+		/* Compose the expected message */
+		pcu_rach_ind := tr_PCUIF_RACH_IND(
+			bts_nr := 0,
+			ra := bit2int(ra11),
+			is_11bit := 1,
+			burst_type := pcu_bt,
+			fn := fn);
+
+		timer T := 2.0;
+		T.start;
+		alt {
+		[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, pcu_rach_ind)) {
+			T.stop;
+			}
+		[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND)) {
+			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Unexpected RACH IND");
+			}
+		[] PCU.receive { repeat; }
+		[] T.timeout {
+			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for RACH IND");
+			}
+		}
+	}
+	setverdict(pass);
+}
+
 private function f_pad_oct(octetstring str, integer len, OCT1 pad) return octetstring {
 	var integer strlen := lengthof(str);
 	for (var integer i := 0; i < len-strlen; i := i+1) {
@@ -4311,6 +4375,7 @@
 		execute( TC_pcu_data_req_agch() );
 		execute( TC_pcu_data_req_imm_ass_pch() );
 		execute( TC_pcu_rach_content() );
+		execute( TC_pcu_ext_rach_content() );
 		execute( TC_pcu_paging_from_rsl() );
 	} else {
 		log("PCU socket path not available, skipping PCU tests");
diff --git a/bts/expected-results.xml b/bts/expected-results.xml
index 2eadffd..7d89da3 100644
--- a/bts/expected-results.xml
+++ b/bts/expected-results.xml
@@ -77,6 +77,7 @@
   <testcase classname='BTS_Tests' name='TC_pcu_data_req_agch' time='MASKED'/>
   <testcase classname='BTS_Tests' name='TC_pcu_data_req_imm_ass_pch' time='MASKED'/>
   <testcase classname='BTS_Tests' name='TC_pcu_rach_content' time='MASKED'/>
+  <testcase classname='BTS_Tests' name='TC_pcu_ext_rach_content' time='MASKED'/>
   <testcase classname='BTS_Tests' name='TC_pcu_paging_from_rsl' time='MASKED'/>
   <testcase classname='BTS_Tests' name='TC_dyn_osmo_pdch_act_deact' time='MASKED'/>
   <testcase classname='BTS_Tests' name='TC_dyn_osmo_pdch_unsol_deact' time='MASKED'/>
diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn
index 8e03c02..7dac4c3 100644
--- a/library/L1CTL_PortType.ttcn
+++ b/library/L1CTL_PortType.ttcn
@@ -87,6 +87,28 @@
 		return fn;
 	}
 
+	function f_L1CTL_EXT_RACH(
+		L1CTL_PT pt, uint16_t ra11, L1ctlRachSynchSeq seq,
+		uint8_t combined := 1, uint16_t offset := 0
+	) return GsmFrameNumber {
+		var L1ctlDlMessage rc;
+		var GsmFrameNumber fn;
+		timer T := 2.0;
+
+		T.start;
+		pt.send(ts_L1CTL_EXT_RACH_REQ(ra11, seq, combined, offset));
+		alt {
+			[] pt.receive(tr_L1CTL_RACH_CONF) -> value rc { fn := rc.dl_info.frame_nr };
+			[] pt.receive { repeat; };
+			[] T.timeout {
+				setverdict(fail, "Timeout in extended RACH");
+				mtc.stop;
+				}
+		}
+
+		return fn;
+	}
+
 	function f_L1CTL_PARAM(L1CTL_PT pt, uint8_t ta, uint8_t tx_power) {
 		pt.send(ts_L1CTL_PAR_REQ(ta, tx_power));
 	}

-- 
To view, visit https://gerrit.osmocom.org/13735
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: I8fe156aeac9de3dc1e71a4950821d4942ba9a253
Gerrit-Change-Number: 13735
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190423/c66342de/attachment.html>


More information about the gerrit-log mailing list