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


Change subject: pcu: TC_mt_ping_pong*: Fix race condition waiting for first DL 
data after X2002
......................................................................

pcu: TC_mt_ping_pong*: Fix race condition waiting for first DL data after X2002

Since recently osmo-pcu arms the X2002 in a more fitting place (later,
when paging.cnf is received from osmo-bts over PCUIF).
Since we use same X2002 value in TTCN3 to wait for the timer to trigger,
in the past it was always fine (the X2002 at osmo-pcu always already had
triggered before the one in ttcn3 after receiving the ImmAss).

However, now the timer is roughly set at the same time in both places (ttcn3 and
osmo-pcu) and hence there may be race conditions where we request a
DL data block before the X2002 triggered at osmo-pcu, in which case we
receive a DL dummy block because the TBF is not yet in the FLOW state

Change-Id: Icc94eb0544226facddcd65be65a8a41bcfc662cc
---
M pcu/PCU_Tests.ttcn
1 file changed, 16 insertions(+), 1 deletion(-)



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

diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index a8a4c8a..385ebf6 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -2565,6 +2565,7 @@
        var uint32_t sched_fn;
        var uint32_t dl_fn;
        var GprsMS ms;
+       var integer i;

        /* Initialize NS/BSSGP side */
        f_init_bssgp();
@@ -2585,7 +2586,21 @@

        /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */
        f_sleep(X2002);
-       f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0, exp_cs_mcs);
+       /* Skip potential dummy blocks before X2002 triggers at PCU after us: */
+       for (i := 0; i < 10; i := i + 1) {
+               f_rx_rlcmac_dl_block(dl_block, dl_fn);
+
+               if (not match(dl_block, tr_RLCMAC_DL_DUMMY_CTRL)) {
+                       /* Received first data, starting processing: */
+                       break;
+               }
+       }
+       if (i == 10) {
+               setverdict(fail, "Didn't receive DL data for the DL-TBF");
+               f_shutdown(__BFILE__, __LINE__);
+       }
+
+       f_rlcmac_dl_block_exp_data(dl_block, data, 0, exp_cs_mcs);

        /* ACK the DL block, and request UL TBF at the same time */
        f_dltbf_ack_block(ms.dl_tbf, dl_block, '1'B);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30373
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: Icc94eb0544226facddcd65be65a8a41bcfc662cc
Gerrit-Change-Number: 30373
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to