aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-06-14 16:06:09 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-06-14 17:46:37 +0200
commit32a03ce688b5be2e82972afdc1d2078b41b19851 (patch)
tree952a85090b15873c8c16e9aa1d881a23fe1ffd35
parent3b33a6fe834b2171da540569625a7cad1e057ef2 (diff)
pcu: Introduce ANR related testspespin/anr2
-rw-r--r--library/PCUIF_Types.ttcn3
-rw-r--r--pcu/PCU_Tests.ttcn102
2 files changed, 104 insertions, 1 deletions
diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index 9c83a441..2af70635 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -250,7 +250,8 @@ type record PCUIF_CellDescriptionV {
uint3_t bcc, /* PLMN colour code */
uint3_t ncc, /* BS colour code */
uint10_t bcch_arfcn
-} with { variant "FIELDORDER(lsb)" };
+} with { variant "BYTEORDER(first), BITORDER(msb), FIELDORDER(msb)" };
+// with { variant "FIELDORDER(lsb)" };
type set of PCUIF_CellDescriptionV PCUIF_CellDescriptionList;
type set of uint8_t PCUIF_RxLevList;
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 8e8fba9b..e3dab6c4 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -5898,6 +5898,105 @@ testcase TC_rim_ran_info_req_single_rep_no_si() runs on RAW_PCU_Test_CT {
f_shutdown(__BFILE__, __LINE__, final := true);
}
+/* Test ANR procedure: fully successful procedure */
+testcase TC_anr_success() runs on RAW_PCU_Test_CT {
+ var RlcmacDlBlock dl_block;
+ var octetstring data := f_rnd_octstring(10);
+ var uint32_t sched_fn, unused_fn;
+ var uint32_t dl_fn;
+ var GprsMS ms;
+
+ /* Initialize NS/BSSGP side */
+ f_init_bssgp();
+ /* Initialize GPRS MS side */
+ f_init_gprs_ms();
+ ms := g_ms[0]; /* We only use first MS in this test */
+
+ /* Initialize the PCU interface abstraction */
+ f_init_raw(testcasename());
+
+ /* Establish BSSGP connection to the PCU */
+ f_bssgp_establish();
+ f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli);
+
+ /* Establish an Uplink TBF */
+ f_ms_establish_ul_tbf(ms);
+
+ /* Send one UL block (with TLLI since we are in One-Phase Access
+ contention resoultion) and make sure it is ACKED fine */
+ f_ms_tx_ul_data_block(ms, data, cv := 15, with_tlli := true, fn := ms.ul_tbf.start_time_fn);
+
+ /* UL block should be received in SGSN */
+ //BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));
+
+ f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, unused_fn);
+
+ /* TBF is to be finished, so no ANR procedure should be starting on this MS */
+ var PCUIF_CellDescriptionList cell_list := {
+ //{3, 2, 880}, {3, 1, 880}, {3, 1, 887}
+ {3, 2, 880}, {3, 1, 880}, {3, 1, 887}
+ };
+ BTS.send(ts_PCUIF_ANR_REQ(0, lengthof(cell_list), cell_list));
+
+ /* Verify no Packet Measurement Order is received */
+ f_rx_rlcmac_dl_block_exp_dummy(dl_block);
+ /* ACK the ACK */
+ f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
+
+ f_shutdown(__BFILE__, __LINE__, final := true);
+}
+
+/* Test ANR procedure: MS is not selected for measuremnts if its TBF is already finished */
+testcase TC_anr_tbf_finished() runs on RAW_PCU_Test_CT {
+ var RlcmacDlBlock dl_block;
+ var octetstring data := f_rnd_octstring(10);
+ var uint32_t sched_fn;
+ var uint32_t dl_fn;
+ var template RlcmacDlBlock acknack_tmpl;
+ var GprsMS ms;
+
+ /* Initialize NS/BSSGP side */
+ f_init_bssgp();
+ /* Initialize GPRS MS side */
+ f_init_gprs_ms();
+ ms := g_ms[0]; /* We only use first MS in this test */
+
+ /* Initialize the PCU interface abstraction */
+ f_init_raw(testcasename());
+
+ /* Establish BSSGP connection to the PCU */
+ f_bssgp_establish();
+ f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli);
+
+ /* Establish an Uplink TBF */
+ f_ms_establish_ul_tbf(ms);
+
+ /* Send one UL block (with TLLI since we are in One-Phase Access
+ contention resoultion) and make sure it is ACKED fine */
+ f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := true, fn := ms.ul_tbf.start_time_fn);
+
+ /* UL block should be received in SGSN */
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));
+
+ acknack_tmpl := tr_RLCMAC_UL_ACK_NACK_GPRS(ms.ul_tbf.tfi,
+ tr_UlAckNackGprs(ms.tlli,
+ tr_AckNackDescription(final_ack := '1'B)))
+ f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn, acknack_tmpl);
+
+ /* TBF is to be finished, so no ANR procedure should be starting on this MS */
+ var PCUIF_CellDescriptionList cell_list := {
+ {3, 2, 880}, {3, 1, 880}, {3, 1, 887}
+ };
+ BTS.send(ts_PCUIF_ANR_REQ(0, lengthof(cell_list), cell_list));
+
+ /* Verify no Packet Measurement Order is received */
+ f_rx_rlcmac_dl_block_exp_dummy(dl_block);
+ /* ACK the ACK */
+ f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
+
+ f_shutdown(__BFILE__, __LINE__, final := true);
+}
+
control {
execute( TC_pcuif_suspend() );
execute( TC_pcuif_suspend_active_tbf() );
@@ -5999,6 +6098,9 @@ control {
execute( TC_rim_ran_info_req_single_rep() );
execute( TC_rim_ran_info_req_single_rep_eutran() );
execute( TC_rim_ran_info_req_single_rep_no_si() );
+
+ execute( TC_anr_success() );
+ execute( TC_anr_tbf_finished() );
}
}