gbproxy: Use Misc_Helpers.f_shutdown() whenever applicable
This should avoid some of the "known" races during shut-down Change-Id: I4fdd47e9c5887597dca89580f856ddc6cd8f54f1
This commit is contained in:
parent
61c5532366
commit
d5b7e74403
|
@ -592,8 +592,7 @@ function f_init(float t_guard := 30.0) runs on test_CT {
|
|||
repeat;
|
||||
}
|
||||
[] SGSN_MGMT.receive {
|
||||
setverdict(fail, "Received unexpected message on SGSN_MGMT");
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, "Received unexpected message on SGSN_MGMT");
|
||||
}
|
||||
|
||||
[] PCU_MGMT.receive(BssgpStatusIndication:{*, ?, BVC_S_UNBLOCKED}) -> value bsi {
|
||||
|
@ -606,8 +605,7 @@ function f_init(float t_guard := 30.0) runs on test_CT {
|
|||
repeat;
|
||||
}
|
||||
[] PCU_MGMT.receive {
|
||||
setverdict(fail, "Received unexpected message on PCU_MGMT");
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, "Received unexpected message on PCU_MGMT");
|
||||
}
|
||||
|
||||
[] T.timeout {
|
||||
|
@ -622,8 +620,8 @@ function f_init(float t_guard := 30.0) runs on test_CT {
|
|||
for (var integer j := 0; j < lengthof(g_sgsn[i].cfg.bvc); j := j+1) {
|
||||
var BssgpBvci bvci := g_sgsn[i].cfg.bvc[j].bvci;
|
||||
if (not ro_integer_contains(bvci_unblocked[i], bvci)) {
|
||||
setverdict(fail, "SGSN ", i, " BVCI=", bvci, " was not unblocked during start-up");
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("SGSN ", i, " BVCI=", bvci, " was not unblocked during start-up"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -742,8 +740,7 @@ private function f_connect_to_sgsn_bvc(integer port_idx, BSSGP_BVC_CT bvc_ct) ru
|
|||
|
||||
private altstep as_gTguard(timer Tguard) {
|
||||
[] Tguard.timeout {
|
||||
setverdict(fail, "Tguard timeout");
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, "Tguard timeout");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -821,16 +818,16 @@ friend function f_pcu2sgsn(template (value) PDU_BSSGP tx, template (present) PDU
|
|||
setverdict(pass);
|
||||
}
|
||||
[] SGSN_PTP[sgsn_idx].receive(PDU_BSSGP:?) -> value rx {
|
||||
setverdict(fail, "Unexpected BSSGP on SGSN[", sgsn_idx, "] side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("Unexpected BSSGP on SGSN[", sgsn_idx, "] side: ", rx));
|
||||
}
|
||||
[] SGSN_SIG[sgsn_idx].receive(PDU_BSSGP:?) -> value rx {
|
||||
setverdict(fail, "Unexpected SIG BSSGP on SGSN[", sgsn_idx, "] side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("Unexpected SIG BSSGP on SGSN[", sgsn_idx, "] side: ", rx));
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "Timeout waiting for BSSGP on SGSN[", sgsn_idx, "] side: ", exp_rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("Timeout waiting for BSSGP on SGSN[", sgsn_idx, "] side: ", exp_rx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -858,16 +855,16 @@ runs on BSSGP_ConnHdlr return integer {
|
|||
setverdict(pass);
|
||||
}
|
||||
[] any from SGSN_PTP.receive(PDU_BSSGP:?) -> value rx @index value rx_idx {
|
||||
setverdict(fail, "Unexpected BSSGP on SGSN[", rx_idx, "] side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("Unexpected BSSGP on SGSN[", rx_idx, "] side: ", rx));
|
||||
}
|
||||
[] any from SGSN_SIG.receive(PDU_BSSGP:?) -> value rx @index value rx_idx {
|
||||
setverdict(fail, "Unexpected SIG BSSGP on SGSN[", rx_idx, "] side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("Unexpected SIG BSSGP on SGSN[", rx_idx, "] side: ", rx));
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "Timeout waiting for BSSGP on SGSN side: ", exp_rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("Timeout waiting for BSSGP on SGSN side: ", exp_rx));
|
||||
}
|
||||
}
|
||||
return rx_idx;
|
||||
|
@ -895,16 +892,14 @@ friend function f_sgsn2pcu(template (value) PDU_BSSGP tx, template (present) PDU
|
|||
setverdict(pass);
|
||||
}
|
||||
[] PCU_PTP[pcu_idx].receive(PDU_BSSGP:?) -> value rx {
|
||||
setverdict(fail, "Unexpected BSSGP on PCU side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, log2str("Unexpected BSSGP on PCU side: ", rx));
|
||||
}
|
||||
[] PCU_SIG[pcu_idx].receive(PDU_BSSGP:?) -> value rx {
|
||||
setverdict(fail, "Unexpected SIG BSSGP on PCU side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, log2str("Unexpected SIG BSSGP on PCU side: ", rx));
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "Timeout waiting for BSSGP on PCU side: ", exp_rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("Timeout waiting for BSSGP on PCU side: ", exp_rx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -987,12 +982,10 @@ friend function f_global_pcu2sgsn(template (value) PDU_BSSGP tx, template (prese
|
|||
setverdict(fail, "BSSGP arrived on wrong SGSN[", rx_idx, "] instead of SGSN[", sgsn_idx, "]");
|
||||
}
|
||||
[] G_SGSN[sgsn_idx].receive(PDU_BSSGP:?) -> value rx {
|
||||
setverdict(fail, "Unexpected BSSGP on SGSN side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, log2str("Unexpected BSSGP on SGSN side: ", rx));
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "Timeout waiting for BSSGP on SGSN side: ", exp_rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, log2str("Timeout waiting for BSSGP on SGSN side: ", exp_rx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1014,12 +1007,10 @@ friend function f_global_sgsn2pcu(template (value) PDU_BSSGP tx, template (prese
|
|||
setverdict(fail, "BSSGP arrived on wrong PCU[", rx_idx, "] instead of PCU[", pcu_idx, "]");
|
||||
}
|
||||
[] G_PCU[pcu_idx].receive(PDU_BSSGP:?) -> value rx {
|
||||
setverdict(fail, "Unexpected BSSGP on PCU side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, log2str("Unexpected BSSGP on PCU side: ", rx));
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "Timeout waiting for BSSGP on PCU side: ", exp_rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, log2str("Timeout waiting for BSSGP on PCU side: ", exp_rx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1061,12 +1052,12 @@ friend function f_bssgp_suspend(integer ran_idx := 0) runs on BSSGP_ConnHdlr ret
|
|||
return rx_pdu.pDU_BSSGP_SUSPEND_ACK.suspend_Reference_Number.suspend_Reference_Number_value;
|
||||
}
|
||||
[] PCU_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_NACK(g_pars.tlli, bvcc.cell_id.ra_id, ?)) -> value rx_pdu {
|
||||
setverdict(fail, "SUSPEND-NACK in response to SUSPEND for TLLI ", g_pars.tlli);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("SUSPEND-NACK in response to SUSPEND for TLLI ", g_pars.tlli));
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "No SUSPEND-ACK in response to SUSPEND for TLLI ", g_pars.tlli);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("No SUSPEND-ACK in response to SUSPEND for TLLI ", g_pars.tlli));
|
||||
}
|
||||
}
|
||||
return '00'O;
|
||||
|
@ -1080,12 +1071,12 @@ friend function f_bssgp_resume(OCT1 susp_ref, integer ran_idx := 0) runs on BSSG
|
|||
alt {
|
||||
[] PCU_SIG[ran_idx].receive(tr_BSSGP_RESUME_ACK(g_pars.tlli, bvcc.cell_id.ra_id));
|
||||
[] PCU_SIG[ran_idx].receive(tr_BSSGP_RESUME_NACK(g_pars.tlli, bvcc.cell_id.ra_id, ?)) {
|
||||
setverdict(fail, "RESUME-NACK in response to RESUME for TLLI ", g_pars.tlli);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("RESUME-NACK in response to RESUME for TLLI ", g_pars.tlli));
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "No RESUME-ACK in response to SUSPEND for TLLI ", g_pars.tlli);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("No RESUME-ACK in response to SUSPEND for TLLI ", g_pars.tlli));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1399,8 +1390,7 @@ private function f_TC_load_sharing_dl(integer sgsn_idx) runs on test_CT_NS
|
|||
[] NS.receive(NsUnitdataIndication:{0,?,?,*,*}) { repeat; } /* signaling BVC */
|
||||
[] NS.receive(NsStatusIndication:?) { repeat; }
|
||||
[] NS.receive {
|
||||
setverdict(fail, "Rx unexpected NS");
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, "Rx unexpected NS");
|
||||
}
|
||||
[] T.timeout {
|
||||
}
|
||||
|
@ -2828,12 +2818,11 @@ friend function f_rim_pcu2sgsn(template (value) PDU_BSSGP tx, template (present)
|
|||
setverdict(pass);
|
||||
}
|
||||
[] any from RIM_SGSN.receive(PDU_BSSGP:?) -> value rx {
|
||||
setverdict(fail, "Unexpected BSSGP on SGSN side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, log2str("Unexpected BSSGP on SGSN side: ", rx));
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "Timeout waiting for BSSGP on SGSN side: ", exp_rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("Timeout waiting for BSSGP on SGSN side: ", exp_rx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2851,12 +2840,11 @@ friend function f_rim_sgsn2pcu(template (value) PDU_BSSGP tx, template (present)
|
|||
setverdict(pass);
|
||||
}
|
||||
[] RIM_PCU[pcu_idx].receive(PDU_BSSGP:?) -> value rx {
|
||||
setverdict(fail, "Unexpected BSSGP on PCU side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, log2str("Unexpected BSSGP on PCU side: ", rx));
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "Timeout waiting for BSSGP on PCU side: ", exp_rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("Timeout waiting for BSSGP on PCU side: ", exp_rx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2881,12 +2869,11 @@ friend function f_rim_pcu2pcu(template (value) PDU_BSSGP tx, template (present)
|
|||
setverdict(fail, "Received RIM on SGSN but expected it on other PCU");
|
||||
}
|
||||
[] any from RIM_SGSN.receive(PDU_BSSGP:?) -> value rx {
|
||||
setverdict(fail, "Unexpected BSSGP on SGSN side: ", rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail, log2str("Unexpected BSSGP on SGSN side: ", rx));
|
||||
}
|
||||
[] T.timeout {
|
||||
setverdict(fail, "Timeout waiting for BSSGP on SGSN side: ", exp_rx);
|
||||
mtc.stop;
|
||||
f_shutdown(__FILE__, __LINE__, fail,
|
||||
log2str("Timeout waiting for BSSGP on SGSN side: ", exp_rx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue