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


Change subject: pcu: TC_paging_cs_from_sgsn_*: Fix race condition between BSSGP 
tx and RLCMAC rx
......................................................................

pcu: TC_paging_cs_from_sgsn_*: Fix race condition between BSSGP tx and RLCMAC rx

It can happen that the RLCMAC req arrives at osmo-pcu before the
CS_PAGING we send to it over BSSGP, in which case osmo-pcu will schedule
an RLCMAC DL Dummy Block. Take into account this scenario to avoid
failing id it occurs.

Change-Id: I30da93835c7738aefcd84691d83f39759dd4b599
---
M pcu/PCU_Tests.ttcn
1 file changed, 21 insertions(+), 2 deletions(-)



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

diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 385ebf6..b2c9aff 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -3638,6 +3638,8 @@
        var hexstring imsi := f_gen_imsi(42);
        var GsmTmsi tmsi;
        var GprsMS ms;
+       var uint32_t dl_fn;
+       var integer i;

        /* Initialize NS/BSSGP side */
        f_init_bssgp();
@@ -3663,8 +3665,25 @@
                BSSGP[0].send(ts_BSSGP_CS_PAGING_IMSI(bvci, imsi));
        }

-       /* Receive it on BTS side towards MS */
-       f_rx_rlcmac_dl_block_exp_pkt_pag_req(dl_block);
+       /* Now receive it on BTS side towards MS.
+        * Skip any dummy blocks in case the PCUIF req arrives before the BSSP 
CS_PAGING:
+        */
+       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 CS_PAGING on RLCMAC");
+               f_shutdown(__BFILE__, __LINE__);
+       }
+       if (not match(dl_block, tr_RLCMAC_PACKET_PAG_REQ())) {
+               setverdict(fail, "Failed to match Packet Paging Request: ",
+                          dl_block, " vs ", tr_RLCMAC_PACKET_PAG_REQ());
+               f_shutdown(__BFILE__, __LINE__);
+       }

        /* Make sure that Packet Paging Request contains the same P-TMSI/IMSI */
        var PacketPagingReq req := dl_block.ctrl.payload.u.paging;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30374
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: I30da93835c7738aefcd84691d83f39759dd4b599
Gerrit-Change-Number: 30374
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to