pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40462?usp=email )
Change subject: stp: Expect and answer M3UA BEAT from IUT ......................................................................
stp: Expect and answer M3UA BEAT from IUT
Change-Id: Idb70acde0683bc053db20781ce4926fbc318f51f --- M stp/STP_Tests_M3UA.ttcn 1 file changed, 14 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/62/40462/1
diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn index 2f452de..c8037aa 100644 --- a/stp/STP_Tests_M3UA.ttcn +++ b/stp/STP_Tests_M3UA.ttcn @@ -140,6 +140,15 @@ } }
+private altstep as_m3ua_beat_answer(integer idx, template M3UA_Heartbeat_Data hbd := *) runs on RAW_M3UA_CT { + var M3UA_RecvFrom rx; + [] M3UA[idx].receive(t_M3UA_RecvFrom(tr_M3UA_BEAT(hbd))) -> value rx { + log("[", idx, "] Answering M3UA BEAT ", rx); + f_M3UA_send(idx, ts_M3UA_BEAT_ACK(rx.msg.m3UA_BEAT.messageParameters.heartbeat_Data)); + repeat; + } +} + friend function f_M3UA_send(integer idx, template (present) PDU_M3UA msg, integer stream := 0) runs on RAW_M3UA_CT { if (g_m3ua_configs[idx].use_tcp) { @@ -154,6 +163,7 @@ timer T := 5.0; T.start; alt { + [] as_m3ua_beat_answer(idx); [] M3UA[idx].receive(t_M3UA_RecvFrom(msg)) { setverdict(pass); } @@ -315,6 +325,7 @@ }
friend function f_init_m3ua(boolean ignore_ssnm := true, + boolean answer_beat := true, template (omit) M3uaConfigs m3ua_configs := omit)
runs on RAW_M3UA_CT { @@ -332,6 +343,9 @@ if (not g_m3ua_configs[i].is_server) { map(self:M3UA[i], system:M3UA_CODEC_PT); } + if (answer_beat) { + activate(as_m3ua_beat_answer(i)); + } }
activate(as_m3ua_sctp());