fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38036?usp=email )


Change subject: s1gw: rework f_pfcp_wait_assoc_setup() into 
f_ConnHdlr_pfcp_expect()
......................................................................

s1gw: rework f_pfcp_wait_assoc_setup() into f_ConnHdlr_pfcp_expect()

Generalize this function, so that it can be used to expect any
PFCP PDUs, not just the Association Setup.

Change-Id: If691cb9df72672eddfbafdd8e03ae09c81b1ce71
---
M s1gw/S1GW_ConnHdlr.ttcn
1 file changed, 12 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/36/38036/1

diff --git a/s1gw/S1GW_ConnHdlr.ttcn b/s1gw/S1GW_ConnHdlr.ttcn
index bb2a309..61c2290 100644
--- a/s1gw/S1GW_ConnHdlr.ttcn
+++ b/s1gw/S1GW_ConnHdlr.ttcn
@@ -240,24 +240,27 @@
        }
 }

-private function f_pfcp_wait_assoc_setup(template (present) PDU_PFCP exp_rx := 
tr_PFCP_Assoc_Setup_Req(),
-                                        float wait_time := 10.0)
-runs on ConnHdlr
+function f_ConnHdlr_pfcp_expect(template (present) PDU_PFCP exp_rx := ?,
+                               float Tval := 2.0)
+runs on ConnHdlr return PDU_PFCP
 {
-       timer T := wait_time;
-       T.start;
+       var PDU_PFCP pdu;
+       timer T;
+
+       T.start(Tval);
        alt {
-       [] as_pfcp_handle_assoc_setup_req(exp_rx);
-       [] PFCP.receive(PDU_PFCP:?) {
+       [] PFCP.receive(exp_rx) -> value pdu { T.stop; }
+       [] PFCP.receive(PDU_PFCP:?) -> value pdu {
                Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
-                                       log2str("Got an unexpected PFCP 
message, was waiting for ", exp_rx));
+                                       log2str("Got an unexpected PFCP PDU: ", 
pdu));
                }
        [] T.timeout {
                Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
                                        log2str("Timeout waiting for PFCP ", 
exp_rx));
                }
        }
-       T.stop;
+
+       return pdu;
 }

 function f_ConnHdlr_register_pfcp() runs on ConnHdlr

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38036?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: If691cb9df72672eddfbafdd8e03ae09c81b1ce71
Gerrit-Change-Number: 38036
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>

Reply via email to