aboutsummaryrefslogtreecommitdiffstats
path: root/pcu/PCU_Tests.ttcn
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-03-03 19:55:11 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2021-03-05 15:06:49 +0100
commitf30fa1d24dae19580474dd531ed249bb47a04096 (patch)
treec3f854302dac80d717284ad09025a179cddffa93 /pcu/PCU_Tests.ttcn
parent14ca7e339899ddc7194ce0413d7c01700e7cca1b (diff)
pcu: Introduce test TC_n3101_max_t3169
This test currently fails to pass in master osmo-pcu (and latest) due to T3169 not being implemented exactly as per specs (due to limitations in detecting lost UL blocks with assigned USF). Related: OS#5033 Change-Id: I56177850f084cdaf4fcac63ebdcdff9cef4e7a5d
Diffstat (limited to 'pcu/PCU_Tests.ttcn')
-rw-r--r--pcu/PCU_Tests.ttcn107
1 files changed, 107 insertions, 0 deletions
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 4c7fdca9..cac423ab 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -1313,6 +1313,112 @@ testcase TC_t3169() runs on RAW_PCU_Test_CT {
f_shutdown(__BFILE__, __LINE__, final := true);
}
+/* Validate what happens when RACH to get UL TBF and then PCU receives no UL
+ * data. It should end up in N3101 reaching N3101_MAX and finally triggering
+ * T3169. See OS#5033 */
+testcase TC_n3101_max_t3169() runs on RAW_PCU_Test_CT {
+ var PCUIF_info_ind info_ind;
+ var template (value) TsTrxBtsNum nr;
+ var BTS_PDTCH_Block data_msg;
+ var GprsMS ms;
+ var uint3_t rx_usf;
+ const integer N3101_MAX := 9; /* N3101 shall be greater than 8 */
+ var integer n3101 := 0;
+ timer T_3169 := 1.0;
+
+ /* 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 */
+ info_ind := valueof(ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS));
+ info_ind.n3101 := N3101_MAX;
+ info_ind.t3169 := 1;
+ f_init_raw(testcasename(), info_ind);
+
+ /* Establish BSSGP connection to the PCU */
+ f_bssgp_establish();
+ f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli);
+
+ /* Establish UL TBF */
+ f_ms_establish_ul_tbf(ms);
+
+ /* Now we wait for PCU to transmit our USF */
+ nr := ts_TsTrxBtsNum;
+ BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr,
+ sapi := PCU_IF_SAPI_PDTCH, fn := 0,
+ arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)),
+ block_nr := nr.blk_nr));
+
+ alt {
+ [] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr,
+ tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH),
+ ?)) -> value data_msg {
+ if (ms.ul_tbf.usf[valueof(nr.ts_nr)] == USF_UNUSED) {
+ setverdict(fail, "Unexpected ts_nr ", valueof(nr.ts_nr), " without USF allocated");
+ f_shutdown(__BFILE__, __LINE__);
+ }
+
+ rx_usf := f_rlcmac_dl_block_get_usf(data_msg.dl_block);
+ if (rx_usf == ms.ul_tbf.usf[valueof(nr.ts_nr)]) {
+ log("PCU requests our USF ", rx_usf, ", n3101=", n3101);
+ n3101 := n3101 + 1;
+ //"if (n3101 > N3101_MAX) {" -> start timer T3169
+ if (n3101 > N3101_MAX) {
+ setverdict(fail, "Reached ", n3101, " > ", N3101_MAX, " (N3101_MAX) and PCU still sends us USFs");
+ f_shutdown(__BFILE__, __LINE__);
+ }
+ } else if (rx_usf == USF_UNUSED and n3101 == N3101_MAX) {
+ /* If we already received USFs for us and we don't receive them anymore, that means the TBF entered T3169 */
+ log("PCU stopped requesting USF ", ms.ul_tbf.usf[valueof(nr.ts_nr)]);
+ if (not T_3169.running) {
+ log("T3169 started");
+ T_3169.start;
+ }
+ } else if(rx_usf == USF_UNUSED and n3101 > 0) {
+ setverdict(fail, "PCU stopped requesting USFs too early: ", n3101, " < ", N3101_MAX, " (N3101_MAX)");
+ f_shutdown(__BFILE__, __LINE__);
+ } else {
+ log("PCU requests ", rx_usf, ", we have ", ms.ul_tbf.usf[valueof(nr.ts_nr)]);
+ }
+ nr := ts_TsTrxBtsNum;
+ BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr,
+ sapi := PCU_IF_SAPI_PDTCH, fn := 0,
+ arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)),
+ block_nr := nr.blk_nr));
+ repeat;
+ }
+ [] T_3169.timeout {
+ log("T_3169 expired");
+ /* Done in alt */
+ }
+ [] BTS.receive {
+ setverdict(fail, "Unexpected BTS message");
+ f_shutdown(__BFILE__, __LINE__);
+ }
+ }
+
+ /* Now that T3169 has expired, establishing a Ul TBF should provide same
+ /* USFs as per previous TBF since they were freed at expiration time: */
+ var uint3_t old_usf[8] := ms.ul_tbf.usf;
+ var uint5_t old_tfi := ms.ul_tbf.tfi;
+ f_ms_establish_ul_tbf(ms);
+ if (old_tfi != ms.ul_tbf.tfi) {
+ setverdict(fail, "Unexpected TFI change: ", ms.ul_tbf.tfi, " vs exp ", old_tfi);
+ f_shutdown(__BFILE__, __LINE__);
+ }
+ for (var integer i := 0; i < 8; i := i +1) {
+ if (ms.ul_tbf.usf[i] != old_usf[i]) {
+ setverdict(fail, "Unexpected USF change: ", ms.ul_tbf.usf[i], " vs exp ", old_usf[i]);
+ f_shutdown(__BFILE__, __LINE__);
+ }
+ }
+
+ f_shutdown(__BFILE__, __LINE__, final := true);
+}
+
/* Verify that a Downlink TBF is kept available until T3191 fires, at which
* point the TBF is no longer available. In order to get to start of T3191, we
* have to wait for x2031 since that marks the IDLE TBF time, that is, the delay
@@ -5530,6 +5636,7 @@ control {
execute( TC_mcs_initial_dl() );
execute( TC_mcs_max_dl() );
execute( TC_t3169() );
+ execute( TC_n3101_max_t3169() );
execute( TC_x2031_t3191() );
execute( TC_zero_x2031_t3191() );
execute( TC_t3193() );