Commit 35aa477d authored by Yann Garcia's avatar Yann Garcia
Browse files

Merge branch 'TTF_T059_Rel17'

parents 55687c3b abb12b39
Loading
Loading
Loading
Loading
+253 −0
Changes for ttcn/Ats_NG_NAS/NG_NAS_TCFunctions.ttcn: 253 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ module NG_NAS_TCFunctions {
    import from Lib_NG_NAS_Pixits all;

    // Lib3GPP
    import from Parameters all;
    import from CommonDefs all;
    import from NAS_CommonTypeDefs all;
    import from NAS_CommonTemplates all;
    import from NG_NAS_TypeDefs all;
@@ -1369,6 +1371,7 @@ module NG_NAS_TCFunctions {
                            ))
                    ))
                );
                
                // Await request for REGISTRATION_ACCEPT
                f_recv_NGAP_PDU(
                                mw_ngap_initMsg(
@@ -1416,6 +1419,256 @@ module NG_NAS_TCFunctions {
                log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            } // End of function f_TC_5GNAS_AMF_REG_ACC_05

            /**
             * @desc Testcase function for TC_5GNAS_AMF_REG_ACC_06
             */
            function f_TC_5GNAS_AMF_REG_ACC_06() runs on aMF_NGNAS_NGAPComponent {
                // Local variables
                var boolean PICS_NGAP_A4_5_2_1 := true; //TODO move to PICS of NGAP

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

                // Test Body
                // Send REGISTRATION_REQUEST
                //use of SUCI identity PX_ params!
                var octetstring v_other_digits := f_get_suci_other_digits(); // ETSI TS 124 501 Figure 9.11.3.4.3: 5GS mobile identity information element for type of identity "SUCI" and SUPI format "IMSI"
                log("f_TC_5GNAS_AMF_REG_ACC_06: v_other_digits: ", v_other_digits);
                
                vt_NgNasUl_Msg := 
                    m_NG_REGISTRATION_REQUEST(
                        {'0'B,'001'B/*FirstRegistration*/},//in template (value) RegistrationType p_RegistrationType,
                        '111'B,//in template (value) NAS_KsiValue p_KeySetId,
                        '0'B,//in template (value) B1_Type p_Tsc,
                        /*m_NG_MobileIdentitySUCI(PX_SUPI_FORMAT, v_other_digits, PX_TYPE_OF_ID)//in template (value) NG_MobileIdentity p_MobileId,  // 24.501 cl. 9.11.3.4*/
                        m_NG_MobileIdentitySUCI('0000'B/*IMSI*/, v_other_digits, '001'B/*SUCI*/)//in template (value) NG_MobileIdentity p_MobileId,  // 24.501 cl. 9.11.3.4
                        
                        /* in template (omit) NAS_KeySetIdentifier p_NonCurrentKSI := omit,
                        in template (omit) NG_GMM_Cap p_GMM_Cap := omit,
                        in template (omit) NG_UE_SecurityCapability p_UESecurityCap := omit,
                        in template (omit) NSSAI p_ReqNSSAI := omit,
                        in template (omit) NG_TrackingAreaId p_TAI := omit,
                        in template (omit) UE_NetworkCap p_UE_NetworkCap := omit,
                        in template (omit) ULDataStatus p_ULDataStatus := omit,
                        in template (omit) PDU_SessionStatus p_PDU_SessionStatus := omit,
                        in template (omit) MICO_Ind p_MICO_Ind := omit,
                        in template (omit) UE_Status p_UE_Status := omit,
                        in template (omit) NG_MobileIdentity p_AddGUTI := omit,
                        in template (omit) AllowedPDU_SessionStatus p_AllowedPDU_SessionStatus := omit,
                        in template (omit) UE_UsageSetting p_UE_UsageSetting := omit,
                        in template (omit) NG_DRXparameter p_DRXparam := omit,
                        in template (omit) EPS_MessageContainer p_EPSMsg := omit,
                        in template (omit) LADN_Ind p_LADN_Ind := omit,
                        in template (omit) PayloadContainerType p_ContainerType := omit, // @sic R5w190113 sic@
                        in template (omit) PayloadContainer p_Payload := omit,
                        in template (omit) NetworkSlicingInd p_NetworkSlicingInd := omit,
                        in template (omit) NG_UpdateType p_NG_UpdateType := omit,
                        in template (omit) MS_Clsmk2 p_MS_Clsmk2 := omit,
                        in template (omit) CodecList p_SupportedCodecs := omit,
                        in template (omit) EPS_BearerContextStatus p_EPS_BearerContextStatus := omit, // @sic R5s190543 sic@
                        in template (omit) NASMessageContainer p_Msg := omit,
                        in template (omit) ExtdDRXParams p_ExtdDRXParams := omit,
                        in template (omit) GPRS_Timer3 p_T3324 := omit,
                        in template (omit) UERadioCapId p_UERadioCapId := omit,
                        in template (omit) MappedNSSAI p_MappedNSSAI := omit,
                        in template (omit) AddInfoRequest p_AddInfoRequest := omit,
                        in template (omit) WUSAssistInfo p_WUSAssistInfo := omit,
                        in template (omit) N5GCInd p_N5GCInd := omit,
                        in template (omit) NB_N1ModeDRXParams p_NB_N1ModeDRXParams := omit,
                        in template (omit) UE_RequestType p_UeRequestType := omit,
                        in template (omit) NG_PagingRestriction p_PagingRestrict := omit,
                        in template (omit) ServiceLvlAAContainer p_ServiceLvlAA := omit,
                        in template (omit) NID p_NId := omit,
                        in template (omit) PLMN_IdIE p_MSPLMNwDisasterCondition := omit,
                        in template (omit) PEIPS_AssistInfo p_RequestedPEIPS_AssistInfo := omit,
                        in template (omit) GPRS_Timer3 p_T3512 := omit */
                    )

                vc_sendNAS_PDU := bit2oct(encvalue( vt_NgNasUl_Msg ));
                f_send_NGAP_PDU(
                    m_ngap_initMsg(
                        m_n2_initialUeMessage(
                            -,
                            vc_sendNAS_PDU,
                            m_uPTransportLayerInformation_userLocationInformationNR(
                                m_userLocationInformationNR(
                                    m_nR_CGI,
                                    m_tAI
                            ))
                    )
                    //UEContextRequest set to "requested" by default in template
                    )
                );
                //NOT IN TP
                // // Await request for REGISTRATION_ACCEPT
                // f_recv_NGAP_PDU(
                //                 mw_ngap_initMsg(
                //                                 mw_n2_DownlinkNASTransport(
                //                                                         ?,//PX_AMF_UE_NGAP_ID,
                //                                                         PX_RAN_UE_NGAP_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_REGISTRATION_ACCEPT(
                //                                                            -,
                //                                                            ?,
                //                                                            mw_PLMN_List(
                //                                                                         -, -, 
                //                                                                         {
                //                                                                          *,
                //                                                                          fl_NasNN_MCC2PlmnId(PX_NAS_MCC, PX_NAS_MNC),
                //                                                                          *
                //                                                                         }
                //                                                            ),
                //                                                            -,?/*AllowedNSSAI*/,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,
                //                                                            ?
                //                                                            ),
                //                                  vc_ng_nas_security_params_type,
                //                                  vc_previous_nas_count_dl,
                //                                  v_message,
                //                                  vc_inner_message
                //                                  ) == false) {
                //     log("*** " & __SCOPE__ & ": FAIL: NG_REGISTRATION_ACCEPT mismatch. ***");
                //     setverdict(fail);
                // } else {
                //     log("*** " & __SCOPE__ & ": PASS: NG_REGISTRATION_ACCEPT match. ***");
                //     setverdict(pass);
                // }

                //f_await_security_mode_command_send_security_mode_complete();
                f_await_security_mode_command();
                // Prepare response for SECURITY_MODE_COMPLETE
                // 1. Registration Request message with no 
                //var octetstring v_other_digits := f_get_suci_other_digits(); // ETSI TS 124 501 Figure 9.11.3.4.3: 5GS mobile identity information element for type of identity "SUCI" and SUPI format "IMSI"
                var NG_NAS_UL_Message_Type ng_registration_Request := valueof(
                                                                            m_NG_REGISTRATION_REQUEST(
                                                                                                        cs_RegistrationType(tsc_NG_RegistrationInitial, '1'B),
                                                                                                        tsc_NasKsi_NoKey,
                                                                                                        '0'B, // TSC,
                                                                                                        m_NG_MobileIdentitySUCI('0000'B/*IMSI*/, v_other_digits, '001'B /*SUCI*/),
                                                                                                        -, 
                                                                                                        m_ng_gmm_cap,
                                                                                                        m_ng_ue_security_capability, // Cleartext IE: the value of the initial REGISTRATION REQUEST (f_send_registration_request)
                                                                                                        cs_NSSAI_Def('2f'O, { f_NGAP_ue_s_nssai() }), // Requested NSSAI
                                                                                                        -, -, -, -, -, -, -, -,
                                                                                                        -, //m_ue_usagesetting,
                                                                                                        -, -, -, -, -, -,
                                                                                                        m_ng_update_type
                                                                            ));
                // 2. Add security if any
                // TODO
                log("ng_registration_Request: ", ng_registration_Request);
                var octetstring v_msg := bit2oct(encvalue(ng_registration_Request.registration_Request));
                log("bit2oct(encvalue(ng_registration_Request.registration_Request))", v_msg);

                // 3. NAS 5GS message
                log("px_IMEISV_Def: ", px_IMEISV_Def);
                log("f_NG_Imeisv2MobileIdentity_v(px_IMEISV_Def): ", f_NG_Imeisv2MobileIdentity_v(px_IMEISV_Def));
                var NG_NAS_UL_Message_Type ng_security_mode_complete := valueof(
                                                                                m_NG_SECURITY_MODE_COMPLETE_no_NonIMEISV_PEI(
                                                                                                                            f_NG_Imeisv2MobileIdentity_v(px_IMEISV_Def), //in template (value) NG_MobileIdentity p_IMEISV,
                                                                                                                            { iei := '71'O, iel := int2oct(lengthof(v_msg), 2), replayedNASMsgContainerValue := v_msg }
                                                                                ));
                ng_security_mode_complete.security_Mode_Complete.nasMsg := { iei := '71'O, iel := int2oct(lengthof(v_msg), 2), replayedNASMsgContainerValue := v_msg };
                log("ng_security_mode_complete: ", ng_security_mode_complete);

                // 4. Add security if any
                v_msg := bit2oct(encvalue(ng_security_mode_complete.security_Mode_Complete));
                log("bit2oct(encvalue(ng_security_mode_complete.security_Mode_Complete))", v_msg);
                var NG_SECURITY_PROTECTED_NAS_MESSAGE v_security_Protected_Nas_Message;
                vc_sendNAS_PDU := f_EncodeAndCipher_NG_NasPdu_v(
                                                                tsc_SHT_IntegrityProtected_Ciphered_NewSecurityContext,
                                                                v_msg, 
                                                                tsc_DirectionUL,
                                                                PX_BEARER_ID,
                                                                vc_previous_nas_count_ul,
                                                                vc_ng_nas_security_params_type,
                                                                v_security_Protected_Nas_Message
                                                                );
                log("vc_previous_nas_count_ul: ", vc_previous_nas_count_ul);
                vt_NgNasUl_Msg.security_Protected_Nas_Message := v_security_Protected_Nas_Message;
                log("vc_sendNAS_PDU: ", vc_sendNAS_PDU);
                f_send_NGAP_PDU(
                                m_ngap_initMsg(
                                                m_n2_UplinkNASTransport(
                                                                        vc_AMF_UE_ID,
                                                                        vc_RAN_UE_ID,
                                                                        vc_sendNAS_PDU,
                                                                        m_uPTransportLayerInformation_userLocationInformationNR(
                                                                                                                                m_userLocationInformationNR(
                                                                                                                                                            m_nR_CGI,
                                                                                                                                                            m_tAI
                                )))));




                if (not (PICS_NGAP_A4_5_2_1)) { //REG_ACCEPT in NAS in InitialContextSetupReq
                    f_recv_NGAP_PDU(
                                mw_ngap_initMsg(
                                                mw_n2_InitialContextSetupRequest_base_nas
                                ));
                    f_NASPDU_Get(vc_recvNGAP_PDU);
                }
                else {
                    f_recv_NGAP_PDU(
                                mw_ngap_initMsg(
                                                mw_n2_DownlinkNASTransport(
                                                                        ?,//PX_AMF_UE_NGAP_ID,
                                                                        PX_RAN_UE_NGAP_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_REGISTRATION_ACCEPT(
                                                                            -,
                                                                            mw_NG_MobileIdentityGuti,
                                                                            mw_PLMN_List(
                                                                                            -, -, 
                                                                                            {
                                                                                            *,
                                                                                            fl_NasNN_MCC2PlmnId(PX_NAS_MCC, PX_NAS_MNC),
                                                                                            *
                                                                                            }
                                                                            ),
                                                                            -,?/*AllowedNSSAI*/,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,
                                                                            ?
                                                                            ),
                                                    vc_ng_nas_security_params_type,
                                                    vc_previous_nas_count_dl,
                                                    v_message,
                                                    vc_inner_message
                                                    ) == false) {
                        log("*** " & __SCOPE__ & ": FAIL: NG_REGISTRATION_ACCEPT mismatch. ***");
                        setverdict(fail);
                    } else {
                        log("*** " & __SCOPE__ & ": PASS: NG_REGISTRATION_ACCEPT match. ***");
                        setverdict(pass);
                    }

                f_send_registration_complete();

                f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict());
                log("*** " & __SCOPE__ & ": INFO: Testbody done. ***");

                // Postamble
                //TODO: f_postamble_NGAP_gNB();
                f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
                log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
            } // End of function f_TC_5GNAS_AMF_REG_ACC_06

            /**
             * @desc Testcase function for TP_5GNAS_AMF_REG_REJ_01
             */
+112 −0
Changes for ttcn/Ats_NG_NAS/NG_NAS_TestCases.ttcn: 112 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -554,6 +554,118 @@ module NG_NAS_TestCases {

            } // End of testcase TC_5GNAS_AMF_REG_ACC_05

            /**
             * @desc Verify that, during the initial registration procedure, when the REGISTRATION_REQUEST message contains a Requested NSSAI IE with one S-NSSAI that is allowed by the IUT, then the IUT sends a REGISTRATION_ACCEPT message containing an Allowed NSSAI IE with the requested S-NSSAI.
             * @see ETSI TS 124 501 [1], Clauses 4.4.6, 5.4.2.4, 5.5.1.2.4, 8.2.6, 8.2.7 and 8.2.26
             */
            testcase TC_5GNAS_AMF_REG_ACC_06() runs on aMF_NGNAS_NGAPComponent system TestAdapter {
        
                // Local variables
                var aMF_NGNAS_NGAPComponent v_ngnas_ngap_gnb;

                // Test control
                if (not (PICS_NGNAS and PICS_NAS_A4_8_1)) {
                    log("*** " & __SCOPE__ & ": ERROR: 'PICS_NGNAS' and 'PICS_NAS_A4_8_1' shall be set to true for executing the TC. ***");
                    stop;
                }

                // Test component configuration
                f_cf_NGNAS_aMF_Up(v_ngnas_ngap_gnb);

                // Start
                v_ngnas_ngap_gnb.start(f_TC_5GNAS_AMF_REG_ACC_06());

                // synchronize PTC on 1 sychronization points
                f_serverSyncNClientsAndStop(1, {c_prDone, c_tbDone, c_poDone});

                //f_cf_Down/*gNBoraMF*/();

            } // End of testcase TC_5GNAS_AMF_REG_ACC_06

            /**
             * @desc Verify that, during the initial registration procedure, when the REGISTRATION_REQUEST message contains a Requested NSSAI IE with one S-NSSAI that is allowed by the IUT, then the IUT sends a REGISTRATION_ACCEPT message containing an Allowed NSSAI IE with the requested S-NSSAI.
             * @see ETSI TS 124 501 [1], Clauses 4.4.2.5, 4.4.6, 5.5.1.2.4, 8.2.6 and 8.2.7
             */
            testcase TC_5GNAS_AMF_REG_ACC_06_1() runs on aMF_NGNAS_NGAPComponent system TestAdapter {
        
                // Local variables
                var aMF_NGNAS_NGAPComponent v_ngnas_ngap_gnb;

                // Test control
                if (not (PICS_NGNAS and PICS_NAS_A4_8_1)) {
                    log("*** " & __SCOPE__ & ": ERROR: 'PICS_NGNAS' and 'PICS_NAS_A4_8_1' shall be set to true for executing the TC. ***");
                    stop;
                }

                // Test component configuration
                f_cf_NGNAS_aMF_Up(v_ngnas_ngap_gnb);

                // Start
                v_ngnas_ngap_gnb.start(f_TC_5GNAS_AMF_REG_ACC_06());

                // synchronize PTC on 1 sychronization points
                f_serverSyncNClientsAndStop(1, {c_prDone, c_tbDone, c_poDone});

                //f_cf_Down/*gNBoraMF*/();

            } // End of testcase TC_5GNAS_AMF_REG_ACC_06_1

            /**
             * @desc Verify that, during the initial registration procedure, when the REGISTRATION_REQUEST message contains a Requested NSSAI IE with one S-NSSAI that is allowed by the IUT, then the IUT sends a REGISTRATION_ACCEPT message containing an Allowed NSSAI IE with the requested S-NSSAI.
             * @see "ETSI TS 124 501 [1], Clauses 4.4.6, 5.4.2.4, 5.5.1.2.4, 8.2.6, 8.2.7 and 8.2.26"
             */
            testcase TC_5GNAS_AMF_REG_ACC_06_2() runs on aMF_NGNAS_NGAPComponent system TestAdapter {
        
                // Local variables
                var aMF_NGNAS_NGAPComponent v_ngnas_ngap_gnb;

                // Test control
                if (not (PICS_NGNAS and PICS_NAS_A4_8_1)) {
                    log("*** " & __SCOPE__ & ": ERROR: 'PICS_NGNAS' and 'PICS_NAS_A4_8_1' shall be set to true for executing the TC. ***");
                    stop;
                }

                // Test component configuration
                f_cf_NGNAS_aMF_Up(v_ngnas_ngap_gnb);

                // Start
                v_ngnas_ngap_gnb.start(f_TC_5GNAS_AMF_REG_ACC_06());

                // synchronize PTC on 1 sychronization points
                f_serverSyncNClientsAndStop(1, {c_prDone, c_tbDone, c_poDone});

                //f_cf_Down/*gNBoraMF*/();

            } // End of testcase TC_5GNAS_AMF_REG_ACC_06_2

            /**
             * @desc Verify that, during the initial registration procedure, when the REGISTRATION_REQUEST message contains a Requested NSSAI IE with one S-NSSAI that is allowed by the IUT, then the IUT sends a REGISTRATION_ACCEPT message containing an Allowed NSSAI IE with the requested S-NSSAI.
             * @see ETSI TS 124 501 [1], Clauses 4.4.2.5, 4.4.6, 5.5.1.2.4, 8.2.6 and 8.2.7
             */
            testcase TC_5GNAS_AMF_REG_ACC_06_3() runs on aMF_NGNAS_NGAPComponent system TestAdapter {
        
                // Local variables
                var aMF_NGNAS_NGAPComponent v_ngnas_ngap_gnb;

                // Test control
                if (not (PICS_NGNAS and PICS_NAS_A4_8_1)) {
                    log("*** " & __SCOPE__ & ": ERROR: 'PICS_NGNAS' and 'PICS_NAS_A4_8_1' shall be set to true for executing the TC. ***");
                    stop;
                }

                // Test component configuration
                f_cf_NGNAS_aMF_Up(v_ngnas_ngap_gnb);

                // Start
                v_ngnas_ngap_gnb.start(f_TC_5GNAS_AMF_REG_ACC_06());

                // synchronize PTC on 1 sychronization points
                f_serverSyncNClientsAndStop(1, {c_prDone, c_tbDone, c_poDone});

                //f_cf_Down/*gNBoraMF*/();

            } // End of testcase TC_5GNAS_AMF_REG_ACC_06_3

            /**
             * @desc Verify that the IUT rejects initial registration request due to general NAS level mobility management congestion control with 5GMM cause value #22 - congestion and assign a value for back-off timer T3346
             * @see ETSI TS 124 501 [1], Clauses 5.5.1.2.5 and 8.2.9
+25 −0

File changed.

Preview size limit exceeded, changes collapsed.