Commit 71ab2853 authored by Yann Garcia's avatar Yann Garcia
Browse files

Review TC_NGAP_AMF_IMP_01; Add TC_NGAP_AMF_IMP_01_02

parent 4feb9c7b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -153,10 +153,12 @@ system.NGAP_AMF.params := "NGAP/SCTP(server=127.0.0.5,port=38412,debug=1)"
#NGAP_TestCases.TC_NGAP_AMF_MMP_09

# Verify that the IUT can send an DOWNLINK NAS TRANSPORT message to carry NAS information over the NG interface.
#NGAP_TestCases.TC_NGAP_AMF_NAS_01
NGAP_TestCases.TC_NGAP_AMF_NAS_01

# Verify that the AMF node successfully processes a NG SETUP REQEST message that contains mandatory IEs and answers with NG SETUP RESPONSE to acknowledge the setup.
NGAP_TestCases.TC_NGAP_AMF_IMP_01
#NGAP_TestCases.TC_NGAP_AMF_IMP_01
# Verify that the AMF node successfully processes an NG_SETUP_REQUEST message containing the PLMN identity, TAC, supported slice IEs and Extended RAN Node Name, and responds with an NG_SETUP_RESPONSE message to acknowledge the setup.
#NGAP_TestCases.TC_NGAP_AMF_IMP_01_02
# Verify that the AMF node successfully processes a NG SETUP REQEST message that contains mandatory IEs and answers with NG SETUP RESPONSE to acknowledge the setup.
#NGAP_TestCases.TC_NGAP_AMF_IMP_02
# Verify that the AMF node successfully processes a NG SETUP REQEST message with optional field UE Retention Information and answers with NG SETUP RESPONSE to acknowledge the setup.
+12 −0
Original line number Diff line number Diff line
@@ -224,6 +224,18 @@ module NGAP_Steps {
            }
        } // End of function f_NGAP_amf_UE_Authentication

        /**
         * @desc
         */
        function f_NGAP_amf_UE_Authentication_Failure() runs on aMFNGAPComponent {
            log(">>> f_NGAP_amf_UE_Authentication");
            if (PICS_OFFLINE_MODE) {
                f_await_authentication_request_await_authentication_response_failure();
            } else {
                f_await_authentication_request_send_authentication_response_failure();
            }
        } // End of function f_NGAP_amf_UE_Authentication

        /**
         * @desc
         */
+72 −9
Original line number Diff line number Diff line
@@ -5441,6 +5441,9 @@ module NGAP_TCFunctions {
                // Extract AMF_UE_NGAP_ID for termination
                vc_AMF_UE_ID := vc_recvNGAP_PDU.initiatingMessage.value_.downlinkNASTransport.protocolIEs[0].value_.aMF_UE_NGAP_ID;
                log("vc_AMF_UE_ID: ", vc_AMF_UE_ID);   
                // Extract RAN_UE_NGAP_ID for termination
                vc_RAN_UE_ID  := vc_recvNGAP_PDU.initiatingMessage.value_.downlinkNASTransport.protocolIEs[1].value_.rAN_UE_NGAP_ID;
                log("vc_RAN_UE_ID: ", vc_RAN_UE_ID);

                f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict());
                log("*** " & __SCOPE__ & ": INFO: Testbody done. ***");
@@ -5498,10 +5501,8 @@ module NGAP_TCFunctions {
                                                                                                                                                      PX_SD*/
                                                                                                                                            )
                                                                                                                             )
                                                                                                                     }
                                                                                                                     )
                                                                                          }
                                                                                          )
                                                                                                                     })
                                                                                          })
                                                                      },
                                                                      PX_PAGING_DRX
                  )));
@@ -5523,12 +5524,74 @@ module NGAP_TCFunctions {
                   log("*** " & __SCOPE__ & ": INFO: Testbody done. ***");

                   // Postamble
                   f_postamble_NGAP_AMF();
                   f_NGAP_amf_UE_Authentication_Failure();
                   f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
                   log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");

                } // End of function f_TC_NGAP_AMF_IMP_01

              /**
               * @desc Testcase function for TC_NGAP_AMF_IMF_01_02
               */
               function f_TC_NGAP_AMF_IMP_01_02() runs on aMFNGAPComponent {
                  // Local variables

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

                  // Body
                  // Send NGSetupRequest
                  f_send_NGAP_PDU(
                                  m_ngap_initMsg(
                                                  m_n2_NGSetupRequest(
                                                                      m_globalRANNodeID_globalGNB_ID(
                                                                                                    m_ie_globalGnbId(
                                                                                                                      fl_NasNN_MCC2PlmnId(PX_NAS_MCC, PX_NAS_MNC),
                                                                                                                      PX_GNB_ID
                                                                      )),
                                                                      {
                                                                        m_supportedTAItem(
                                                                                          PX_TACode,
                                                                                          {
                                                                                              m_ie_broadcastPLMNItem(
                                                                                                                     fl_NasNN_MCC2PlmnId(PX_NAS_MCC, PX_NAS_MNC),
                                                                                                                     {
                                                                                                                         m_sliceSupportItem(
                                                                                                                                            m_s_NSSAI(
                                                                                                                                                      PX_SST,
                                                                                                                                                      PX_SD
                                                                                                                                            ))
                                                                                                                     })
                                                                                          })
                                                                      },
                                                                      PX_PAGING_DRX
                  )));
                  // Await NGSetupResponse
                  f_recv_NGAP_PDU(
                                  mw_ngap_succMsg(
                                                  mw_n2_NGSetupResponse(
                                                                        mw_aMFName(PX_AMF_NAME),
                                                                        {
                                                                        *,
                                                                        mw_servedGUAMIItem(
                                                                                            mw_gUAMI(
                                                                                                    fl_NasNN_MCC2PlmnId(PX_NAS_MCC, PX_NAS_MNC)
                                                                                            )),
                                                                        *
                                                                        }
                                  )));
                   f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict());
                   log("*** " & __SCOPE__ & ": INFO: Testbody done. ***");

                   // Postamble
                   f_NGAP_amf_UE_Authentication_Failure();
                   f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
                   log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");

                } // End of function f_TC_NGAP_AMF_IMP_01_02

              /**
               * @desc Testcase function for TC_NGAP_AMF_IMP_02
               */
+74 −0
Original line number Diff line number Diff line
@@ -294,6 +294,7 @@ module LibNGAP_Functions {

            // Extract RAN_UE_NGAP_ID
            vc_RAN_UE_ID  := vc_recvNGAP_PDU.initiatingMessage.value_.initialUEMessage.protocolIEs[0].value_.rAN_UE_NGAP_ID;
            log("vc_RAN_UE_ID: ", vc_RAN_UE_ID);
        } else {
            log("*** " & __SCOPE__ & ": FAIL: Unexpected NAS message");
            setverdict(fail, "*** " & __SCOPE__ & ": FAIL: Unexpected NAS message");
@@ -339,6 +340,9 @@ module LibNGAP_Functions {
        // Extract AMF_UE_NGAP_ID
        vc_AMF_UE_ID := vc_recvNGAP_PDU.initiatingMessage.value_.downlinkNASTransport.protocolIEs[0].value_.aMF_UE_NGAP_ID;
        log("vc_AMF_UE_ID: ", vc_AMF_UE_ID);   
        // Extract RAN_UE_NGAP_ID
        vc_RAN_UE_ID  := vc_recvNGAP_PDU.initiatingMessage.value_.downlinkNASTransport.protocolIEs[0].value_.rAN_UE_NGAP_ID;
        log("vc_RAN_UE_ID: ", vc_RAN_UE_ID);

        // Compute RES/XRES
        if (f_5g_aka_compute_res_xres(-, v_message.authentication_Request.rand.randValue, v_message.authentication_Request.autn.aUTN, v_message.authentication_Request.abba, fl_NasNN_MCC2PlmnId(PX_NAS_MCC, PX_NAS_MNC), -/*oct2hex(PX_SUPI_DIGITS)*/, px_IMSI_Def, vc_ng_nas_security_params_type) == false) {
@@ -401,6 +405,9 @@ module LibNGAP_Functions {
        // Extract AMF_UE_NGAP_ID
        vc_AMF_UE_ID := vc_recvNGAP_PDU.initiatingMessage.value_.downlinkNASTransport.protocolIEs[0].value_.aMF_UE_NGAP_ID;
        log("vc_AMF_UE_ID: ", vc_AMF_UE_ID);   
        // Extract RAN_UE_NGAP_ID
        vc_RAN_UE_ID  := vc_recvNGAP_PDU.initiatingMessage.value_.downlinkNASTransport.protocolIEs[0].value_.rAN_UE_NGAP_ID;
        log("vc_RAN_UE_ID: ", vc_RAN_UE_ID);

        // Compute RES/XRES
        if (f_5g_aka_compute_res_xres(-, v_dl_message.authentication_Request.rand.randValue, v_dl_message.authentication_Request.autn.aUTN, v_dl_message.authentication_Request.abba, fl_NasNN_MCC2PlmnId(PX_NAS_MCC, PX_NAS_MNC), -/*oct2hex(PX_SUPI_DIGITS)*/, px_IMSI_Def, vc_ng_nas_security_params_type) == false) {
@@ -444,6 +451,73 @@ module LibNGAP_Functions {
        // TODO Await response for AUTHENTICATION_RESPONSE
    }

    /**
     * @desc Function to await NAS AuthenticationRequest message and await for ErrorIndication message
     */
    function f_await_authentication_request_await_authentication_response_failure() runs on NGNASComponent {
        log(">>> f_await_authentication_request_await_authentication_response_failure");

        // Await request for DOWNLINK_NAS_TRANSPORT
        f_recv_NGAP_PDU(
                        mw_ngap_initMsg(
                                        mw_n2_DownlinkNASTransport(
                                                                   ?,
                                                                   vc_RAN_UE_ID,
                                                                   ? // AuthorizationRequest
                        )));

        // Extract AMF_UE_NGAP_ID
        vc_AMF_UE_ID := vc_recvNGAP_PDU.initiatingMessage.value_.downlinkNASTransport.protocolIEs[0].value_.aMF_UE_NGAP_ID;
        log("vc_AMF_UE_ID: ", vc_AMF_UE_ID);   
        // Extract RAN_UE_NGAP_ID
        vc_RAN_UE_ID  := vc_recvNGAP_PDU.initiatingMessage.value_.downlinkNASTransport.protocolIEs[1].value_.rAN_UE_NGAP_ID;
        log("vc_RAN_UE_ID: ", vc_RAN_UE_ID);

        // Await response for AUTHENTICATION_RESPONSE failure
        f_recv_NGAP_PDU(
                        mw_ngap_initMsg(
                                        mw_n2_ErrorIndication_ids(
                                                                  vc_AMF_UE_ID,
                                                                  vc_RAN_UE_ID
                        )));

        setverdict(pass);
    }

    /**
     * @desc Function to await NAS AuthenticationRequest message and send for ErrorIndication message
     */
    function f_await_authentication_request_send_authentication_response_failure() runs on NGNASComponent {
        log(">>> f_await_authentication_request_send_authentication_response_failure");

        // Await request for DOWNLINK_NAS_TRANSPORT
        f_recv_NGAP_PDU(
                        mw_ngap_initMsg(
                                        mw_n2_DownlinkNASTransport(
                                                                   ?,
                                                                   vc_RAN_UE_ID,
                                                                   ? // AuthorizationRequest
                        )));

        // Extract AMF_UE_NGAP_ID
        vc_AMF_UE_ID := vc_recvNGAP_PDU.initiatingMessage.value_.downlinkNASTransport.protocolIEs[0].value_.aMF_UE_NGAP_ID;
        log("vc_AMF_UE_ID: ", vc_AMF_UE_ID);   
        // Extract RAN_UE_NGAP_ID
        vc_RAN_UE_ID  := vc_recvNGAP_PDU.initiatingMessage.value_.downlinkNASTransport.protocolIEs[1].value_.rAN_UE_NGAP_ID;
        log("vc_RAN_UE_ID: ", vc_RAN_UE_ID);

        // Await response for AUTHENTICATION_RESPONSE failure
        f_send_NGAP_PDU(
                        m_ngap_initMsg(
                                       m_n2_ErrorIndication_ids(
                                                                vc_AMF_UE_ID,
                                                                vc_RAN_UE_ID,
                                                                m_cause_nas(authentication_failure)
                        )));

        setverdict(pass);
    }

    /**
     * @desc Function to send NAS SecurityModeCommand message and await for SecurityModeComplete message
     */
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ module Lib_NG_NAS_Functions {
//             log("Received NG_REGISTRATION_REQUEST NAS message");

//             // Extract ID-RAN-UE-NGAP-ID
//             vc_RAN_UE_ID := vc_recvNGAP_PDU.initiatingMessage.value_.InitialUEMessage.protocolIEs[0].value_.rAN_UE_NGAP_ID;
//             vc_RAN_UE_ID := vc_recvNGAP_PDU.initiatingMessage.value_.InitialUEMessage.protocolIEs[1].value_.rAN_UE_NGAP_ID;
//             log("vc_RAN_UE_ID: ", vc_RAN_UE_ID);   
//         } else {
//             log("*** " & __SCOPE__ & ": FAIL: Unexpected NAS message ***");