Commit 6a4be4dc authored by Yann Garcia's avatar Yann Garcia
Browse files

Force UE deregistration for free5gc

parent 41cd9f21
Loading
Loading
Loading
Loading
+408 B (16.9 KiB)

File changed.

No diff preview for this file type.

+1.21 KiB (17.5 KiB)

File changed.

No diff preview for this file type.

+6 −0
Changes for ttcn/LibNGAP/lib/LibNGAP_Pixits.ttcn: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -884,6 +884,12 @@ module LibNGAP_Pixits {
     *        whose slice has no SD). Used in the PDU SESSION ESTABLISHMENT REQUEST, and expected back from the AMF */
    modulepar boolean PX_SD_PRESENT := false;

    /** @desc true: in the postamble of the AMF test cases (f_postambleNGAP_AMF, online), the registered UE de-registers
     *        (DEREGISTRATION REQUEST, 3GPP access) and the AMF releases its UE context, so that the next test case finds no
     *        registered UE nor PDU session left over (e.g. free5GC); false: the gNB only asks for the release of the UE
     *        context (UE CONTEXT RELEASE REQUEST), the UE staying registered in the AMF */
    modulepar boolean PX_POSTAMBLE_DEREGISTRATION := false;

    /** @desc Host of the data network the test system, playing the UE behind the gNB, pings through the UPF of the 5GC
     *        under test (AMF as IUT, PICS_USE_GTPU), to check that the PDU session works end to end (e.g. "10.45.0.1",
     *        the ogstun address of an open5gs host). Empty: no user plane check */
+44 −0
Changes for ttcn/LibNGAP/lib_system/LibNGAP_Functions.ttcn: 44 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4131,6 +4131,50 @@ module LibNGAP_Functions {
                        )))));
    } // End of function f_send_deregistration_request_registered

    /**
     * @brief  Postamble: de-register the registered UE (f_send_deregistration_request_registered, not switch off) and let the
     *         AMF release its UE context (test system = UE and gNB, TS 24.501 clause 5.5.2.2, TS 38.413 clause 8.3.3).
     * @details Awaits, for up to p_timeout, the UE CONTEXT RELEASE COMMAND, answered with the UE CONTEXT RELEASE COMPLETE; the
     *          DOWNLINK NAS TRANSPORTs before it (DEREGISTRATION ACCEPT or other) are read and logged. The verdict is left
     *          unchanged.
     * @param  p_timeout The longest wait for the UE CONTEXT RELEASE COMMAND, in seconds.
     * @return true if the UE context was released.
     */
    function f_send_deregistration_request_await_ue_context_release(in float p_timeout) runs on NGNASComponent return boolean {
        var NG_NAS_DL_Message_Type v_message;
        timer t_release := p_timeout;

        f_send_deregistration_request_registered(false);
        t_release.start;
        alt {
            [] N2_gNBaMF_P.receive(mw_ngap_initMsg(mw_n2_DownlinkNASTransport(vc_AMF_UE_ID, vc_RAN_UE_ID, ?))) -> value vc_recvNGAP_PDU {
                f_NASPDU_Get(vc_recvNGAP_PDU);
                if (f_Check_5GAKA_NAS_DL_Message(
                                                 vc_recvNAS_PDU,
                                                 mw_NG_DEREGISTRATION_ACCEPT_MO,
                                                 vc_ng_nas_security_params_type,
                                                 vc_previous_nas_count_dl,
                                                 v_message,
                                                 vc_inner_message
                                                 )) {
                    log("f_send_deregistration_request_await_ue_context_release: DEREGISTRATION ACCEPT");
                } else {
                    log("f_send_deregistration_request_await_ue_context_release: other DOWNLINK NAS TRANSPORT: ", vc_recvNAS_PDU);
                }
                repeat;
            }
            [] N2_gNBaMF_P.receive(mw_ngap_initMsg(mw_n2_UEContextReleaseCommand())) -> value vc_recvNGAP_PDU {
                t_release.stop;
                f_send_NGAP_PDU(m_ngap_succMsg(f_m_n2_UEContextReleaseComplete(vc_AMF_UE_ID, vc_RAN_UE_ID)));
            }
            [] t_release.timeout {
                log("f_send_deregistration_request_await_ue_context_release: no UE CONTEXT RELEASE COMMAND within ", p_timeout, " s");
                return false;
            }
        }
        return true;
    } // End of function f_send_deregistration_request_await_ue_context_release

    /**
     * @brief  Await a UE-originating DEREGISTRATION REQUEST in an UPLINK NAS TRANSPORT.
     * @details Sets the verdict to fail if the NAS message does not match.
+1 −1
Changes for ttcn/LibNGAP/lib_system/LibNGAP_Interface.ttcn: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ module LibNGAP_Interface {

            var NGAP_PDU vc_sendNGAP_PDU ;
            var NGAP_PDU vc_recvNGAP_PDU ;
            var boolean vc_ueContextReleased := false; // true once the UE context is released (UE CONTEXT RELEASE COMPLETE received), false again once a new one is set up (INITIAL CONTEXT SETUP RESPONSE received)
            var boolean vc_ueContextReleased := false; // true once the UE context is released (UE CONTEXT RELEASE COMPLETE received, or sent by the test system playing the gNB: f_send_NGAP_PDU), false again once a new one is set up (INITIAL CONTEXT SETUP RESPONSE received or sent)
            var TAI vc_ueTai;                     // TAI of the UE, from the User Location Information of its INITIAL UE MESSAGE (f_await_registration_request)
            var boolean vc_ueTaiKnown := false;   // true once vc_ueTai is set
            var hexstring vc_supi := ''H;         // SUPI (IMSI digits) of the UE, from the SUCI it sent (f_get_supi_from_registration_request); empty: px_IMSI_Def, see f_amf_supi
Loading