Commit 2c7c0999 authored by Yann Garcia's avatar Yann Garcia
Browse files

Review TC_5GNAS_AMF_AUT_REQ_04/05

parent bd07d24c
Loading
Loading
Loading
Loading
+6.61 KiB

File added.

No diff preview for this file type.

+2.38 KiB

File added.

No diff preview for this file type.

+6 −6
Original line number Diff line number Diff line
@@ -112,17 +112,17 @@ system.NGAP_AMF.params := "NGAP/SCTP(server=127.0.0.5,port=38412,debug=1)"
# Verify that the IUT sends an AUTHENTICATION REQUEST message correctly upon receipt of a NAS Registration without an active security context
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_01
# Verify that the IUT sends an AUTHENTICATION_REJECT message upon receipt of an AUTHENTICATION_RESPONSE containing an invalid authentication response value, when the UE was identified with SUCI in the initial NAS message
NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_02
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_02
# Verify that the IUT stops re-sending an AUTHENTICATION_REQUEST message if no AUTHENTICATION_RESPONSE message is received on the fifth expire of timer T3560
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_03
# Verify that the IUT sends an IDENTITY REQUEST message correctly upon receipt of an AUTHENTICATION FAILURE message indicating a 5GMM cause value #20 - MAC failure
# Verify that the IUT sends an IDENTITY_REQUEST message correctly upon receipt of an AUTHENTICATION_FAILURE message indicating a 5GMM cause value #20 - MAC failure
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_04
# Verify that the IUT sends a new AUTHENTICATION REQUEST message with new ngKSI value to re-initiate the 5G AKA based primary authentication upon receipt of an AUTHENTICATION FAILURE message indicating a 5GMM cause value #71 - ngKSI already in use
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_05
# Verify that the IUT sends a new IDENTITY REQUEST message to obtain the SUCI from the UE upon receipt of an AUTHENTICATION FAILURE message indicating a 5GMM cause value #26 - non-5G authentication unacceptable
# Verify that the IUT sends a new AUTHENTICATION_REQUEST message with new ngKSI value to re-initiate the 5G AKA based primary authentication upon receipt of an AUTHENTICATION_FAILURE message indicating a 5GMM cause value #71 - ngKSI already in use
NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_05
# Verify that the IUT sends an IDENTITY_REQUEST message to obtain the SUCI from the UE upon receipt of an AUTHENTICATION_FAILURE message indicating a 5GMM cause value #26 - non-5G authentication unacceptable
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_ABN_01
# Verify that the IUT sends a SECURITY MODE COMMAND message correctly to indicate NAS security mode procedure upon receipt of a NAS AUTHENTICATION RESPONSE
#NG_NAS_TestCases.TC_NGNAS_AMF_AUT_SEQ_01
#NG_NAS_TestCases.TC_5GNAS_AMF_SEC_COM_01
# Verify that the IUT, upon receiving the NAS SECURITY MODE COMPLETE message after completing the NAS Authentication and Security procedure, successfully completes the registration process by accepting the registration
#NG_NAS_TestCases.TC_5GNAS_AMF_SEC_ACC_01
# Verify that the IUT, upon receiving the NAS SECURITY MODE REJECT Message after a failed NAS Authentication and security procedure, successfully aborts the registration process by rejecting the registration
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ module NG_NAS_Steps {
        function f_NG_NAS_amf_UE_Authentication_with_invalid_response() runs on aMF_NGNAS_NGAPComponent {
            log(">>> f_NG_NAS_amf_UE_Authentication_with_invalid_response");
            if (PICS_OFFLINE_MODE) {
                f_await_authentication_request_await_authentication_response();
                f_await_authentication_request_await_authentication_reject();
            } else {
                f_await_authentication_request_send_authentication_response_with_invalid_response();
            }
+114 −29
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ module NG_NAS_TCFunctions {
                    // Local variables
                    var NGAP_PDU v_PDU;
                    var float v_start_time_ms;
                    var float v_max_wait_time_ms := 6.0 * (int2float(PX_TIMER_T3560) / 1000.0); // Set a maximum wait time of 7 seconds for the test body to prevent infinite waiting in case of failure
                    var float v_max_wait_time_ms := 6.0 * 1000.0 * int2float(PX_TIMER_T3560); // Set a maximum wait time of 6 seconds for the test body to prevent infinite waiting in case of failure

                    // Preamble
                    f_NGNAS_amf_init();
@@ -173,7 +173,7 @@ module NG_NAS_TCFunctions {

                    // Test Body
                    tc_noac.start;
                    v_start_time_ms := int2float(f_getCurrentTimeUtc()); // FSCOM: TTCN-3 timer are in seconds (ETSI ES 201 873-1 V4.16.1 (2024-10) Clause 12 Declaring timers)
                    v_start_time_ms := int2float(f_getCurrentTimeUtc());
                    alt {
                        [] N2_gNBaMF_P.receive(
                                               mw_ngap_initMsg(
@@ -181,7 +181,7 @@ module NG_NAS_TCFunctions {
                                                                                          ?,
                                                                                          vc_RAN_UE_ID,
                                                                                          ? // AuthorizationRequest
                                                ))) {
                                                ))) -> value v_PDU {
                            tc_noac.stop;

                            f_NGAPPDU_Get(v_PDU)
@@ -205,6 +205,36 @@ module NG_NAS_TCFunctions {
                                }
                            }
                        }
                        [] N2_gNBaMF_P.receive(
                                               mw_ngap_initMsg(
                                                               mw_n2_DownlinkNASTransport(
                                                                                          ?,
                                                                                          vc_RAN_UE_ID,
                                                                                          ? // AuthorizationRequest
                                                ))) -> value v_PDU {
                            tc_noac.stop;

                            f_NGAPPDU_Get(v_PDU)
                            f_NASPDU_Get(vc_recvNGAP_PDU);
                            var NG_NAS_DL_Message_Type v_message;
                            if (f_Check_5GAKA_NAS_DL_Message(
                                                             vc_recvNAS_PDU, 
                                                             mw_NG_AUTHENTICATION_REJECT, 
                                                             vc_ng_nas_security_params_type, 
                                                             vc_previous_nas_count_dl, 
                                                             v_message,
                                                             vc_inner_message
                                                             ) == true) {
                                // Do not reply to trigger T3560 expiry at AMF and verify that no unexpected messages are received after timer expiry
                                if ((int2float(f_getCurrentTimeUtc()) - v_start_time_ms) < v_max_wait_time_ms) {
                                    log("*** " & __SCOPE__ & ": FAIL: Unexpected NG_AUTHENTICATION_REJECT before T3560 timer expiration ***");
                                    f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                                } else {
                                    setverdict(pass);
                                    log("*** " & __SCOPE__ & ": PASS: T3560 timer expired and no unexpected messages received. ***");
                                }
                            }
                        }
                        [] N2_gNBaMF_P.receive {
                            tc_noac.stop;
                            setverdict(inconc);
@@ -215,8 +245,6 @@ module NG_NAS_TCFunctions {
                                setverdict(inconc);
                                log("*** " & __SCOPE__ & ": FAIL: T3560 shall be expired. ***");
                            } else {
                                setverdict(pass);
                                log("*** " & __SCOPE__ & ": PASS: T3560 timer expired and no unexpected messages received. ***");
                            }
                        }
                    } // End of 'alt'statement
@@ -234,11 +262,42 @@ module NG_NAS_TCFunctions {
                    // Local variables

                    // Preamble
                    f_NGNAS_amf_init();
                    f_NG_NAS_amf_UE_Register();
                    f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                    log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");

                    // Test Body
                    // Await AuthenticationRequest
                    f_recv_NGAP_PDU(
                                    mw_ngap_initMsg(
                                                    mw_n2_DownlinkNASTransport(
                                                                               ?,
                                                                               vc_RAN_UE_ID,
                                                                               ? // AuthorizationRequest
                    )));
                    f_NASPDU_Get(vc_recvNGAP_PDU);
                    var NG_NAS_DL_Message_Type v_message;
                    if (f_Check_5GAKA_NAS_DL_Message(
                                                     vc_recvNAS_PDU, 
                                                     mw_NG_AUTHENTICATION_REQUEST(
                                                                                  ?,
                                                                                  -,
                                                                                  mw_GMM_AuthRAND,
                                                                                  mw_GSM_AUTN
                                                                                  ),
                                                     vc_ng_nas_security_params_type,
                                                     vc_previous_nas_count_dl,
                                                     v_message,
                                                     vc_inner_message
                                                     ) == false) {
                        log("*** " & __SCOPE__ & ": FAIL: Unexpected NG_AUTHENTICATION_REQUEST ***");
                        setverdict(fail);
                        return;
                    } else {
                        log("*** " & __SCOPE__ & ": PASS: Expected NG_AUTHENTICATION_REQUEST ***");
                        setverdict(pass);
                    }
                    // Send error message
                    vt_NgNasUl_Msg := m_NG_AUTHENTICATION_FAILURE(
                                                                  m_GMM_GSM_Cause(
@@ -249,24 +308,23 @@ module NG_NAS_TCFunctions {
                    f_send_NGAP_PDU(
                                    m_ngap_initMsg(
                                                    m_n2_UplinkNASTransport(
                                                                            PX_AMF_UE_NGAP_ID,
                                                                            PX_RAN_UE_NGAP_ID,
                                                                            -,
                                                                            -,
                                                                            vc_sendNAS_PDU,
                                                                            m_uPTransportLayerInformation_userLocationInformationNR(
                                                                                                                                    m_userLocationInformationNR(
                                                                                                                                                                m_nR_CGI,
                                                                                                                                                                m_tAI
                                    )))));
                    // Await response
                    // Await new AuthenticationRequest due to authentication failure
                    f_recv_NGAP_PDU(
                                    mw_ngap_initMsg(
                                                    mw_n2_DownlinkNASTransport(
                                                                               ?,//PX_AMF_UE_NGAP_ID,
                                                                               PX_RAN_UE_NGAP_ID,
                                                                               ?,
                                                                               vc_RAN_UE_ID,
                                                                               ? // IdentityRequest
                    )));
                    f_NASPDU_Get(vc_recvNGAP_PDU);
                    var NG_NAS_DL_Message_Type v_message;
                    if (f_Check_5GAKA_NAS_DL_Message(
                                                     vc_recvNAS_PDU, 
                                                     mw_NG_AUTHENTICATION_REQUEST(
@@ -288,8 +346,8 @@ module NG_NAS_TCFunctions {

                    // Postamble
                    // Terminate call with rejection
                    f_send_NasAuthenticationFailure();
                    f_send_ue_context_release_request_await_ue_context_release_response(m_cause_nas(authentication_failure));
                    f_send_error_indication(m_cause_nas(authentication_failure));
                    f_postamble_NGAP_AMF();
                    f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
                    log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                } // End of function f_TC_5GNAS_AMF_AUT_REQ_04
@@ -299,17 +357,45 @@ module NG_NAS_TCFunctions {
                 */
                function f_TC_5GNAS_AMF_AUT_REQ_05() runs on aMF_NGNAS_NGAPComponent {
                    // Local variables
                    var NG_NAS_DL_Message_Type v_NG_NAS_DL_Message_Type;
                    var NAS_KsiValue ngKSI;

                    // Preamble
                    f_NGNAS_amf_init();
                    f_NG_NAS_amf_UE_Register();
                    f_decode_5G_NAS_DL_Message(vc_recvNAS_PDU, v_NG_NAS_DL_Message_Type);
                    ngKSI := v_NG_NAS_DL_Message_Type.authentication_Request.ngNasKeySetId.nasKeySetId;
                    action("Send invalid response to trigger NAS authentication failure and verify that AMF initiates a new authentication procedure with new KSI value");
                    f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                    log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");

                    // Test Body
                    // Await AuthenticationRequest
                    f_recv_NGAP_PDU(
                                    mw_ngap_initMsg(
                                                    mw_n2_DownlinkNASTransport(
                                                                               ?,
                                                                               vc_RAN_UE_ID,
                                                                               ? // AuthorizationRequest
                    )));
                    f_NASPDU_Get(vc_recvNGAP_PDU);
                    var NG_NAS_DL_Message_Type v_message;
                    if (f_Check_5GAKA_NAS_DL_Message(
                                                     vc_recvNAS_PDU, 
                                                     mw_NG_AUTHENTICATION_REQUEST(
                                                                                  ?,
                                                                                  -,
                                                                                  mw_GMM_AuthRAND,
                                                                                  mw_GSM_AUTN
                                                                                  ),
                                                     vc_ng_nas_security_params_type,
                                                     vc_previous_nas_count_dl,
                                                     v_message,
                                                     vc_inner_message
                                                     ) == false) {
                        log("*** " & __SCOPE__ & ": FAIL: Unexpected NG_AUTHENTICATION_REQUEST ***");
                        setverdict(fail);
                        return;
                    } else {
                        log("*** " & __SCOPE__ & ": PASS: Expected NG_AUTHENTICATION_REQUEST ***");
                        setverdict(pass);
                    }
                    // Send error message
                    vt_NgNasUl_Msg := m_NG_AUTHENTICATION_FAILURE(
                                                                  m_GMM_GSM_Cause(
@@ -320,28 +406,27 @@ module NG_NAS_TCFunctions {
                    f_send_NGAP_PDU(
                                    m_ngap_initMsg(
                                                    m_n2_UplinkNASTransport(
                                                                            PX_AMF_UE_NGAP_ID,
                                                                            PX_RAN_UE_NGAP_ID,
                                                                            -,
                                                                            -,
                                                                            vc_sendNAS_PDU,
                                                                            m_uPTransportLayerInformation_userLocationInformationNR(
                                                                                                                                    m_userLocationInformationNR(
                                                                                                                                                                m_nR_CGI,
                                                                                                                                                                m_tAI
                                    )))));
                    // Await response
                    // Await new AuthenticationRequest due to authentication failure
                    f_recv_NGAP_PDU(
                                    mw_ngap_initMsg(
                                                    mw_n2_DownlinkNASTransport(
                                                                               ?,//PX_AMF_UE_NGAP_ID,
                                                                               PX_RAN_UE_NGAP_ID,
                                                                               ?,
                                                                               vc_RAN_UE_ID,
                                                                               ?
                    )));
                    f_NASPDU_Get(vc_recvNGAP_PDU);
                    var NG_NAS_DL_Message_Type v_message;
                    if (f_Check_5GAKA_NAS_DL_Message(
                                                     vc_recvNAS_PDU, 
                                                     mw_NG_AUTHENTICATION_REQUEST(
                                                                                  complement(ngKSI)
                                                                                  complement(vc_ngKSI)
                                                                                  ),
                                                     vc_ng_nas_security_params_type,
                                                     vc_previous_nas_count_dl,
@@ -359,8 +444,8 @@ module NG_NAS_TCFunctions {

                    // Postamble
                    // Terminate call with rejection
                    f_send_NasAuthenticationFailure();
                    f_send_ue_context_release_request_await_ue_context_release_response(m_cause_nas(authentication_failure));
                    f_send_error_indication(m_cause_nas(authentication_failure));
                    f_postamble_NGAP_AMF();
                    f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
                    log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                } // End of function f_TC_5GNAS_AMF_AUT_REQ_05
@@ -437,9 +522,9 @@ module NG_NAS_TCFunctions {
            group /*5_4_2_*/Security_mode_control_procedure {

                /**
                 * @desc Testcase function for TC_NGNAS_AMF_AUT_SEQ_01
                 * @desc Testcase function for TC_5GNAS_AMF_SEC_COM_01
                 */
                function f_TC_NGNAS_AMF_AUT_SEQ_01() runs on aMF_NGNAS_NGAPComponent {
                function f_TC_5GNAS_AMF_SEC_COM_01() runs on aMF_NGNAS_NGAPComponent {
                    // Local variables

                    // Preamble
@@ -482,7 +567,7 @@ module NG_NAS_TCFunctions {
                    f_send_ue_context_release_request_await_ue_context_release_response(m_cause_nas(authentication_failure));
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                } // End of function f_TC_NGNAS_AMF_AUT_SEQ_01
                } // End of function f_TC_5GNAS_AMF_SEC_COM_01
    
                /**
                * @desc Testcase function for TC_5GNAS_AMF_SEC_ACC_01
Loading