fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42494?usp=email )
Change subject: s1gw: TC_pfcp_heartbeat: validate RTS in Heartbeat Response
......................................................................
s1gw: TC_pfcp_heartbeat: validate RTS in Heartbeat Response
The test case had a TODO noting that the Recovery Timestamp in the
Heartbeat Response was not yet validated. Let's get this resolved:
query the IUT's PFCP association state via REST to obtain its local
Recovery Timestamp (lrts), and verify that the IUT echoes back that
same value in the Heartbeat Response.
Change-Id: I000cc82e7582baded96a33cb0da2103906972ff9
---
M s1gw/S1GW_Tests.ttcn
1 file changed, 22 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks
refs/changes/94/42494/1
diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn
index 121d717..38a5e7d 100644
--- a/s1gw/S1GW_Tests.ttcn
+++ b/s1gw/S1GW_Tests.ttcn
@@ -1030,16 +1030,33 @@
function f_TC_pfcp_heartbeat(charstring id) runs on ConnHdlr {
var integer rts := f_PFCPEM_get_recovery_timestamp();
+ var PfcpAssocInfo assoc_info;
var PDU_PFCP pfcp_pdu;
+ timer T;
+
+ /* Query IUT's PFCP assoc state via REST to get its RTS:
+ * assoc_info.lrts - IUT's RTS,
+ * assoc_info.rrts - PFCPEM's RTS */
+ assoc_info := f_REST_PfcpAssocState();
/* Tx Heartbeat Request */
PFCP.send(ts_PFCP_Heartbeat_Req(rts));
- /* Expect Heartbeat Response
- * TODO: validate the indicated Recovery Time Stamp against
- * the one that we received in the PFCP Association Setup. */
- pfcp_pdu := f_ConnHdlr_pfcp_expect(tr_PFCP_Heartbeat_Resp);
- setverdict(pass);
+ /* Expect Heartbeat Resp with RTS that we learned from the Association
Setup Req */
+ T.start(2.0);
+ alt {
+ [] PFCP.receive(tr_PFCP_Heartbeat_Resp(assoc_info.lrts)) {
+ setverdict(pass);
+ }
+ [] PFCP.receive(tr_PFCP_Heartbeat_Resp) -> value pfcp_pdu {
+ setverdict(fail, "Rx Heartbeat Response with unexpected RTS: ",
pfcp_pdu);
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+ }
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for Heartbeat Response");
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+ }
+ }
}
testcase TC_pfcp_heartbeat() runs on test_CT {
f_TC_exec(refers(f_TC_pfcp_heartbeat));
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42494?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I000cc82e7582baded96a33cb0da2103906972ff9
Gerrit-Change-Number: 42494
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>