Change in osmo-ttcn3-hacks[master]: PCU: introduce TC_egprs_pkt_chan_req_reject_content

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 May 22 13:51:15 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18423 )


Change subject: PCU: introduce TC_egprs_pkt_chan_req_reject_content
......................................................................

PCU: introduce TC_egprs_pkt_chan_req_reject_content

The purpose of this test case is to verify the contents of RR
Immediate Assignment Reject message (and its IAR Rest Octets)
sent in response to EGPRS Packet Channel Request (11 bit RA).

To provoke the reject message, test case crafts an incorrect
EGPRS Packet Channel Request message ('111111xxxxx'B).

Note that at the time of writing this test, the IUT does not
handle EGPRS Packet Channel Request properly, so it fails.

Change-Id: I4bfd5621085d63896e2e9b70355524cf4285036a
Related: OS#1548
---
M pcu/PCU_Tests.ttcn
1 file changed, 70 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/23/18423/1

diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 22e3c1f..fb59c13 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -7,7 +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>
+ * (C) 2019-2020 Vadim Yanitskiy <axilirator at gmail.com>
  * All rights reserved.
  *
  * Released under the terms of GNU General Public License, Version 2 or
@@ -1764,6 +1764,74 @@
 	f_shutdown(__BFILE__, __LINE__, final := true);
 }
 
+private function f_TC_egprs_pkt_chan_req_reject(bitstring ra11, uint32_t fn,
+						template IARRestOctets rest := ?,
+						PCUIF_BurstType bt := BURST_TYPE_1)
+runs on RAW_PCU_Test_CT {
+	var template ReqRefWaitInd tr_ref;
+	var GsmRrMessage rr_msg;
+	var boolean ok;
+
+	/* Send RACH.ind with malformed EGPRS Packet Channel Request */
+	BTS.send(ts_PCUIF_RACH_IND(bts_nr := 0, trx_nr := 0, ts_nr := 0,
+				   ra := bit2int(ra11), is_11bit := 1,
+				   burst_type := bt, fn := fn,
+				   arfcn := 871));
+
+	/* Abuse f_pcuif_rx_imm_ass(): wait for Immediate Assignment Reject */
+	ok := f_pcuif_rx_imm_ass(rr_msg, t_imm_ass := tr_IMM_ASS_REJ);
+	if (not ok) {
+		setverdict(fail, "Failed to match Immediate Assignment Reject");
+		f_shutdown(__BFILE__, __LINE__);
+	}
+
+	/* Just to have a short-name reference to the actual message */
+	var ImmediateAssignmentReject iar := rr_msg.payload.imm_ass_rej;
+
+	/* Make sure that Request Reference list contains at least one entry
+	 * with our TDMA frame number, and RA is set to 'reserved' value 127. */
+	tr_ref := tr_ReqRefWaitInd(f_compute_ReqRef(127, fn));
+	if (not match(iar.payload, { *, tr_ref, * })) {
+		setverdict(fail, "Request Reference list does not match");
+		f_shutdown(__BFILE__, __LINE__);
+	}
+
+	/* Match Feature Indicator (must indicate PS domain) */
+	if (not match(iar.feature_ind, FeatureIndicator:{?, false, true})) {
+		setverdict(fail, "Feature Indicator does not match");
+		f_shutdown(__BFILE__, __LINE__);
+	}
+
+	/* Match IAR Rest Octets */
+	if (not match(iar.rest_octets, rest)) {
+		setverdict(fail, "IAR Rest Octets does not match: ",
+			   iar.rest_octets, " vs expected ", rest);
+		f_shutdown(__BFILE__, __LINE__);
+	}
+
+	setverdict(pass);
+}
+
+/* Verify the contents of RR Immediate Assignment Reject message and its
+ * Rest Octets sent in response to EGPRS Packet Channel Request (11 bit). */
+testcase TC_egprs_pkt_chan_req_reject_content() runs on RAW_PCU_Test_CT {
+	var template IARRestOctets rest;
+	var BIT5 ext_ra;
+
+	/* Initialize the PCU interface abstraction */
+	f_init_raw(testcasename());
+
+	for (var integer i := 0; i < 6; i := i + 1) {
+		ext_ra := int2bit(f_rnd_int(32), 5); /* 5 LSB's of RA11 */
+		rest := tr_IARRestOctets({ *, tr_ExtRAOpt(ext_ra), * });
+
+		/* Intentionally incorrect message (see table 11.2.5a.2) */
+		f_TC_egprs_pkt_chan_req_reject('111111'B & ext_ra, 1337 + i, rest);
+	}
+
+	f_shutdown(__BFILE__, __LINE__, final := true);
+}
+
 control {
 	execute( TC_pcuif_suspend() );
 	execute( TC_ta_ptcch_idle() );
@@ -1796,6 +1864,7 @@
 	execute( TC_egprs_pkt_chan_req_signalling() );
 	execute( TC_egprs_pkt_chan_req_one_phase() );
 	execute( TC_egprs_pkt_chan_req_two_phase() );
+	execute( TC_egprs_pkt_chan_req_reject_content() );
 
 	execute( TC_mo_ping_pong_with_ul_racap_egprs_only() );
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18423
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: I4bfd5621085d63896e2e9b70355524cf4285036a
Gerrit-Change-Number: 18423
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200522/e0f3d1d9/attachment.htm>


More information about the gerrit-log mailing list