pcu: Introduce test TC_multitrx_multims_alloc

Related: OS#1775
Change-Id: I6b20fded6b2a1896fb7ec47c7c5dcbdcbe27f771
This commit is contained in:
Pau Espin 2020-10-22 18:06:07 +02:00
parent b88f21cc84
commit bfd69f6133
3 changed files with 63 additions and 5 deletions

View File

@ -46,6 +46,15 @@ function f_gprs_blocksize(GprsCodingScheme cs) return integer {
}
}
const GprsTlli TLLI_UNUSED := 'FFFFFFFF'O;
function f_gen_tlli() return GprsTlli {
var GprsTlli tlli := f_rnd_octstring(4);
if (tlli == TLLI_UNUSED) {
tlli := 'EEEEEEEE'O;
}
return tlli;
}
/* 10.5.2.8 */
type enumerated ChannelNeeded {
CHAN_NEED_ANY (0),

View File

@ -121,7 +121,7 @@ const uint3_t USF_UNUSED := 7; /* used to indicate PRACH */
template (value) GprsMS t_GprsMS_def := {
imsi := f_gen_imsi(42),
tlli := '00000001'O,
tlli := f_gen_tlli(),
ra := bit2int(chan_req_def),
ra_is_11bit := 0,
burst_type := BURST_TYPE_0,
@ -147,16 +147,18 @@ type component MS_BTS_IFACE_CT {
/* Connection to the BTS component (one for now) */
port RAW_PCU_MSG_PT BTS;
/* Support only 1 ms for now */
var GprsMS g_ms[1];
/* Support only 8 ms for now */
var GprsMS g_ms[8];
/* Value at which Countdown Procedure starts. Announced by network (GPRS Cell Options as per TS 04.60 Chapter 12.24) */
var uint4_t g_bs_cv_max := 4;
}
function f_init_gprs_ms(template (value) GprsMS ms_params := t_GprsMS_def) runs on MS_BTS_IFACE_CT
function f_init_gprs_ms(integer num_ms := 1, template (value) GprsMS ms_params := t_GprsMS_def) runs on MS_BTS_IFACE_CT
{
g_ms[0] := valueof(ms_params);
for (var integer i := 0; i < num_ms; i := i + 1 ) {
g_ms[i] := valueof(ms_params);
}
}

View File

@ -2472,6 +2472,52 @@ testcase TC_pcuif_info_ind_subsequent() runs on RAW_PCU_Test_CT {
f_shutdown(__BFILE__, __LINE__, final := true);
}
/* Verify allocation of several MS along PDCH ts of several TRX. See OS#1775, SYS#5030 */
testcase TC_multitrx_multims_alloc() runs on RAW_PCU_Test_CT {
var PCUIF_info_ind info_ind;
var integer i;
const integer num_ms := 8;
/* Initialize NS/BSSGP side */
f_init_bssgp();
/* Initialize GPRS MS side */
f_init_gprs_ms(num_ms);
info_ind := valueof(ts_PCUIF_INFO_default);
/* Only the 3 first TRX are enabled. The enabled ones all have same
amount of resources, hence same amount of initial resources. */
for (i := 0; i < lengthof(info_ind.trx.v10); i := i + 1) {
info_ind.trx.v10[i].pdch_mask := '00000000'B;
}
info_ind.trx.v10[0].pdch_mask := '00000011'B;
info_ind.trx.v10[1].pdch_mask := '00001100'B;
info_ind.trx.v10[2].pdch_mask := '11000000'B;
/* Initialize the PCU interface abstraction */
f_init_raw(testcasename(), info_ind);
/* Establish BSSGP connection to the PCU */
f_bssgp_establish();
for (i := 0; i < num_ms; i := i + 1) {
f_bssgp_client_llgmm_assign(TLLI_UNUSED, g_ms[i].tlli);
}
/* Establish an Uplink TBF for each MS. They should be allocated on
different TRX in an uniform way. */
for (i := 0; i < num_ms; i := i + 1) {
f_ms_establish_ul_tbf(g_ms[i]);
var uint10_t arfcn := g_ms[i].ul_tbf.rr_imm_ass.payload.imm_ass.pkt_chan_desc.zero.arfcn;
if (arfcn != info_ind.trx.v10[i mod 3].arfcn) {
setverdict(fail, "Got assigned ARFCN ", arfcn, " vs exp ",
info_ind.trx.v10[i mod 3].arfcn);
f_shutdown(__BFILE__, __LINE__);
}
}
f_shutdown(__BFILE__, __LINE__, final := true);
}
control {
execute( TC_pcuif_suspend() );
execute( TC_ta_ptcch_idle() );
@ -2524,6 +2570,7 @@ control {
/* Packet Uplink/Downlink Assignment on PACCH */
execute( TC_pcuif_fh_pkt_ass_ul() );
execute( TC_pcuif_fh_pkt_ass_dl() );
execute( TC_multitrx_multims_alloc() );
}
execute( TC_pcuif_info_ind_subsequent() );