aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2023-04-15 20:02:52 +0800
committerlaforge <laforge@osmocom.org>2023-04-20 04:51:39 +0000
commit3e5f05ef593980df7438401e0b943f9b9a8dee7b (patch)
tree62f09046439a69bdf13885a3b393e5c10ac5c7fa
parent843917ef19639233a26bda95dd880f584684fd86 (diff)
stp: Discard any ASP-UP retransmissions
In some cases, there's some time between accepting the SCTP connection and the execution of f_M3UA_CLNT_asp_up(). This may cause the client sending re-transmitted ASP-UP messages. Let's simply flush and ignore those, rather than failing the test case. Change-Id: Iea39e9543535977a3004b150e222ce8c7f4d821a
-rw-r--r--stp/STP_Tests_M3UA.ttcn19
1 files changed, 19 insertions, 0 deletions
diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 08fc9c95..41b2e2cf 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -148,6 +148,22 @@ friend function f_M3UA_exp(integer idx, template (present) PDU_M3UA msg) runs on
}
}
+/* flush any number of queued messages matching 'msg' */
+friend function f_M3UA_flush(integer idx, template (present) PDU_M3UA msg) runs on RAW_M3UA_CT {
+ var M3UA_RecvFrom rx;
+ timer T := 0.01;
+ T.start;
+ alt {
+ /* this should normally be possible with something like M3UA[idx].check(receive(...)) but somehow
+ * TITAN complains about the 'check' token, so it looks that feature of TTCN3 is not supported? */
+ [] M3UA[idx].receive(t_M3UA_RecvFrom(msg)) {
+ repeat;
+ }
+ [] T.timeout {
+ }
+ }
+}
+
private template (value) Socket ts_Socket(HostName hostName, PortNumber portNumber) := {
hostName := hostName,
portNumber := portNumber
@@ -672,6 +688,9 @@ testcase TC_rkm_unreg_active() runs on RAW_M3UA_CT {
/* expect/perform an inbound ASP-UP procedure */
friend function f_M3UA_CLNT_asp_up(integer idx, template OCT4 aspid := omit) runs on RAW_M3UA_CT {
f_M3UA_exp(idx, tr_M3UA_ASPUP(aspid));
+ /* there might have been multiple re-transmissions that have queued up in the ATS between
+ * the SCTP connection establishment and this function execution, so let's flush those copies. */
+ f_M3UA_flush(idx, tr_M3UA_ASPUP(aspid));
f_M3UA_send(idx, ts_M3UA_ASPUP_ACK);
}