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
This commit is contained in:
Vadim Yanitskiy 2020-05-22 20:15:48 +07:00
parent 16e24aa4e7
commit 4f56d329b0
1 changed files with 70 additions and 1 deletions

View File

@ -7,7 +7,7 @@ module PCU_Tests {
those NS and BSSGP implementations on the BSS (PCU) side. */
/* (C) 2018-2019 Harald Welte <laforge@gnumonks.org>
* (C) 2019 Vadim Yanitskiy <axilirator@gmail.com>
* (C) 2019-2020 Vadim Yanitskiy <axilirator@gmail.com>
* All rights reserved.
*
* Released under the terms of GNU General Public License, Version 2 or
@ -1764,6 +1764,74 @@ testcase TC_egprs_pkt_chan_req_two_phase() runs on RAW_PCU_Test_CT {
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 @@ control {
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() );
}