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


Change subject: pcu: Fix race condition in TC_cs_max_dl waiting for timer first 
DL data after X2002
......................................................................

pcu: Fix race condition in TC_cs_max_dl waiting for timer 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: If7121473a3580b40d3a658dc38b9bb1421196127
---
M pcu/PCU_Tests.ttcn
1 file changed, 17 insertions(+), 2 deletions(-)



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

diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index af84821..4ab35c0 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -1067,6 +1067,7 @@
        var boolean using_egprs := 
f_rlcmac_cs_mcs_is_mcs(valueof(exp_final_cs));
        var integer bsn_mod;
        var template (present) CodingScheme exp_tmp_csmcs;
+       var integer i;

        if (using_egprs) {
                exp_tmp_csmcs := mcs_egprs_any;
@@ -1089,10 +1090,23 @@
        /* Wait timer X2002 and DL block is available after CCCH IMM ASS */
        f_sleep(X2002);

-       for (var integer i := 0; i < 800; i := i + 1) {
-               bsn := i mod bsn_mod;
+       /* 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, 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__);
+       }
+
+       for (i := 0; i < 800; i := i + 1) {
+               bsn := i mod bsn_mod;
+
                if (match(dl_block, tr_RLCMAC_DL_DUMMY_CTRL)) {
                        /* No more data to receive, done */
                        break;
@@ -1114,6 +1128,7 @@
                        }
                }
                prev_dl_block := dl_block;
+               f_rx_rlcmac_dl_block(dl_block, fn);
        }

        bsn := (bsn + (bsn_mod-1)) mod bsn_mod; /* previous bsn: bsn -1 */

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

Reply via email to