neels has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31766 )
Change subject: hnbgw: add f_pfcp_expect()
......................................................................
hnbgw: add f_pfcp_expect()
End the guessing when seeing "timeout of T_guard": set a precise failure
verdict when an expected PFCP message did not arrive as expected.
Change-Id: I2117475b695d486b1204d61e5bb21120a6187354
---
M hnbgw/HNBGW_Tests.ttcn
1 file changed, 36 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/31766/1
diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index b74ba51..1215e64 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -1306,10 +1306,29 @@
}
}
+private function f_pfcp_expect(template (present) PDU_PFCP exp_rx) runs on ConnHdlr
return PDU_PFCP {
+ var PDU_PFCP rx;
+ timer T := 5.0;
+
+ alt {
+ [] PFCP.receive(exp_rx) -> value rx {
+ setverdict(pass);
+ }
+ [] PFCP.receive(PDU_PFCP:?) {
+ setverdict(fail, "Got an unexpected PFCP message, was waiting for ",
exp_rx);
+ mtc.stop;
+ }
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for PFCP ", exp_rx);
+ mtc.stop;
+ }
+ }
+ return rx;
+}
+
friend function f_tc_ps_rab_assignment_with_pfcp(charstring id, TestHdlrParams pars) runs
on ConnHdlr {
var RANAP_PDU tx;
var RANAP_PDU rx;
- timer T := 5.0;
f_init_handler(pars);
@@ -1318,7 +1337,7 @@
var PDU_PFCP m;
var Node_ID upf_node_id := valueof(ts_PFCP_Node_ID_fqdn("\07osmocom\03org"));
- PFCP.receive(tr_PFCP_Assoc_Setup_Req()) -> value m;
+ m := f_pfcp_expect(tr_PFCP_Assoc_Setup_Req())
PFCP.send(ts_PFCP_Assoc_Setup_Resp(m.sequence_number, upf_node_id,
ts_PFCP_Cause(REQUEST_ACCEPTED), 1234));
@@ -1334,7 +1353,7 @@
BSSAP.send(tx);
/* Expect PFCP Session Establishment Request. */
- PFCP.receive(tr_PFCP_Session_Est_Req()) -> value m;
+ m := f_pfcp_expect(tr_PFCP_Session_Est_Req());
var F_SEID hnbgw_f_seid := m.message_body.pfcp_session_establishment_request.CP_F_SEID;
var PFCP_Session_Establishment_Request serq :=
m.message_body.pfcp_session_establishment_request;
@@ -1373,9 +1392,8 @@
gtp_pars.access.remote.teid);
tx := valueof(ts_RANAP_RabAssResp(rab_smdl));
RUA.send(tx);
- T.start;
- PFCP.receive(tr_PFCP_Session_Mod_Req(up_f_seid.seid)) -> value m;
+ m := f_pfcp_expect(tr_PFCP_Session_Mod_Req(up_f_seid.seid));
r := ts_PFCP_Session_Mod_Resp(m.sequence_number, hnbgw_f_seid.seid);
PFCP.send(r);
@@ -1389,7 +1407,7 @@
tx := valueof(ts_RANAP_IuReleaseComplete());
f_iuh2iu(tx);
- PFCP.receive(tr_PFCP_Session_Del_Req(up_f_seid.seid)) -> value m;
+ m := f_pfcp_expect(tr_PFCP_Session_Del_Req(up_f_seid.seid));
PFCP.send(ts_PFCP_Session_Del_Resp(m.sequence_number, hnbgw_f_seid.seid));
f_sleep(2.0);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31766
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: I2117475b695d486b1204d61e5bb21120a6187354
Gerrit-Change-Number: 31766
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange