ran emulation: allow multiple reset attempts
bsc-nat introduces a delay that will lead to failed tests, since the
reset attempt happens too early and times out, and the tests do not
retry.
Change-Id: I9f6db2a24e984eef31e76f9d42a80eb6a1bb6928
diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp
index d87ee9c..e6d36e6 100644
--- a/library/RAN_Emulation.ttcnpp
+++ b/library/RAN_Emulation.ttcnpp
@@ -521,20 +521,28 @@
function f_bssap_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) runs on RAN_Emulation_CT {
timer T := 5.0;
var boolean append_osmux_support := append_osmux_ie();
+ var integer attempts := g_ran_ops.bssap_reset_retries;
- BSSAP.send(ts_BSSAP_UNITDATA_req(peer, own, ts_BSSMAP_Reset(0, append_osmux_support)));
- T.start;
- alt {
- [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(own, peer, tr_BSSMAP_ResetAck(append_osmux_support))) {
- log("BSSMAP: Received RESET-ACK in response to RESET, we're ready to go!");
- }
- [] as_reset_ack(append_osmux_support);
- [] BSSAP.receive { repeat };
- [] T.timeout {
- setverdict(fail, "BSSMAP: Timeout waiting for RESET-ACK after sending RESET");
- mtc.stop;
+ while (attempts > 0) {
+ attempts := attempts - 1;
+
+ BSSAP.send(ts_BSSAP_UNITDATA_req(peer, own, ts_BSSMAP_Reset(0, append_osmux_support)));
+ T.start;
+ alt {
+ [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(own, peer, tr_BSSMAP_ResetAck(append_osmux_support))) {
+ log("BSSMAP: Received RESET-ACK in response to RESET, we're ready to go!");
+ return;
+ }
+ [] as_reset_ack(append_osmux_support);
+ [] BSSAP.receive { repeat };
+ [] T.timeout {
+ continue;
+ }
}
}
+
+ setverdict(fail, "BSSMAP: Timeout waiting for RESET-ACK after sending RESET");
+ mtc.stop;
}
private function f_bssap_l3_is_rr(PDU_BSSAP bssap) return boolean {
@@ -713,6 +721,7 @@
RanProtocol protocol,
RAN_Transport transport,
boolean use_osmux,
+ integer bssap_reset_retries,
/* needed for performing BSSMAP RESET */
SCCP_PAR_Address sccp_addr_local optional,
SCCP_PAR_Address sccp_addr_peer optional