summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-02-18 21:18:36 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2019-02-18 21:24:02 +0100
commitd6d614fb211a4f9729b60167cd8901768b7a1062 (patch)
treee75cf8528c6937eeac21fb53449467bfbf505b3e
parenta7377d8c7499dc7d2e61f585bc1919cc7d5e5ba0 (diff)
bts: Fix race condition in f_dyn_ipa_pdch_(de)actpespin/race
Test BTS_Tests.TC_dyn_osmo_pdch_act_deact was sporadically failing due to receiving IND_INFO on the PCU port with pdch_mask related TS bit set to 0 after sending a PDCH ACT. That happened due to a race condition because PCU send IND_INFO periodically. As a result, it can happen that BTS sends an IND_INFO after PCU.clear was called and before the PDCH ACT is handled. Change-Id: If11ef05d97aa5f6caaa731f3817c1fecfc3edf7c
-rw-r--r--bts/BTS_Tests.ttcn20
1 files changed, 18 insertions, 2 deletions
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index f7caac2..230d3b6 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -3182,13 +3182,21 @@ runs on ConnHdlr {
PCU.clear;
RSL.send(ts_RSL_IPA_PDCH_ACT(g_chan_nr));
/* expect INFO_IND on PCU interface listing TS as PDCH */
+ timer T_wait := 2.0;
+ T_wait.start;
alt {
[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd {
if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '1'B) {
- Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "PCUIF_INFO_IND PDCH_MASK not '1' after PDCH ACT");
+ log("PCUIF_INFO_IND PDCH_MASK not yet '1' after PDCH ACT on TS", g_chan_nr.tn,
+ " mask:", sd.data.u.info_ind.trx[trx_nr].pdch_mask);
+ repeat;
}
}
[] PCU.receive { repeat; }
+ [] T_wait.timeout {
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+ log2str("Timeout waiting for PCUIF_INFO_IND PDCH_MASK to be '1' on TS", g_chan_nr.tn));
+ }
}
/* try to activate this PDCH from the PCU point of view */
PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_ACT_REQ(bts_nr, trx_nr, g_chan_nr.tn)));
@@ -3204,13 +3212,21 @@ runs on ConnHdlr {
RSL.send(ts_RSL_IPA_PDCH_DEACT(g_chan_nr));
PCU.clear;
/* expect BTS to ask PCU to deactivate the channel */
+ timer T_wait := 2.0;
+ T_wait.start;
alt {
[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd {
if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '0'B) {
- Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "PCUIF_INFO_IND PDCH_MASK not '0' after PDCH DEACT");
+ log("PCUIF_INFO_IND PDCH_MASK not yet '0' after PDCH DEACT on TS", g_chan_nr.tn,
+ " mask:", sd.data.u.info_ind.trx[trx_nr].pdch_mask);
+ repeat;
}
}
[] PCU.receive { repeat; }
+ [] T_wait.timeout {
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+ log2str("Timeout waiting for PCUIF_INFO_IND PDCH_MASK to be '0' on TS", g_chan_nr.tn));
+ }
}
/* Emulate PCU asking BTS to deactivate PDCH */
PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_DEACT_REQ(bts_nr, trx_nr, g_chan_nr.tn)));