[M] Change in osmo-ttcn3-hacks[master]: hnbgw: add f_rua_expect()
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31765 ) Change subject: hnbgw: add f_rua_expect() ...................................................................... hnbgw: add f_rua_expect() End the guessing when seeing "timeout of T_guard": set a precise failure verdict when an expected RUA message did not arrive as expected. Change-Id: I29e6b7659ba53efee9f676197b502f79780ead7e --- M hnbgw/HNBGW_Tests.ttcn 1 file changed, 33 insertions(+), 23 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index 5a2c72e..cf0cd07 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -501,24 +501,35 @@ /* send RANAP on Iu and expect it to show up on Iuh */ function f_iu2iuh(template (present) RANAP_PDU tx, template RANAP_PDU exp_rx := omit) runs on ConnHdlr return RANAP_PDU { - var RANAP_PDU rx; - timer T := 5.0; - if (istemplatekind(exp_rx, "omit")) { exp_rx := tx; } BSSAP.send(tx); - T.start; + return f_rua_expect(exp_rx) +} + +/* expect to receive a specific RUA message on Iuh */ +private function f_rua_expect(template (present) RANAP_PDU exp_rx) runs on ConnHdlr return RANAP_PDU +{ + var RANAP_PDU rx; + timer T := 5.0; + T.start; alt { [] RUA.receive(exp_rx) -> value rx { setverdict(pass); } + [] RUA.receive(RANAP_PDU:?) { + setverdict(fail, "Got an unexpected RUA message, was waiting for ", exp_rx); + mtc.stop; + } [] T.timeout { setverdict(fail, "Timeout waiting for Iuh ", exp_rx); + mtc.stop; } } + T.stop; return rx; } @@ -945,19 +956,13 @@ setverdict(fail, "Timeout waiting for MGCP"); } } + T.stop; /* Expect RAB Assignment Request with IP/port from CRCX ACK via Iuh */ rab_sml := ts_RAB_SML(t_RAB_id(23), f_ts_RAB_TLA(pars.mgw_conn_1.mgw_rtp_ip), t_RAB_binding_port(pars.mgw_conn_1.mgw_rtp_port)); tx := valueof(ts_RANAP_RabAssReq(rab_sml)); - alt { - [] RUA.receive(tx) { - setverdict(pass); - } - [] T.timeout { - setverdict(fail, "Timeout waiting for Iuh ", tx); - } - } + f_rua_expect(tx); } friend function f_rab_ass_resp(inout MgcpParameters pars) runs on ConnHdlr { @@ -1119,16 +1124,9 @@ setverdict(fail, "Timeout waiting for DLCX"); } } + T.stop; - alt { - [] RUA.receive(tx) { - setverdict(pass); - } - [] T.timeout { - setverdict(fail, "Timeout waiting for Iuh ", tx); - } - } - + f_rua_expect(tx); } testcase TC_rab_release() runs on test_CT { @@ -1365,7 +1363,7 @@ rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.access.local.addr), gtp_pars.access.local.teid); rx := valueof(ts_RANAP_RabAssReq(rab_sml)); - RUA.receive(rx); + f_rua_expect(rx); /* Send back RAB Assignment Response via Iuh */ var template RAB_SetupOrModifiedList rab_smdl; @@ -1436,7 +1434,7 @@ /* Expect on Iuh: unmodified RAB Assignment Request */ rx := valueof(ts_RANAP_RabAssReq(rab_sml)); - RUA.receive(rx); + f_rua_expect(rx); /* Send back RAB Assignment Response via Iuh */ var template RAB_SetupOrModifiedList rab_smdl; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31765 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I29e6b7659ba53efee9f676197b502f79780ead7e Gerrit-Change-Number: 31765 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-MessageType: merged
participants (1)
-
neels