pespin has uploaded this change for review. ( 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(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/81/43881/1 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..b495555 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 := 0; +const OCT1 PFCP_Cause_REQUEST_ACCEPTED := 1; +const OCT1 PFCP_Cause_MORE_USAGE_REPORT_TO_SEND := 2; +const OCT1 PFCP_Cause_REQUEST_REJECTED := 64; +const OCT1 PFCP_Cause_SESSION_CTX_NOT_FOUND := 65; +const OCT1 PFCP_Cause_MANDATORY_IE_MISSING := 66; +const OCT1 PFCP_Cause_CONDITIONAL_IE_MISSING := 67; +const OCT1 PFCP_Cause_INVALID_LENGTH := 68; +const OCT1 PFCP_Cause_MANDATORY_IE_INCORRECT := 69; +const OCT1 PFCP_Cause_INVALID_FORW_POLICY := 70; +const OCT1 PFCP_Cause_INVALID_F_TEID_ALLOC_OPTION := 71; +const OCT1 PFCP_Cause_NO_ESTABLISHED_PFCP_ASSOC := 72; +const OCT1 PFCP_Cause_RULE_CREATION_MOD_FAILURE := 73; +const OCT1 PFCP_Cause_PFCP_ENTITY_IN_CONGESTION := 74; +const OCT1 PFCP_Cause_NO_RESOURCES_AVAILABLE := 75; +const OCT1 PFCP_Cause_SERVICE_NOT_SUPPORTED := 76; +const OCT1 PFCP_Cause_SYSTEM_FAILURE := 77; +const OCT1 PFCP_Cause_REDIRECTION_REQUESTED := 78; +const OCT1 PFCP_Cause_ALL_DYNAMIC_ADDRESSES_ARE_OCCUPIED := 79; -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 9afb1d7..44bf25b 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: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I94d089bbfbca233fbb2393387eea0ab723e0c708 Gerrit-Change-Number: 43881 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin@sysmocom.de>