pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41725?usp=email )
Change subject: BSSAP(_LE)/RANAP: Proper counting of RESET retries ......................................................................
BSSAP(_LE)/RANAP: Proper counting of RESET retries
N retries means N+1 attempts.
Since M3UA_Emulation (in deps/, not in library) doesn't support pushing DUNA/DAVA as primitive up the stack, we cannot implement the related SCCP primitives which should end up sending in turn other primitives to our BSSAP(_LE)/RANAP emulations. This means we currently have no way to figure out the status of the underlying SCCP/MTP link, and our only way is implement a poor man's solution: retransmit RESET until we get an answer.
Since before bssap_reset_retries was set to 1 everywhere and we were only attempting once, it could happen that the other end (the IUT) was not yet connected to the STP when we send the RESET, and hence it is discarded the STP. In that scenario, we'd time out and fail the test. Instead, now that we do N+1 attempts, we retry after 5 seconds, which should be enough time for the peer to reconnect to the STP.
Change-Id: If02e424672ff6270aed323c3bb236e822d8a39a4 --- M library/BSSAP_LE_Emulation.ttcn M library/RAN_Emulation.ttcnpp 2 files changed, 3 insertions(+), 5 deletions(-)
Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve fixeria: Looks good to me, approved
diff --git a/library/BSSAP_LE_Emulation.ttcn b/library/BSSAP_LE_Emulation.ttcn index 771caec..15930d5 100644 --- a/library/BSSAP_LE_Emulation.ttcn +++ b/library/BSSAP_LE_Emulation.ttcn @@ -310,7 +310,7 @@
private function f_bssap_le_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) runs on BSSAP_LE_Emulation_CT { timer T := 5.0; - var integer attempts := g_ran_ops.bssap_le_reset_retries; + var integer attempts := g_ran_ops.bssap_le_reset_retries + 1;
while (attempts > 0) { attempts := attempts - 1; @@ -514,7 +514,6 @@ f_expect_table_init();
if (isvalue(ops.sccp_addr_peer) and isvalue(ops.sccp_addr_local)) { - f_sleep(1.0); /* HACK to wait for M3UA/ASP to be ACTIVE */ f_bssap_le_reset(ops.sccp_addr_peer, ops.sccp_addr_local); }
diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp index 7ea1578..3b3e6bd 100644 --- a/library/RAN_Emulation.ttcnpp +++ b/library/RAN_Emulation.ttcnpp @@ -592,7 +592,7 @@ 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; + var integer attempts := g_ran_ops.bssap_reset_retries + 1;
while (attempts > 0) { attempts := attempts - 1; @@ -799,7 +799,7 @@ SCCP_PAR_Address own, template (omit) GlobalRNC_ID grnc_id := omit) runs on RAN_Emulation_CT { timer T := 5.0; - var integer attempts := g_ran_ops.bssap_reset_retries; + var integer attempts := g_ran_ops.bssap_reset_retries + 1; var CN_DomainIndicator dom;
if (g_ran_ops.ps_domain) { @@ -1347,7 +1347,6 @@ f_expect_table_init();
if (isvalue(ops.sccp_addr_peer) and isvalue(ops.sccp_addr_local)) { - f_sleep(1.0); /* HACK to wait for M3UA/ASP to be ACTIVE */ select (g_ran_ops.protocol) { #ifdef RAN_EMULATION_BSSAP case (RAN_PROTOCOL_BSSAP) {