pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43881?usp=email )

Change subject: PFCP_Templates: Avoid enum2oct() conversion in PFCP_Cause
......................................................................

PFCP_Templates: Avoid enum2oct() conversion in PFCP_Cause

The type uses a OCT1, so better use OCT1 to define the causes, otherwise
the tr_ template cannot be passed wildcards due to the enum2oct() call.

Change-Id: I94d089bbfbca233fbb2393387eea0ab723e0c708
---
M library/PFCP_Emulation.ttcn
M library/PFCP_Templates.ttcn
M s1gw/S1GW_ConnHdlr.ttcn
M s1gw/S1GW_Tests.ttcn
M smf/SMF_Session_CT.ttcn
M smf/SMF_Tests.ttcn
M upf/UPF_Tests.ttcn
7 files changed, 44 insertions(+), 43 deletions(-)

Approvals:
  osmith: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/library/PFCP_Emulation.ttcn b/library/PFCP_Emulation.ttcn
index f07475a..72b9562 100644
--- a/library/PFCP_Emulation.ttcn
+++ b/library/PFCP_Emulation.ttcn
@@ -437,7 +437,7 @@
        [] PFCP.receive(tr_PFCP_Assoc_Setup_Req()) -> value m {
                        PFCP.send(ts_PFCP_Assoc_Setup_Resp(m.sequence_number,
                                                           local_node_id,
-                                                          
ts_PFCP_Cause(REQUEST_ACCEPTED),
+                                                          
ts_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED),
                                                           rts,
                                                           up_function_features 
:= up_function_features,
                                                           cp_function_features 
:= cp_function_features));
@@ -490,7 +490,7 @@
                rx_assoc_setup_req := true;
                PFCP.send(ts_PFCP_Assoc_Setup_Resp(m.sequence_number,
                                                   local_node_id,
-                                                  
ts_PFCP_Cause(REQUEST_ACCEPTED),
+                                                  
ts_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED),
                                                   rts,
                                                   up_function_features := 
up_function_features,
                                                   cp_function_features := 
cp_function_features));
diff --git a/library/PFCP_Templates.ttcn b/library/PFCP_Templates.ttcn
index ae23414..a85b075 100644
--- a/library/PFCP_Templates.ttcn
+++ b/library/PFCP_Templates.ttcn
@@ -14,38 +14,39 @@
 import from Osmocom_Types all;
 import from PFCP_Types all;

-type enumerated e_PFCP_Cause {
-       RESERVED (0),
-       REQUEST_ACCEPTED (1),
-       MORE_USAGE_REPORT_TO_SEND (2),
-       REQUEST_REJECTED (64),
-       SESSION_CTX_NOT_FOUND (65),
-       MANDATORY_IE_MISSING (66),
-       CONDITIONAL_IE_MISSING (67),
-       INVALID_LENGTH (68),
-       MANDATORY_IE_INCORRECT (69),
-       INVALID_FORW_POLICY (70),
-       INVALID_F_TEID_ALLOC_OPTION (71),
-       NO_ESTABLISHED_PFCP_ASSOC (72),
-       RULE_CREATION_MOD_FAILURE (73),
-       PFCP_ENTITY_IN_CONGESTION (74),
-       NO_RESOURCES_AVAILABLE (75),
-       SERVICE_NOT_SUPPORTED (76),
-       SYSTEM_FAILURE (77),
-       REDIRECTION_REQUESTED (78),
-       ALL_DYNAMIC_ADDRESSES_ARE_OCCUPIED (79)
-};
+/* 8.2.1 Cause */
+const OCT1 PFCP_Cause_RESERVED := int2oct(0, 1);
+const OCT1 PFCP_Cause_REQUEST_ACCEPTED := int2oct(1, 1);
+const OCT1 PFCP_Cause_MORE_USAGE_REPORT_TO_SEND := int2oct(2, 1);
+const OCT1 PFCP_Cause_REQUEST_REJECTED := int2oct(64, 1);
+const OCT1 PFCP_Cause_SESSION_CTX_NOT_FOUND := int2oct(65, 1);
+const OCT1 PFCP_Cause_MANDATORY_IE_MISSING := int2oct(66, 1);
+const OCT1 PFCP_Cause_CONDITIONAL_IE_MISSING := int2oct(67, 1);
+const OCT1 PFCP_Cause_INVALID_LENGTH := int2oct(68, 1);
+const OCT1 PFCP_Cause_MANDATORY_IE_INCORRECT := int2oct(69, 1);
+const OCT1 PFCP_Cause_INVALID_FORW_POLICY := int2oct(70, 1);
+const OCT1 PFCP_Cause_INVALID_F_TEID_ALLOC_OPTION := int2oct(71, 1);
+const OCT1 PFCP_Cause_NO_ESTABLISHED_PFCP_ASSOC := int2oct(72, 1);
+const OCT1 PFCP_Cause_RULE_CREATION_MOD_FAILURE := int2oct(73, 1);
+const OCT1 PFCP_Cause_PFCP_ENTITY_IN_CONGESTION := int2oct(74, 1);
+const OCT1 PFCP_Cause_NO_RESOURCES_AVAILABLE := int2oct(75, 1);
+const OCT1 PFCP_Cause_SERVICE_NOT_SUPPORTED := int2oct(76, 1);
+const OCT1 PFCP_Cause_SYSTEM_FAILURE := int2oct(77, 1);
+const OCT1 PFCP_Cause_REDIRECTION_REQUESTED := int2oct(78, 1);
+const OCT1 PFCP_Cause_ALL_DYNAMIC_ADDRESSES_ARE_OCCUPIED := int2oct(79, 1);

-template (value) Cause ts_PFCP_Cause(e_PFCP_Cause cause) := {
+template (value) Cause
+ts_PFCP_Cause(template (value) OCT1 cause) := {
        elementIdentifier := 19,
        lengthIndicator := 0,
-       causeValue := int2oct(enum2int(cause), 1)
+       causeValue := cause
 };

-template (present) Cause tr_PFCP_Cause(e_PFCP_Cause cause) := {
+template (present) Cause
+tr_PFCP_Cause(template (present) OCT1 cause := ?) := {
        elementIdentifier := 19,
        lengthIndicator := ?,
-       causeValue := int2oct(enum2int(cause), 1)
+       causeValue := cause
 };

 const INT4b PFCP_Node_ID_IPv4 := 0;
@@ -1478,7 +1479,7 @@
                         template (value) OCT8 seid,
                         template (value) F_SEID f_seid,
                         template (value) 
PFCP_Session_Establishment_Response.created_PDR_list created_pdr,
-                        template (value) Cause cause := 
ts_PFCP_Cause(REQUEST_ACCEPTED))
+                        template (value) Cause cause := 
ts_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED))
 modifies ts_PDU_PFCP_ := {
        seid := seid,
        sequence_number := seq_nr,
@@ -1503,7 +1504,7 @@
                         template (present) OCT8 seid := ?,
                         template (present) F_SEID f_seid := ?,
                         template (present) 
PFCP_Session_Establishment_Response.created_PDR_list created_pdr := ?,
-                        template (present) Cause cause := 
tr_PFCP_Cause(REQUEST_ACCEPTED))
+                        template (present) Cause cause := 
tr_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED))
 modifies tr_PDU_PFCP_ := {
        seid := seid,
        sequence_number := ?,
@@ -1597,7 +1598,7 @@
 template (value) PDU_PFCP
 ts_PFCP_Session_Mod_Resp(template (value) LIN3_BO_LAST seq_nr,
                         template (value) OCT8 seid,
-                        template (value) Cause cause := 
ts_PFCP_Cause(REQUEST_ACCEPTED))
+                        template (value) Cause cause := 
ts_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED))
 modifies ts_PDU_PFCP_ := {
        seid := seid,
        sequence_number := seq_nr,
@@ -1617,7 +1618,7 @@
 }
 template (present) PDU_PFCP
 tr_PFCP_Session_Mod_Resp(template (present) OCT8 seid := ?,
-                        template (present) Cause cause := 
tr_PFCP_Cause(REQUEST_ACCEPTED))
+                        template (present) Cause cause := 
tr_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED))
 modifies tr_PDU_PFCP_ := {
        seid := seid,
        message_body := {
@@ -1658,7 +1659,7 @@
 template (value) PDU_PFCP
 ts_PFCP_Session_Del_Resp(template (value) LIN3_BO_LAST seq_nr,
                         template (value) OCT8 seid,
-                        template (value) Cause cause := 
ts_PFCP_Cause(REQUEST_ACCEPTED),
+                        template (value) Cause cause := 
ts_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED),
                         template (omit) Usage_Report_Deletion_Response_list 
usage_report := omit)
 modifies ts_PDU_PFCP_ := {
        seid := seid,
@@ -1675,7 +1676,7 @@
 }
 template (present) PDU_PFCP
 tr_PFCP_Session_Del_Resp(template (present) OCT8 seid,
-                        template (present) Cause cause := 
tr_PFCP_Cause(REQUEST_ACCEPTED),
+                        template (present) Cause cause := 
tr_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED),
                         template Usage_Report_Deletion_Response_list 
usage_report := *)
 modifies tr_PDU_PFCP_ := {
        seid := seid,
@@ -1785,7 +1786,7 @@

 template (present) PDU_PFCP
 tr_PFCP_Session_Report_Resp(template (present) OCT8 seid := ?,
-                           template (present) Cause cause := 
tr_PFCP_Cause(REQUEST_ACCEPTED))
+                           template (present) Cause cause := 
tr_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED))
 modifies tr_PDU_PFCP_ := {
        seid := seid,
        message_body := {
diff --git a/s1gw/S1GW_ConnHdlr.ttcn b/s1gw/S1GW_ConnHdlr.ttcn
index 423c05d..9c127d8 100644
--- a/s1gw/S1GW_ConnHdlr.ttcn
+++ b/s1gw/S1GW_ConnHdlr.ttcn
@@ -405,7 +405,7 @@
        f_PFCPEM_unsubscribe_bcast(); /* ask PFCPEM to *not* route all PDUs to 
us */
        PFCP.send(ts_PFCP_Assoc_Setup_Resp(rx.sequence_number,
                                           
ts_PFCP_Node_ID_fqdn("\07osmocom\03org"),
-                                          ts_PFCP_Cause(REQUEST_ACCEPTED),
+                                          
ts_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED),
                                           f_PFCPEM_get_recovery_timestamp()));
 }

diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn
index 61f2a61..b8f9e78 100644
--- a/s1gw/S1GW_Tests.ttcn
+++ b/s1gw/S1GW_Tests.ttcn
@@ -522,7 +522,7 @@
                                         seid := erab0.pfcp_rem_seid,
                                         f_seid := ts_PFCP_F_SEID_ipv4(addr, 
erab0.pfcp_loc_seid),
                                         created_pdr := {},
-                                        cause := 
ts_PFCP_Cause(REQUEST_REJECTED));
+                                        cause := 
ts_PFCP_Cause(PFCP_Cause_REQUEST_REJECTED));
        PFCP.send(resp);

        /* see comments in f_ConnHdlr_erab_setup_req() */
diff --git a/smf/SMF_Session_CT.ttcn b/smf/SMF_Session_CT.ttcn
index bb617cb..58ee1c2 100644
--- a/smf/SMF_Session_CT.ttcn
+++ b/smf/SMF_Session_CT.ttcn
@@ -513,12 +513,12 @@
        var template (value) PDU_PFCP resp;
        resp := ts_PFCP_Session_Mod_Resp(seq_nr := req.sequence_number,
                                         seid := 
g_pars.pfcp_pars.remote_cp_f_seid.seid,
-                                        cause := 
ts_PFCP_Cause(REQUEST_ACCEPTED));
+                                        cause := 
ts_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED));
        PFCP.send(resp);
 }


-altstep as_pfcp_sess_del_req(template (value) PFCP_Types.Cause resp_cause := 
ts_PFCP_Cause(REQUEST_ACCEPTED))
+altstep as_pfcp_sess_del_req(template (value) PFCP_Types.Cause resp_cause := 
ts_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED))
 runs on SMF_Session_CT {
        var PDU_PFCP req;
        [] 
PFCP.receive(tr_PFCP_Session_Del_Req(g_pars.pfcp_pars.local_f_seid.seid)) -> 
value req {
@@ -527,7 +527,7 @@
 }

 private function f_pfcp_sess_del_resp(PDU_PFCP req,
-                                     template (value) PFCP_Types.Cause 
resp_cause := ts_PFCP_Cause(REQUEST_ACCEPTED))
+                                     template (value) PFCP_Types.Cause 
resp_cause := ts_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED))
 runs on SMF_Session_CT {
        var template (present) PDU_PFCP resp;
        var template (omit) Usage_Report_Deletion_Response_list usage_reports 
:= omit;
@@ -554,7 +554,7 @@
        as_pfcp_sess_report_resp();
 }

-private altstep as_pfcp_sess_report_resp(template (present) PFCP_Types.Cause 
resp_cause := tr_PFCP_Cause(REQUEST_ACCEPTED))
+private altstep as_pfcp_sess_report_resp(template (present) PFCP_Types.Cause 
resp_cause := tr_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED))
 runs on SMF_Session_CT {
        var PDU_PFCP resp;
        [] 
PFCP.receive(tr_PFCP_Session_Report_Resp(g_pars.pfcp_pars.local_f_seid.seid,
diff --git a/smf/SMF_Tests.ttcn b/smf/SMF_Tests.ttcn
index b868ac7..a3e5c14 100644
--- a/smf/SMF_Tests.ttcn
+++ b/smf/SMF_Tests.ttcn
@@ -604,7 +604,7 @@
        f_prometheus_expect(valueof(t_Metrics_Expect(0, 1)), wait_converge := 
true);
        PFCP.send(ts_PFCP_Assoc_Setup_Resp(m.sequence_number,
                                           
ts_PFCP_Node_ID_ipv4(f_inet_addr(mp_pfcp_ip_local)),
-                                          ts_PFCP_Cause(REQUEST_ACCEPTED),
+                                          
ts_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED),
                                           rts,
                                           up_function_features := 
ts_PFCP_UP_Function_Features(ftup := '1'B,
                                                                                
                vtime := '1'B)));
diff --git a/upf/UPF_Tests.ttcn b/upf/UPF_Tests.ttcn
index 59550a8..159ac83 100644
--- a/upf/UPF_Tests.ttcn
+++ b/upf/UPF_Tests.ttcn
@@ -574,13 +574,13 @@
 /* Run a PFCP Association procedure */
 private function f_assoc_setup() runs on CPF_ConnHdlr {
        PFCP.send(ts_PFCP_Assoc_Setup_Req(g_pars.local_node_id, 
g_recovery_timestamp));
-       PFCP.receive(tr_PFCP_Assoc_Setup_Resp(cause := 
tr_PFCP_Cause(REQUEST_ACCEPTED)));
+       PFCP.receive(tr_PFCP_Assoc_Setup_Resp(cause := 
tr_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED)));
 }

 /* Release a PFCP Association */
 private function f_assoc_release() runs on CPF_ConnHdlr {
        PFCP.send(ts_PFCP_Assoc_Release_Req(g_pars.local_node_id));
-       PFCP.receive(tr_PFCP_Assoc_Release_Resp(cause := 
tr_PFCP_Cause(REQUEST_ACCEPTED)));
+       PFCP.receive(tr_PFCP_Assoc_Release_Resp(cause := 
tr_PFCP_Cause(PFCP_Cause_REQUEST_ACCEPTED)));
 }

 /* Collection of what a test intends to send to osmo-upf */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43881?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I94d089bbfbca233fbb2393387eea0ab723e0c708
Gerrit-Change-Number: 43881
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to