/*
Copyright (c) ETSI 2025.

This software is subject to copyrights owned by ETSI. Non-exclusive permission
is hereby granted, free of charge, to copy, reproduce and amend this file
under the following conditions: It is provided "as is", without warranty of any
kind, expressed or implied.

ETSI shall never be liable for any claim, damages, or other liability arising
from its use or inability of use.This permission does not apply to any documentation
associated with this file for which ETSI keeps all rights reserved. The present
copyright notice shall be included in all copies of whole or part of this
file and shall not imply any sub-license right.
*/

/* interface at AMF */
Package TP_AMF_NGAP {
	
    import all from Ngnas_Common;
	 
	Test Purpose {
	
    TP Id TP_5GAP_ICS_01 
    
    Test objective "The IUT is able to receive an INITIAL_UE_MESSAGE to indicate a NAS transport procedure and reply with INITIAL_CONTEXT_SETUP_REQUEST."
    
    Reference 
        "ETSI TS 138 413 [1], Clauses 8.3.1.2, 8.6.1.2, 9.2.5.1 and 9.2.2.1" 
    
    Config Id CF_AMF_N2N1
    
    PICS Selection NONE
    
    Initial conditions with {
            the UE entity isNotRegisteredTo the AMF
    }
    
    Expected behaviour
        ensure that {
            when {
               the IUT entity receives an INITIAL_UE_MESSAGE containing
                   RAN_UE_NGAP_ID indicating value PX_RAN_UE_NGAP_ID,
                   NAS_PDU, //(see note)
                   User_Location_Information containing
                       nR_CGI containing
                           pLMNIdentity containing
                               MCC indicating value PX_MCC,
	                           MNC indicating value PX_MNC;,
	                       nRCellIdentity indicating value PX_NR_CELL_IDENTITY;,
                       tAI containing
                           pLMNIdentity containing
                               MCC indicating value PX_MCC,
	                           MNC indicating value PX_MNC;,
                           tAC indicating value PX_TAC;;,
                   RRC_Establishmnet_Cause indicating value "mo-signalling",
                   UE_Context_Request containing
                       UEContextRequest indicating value '0';; //requested
               from the GNB entity
            }
            then {
               the IUT entity sends an INITIAL_CONTEXT_SETUP_REQUEST containing
                   AMF_UE_NGAP_ID indicating value RV_AMF_UE_NGAP_ID,
                   RAN_UE_NGAP_ID indicating value PX_RAN_UE_NGAP_ID,
                   GUAMI containing
                       pLMNIdentity containing
                               MCC indicating value PX_MCC,
	                           MNC indicating value PX_MNC;,
	                   aMFRegionID indicating value RV_AMFRegionID,
	                   aMFSetID indicating value RV_AMFSetID,
	                   aMFPointerID indicating value RV_AMFPointerID;,
                   NAS_PDU, //(see note)
                   Allowed_NSSAI containing
	                   Allowed_NSSAI_List containing
	                       Allowed_NSSAI_Item containing
	                           S_NSSAI containing
	                               SST;;;;,
                   UE_Security_Capabilities containing
	                   NR_Encryption_Algorithms,
	                   NR_Integrity_Protection_Algorithms,
	                   E_UTRA_Encryption_Algorithms,
	                   E_UTRA_Integrity_Protection_Algorithms;,
	               Security_Key;
               to the GNB entity       
            }
        }
    }// end TP_5GAP_ICS_01
	 
	Test Purpose {
	
    TP Id TP_5GAP_ICS_02 
    
    Test objective "The IUT is able to receive an UPLINK_NAS_TRANSPORT to indicate a NAS transport procedure and reply with INITIAL_CONTEXT_SETUP_REQUEST."
    
    Reference 
        "ETSI TS 138 413 [1], Clauses 8.3.1.2, 8.6.3.2, 9.2.2.1 and 9.2.5.3" 
    
    Config Id CF_AMF_N2N1
    
    PICS Selection NONE
    
    Initial conditions with {
            the UE entity isNotRegisteredTo the AMF
    }
    
    Expected behaviour
        ensure that {
            when {
               the IUT entity receives an UPLINK_NAS_TRANSPORT containing
	               AMF_UE_NGAP_ID indicating value RV_AMF_UE_NGAP_ID,
	               RAN_UE_NGAP_ID indicating value PX_RAN_UE_NGAP_ID,
	               NAS_PDU, //(see note)
	               User_Location_Information; 
               from the GNB entity
            }
            then {
               the IUT entity sends an INITIAL_CONTEXT_SETUP_REQUEST containing
                   AMF_UE_NGAP_ID indicating value RV_AMF_UE_NGAP_ID,
                   RAN_UE_NGAP_ID indicating value PX_RAN_UE_NGAP_ID,
                   GUAMI containing
                       pLMNIdentity containing
                               MCC indicating value PX_MCC,
	                           MNC indicating value PX_MNC;,
	                   aMFRegionID indicating value RV_AMFRegionID,
	                   aMFSetID indicating value RV_AMFSetID,
	                   aMFPointerID indicating value RV_AMFPointerID;,
                   NAS_PDU, //(see note)
                   Allowed_NSSAI containing
	                   Allowed_NSSAI_List containing
	                       Allowed_NSSAI_Item containing
	                           S_NSSAI containing
	                               SST indicating value PX_SST;;;;,
                   UE_Security_Capabilities containing
	                   NR_Encryption_Algorithms,
	                   NR_Integrity_Protection_Algorithms,
	                   E_UTRA_Encryption_Algorithms,
	                   E_UTRA_Integrity_Protection_Algorithms;,
	               Security_Key;
               to the GNB entity       
            }
        }
    }// end TP_5GAP_ICS_02
	 
	Test Purpose {
	
    TP Id TP_5GAP_DNA_01 
    
    Test objective "The IUT is able to receive an INITIAL_UE_MESSAGE to indicate a NAS transport procedure and reply with DOWNLINK_NAS_TRANSPORT."
    
    Reference 
        "ETSI TS 138 413 [1], Clauses 8.6.1.2, 8.6.2.2, 9.2.5.1 and 9.2.5.2" 
    
    Config Id CF_AMF_N2N1
    
    PICS Selection NONE
    
    Initial conditions with {
            the UE entity isNotRegisteredTo the AMF
    }
    
    Expected behaviour
        ensure that {
            when {
               the IUT entity receives an INITIAL_UE_MESSAGE containing
                   RAN_UE_NGAP_ID indicating value PX_RAN_UE_NGAP_ID,
                   NAS_PDU, //(see note)
                   User_Location_Information containing
                       nR_CGI containing
                           pLMNIdentity containing
                               MCC indicating value PX_MCC,
	                           MNC indicating value PX_MNC;,
	                       nRCellIdentity indicating value PX_NR_CELL_IDENTITY;,
                       tAI containing
                           pLMNIdentity containing
                               MCC indicating value PX_MCC,
	                           MNC indicating value PX_MNC;,
                           tAC indicating value PX_TAC;;,
                   RRC_Establishmnet_Cause indicating value "mo-signalling",
                   UE_Context_Request containing
                       UEContextRequest indicating value '0';; //requested
               from the GNB entity
            }
            then {
               the IUT entity sends a DOWNLINK_NAS_TRANSPORT containing
                   AMF_UE_NGAP_ID indicating value RV_AMF_UE_NGAP_ID,
                   RAN_UE_NGAP_ID indicating value PX_RAN_UE_NGAP_ID,
                   NAS_PDU; //(see note)
               to the GNB entity       
            }
        }
    }// end TP_5GAP_DNA_01
	 
	Test Purpose {
	
    TP Id TP_5GAP_DNA_02 
    
    Test objective "The IUT is able to receive an UPLINK_NAS_TRANSPORT to indicate a NAS transport procedure and reply with DOWNLINK_NAS_TRANSPORT."
    
    Reference 
        "ETSI TS 138 413 [1], Clauses 8.6.2.2, 8.6.3.2, 9.2.5.2 and 9.2.5.3" 
    
    Config Id CF_AMF_N2N1
    
    PICS Selection NONE
    
    Initial conditions with {
            the UE entity isNotRegisteredTo the AMF
    }
    
    Expected behaviour
        ensure that {
            when {
               the IUT entity receives an UPLINK_NAS_TRANSPORT containing
	               AMF_UE_NGAP_ID indicating value RV_AMF_UE_NGAP_ID,
	               RAN_UE_NGAP_ID indicating value PX_RAN_UE_NGAP_ID,
	               NAS_PDU, //(see note)
	               User_Location_Information; 
               from the GNB entity
            }
            then {
               the IUT entity sends a DOWNLINK_NAS_TRANSPORT containing
                   AMF_UE_NGAP_ID indicating value RV_AMF_UE_NGAP_ID,
                   RAN_UE_NGAP_ID indicating value PX_RAN_UE_NGAP_ID,
                   NAS_PDU; //(see note)
               to the GNB entity       
            }
        }
    }// end TP_5GAP_DNA_02
	 
	Test Purpose {
	
    TP Id TP_5GAP_PDU_01 
    
    Test objective "The IUT is able to receive an UPLINK_NAS_TRANSPORT to indicate a NAS transport procedure and reply with DOWNLINK_NAS_TRANSPORT."
    
    Reference 
        "ETSI TS 138 413 [1], Clauses 8.2.1.2, 8.6.3.2, 9.2.1.1 and 9.2.5.3" 
    
    Config Id CF_AMF_N2N1
    
    PICS Selection NONE
    
    Initial conditions with {
            the UE entity isNotRegisteredTo the AMF
    }
    
    Expected behaviour
        ensure that {
            when {
               the IUT entity receives an UPLINK_NAS_TRANSPORT containing
	               AMF_UE_NGAP_ID indicating value RV_AMF_UE_NGAP_ID,
	               RAN_UE_NGAP_ID indicating value PX_RAN_UE_NGAP_ID,
	               NAS_PDU, //(see note)
	               User_Location_Information; 
               from the GNB entity
            }
            then {
	            the IUT entity sends a PDU_SESSION_RESOURCE_SETUP_REQUEST containing 	
	                AMF_UE_NGAP_ID indicating value RV_AMF_UE_NGAP_ID,
	                RAN_UE_NGAP_ID indicating value PX_RAN_UE_NGAP_ID,
	                PDU_Session_Resource_Setup_Request_List containing
	                    PDU_SessionId,
	                    PDU_Session_NAS_PDU, //(see note)
	                    S_NSSAI containing
	                        SST indicating value PX_SST;,
	                    PDU_Session_Resource_Setup_Request_Transfer containing
	                        UL_NGU_UP_TNL_information containing
	                            gTP_tunnel containing
	                                Endpoint_IP_Address,
	                                GTP_TEID;;,
	                        PDU_Session_Type,
	                        QoS_Flow_Setup_Request_List containing
	                            QoS_Flow_Identifier,
	                            QoS_Flow_Level_QoS_Parameters;;;;
	             to the GNB entity      
            }
        }
    }// end TP_5GAP_PDU_01
        
} // End of Package TP_AMF_NGAP

