lists.osmocom.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2026
October
September
August
July
June
May
April
March
February
January
2025
December
November
October
September
August
July
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
List overview
Download
gerrit-log
October 2026
----- 2026 -----
October 2026
September 2026
August 2026
July 2026
June 2026
May 2026
April 2026
March 2026
February 2026
January 2026
----- 2025 -----
December 2025
November 2025
October 2025
September 2025
August 2025
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
gerrit-log@lists.osmocom.org
1 participants
1166 discussions
Start a n
N
ew thread
[L] Change in osmo-ttcn3-hacks[master]: Introduce udr testsuite
by osmith
22 Oct '26
22 Oct '26
Attention is currently required from: pespin. osmith has posted comments on this change by pespin. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43948?usp=email
) Change subject: Introduce udr testsuite ...................................................................... Patch Set 2: Code-Review+1 (1 comment) File udr/ConnHdlr.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43948/comment/8b18ce70_cc33…
: PS2, Line 292: ts_HTTP2_Hdr_accept("application/json,application/problem+json"), TIL about
https://datatracker.ietf.org/doc/html/rfc7807
-- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43948?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I025c7e87e9a8308c084edc7a7da23c080a0dc970 Gerrit-Change-Number: 43948 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 22 Oct 2026 06:24:17 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1
0
0
0
[XL] Change in osmo-ttcn3-hacks[master]: Introduce udm testsuite
by osmith
22 Oct '26
22 Oct '26
Attention is currently required from: fixeria, pespin. osmith has posted comments on this change by pespin. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43932?usp=email
) Change subject: Introduce udm testsuite ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43932?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia9a2a055ee81c889de00ef86f8562425862ea5e3 Gerrit-Change-Number: 43932 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 22 Oct 2026 06:17:54 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1
0
0
0
[M] Change in osmo-ttcn3-hacks[master]: smf: Introduce test TC_createSession_pfcp_sess_est_timeout
by pespin
21 Oct '26
21 Oct '26
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43902?usp=email
) ( 6 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: smf: Introduce test TC_createSession_pfcp_sess_est_timeout ...................................................................... smf: Introduce test TC_createSession_pfcp_sess_est_timeout Change-Id: I005cc6c6afd3f9aba15790e8cd67eeaa2f4d4b89 --- M library/GTPv2_Templates.ttcn M smf/SMF_Session_CT_4G.ttcn M smf/SMF_Tests.ttcn M smf/expected-results.xml 4 files changed, 72 insertions(+), 18 deletions(-) Approvals: fixeria: Looks good to me, approved osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/library/GTPv2_Templates.ttcn b/library/GTPv2_Templates.ttcn index 3073a64..1664f9a 100644 --- a/library/GTPv2_Templates.ttcn +++ b/library/GTPv2_Templates.ttcn @@ -176,6 +176,7 @@ New_PDN_type_due_to_single_address_bearer_only (19), /* ... */ Context_Not_Found (64), + System_Failure (72), APN_access_denied__no_subscription (93) } with { variant "FIELDLENGTH(8)" encode "RAW" }; diff --git a/smf/SMF_Session_CT_4G.ttcn b/smf/SMF_Session_CT_4G.ttcn index 35a2b5f..c2cf3d7 100644 --- a/smf/SMF_Session_CT_4G.ttcn +++ b/smf/SMF_Session_CT_4G.ttcn @@ -165,6 +165,20 @@ } } +function f_DIA_handle_delete_session() runs on SMF_Session_CT +{ + var boolean do_s6b := is_s2b_iface(); + if (do_s6b and DIAMETER[DIA_S6b].checkstate("Connected")) { + as_DIA_S6b_STR(); + } + if (DIAMETER[DIA_Gx].checkstate("Connected")) { + as_DIA_Gx_CCR(TERMINATION_REQUEST); + } + if (DIAMETER[DIA_Gy].checkstate("Connected")) { + as_DIA_Gy_CCR(TERMINATION_REQUEST); + } +} + /* GTPv2C */ private function is_s2b_iface() runs on SMF_Session_CT return boolean { return (g_pars.rat_type == GTP2C_RAT_WLAN or g_pars.rat_type == GTP2C_RAT_Virtual); @@ -433,15 +447,8 @@ as_pfcp_sess_del_req(); } - if (is_s2b_iface() and DIAMETER[DIA_S6b].checkstate("Connected") and expect_diameter) { - as_DIA_S6b_STR(); - } - - if (DIAMETER[DIA_Gx].checkstate("Connected") and expect_diameter) { - as_DIA_Gx_CCR(TERMINATION_REQUEST); - } - if (DIAMETER[DIA_Gy].checkstate("Connected") and expect_diameter) { - as_DIA_Gy_CCR(TERMINATION_REQUEST); + if (expect_diameter) { + f_DIA_handle_delete_session(); } alt { [] GTP2.receive(tr_GTP2C_DeleteSessionResp(d_teid := g_pars.teic_local, cause := exp_cause)) { @@ -496,15 +503,8 @@ rx_pdu.gtpcv2_pdu.deleteBearerRequest.epsBearerIdentity[0].ePS_Bearer_ID_Value, Request_accepted); GTP2.send(tx_pdu); - if (is_s2b_iface() and DIAMETER[DIA_S6b].checkstate("Connected") and expect_diameter) { - as_DIA_S6b_STR(); - } - - if (DIAMETER[DIA_Gx].checkstate("Connected") and expect_diameter) { - as_DIA_Gx_CCR(TERMINATION_REQUEST); - } - if (DIAMETER[DIA_Gy].checkstate("Connected") and expect_diameter) { - as_DIA_Gy_CCR(TERMINATION_REQUEST); + if (expect_diameter) { + f_DIA_handle_delete_session(); } setverdict(pass); } diff --git a/smf/SMF_Tests.ttcn b/smf/SMF_Tests.ttcn index 3a6b1d6..d737688 100644 --- a/smf/SMF_Tests.ttcn +++ b/smf/SMF_Tests.ttcn @@ -428,6 +428,57 @@ f_TC_createSession_deleteSession_250(c_PFCP_PDN_Type_IPv4v6); } +/* create an IPv4 session, then delete it again */ +private function f_TC_createSession_pfcp_sess_est_timeout() runs on SMF_Session_CT { + var PrometheusExpects expects0 := valueof({ + ts_PrometheusExpect("ues_active", GAUGE, min := 0, max := 0), + ts_PrometheusExpect("gtp2_sessions_active", GAUGE, min := 0, max := 0) + }); + var PrometheusExpects expects1 := valueof({ + ts_PrometheusExpect("ues_active", GAUGE, min := 1, max := 1), + ts_PrometheusExpect("gtp2_sessions_active", GAUGE, min := 1, max := 1) + }); + f_prometheus_expect(expects0, wait_converge := true); + + + /* Subscribe for PFCP Session Establishment Request PDU(s), which are + * expected to have SEID set to 0, as per 3GPP TS 29.244, section 7.2.2.4.2. */ + f_PFCPEM_subscribe_seid(c_SEID0); + + + f_s5s8_tx_create_session_req(f_s5s8_fteid_c_ie(), + f_s5s8_fteid_u_ie(), + f_s5s8_UserLocationInfo()); + f_DIA_handle_create_sesion(); + + f_prometheus_expect(expects1, wait_converge := true); + + log("Waiting 1st PFCP Sess Est Req"); + PFCP.receive(f_Session_tr_PFCP_Session_Est_Req()); + log("RX 1st PFCP Sess Est Req"); + PFCP.receive(f_Session_tr_PFCP_Session_Est_Req()); + log("RX 2nd PFCP Sess Est Req"); + PFCP.receive(f_Session_tr_PFCP_Session_Est_Req()); + log("RX 3rd PFCP Sess Est Req"); + + f_DIA_handle_delete_session(); + /* This currently may fail to be transmitted due to: + *
https://github.com/open5gs/open5gs/issues/4876
+ * */ + GTP2.receive(tr_GTP2C_CreateSessionResp(d_teid := g_pars.teic_local, + cause := System_Failure)); + f_prometheus_expect(expects0, wait_converge := true); + setverdict(pass); +} +testcase TC_createSession_pfcp_sess_est_timeout() runs on SMF_Test_CT { + var SMF_Session_CT vc_conn; + var SessionPars pars := f_SessionPars(11); + f_init(); + vc_conn := f_start_handler(refers(f_TC_createSession_pfcp_sess_est_timeout), pars); + vc_conn.done; + f_shutdown(); +} + /* send a DeleteSessionReq for an unknown/invalid TEID */ private function f_TC_deleteSession_unknown() runs on SMF_Session_CT { g_pars.teic_remote := f_rnd_octstring(4); @@ -766,6 +817,7 @@ execute( TC_createSession_deleteSession_250() ); execute( TC_createSession_deleteSession_250_ipv6() ); execute( TC_createSession_deleteSession_250_ipv4v6() ); + execute( TC_createSession_pfcp_sess_est_timeout() ); execute( TC_deleteSession_unknown() ); execute( TC_gy_charging_cc_time() ); execute( TC_gy_ccr_update_rejected() ); diff --git a/smf/expected-results.xml b/smf/expected-results.xml index aab8202..1493d31 100644 --- a/smf/expected-results.xml +++ b/smf/expected-results.xml @@ -7,6 +7,7 @@ <testcase classname='SMF_Tests' name='TC_createSession_deleteSession_250' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_createSession_deleteSession_250_ipv6' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_createSession_deleteSession_250_ipv4v6' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_createSession_pfcp_sess_est_timeout' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_deleteSession_unknown' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_gy_charging_cc_time' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_gy_ccr_update_rejected' time='MASKED'/> -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43902?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: I005cc6c6afd3f9aba15790e8cd67eeaa2f4d4b89 Gerrit-Change-Number: 43902 Gerrit-PatchSet: 8 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1
0
0
0
[M] Change in osmo-ttcn3-hacks[master]: smf: Introduce test TC_5g_pfcp_heartbeat_recovery_timestamp
by pespin
21 Oct '26
21 Oct '26
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43906?usp=email
) Change subject: smf: Introduce test TC_5g_pfcp_heartbeat_recovery_timestamp ...................................................................... smf: Introduce test TC_5g_pfcp_heartbeat_recovery_timestamp Change-Id: Ie1511ef9cfad49e089bd5f2f0638feaf24c6e4c2 --- M smf/SMF_Tests.ttcn M smf/expected-results.xml 2 files changed, 54 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, approved osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/smf/SMF_Tests.ttcn b/smf/SMF_Tests.ttcn index 2c6067b..6101202 100644 --- a/smf/SMF_Tests.ttcn +++ b/smf/SMF_Tests.ttcn @@ -869,6 +869,58 @@ f_shutdown(); } +/* Validate IUT detects PFCP Heartbeat Recovery Timestamp change and recovers from it restoring + * existing subscriber connections: */ +private template (value) PrometheusExpects t_TC_5g_pfcp_heartbeat_recovery_timestamp(integer pfcp_peers_active, integer ues_active) := { + ts_PrometheusExpect("pfcp_peers_active", GAUGE, min := pfcp_peers_active, max := pfcp_peers_active), + ts_PrometheusExpect("ues_active", GAUGE, min := ues_active, max := ues_active), + ts_PrometheusExpect("pfcp_sessions_active", GAUGE, min := ues_active, max := ues_active) +}; +private function f_TC_5g_pfcp_heartbeat_recovery_timestamp() runs on SMF_Session_CT { + var PDU_PFCP m; + var integer rts := f_PFCPEM_get_recovery_timestamp(); + + f_prometheus_expect(valueof(t_TC_5g_pfcp_heartbeat_recovery_timestamp(1, 0)), wait_converge := true); + + f_PFCPEM_subscribe_bcast(); + as_pfcp_handle_heartbeat_req(rts); + + f_n11_create_session(); + f_prometheus_expect(valueof(t_TC_5g_pfcp_heartbeat_recovery_timestamp(1, 1)), wait_converge := true); + + rts := rts + 1; + as_pfcp_handle_heartbeat_req(rts); + activate(as_pfcp_handle_heartbeat_req(rts, do_repeat := true)); + + /* Wait for IUT to detect during rx of Heartbeat Response that peer restarted, ie. wait for a + * 2nd ASSOC SETUP REQ after Heartbeat timeout: */ + PFCP.receive(tr_PFCP_Assoc_Setup_Req()) -> value m; + + f_prometheus_expect(valueof(t_TC_5g_pfcp_heartbeat_recovery_timestamp(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(PFCP_Cause_REQUEST_ACCEPTED), + rts, + up_function_features := ts_PFCP_UP_Function_Features(ftup := '1'B, + vtime := '1'B))); + + /* IUT restores existing subscriber connections */ + as_pfcp_sess_est_req(exp_sess_restoration := true); + + f_n11_delete_session(); + setverdict(pass); +} +testcase TC_5g_pfcp_heartbeat_recovery_timestamp() runs on SMF_Test_CT { + var SMF_Session_CT vc_conn; + var SessionPars pars := f_SessionPars(12, + rat_type := GTP2C_RAT_NR); + g_pfcp_answer_heartbeat_req := false; + f_init(guard_timeout := 60.0); + vc_conn := f_start_handler(refers(f_TC_5g_pfcp_heartbeat_recovery_timestamp), pars); + vc_conn.done; + f_shutdown(); +} + control { execute( TC_tx_echo() ); execute( TC_createSession_deleteSession() ); @@ -894,6 +946,7 @@ execute( TC_n11_createSession_deleteSession_250_ipv6() ); execute( TC_n11_createSession_deleteSession_250_ipv4v6() ); execute( TC_5g_pfcp_heartbeat_timeout() ); + execute( TC_5g_pfcp_heartbeat_recovery_timestamp() ); } diff --git a/smf/expected-results.xml b/smf/expected-results.xml index 77ba9ca..2d5c61c 100644 --- a/smf/expected-results.xml +++ b/smf/expected-results.xml @@ -22,4 +22,5 @@ <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250_ipv6' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250_ipv4v6' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_5g_pfcp_heartbeat_timeout' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_5g_pfcp_heartbeat_recovery_timestamp' time='MASKED'/> </testsuite> -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43906?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: Ie1511ef9cfad49e089bd5f2f0638feaf24c6e4c2 Gerrit-Change-Number: 43906 Gerrit-PatchSet: 7 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1
0
0
0
[M] Change in osmo-ttcn3-hacks[master]: smf: Introduce test TC_5g_pfcp_heartbeat_timeout
by pespin
21 Oct '26
21 Oct '26
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43905?usp=email
) Change subject: smf: Introduce test TC_5g_pfcp_heartbeat_timeout ...................................................................... smf: Introduce test TC_5g_pfcp_heartbeat_timeout Change-Id: Id1db247658aa11e10626357fbb47616ba425fb7f --- M library/NG_NAS_Osmo_Templates.ttcn M smf/SMF_Session_CT_5G.ttcn M smf/SMF_Tests.ttcn M smf/expected-results.xml 4 files changed, 223 insertions(+), 5 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve diff --git a/library/NG_NAS_Osmo_Templates.ttcn b/library/NG_NAS_Osmo_Templates.ttcn index eabe221..b2d4e83 100644 --- a/library/NG_NAS_Osmo_Templates.ttcn +++ b/library/NG_NAS_Osmo_Templates.ttcn @@ -1023,6 +1023,33 @@ } }; +template (present) NG_NAS_DL_SM_Message_Type +cr_NG_SM_PDU_SESSION_RELEASE_COMMAND(template (present) NG_PDU_SessionId p_PDU_SessionId := ?, + template (present) ProcedureTransactionIdentifier p_PTI := ?, + template (present) GMM_GSM_Cause p_Cause := ?, + template GPRS_Timer3 p_BackOffTimer := *, + template EAP_Message p_EAP := *, + template NGSM_CongestionReattemptInd p_NGSM_CongestionReattemptInd := *, // @sic R5s190543 sic@ + template ExtdProtocolConfigOptions p_ExtdPCO := *, + template AccessType p_AccessType := *, + template ServiceLvlAAContainer p_ServiceLvlAA := *) := +{ + /* 24.501 cl. 8.3.14 */ + pdu_Session_Release_Command := { + protocolDiscriminator := tsc_EPD_GSM, /* cl. 9.2 M V 1 */ + pduSessionId := p_PDU_SessionId, /* cl. 9.4 M V 1 */ + procedureTransactionIdentifier := p_PTI, /* cl. 9.6 M V 1 */ + messageType := tsc_MT_NG_PDUSessionReleaseCommand, /* cl. 9.7 M V 1 */ + gsmCause := p_Cause, /* cl. 9.11.4.2 M V 1 */ + backOffTimerValue := p_BackOffTimer, /* cl. 9.11.2.5 O TLV 3 IEI=37 */ + eapMessage := p_EAP, /* cl. 9.11.2.2 O TLV-E 7-1503 IEI=78 */ + ngsmCongestionReattemptInd := p_NGSM_CongestionReattemptInd, /* cl. 9.11.4.2A O TLV 3 IEI=61 Jun19 @sic R5s190543 sic@ */ + extdProtocolConfigurationOptions := p_ExtdPCO, /* cl. 9.11.4.6 O TLV-E 4-65538 IEI=0x7B */ + accessType := p_AccessType, /* cl. 9.11.2.1A O TV 1 IEI=D Sep20 @sic R5s201387 Baseline Moving sic@ */ + serviceLvlAA := p_ServiceLvlAA /* cl. 9.11.2.10 O TLV-E 6-n IEI=72 Sep22 @sic R5s221179 Baseline Moving sic@ */ + } +}; + /* 24.501 cl. 8.3.15 */ template (value) NG_NAS_UL_Message_Type cs_NG_PDU_SESSION_RELEASE_COMPLETE(template (value) NG_PDU_SessionId p_PDU_SessionId, diff --git a/smf/SMF_Session_CT_5G.ttcn b/smf/SMF_Session_CT_5G.ttcn index ab35f03..c550ec2 100644 --- a/smf/SMF_Session_CT_5G.ttcn +++ b/smf/SMF_Session_CT_5G.ttcn @@ -354,7 +354,57 @@ setverdict(pass); } -/* 3GPP TS 29.502 5.2.2.4 Release SM Context service operation */ +/* 3GPP TS 23.502 4.3.7 CN-initiated selective deactivation of UP connection of an existing PDU Session (step 9) + * 3GPP TS 23.502 Figure 4.3.4.2-1 step 7a */ +function f_n11_update_sm_context_pdu_sess_release_ngap() +runs on SMF_Session_CT { + var template (value) SmContextUpdateData sm_ctx_update; + var template (value) octetstring body_enc; + var integer http2_stream_id := 3; + var HTTP2_Msg http2_tx; + var HTTP2_Msg http2_rx; + + sm_ctx_update := ts_SmContextUpdateData(ueLocation := f_ts_UserLocation(), + n2SmInfo := TS29502_Nsmf_PDUSession_Templates.ts_RefToBinaryData("ngap-sm"), + n2SmInfoType := ts_N2SmInfoType(PDU_RES_REL_RSP)); + var octetstring ngap_enc := enc_NGAP_PDUSessionResourceReleaseResponseTransfer(valueof(m_pDUSessionResourceReleaseResponseTransfer())); + + http2_tx := f_n11_prepare_update_sm_context(valueof(sm_ctx_update), ngap_enc, omit); + + f_http2_adapter_connect(mp_smf_hostname, mp_smf_sbi_port, mp_amf_local_ip, idx := http2_tx.conn_id); + f_http2_adapter_send(http2_tx); + + /* Successful answer with no content: */ + as_http2_adapter_receive(http2_rx, tr_HTTP2_Msg_204_No_Content(), idx := http2_tx.conn_id); + f_http2_adapter_close(idx := http2_tx.conn_id); + setverdict(pass); +} + +function f_n11_update_sm_context_pdu_sess_release_ngnas() +runs on SMF_Session_CT { + var template (value) SmContextUpdateData sm_ctx_update; + var template (value) octetstring body_enc; + var integer http2_stream_id := 3; + var HTTP2_Msg http2_tx; + var HTTP2_Msg http2_rx; + + sm_ctx_update := ts_SmContextUpdateData(ueLocation := f_ts_UserLocation(), + n1SmMsg := TS29502_Nsmf_PDUSession_Templates.ts_RefToBinaryData("5gnas-sm")); + var octetstring ngnas_enc := f_ng_nas_gen_session_release_complete(); + + http2_tx := f_n11_prepare_update_sm_context(valueof(sm_ctx_update), omit, ngnas_enc); + + f_http2_adapter_connect(mp_smf_hostname, mp_smf_sbi_port, mp_amf_local_ip, idx := http2_tx.conn_id); + f_http2_adapter_send(http2_tx); + + /* Successful answer with no content: */ + as_http2_adapter_receive(http2_rx, tr_HTTP2_Msg_204_No_Content(), idx := http2_tx.conn_id); + f_http2_adapter_close(idx := http2_tx.conn_id); + setverdict(pass); +} + +/* 3GPP TS 29.502 5.2.2.4 Release SM Context service operation + * 3GPP TS 23.502 Figure 4.3.4.2-1 step 10a */ private function f_n11_prepare_release_sm_context(SmContextReleaseData sm_ctx_rel, template (omit) octetstring ngap_enc := omit) runs on SMF_Session_CT return HTTP2_Msg { @@ -524,6 +574,48 @@ } } +/* 5.2.2.3.1 N1N2MessageTransfer, PDU Session release (see clause 4.3.4 of TS 3GPP 23.502) + * 3GPP TS 23.502 4.3.7 CN-initiated selective deactivation of UP connection of an existing PDU Session */ +altstep as_namf_comm_post_n1n2_messages_pdu_sess_release_command() +runs on SMF_Session_CT { + var HTTP2_Msg http2_rx; + var HTTP2_multipart_part_list parts; + [] as_namf_comm_post_n1n2_messages(http2_rx, parts) { + var N1N2MessageTransferReqData n1n2msg_req; + var NGAP_IEs.PDUSessionResourceReleaseCommandTransfer rel_cmd_transf; + var template (value) N1N2MessageTransferRspData n1n2msg_rsp; + var NG_NAS_DL_SM_Message_Type dl_nas; + var template (value) HTTP2_Msg http2_tx; + var octetstring body_enc; + + /* Decode 1st part: SBI json: */ + f_dec_N1N2MessageTransferReqData(parts[0].data, n1n2msg_req); // TODO: check returned integer. + + /* Decode 2nd part: NG-NAS: */ + dl_nas := dec_NG_NAS_DL_SM_Message_Type(parts[1].data); + f_ng_nas_handle_session_release_command(dl_nas); + + /* Decode 3rd part: NGAP: 3GPP TS 24.501 8.3.14 */ + rel_cmd_transf := dec_NGAP_PDUSessionResourceReleaseCommandTransfer(parts[2].data); + f_ngap_pdu_handle_PDUSessionResourceReleaseCommandTransfer(rel_cmd_transf); + + /* Tx answer: */ + n1n2msg_rsp := ts_N1N2MessageTransferRspData(cause := ts_N1N2MessageTransferCause(N1_N2_TRANSFER_INITIATED)) + body_enc := f_enc_N1N2MessageTransferRspData(valueof(n1n2msg_rsp)); + + http2_tx := ts_HTTP2_Msg_200_OK(http2_rx.conn_id, + http2_rx.stream_id, + headers := { + ts_HTTP2_Hdr_content_type("application/json; charset=utf-8") + }, + body := ts_HTTP2_Data_frame(http2_rx.stream_id, + end_stream_flag := true, + data := body_enc)); + HTTP2_CONN[HTTP2_CONN_SCP].send(http2_tx); + setverdict(pass); + } +} + /************************************************ * N10 Nudm (SBI): Emulated UDM, 3GPP TS 29.503 ************************************************/ @@ -642,7 +734,7 @@ } /* 3GPP TS 29.503 5.3.2.4.4 SMF deregistration */ -private altstep as_nudm_uecm_delete_IndividualSmfRegistration() +altstep as_nudm_uecm_delete_IndividualSmfRegistration() runs on SMF_Session_CT { var HTTP2_Msg http2_rx; [] HTTP2_CONN[HTTP2_CONN_SCP].receive(f_tr_Nudm_UECM_delete_IndividualSmfRegistration()) -> value http2_rx { @@ -793,7 +885,7 @@ } /* 3GPP TS 29.503 5.2.2.3.2 Subscription to notifications of data change */ -private altstep as_nudm_sdm_delete_IndividualSubscription() +altstep as_nudm_sdm_delete_IndividualSubscription() runs on SMF_Session_CT { var HTTP2_Msg http2_rx; [] HTTP2_CONN[HTTP2_CONN_SCP].receive(f_tr_Nudm_SDM_delete_IndividualSubscription()) -> value http2_rx { @@ -900,7 +992,7 @@ } /* 3GPP TS 29.503 4.2.5.2 SM Policy Association termination */ -private altstep as_npcf_smpolicycontrol_post_IndividualSMPOlicyTermination() +altstep as_npcf_smpolicycontrol_post_IndividualSMPOlicyTermination() runs on SMF_Session_CT { var HTTP2_Msg http2_rx; [] HTTP2_CONN[HTTP2_CONN_SCP].receive(f_tr_SMPolicyControl_post_IndividualSMPolicyTermination()) -> value http2_rx { @@ -968,6 +1060,17 @@ } } +private function f_ngap_pdu_handle_PDUSessionResourceReleaseCommandTransfer(NGAP_IEs.PDUSessionResourceReleaseCommandTransfer rel_cmd_transf) +runs on SMF_Session_CT { + var template (present) PDUSessionResourceReleaseCommandTransfer exp; + + exp := mw_pDUSessionResourceReleaseCommandTransfer(p_cause := m_cause_nas(normal_release)) + if (not match(rel_cmd_transf, exp)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Rx unexpected DL NGAP: ", rel_cmd_transf, " vs exp ", exp)); + } +} + private function f_ngap_pdu_gen_PDUSessionResourceSetupResponseTransfer() runs on SMF_Session_CT return octetstring { var template (value) UPTransportLayerInformation utla; @@ -1075,4 +1178,31 @@ } } +private function f_ng_nas_handle_session_release_command(NG_NAS_DL_SM_Message_Type dl_nas) +runs on SMF_Session_CT { + var template (present) NG_NAS_DL_SM_Message_Type exp_rx_nas; + + exp_rx_nas := cr_NG_SM_PDU_SESSION_RELEASE_COMMAND(p_PDU_SessionId := cs_NG_PDU_SessionIdV(int2oct(g_pars.namf.pdu_sess_id, 1)), + p_Cause := cs_GMM_GSM_Cause(omit, int2bit(39 /* Reactivation Requested */, 8))); + if (not match(dl_nas, exp_rx_nas)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Rx unexpected DL NG-NAS: ", dl_nas, " vs exp ", exp_rx_nas)); + } +} + +/* 3GPP TS 24.501 8.3.15 PDU session release complete */ +private function f_ng_nas_gen_session_release_complete() +runs on SMF_Session_CT return octetstring { + var BIT3 pdu_sess_type := f_pfcp_pdn_type_2_ng_nas_pdu_session_type(g_pars.pfcp_pars.pdn_type); + var ProcedureTransactionIdentifier pti := f_next_pti(); + var template (value) NG_NAS_UL_Message_Type nas_ul_msg; + var octetstring nas_enc; + + nas_ul_msg := cs_NG_PDU_SESSION_RELEASE_COMPLETE(cs_NG_PDU_SessionIdV(int2oct(g_pars.namf.pdu_sess_id, 1)), + pti, + cs_GMM_GSM_Cause('59'O, '00100100'B)); + nas_enc := enc_NG_NAS_UL_Message_Type(valueof(nas_ul_msg)); + return nas_enc; +} + } diff --git a/smf/SMF_Tests.ttcn b/smf/SMF_Tests.ttcn index d737688..2c6067b 100644 --- a/smf/SMF_Tests.ttcn +++ b/smf/SMF_Tests.ttcn @@ -809,6 +809,66 @@ f_TC_n11_createSession_deleteSession_250(c_PFCP_PDN_Type_IPv4v6); } +/* Validate IUT detects PFCP Heartbeat timeout and recovers from it tearing down + * existing subscriber connections: */ +private template (value) PrometheusExpects t_TC_5g_pfcp_heartbeat_timeout_Metrics_Expect(integer pfcp_peers_active, integer ues_active) := { + ts_PrometheusExpect("pfcp_peers_active", GAUGE, min := pfcp_peers_active, max := pfcp_peers_active), + ts_PrometheusExpect("ues_active", GAUGE, min := ues_active, max := ues_active), + ts_PrometheusExpect("pfcp_sessions_active", GAUGE, min := ues_active, max := ues_active) +}; +private function f_TC_5g_pfcp_heartbeat_timeout() runs on SMF_Session_CT { + var PDU_PFCP m; + var integer rts := f_PFCPEM_get_recovery_timestamp(); + + f_prometheus_expect(valueof(t_TC_5g_pfcp_heartbeat_timeout_Metrics_Expect(1, 0)), wait_converge := true); + + /* Drop all received Hearbeat requests from IUT: */ + f_PFCPEM_subscribe_bcast(); + var default d := activate(as_pfcp_ignore(PFCP, tr_PFCP_Heartbeat_Req)); + + f_n11_create_session(); + f_prometheus_expect(valueof(t_TC_5g_pfcp_heartbeat_timeout_Metrics_Expect(1, 1)), wait_converge := true); + + /* Wait for IUT to detect peer went down after Heartbeat timeout, ie. wait for sessions + * being released and another ASSOC SETUP REQ to attempt re-association: */ + as_namf_comm_post_n1n2_messages_pdu_sess_release_command(); + f_n11_update_sm_context_pdu_sess_release_ngap(); + f_n11_update_sm_context_pdu_sess_release_ngnas(); + + /* SMF deletes policy in PCF: */ + as_npcf_smpolicycontrol_post_IndividualSMPOlicyTermination(); + + /* SMF deregisters on UDM: */ + as_nudm_sdm_delete_IndividualSubscription(); + as_nudm_uecm_delete_IndividualSmfRegistration(); + + f_prometheus_expect(valueof(t_TC_5g_pfcp_heartbeat_timeout_Metrics_Expect(0, 0)), wait_converge := true); + + PFCP.receive(tr_PFCP_Assoc_Setup_Req()) -> value m; + deactivate(d); + activate(as_pfcp_handle_heartbeat_req(rts, do_repeat := 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(PFCP_Cause_REQUEST_ACCEPTED), + rts, + up_function_features := ts_PFCP_UP_Function_Features(ftup := '1'B, + vtime := '1'B))); + + /* After we answer the ASSOC SETUP RESP, IUT detects peer up: */ + f_prometheus_expect(valueof(t_TC_5g_pfcp_heartbeat_timeout_Metrics_Expect(1, 0)), wait_converge := true); + setverdict(pass); +} +testcase TC_5g_pfcp_heartbeat_timeout() runs on SMF_Test_CT { + var SMF_Session_CT vc_conn; + var SessionPars pars := f_SessionPars(9, + rat_type := GTP2C_RAT_NR); + g_pfcp_answer_heartbeat_req := false; + f_init(guard_timeout := 60.0); + vc_conn := f_start_handler(refers(f_TC_5g_pfcp_heartbeat_timeout), pars); + vc_conn.done; + f_shutdown(); +} + control { execute( TC_tx_echo() ); execute( TC_createSession_deleteSession() ); @@ -830,10 +890,10 @@ execute( TC_n11_createSession_deleteSession() ); execute( TC_n11_createSession_deleteSession_ipv6() ); execute( TC_n11_createSession_deleteSession_ipv4v6() ); - execute( TC_n11_createSession_deleteSession_250() ); execute( TC_n11_createSession_deleteSession_250_ipv6() ); execute( TC_n11_createSession_deleteSession_250_ipv4v6() ); + execute( TC_5g_pfcp_heartbeat_timeout() ); } diff --git a/smf/expected-results.xml b/smf/expected-results.xml index 1493d31..77ba9ca 100644 --- a/smf/expected-results.xml +++ b/smf/expected-results.xml @@ -21,4 +21,5 @@ <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250_ipv6' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250_ipv4v6' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_5g_pfcp_heartbeat_timeout' time='MASKED'/> </testsuite> -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43905?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: Id1db247658aa11e10626357fbb47616ba425fb7f Gerrit-Change-Number: 43905 Gerrit-PatchSet: 9 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1
0
0
0
[S] Change in osmo-ttcn3-hacks[master]: smf: Remove unused open5gs-nrf.yaml
by pespin
21 Oct '26
21 Oct '26
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43922?usp=email
) Change subject: smf: Remove unused open5gs-nrf.yaml ...................................................................... smf: Remove unused open5gs-nrf.yaml Change-Id: Iade84e45f120ecfec47c32bb53f2d1a7d5006825 --- D smf/open5gs-nrf.yaml 1 file changed, 0 insertions(+), 40 deletions(-) Approvals: osmith: Looks good to me, approved Jenkins Builder: Verified diff --git a/smf/open5gs-nrf.yaml b/smf/open5gs-nrf.yaml deleted file mode 100644 index 57f5b45..0000000 --- a/smf/open5gs-nrf.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# See
https://github.com/open5gs/open5gs/blob/main/configs/open5gs/nrf.yaml.in
- -db_uri: mongodb://localhost/open5gs - -logger: - level: debug - -global: - max: - ue: 1024 - -sbi: - server: - no_tls: true - cacert: /etc/open5gs/tls/ca.crt - key: /etc/open5gs/tls/nrf.key - cert: /etc/open5gs/tls/nrf.crt - client: - no_tls: true - cacert: /etc/open5gs/tls/ca.crt - key: /etc/open5gs/tls/nrf.key - cert: /etc/open5gs/tls/nrf.crt - -nrf: - sbi: - server: - - address: 127.0.0.10 - port: 7777 - -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - - -parameter: - -max: - -time: -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43922?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: Iade84e45f120ecfec47c32bb53f2d1a7d5006825 Gerrit-Change-Number: 43922 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1
0
0
0
[M] Change in osmo-ttcn3-hacks[master]: smf: Introduce test TC_n11_createSession_pfcp_sess_est_timeout
by pespin
21 Oct '26
21 Oct '26
pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43907?usp=email
) Change subject: smf: Introduce test TC_n11_createSession_pfcp_sess_est_timeout ...................................................................... smf: Introduce test TC_n11_createSession_pfcp_sess_est_timeout Change-Id: I8edbfb261b8dfe629326410ced3dbf63491ad029 --- M library/NG_NAS_Osmo_Templates.ttcn M smf/SMF_Session_CT_5G.ttcn M smf/SMF_Tests.ttcn M smf/expected-results.xml 4 files changed, 198 insertions(+), 24 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/library/NG_NAS_Osmo_Templates.ttcn b/library/NG_NAS_Osmo_Templates.ttcn index b2d4e83..f7a481e 100644 --- a/library/NG_NAS_Osmo_Templates.ttcn +++ b/library/NG_NAS_Osmo_Templates.ttcn @@ -881,6 +881,34 @@ } } +/* 24.501 cl. 8.3.3 */ +template (present) NG_NAS_DL_SM_Message_Type +cr_NG_SM_PDU_SESSION_ESTABLISHMENT_REJECT(template (present) NG_PDU_SessionId p_PDU_SessionId := ?, + template (present) ProcedureTransactionIdentifier p_PTI := ?, + template (present) GMM_GSM_Cause p_Cause := ?, + template GPRS_Timer3 p_BackOff := *, + template AllowedSSCMode p_SSC_Mode := *, + template EAP_Message p_EAP := *, + template ExtdProtocolConfigOptions p_ExtdPCO := *, + template ReAttemptIndicator p_ReAttemptIndicator := *, + template NGSM_CongestionReattemptInd p_NGSM_CongestionReattemptInd := *, // @sic R5s190543 sic@ + template ServiceLvlAAContainer p_ServiceLvlAA := *) := { + pdu_Session_Establishment_Reject := { + protocolDiscriminator := tsc_EPD_GSM, /* cl. 9.2 M V 1 */ + pduSessionId := p_PDU_SessionId, /* cl. 9.4 M V 1 */ + procedureTransactionIdentifier := p_PTI, /* cl. 9.6 M V 1 */ + messageType := tsc_MT_NG_PDUSessionEstablishmentReject, /* cl. 9.7 M V 1 */ + gsmCause := p_Cause, /* cl. 9.11.4.2 M V 1 */ + backOffTimerValue := p_BackOff, /* cl. 9.11.2.5 O TLV 3 IEI=37 */ + allowedSSCMode := p_SSC_Mode, /* cl. 9.11.4.5 O TV 1 IEI=F */ + eapMessage := p_EAP, /* cl. 9.11.2.2 O TLV-E 7-1503 IEI=78 */ + ngsmCongestionReattemptInd := p_NGSM_CongestionReattemptInd, /* cl. 9.11.4.2A O TLV 3 IEI=61 Jun19 @sic R5s201387, R5s210444 Baseline Moving sic@ */ + extdProtocolConfigurationOptions := p_ExtdPCO, /* cl. 9.11.4.6 O TLV-E 4-65538 IEI=0x7B */ + reattemptInd := p_ReAttemptIndicator, /* cl. 9.11.4.17 O TLV 3 IEI=1D Sep20 @sic R5s201387 Baseline Moving sic@ */ + serviceLvlAA := p_ServiceLvlAA /* cl. 9.11.2.10 O TLV-E 6-n IEI=72 Sep22 @sic R5s221179 Baseline Moving sic@ */ + } +} + template (value) NG_NAS_UL_Message_Type cs_NG_PDU_SESSION_MODIFICATION_REQUEST(template (value) NG_PDU_SessionId p_PDU_SessionId, template (value) ProcedureTransactionIdentifier p_PTI, diff --git a/smf/SMF_Session_CT_5G.ttcn b/smf/SMF_Session_CT_5G.ttcn index c550ec2..5343dfd 100644 --- a/smf/SMF_Session_CT_5G.ttcn +++ b/smf/SMF_Session_CT_5G.ttcn @@ -177,15 +177,10 @@ return valueof(http2_tx); } -/* Nsmf_PDUSession_CreateSMContext Request/response - * 3GPP TS 23.502 Figure 4.3.2.2.1-1 - * 3GPP TS 29.502 6.1.3.2 */ -function f_n11_create_session() -runs on SMF_Session_CT { - var HTTP2_Msg http2_tx; - var HTTP2_Msg http2_rx; - var template (present) HTTP2_Msg http2_exp_rx; +function f_n11_prepare_create_sm_context_pdu_sess_establishment() +runs on SMF_Session_CT return HTTP2_Msg { var template (value) SmContextCreateData sm_contexts; + var HTTP2_Msg http2_tx; sm_contexts := ts_SmContextCreateData(supi := "imsi-" & g_pars.imsi_str, pei := "imeisv-0790219824011594", @@ -203,6 +198,39 @@ var octetstring nas_enc := f_ng_nas_gen_session_establishment_request(); http2_tx := f_n11_prepare_create_sm_context(valueof(sm_contexts), omit, nas_enc); + return http2_tx; +} + +/* Expect to receive "201 Created body={}" answer to our Nsmf sm-contexts request: */ +altstep as_n11_create_sm_context_pdu_sess_establishment_201_Created(HTTP2_Msg http2_tx) +runs on SMF_Session_CT { + var HTTP2_Msg http2_rx; + var template (present) HTTP2_Msg http2_exp_rx := + tr_HTTP2_Msg(http2_tx.conn_id, + http2_tx.stream_id, + tr_HTTP2_header_block(pseudo_headers := tr_HTTP2_pseudo_headers_Resp(201), + headers := {*, tr_HTTP2_Hdr_location(tr_Nsmf_PDUSession_uri_sm_contexts), *}), + tr_HTTP2_Data_frame(stream_id := http2_tx.stream_id, + end_stream_flag := true, + data := char2oct("{}"))); + + [] as_http2_adapter_receive(http2_rx, http2_exp_rx, idx := http2_tx.conn_id) { + /* Store obtained smContextRef:*/ + var charstring created_location := valueof(f_HTTP2_header_list_find_header(http2_rx.hb.headers, c_HTTP2_HDR_location)); + g_pars.nsmf.smContextRef := regexp(created_location, Nsmf_uri_prefix & Nsmf_PDUSession_path_sm_contexts & "/(?+)", 0); + } +} + +/* Nsmf_PDUSession_CreateSMContext Request/response + * 3GPP TS 23.502 Figure 4.3.2.2.1-1 + * 3GPP TS 29.502 6.1.3.2 */ +function f_n11_create_session() +runs on SMF_Session_CT { + var HTTP2_Msg http2_tx; + var HTTP2_Msg http2_rx; + var template (present) HTTP2_Msg http2_exp_rx; + + http2_tx := f_n11_prepare_create_sm_context_pdu_sess_establishment(); f_http2_adapter_connect(mp_smf_hostname, mp_smf_sbi_port, mp_amf_local_ip, idx := http2_tx.conn_id); @@ -231,17 +259,7 @@ as_nudm_sdm_post_sdm_subscriptions(); /* Expect to receive "201 Created body={}" answer to our Nsmf sm-contexts request: */ - http2_exp_rx := tr_HTTP2_Msg(http2_tx.conn_id, - http2_tx.stream_id, - tr_HTTP2_header_block(pseudo_headers := tr_HTTP2_pseudo_headers_Resp(201), - headers := {*, tr_HTTP2_Hdr_location(tr_Nsmf_PDUSession_uri_sm_contexts), *}), - tr_HTTP2_Data_frame(stream_id := http2_tx.stream_id, - end_stream_flag := true, - data := char2oct("{}"))); - as_http2_adapter_receive(http2_rx, http2_exp_rx, idx := http2_tx.conn_id); - /* Store obtained smContextRef:*/ - var charstring created_location := valueof(f_HTTP2_header_list_find_header(http2_rx.hb.headers, c_HTTP2_HDR_location)); - g_pars.nsmf.smContextRef := regexp(created_location, Nsmf_uri_prefix & Nsmf_PDUSession_path_sm_contexts & "/(?+)", 0); + as_n11_create_sm_context_pdu_sess_establishment_201_Created(http2_tx); /* Prepare expect for the smContextRef: */ f_http2_server_emu_register(valueof(ts_Nsmf_PDUSession_path_sm_contexts(g_pars.nsmf.smContextRef)), idx := HTTP2_CONN_SCP); @@ -263,7 +281,7 @@ f_Mutex_unlock(__BFILE__, __LINE__); /////////// END MUTUAL EXCLUSION ZONE //////////// - as_namf_comm_post_n1n2_messages_pdu_sess_establishment(); + as_namf_comm_post_n1n2_messages_pdu_sess_establishment_accept(); f_n11_update_sm_context_pdu_sess_establishment(); if (g_pars.pdn_type == c_PFCP_PDN_Type_IPv6 or @@ -534,7 +552,7 @@ } /* 5.2.2.3.1 N1N2MessageTransfer, PDU Session establishment (see clause 4.3.2 of 3GPP TS 23.502) */ -private altstep as_namf_comm_post_n1n2_messages_pdu_sess_establishment() +private altstep as_namf_comm_post_n1n2_messages_pdu_sess_establishment_accept() runs on SMF_Session_CT { var HTTP2_Msg http2_rx; var HTTP2_multipart_part_list parts; @@ -574,6 +592,29 @@ } } +/* 5.2.2.3.1 N1N2MessageTransfer, PDU Session establishment (see clause 4.3.2 of 3GPP TS 23.502) */ +altstep as_namf_comm_post_n1n2_messages_pdu_sess_establishment_reject(template (present) GMM_GSM_Cause exp_cause := ?) +runs on SMF_Session_CT { + var HTTP2_Msg http2_rx; + var HTTP2_multipart_part_list parts; + [] as_namf_comm_post_n1n2_messages(http2_rx, parts) { + var N1N2MessageTransferReqData n1n2msg_req; + var NGAP_IEs.PDUSessionResourceSetupRequestTransfer setup_req_transf; + var template (value) N1N2MessageTransferRspData n1n2msg_rsp; + var NG_NAS_DL_SM_Message_Type dl_nas; + var template (value) HTTP2_Msg http2_tx; + var octetstring body_enc; + + /* Decode 1st part: SBI json: */ + f_dec_N1N2MessageTransferReqData(parts[0].data, n1n2msg_req); // TODO: check returned integer. + + /* Decode 2nd part: NG-NAS: */ + dl_nas := dec_NG_NAS_DL_SM_Message_Type(parts[1].data); + f_ng_nas_handle_session_establishment_reject(dl_nas, exp_cause); + setverdict(pass); + } +} + /* 5.2.2.3.1 N1N2MessageTransfer, PDU Session release (see clause 4.3.4 of TS 3GPP 23.502) * 3GPP TS 23.502 4.3.7 CN-initiated selective deactivation of UP connection of an existing PDU Session */ altstep as_namf_comm_post_n1n2_messages_pdu_sess_release_command() @@ -771,7 +812,7 @@ } /* 3GPP TS 29.503 5.2.2.2.5 Session Management Subscription Data Retrieval */ -private altstep as_nudm_sdm_get_sm_data() +altstep as_nudm_sdm_get_sm_data() runs on SMF_Session_CT { var HTTP2_Msg http2_rx; [] HTTP2_CONN[HTTP2_CONN_SCP].receive(f_tr_Nudm_SDM_get_sm_data()) -> value http2_rx { @@ -835,7 +876,7 @@ } /* 3GPP TS 29.503 5.2.2.3.2 Subscription to notifications of data change */ -private altstep as_nudm_sdm_post_sdm_subscriptions() +altstep as_nudm_sdm_post_sdm_subscriptions() runs on SMF_Session_CT { var HTTP2_Msg http2_rx; [] HTTP2_CONN[HTTP2_CONN_SCP].receive(f_tr_Nudm_SDM_post_sdm_subscriptions()) -> value http2_rx { @@ -946,7 +987,7 @@ } /* 3GPP TS 29.512 4.2.2.2 SM Policy Association establishment */ -private altstep as_npcf_smpolicycontrol_post_sm_policies() +altstep as_npcf_smpolicycontrol_post_sm_policies() runs on SMF_Session_CT { var HTTP2_Msg http2_rx; [] HTTP2_CONN[HTTP2_CONN_SCP].receive(f_tr_Npcf_SMPolicyControl_post_sm_policies()) -> value http2_rx { @@ -1126,6 +1167,7 @@ return nas_enc; } +/* 3GPP TS 24.501 8.3.2 PDU session establishment accept */ private function f_ng_nas_handle_session_establishment_accept(NG_NAS_DL_SM_Message_Type dl_nas) runs on SMF_Session_CT { var template (present) NG_NAS_DL_SM_Message_Type exp_rx_nas; @@ -1178,6 +1220,20 @@ } } +/* 3GPP TS 24.501 8.3.3 PDU session establishment reject */ +private function f_ng_nas_handle_session_establishment_reject(NG_NAS_DL_SM_Message_Type dl_nas, template (present) GMM_GSM_Cause exp_cause := ?) +runs on SMF_Session_CT { + var template (present) NG_NAS_DL_SM_Message_Type exp_rx_nas; + var BIT3 pdu_sess_type := f_pfcp_pdn_type_2_ng_nas_pdu_session_type(g_pars.pfcp_pars.pdn_type); + + exp_rx_nas := cr_NG_SM_PDU_SESSION_ESTABLISHMENT_REJECT(p_PDU_SessionId := cs_NG_PDU_SessionIdV(int2oct(g_pars.namf.pdu_sess_id, 1)), + p_Cause := exp_cause); + if (not match(dl_nas, exp_rx_nas)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Rx unexpected DL NG-NAS: ", dl_nas, " vs exp ", exp_rx_nas)); + } +} + private function f_ng_nas_handle_session_release_command(NG_NAS_DL_SM_Message_Type dl_nas) runs on SMF_Session_CT { var template (present) NG_NAS_DL_SM_Message_Type exp_rx_nas; diff --git a/smf/SMF_Tests.ttcn b/smf/SMF_Tests.ttcn index 6101202..c596baf 100644 --- a/smf/SMF_Tests.ttcn +++ b/smf/SMF_Tests.ttcn @@ -32,9 +32,12 @@ import from HTTP2_Types all; import from HTTP2_Templates all; +import from HTTP2_Msg all; import from HTTP2_Adapter all; import from HTTP2_Server_Emulation all; +import from NG_NAS_Templates all; + import from Mutex all; import from SMF_Session_CT all; import from SMF_Session_CT_4G all; @@ -809,6 +812,91 @@ f_TC_n11_createSession_deleteSession_250(c_PFCP_PDN_Type_IPv4v6); } +/* create an IPv4 session, then delete it again */ +private function f_TC_n11_createSession_pfcp_sess_est_timeout() runs on SMF_Session_CT { + var HTTP2_Msg http2_tx; + + var PrometheusExpects expects0 := valueof({ + ts_PrometheusExpect("ues_active", GAUGE, min := 0, max := 0), + ts_PrometheusExpect("pfcp_sessions_active", GAUGE, min := 0, max := 0) + }); + var PrometheusExpects expects1 := valueof({ + ts_PrometheusExpect("ues_active", GAUGE, min := 1, max := 1), + ts_PrometheusExpect("pfcp_sessions_active", GAUGE, min := 1, max := 1) + }); + f_prometheus_expect(expects0, wait_converge := true); + + + /* Subscribe for PFCP Session Establishment Request PDU(s), which are + * expected to have SEID set to 0, as per 3GPP TS 29.244, section 7.2.2.4.2. */ + f_PFCPEM_subscribe_seid(c_SEID0); + + http2_tx := f_n11_prepare_create_sm_context_pdu_sess_establishment(); + f_http2_adapter_connect(mp_smf_hostname, mp_smf_sbi_port, mp_amf_local_ip, idx := http2_tx.conn_id); + f_http2_adapter_send(http2_tx); + + /* PCF: register to rx generic path. We take advantage of the fact that + * we are inside a mutual exclusion zone, so only one session can be here at a time. */ + f_http2_server_emu_register(Npcf_SMPolicyControl_path_sm_policies, idx := HTTP2_CONN_SCP); + + /* Expect UDM to receive GET sm-data: */ + as_nudm_sdm_get_sm_data(); + /* Expect UDM to receive POST sdm-subscriptions: */ + as_nudm_sdm_post_sdm_subscriptions(); + + /* Expect to receive "201 Created body={}" answer to our Nsmf sm-contexts request: */ + as_n11_create_sm_context_pdu_sess_establishment_201_Created(http2_tx); + /* Prepare expect for the smContextRef: */ + f_http2_server_emu_register(valueof(ts_Nsmf_PDUSession_path_sm_contexts(g_pars.nsmf.smContextRef)), + idx := HTTP2_CONN_SCP); + /* Close HTTP2 conn: */ + f_http2_adapter_close(idx := http2_tx.conn_id); + + /* Expect PCF to receive POST sm-policies: */ + as_npcf_smpolicycontrol_post_sm_policies(); + f_http2_server_emu_unregister(Npcf_SMPolicyControl_path_sm_policies, idx := HTTP2_CONN_SCP); + + f_prometheus_expect(expects1, wait_converge := true); + + log("Waiting 1st PFCP Sess Est Req"); + PFCP.receive(f_Session_tr_PFCP_Session_Est_Req()); + log("RX 1st PFCP Sess Est Req"); + PFCP.receive(f_Session_tr_PFCP_Session_Est_Req()); + log("RX 2nd PFCP Sess Est Req"); + PFCP.receive(f_Session_tr_PFCP_Session_Est_Req()); + log("RX 3rd PFCP Sess Est Req"); + + /* SMF deletes policy in PCF: */ + as_npcf_smpolicycontrol_post_IndividualSMPOlicyTermination(); + + /* SMF deregisters on UDM: */ + alt { + [] as_nudm_sdm_delete_IndividualSubscription() { setverdict(pass); } /* expected incoming msg */ + [] as_namf_comm_post_n1n2_messages_pdu_sess_establishment_reject() { /* Unexpecte msg: */ + setverdict(fail, "Received PDU SESS REJ while waiting for UDM!
https://github.com/open5gs/open5gs/issues/4878
"); + repeat; + } + } + as_nudm_uecm_delete_IndividualSmfRegistration(); + + /* SMF Rejects the Create Session back to the UE: */ + as_namf_comm_post_n1n2_messages_pdu_sess_establishment_reject(cs_GMM_GSM_Cause(omit, int2bit(38 /* Network Failure */, 8))); + f_http2_server_emu_unregister(valueof(ts_Nsmf_PDUSession_path_sm_contexts(g_pars.nsmf.smContextRef)), + idx := HTTP2_CONN_SCP); + f_prometheus_expect(expects0, wait_converge := true); + setverdict(pass); +} +testcase TC_n11_createSession_pfcp_sess_est_timeout() runs on SMF_Test_CT { + var SMF_Session_CT vc_conn; + var SessionPars pars := f_SessionPars(13, + rat_type := GTP2C_RAT_NR); + f_init(); + vc_conn := f_start_handler(refers(f_TC_n11_createSession_pfcp_sess_est_timeout), pars); + vc_conn.done; + f_shutdown(); +} + + /* Validate IUT detects PFCP Heartbeat timeout and recovers from it tearing down * existing subscriber connections: */ private template (value) PrometheusExpects t_TC_5g_pfcp_heartbeat_timeout_Metrics_Expect(integer pfcp_peers_active, integer ues_active) := { @@ -945,6 +1033,7 @@ execute( TC_n11_createSession_deleteSession_250() ); execute( TC_n11_createSession_deleteSession_250_ipv6() ); execute( TC_n11_createSession_deleteSession_250_ipv4v6() ); + execute( TC_n11_createSession_pfcp_sess_est_timeout() ); execute( TC_5g_pfcp_heartbeat_timeout() ); execute( TC_5g_pfcp_heartbeat_recovery_timestamp() ); } diff --git a/smf/expected-results.xml b/smf/expected-results.xml index 2d5c61c..aef27e9 100644 --- a/smf/expected-results.xml +++ b/smf/expected-results.xml @@ -21,6 +21,7 @@ <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250_ipv6' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250_ipv4v6' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_n11_createSession_pfcp_sess_est_timeout' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_5g_pfcp_heartbeat_timeout' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_5g_pfcp_heartbeat_recovery_timestamp' time='MASKED'/> </testsuite> -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43907?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: I8edbfb261b8dfe629326410ced3dbf63491ad029 Gerrit-Change-Number: 43907 Gerrit-PatchSet: 7 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1
0
0
0
[M] Change in osmo-ttcn3-hacks[master]: smf: Introduce test TC_n11_createSession_pfcp_sess_est_timeout
by pespin
21 Oct '26
21 Oct '26
pespin has posted comments on this change by pespin. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43907?usp=email
) Change subject: smf: Introduce test TC_n11_createSession_pfcp_sess_est_timeout ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43907?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I8edbfb261b8dfe629326410ced3dbf63491ad029 Gerrit-Change-Number: 43907 Gerrit-PatchSet: 6 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 21 Oct 2026 18:34:00 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1
0
0
0
[M] Change in osmo-ttcn3-hacks[master]: smf: Introduce test TC_5g_pfcp_heartbeat_recovery_timestamp
by pespin
21 Oct '26
21 Oct '26
pespin has posted comments on this change by pespin. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43906?usp=email
) Change subject: smf: Introduce test TC_5g_pfcp_heartbeat_recovery_timestamp ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43906?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ie1511ef9cfad49e089bd5f2f0638feaf24c6e4c2 Gerrit-Change-Number: 43906 Gerrit-PatchSet: 6 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 21 Oct 2026 18:33:58 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1
0
0
0
[M] Change in osmo-ttcn3-hacks[master]: smf: Introduce test TC_5g_pfcp_heartbeat_timeout
by pespin
21 Oct '26
21 Oct '26
Attention is currently required from: fixeria. pespin has posted comments on this change by pespin. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43905?usp=email
) Change subject: smf: Introduce test TC_5g_pfcp_heartbeat_timeout ...................................................................... Patch Set 8: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43905?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Id1db247658aa11e10626357fbb47616ba425fb7f Gerrit-Change-Number: 43905 Gerrit-PatchSet: 8 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 21 Oct 2026 18:33:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
117
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200