Commit ccdb0575 authored by pintar's avatar pintar
Browse files

New modules for ATS: week 37

parent 62cfda6e
Loading
Loading
Loading
Loading
+24 −0
Original line number Original line Diff line number Diff line
/**
 *  @author     STF 490
 *  @version    $Id: DiameterRfRo_PICS.ttcn 75 2015-02-06 12:52:11Z pintar $
 *  @desc       This module provides the PICS used for the DiameterRfRo tests.
 *              See ETSI DTS/INT-121-1
*/

module DiameterRfRo_PICS {
    group PICS_A2{
//    /**
//         * @desc Does H-PCRF act as the IUT? 
//         * @see  ETSI DTS/INT-095-1 V0.0.4 (2014-02) A.2/1 
//         */
//        modulepar boolean PICS_HPCRF_IUT := false;

    }//end group PICS_A2

    group PICS_A3{


    }//end group PICS_A3


} // End of module DiameterRfRo_PICS 
 No newline at end of file
+295 −0
Original line number Original line Diff line number Diff line
/**
 *	@author 	STF 490
 *  @version    $Id: DiameterRfRo_PIXITS.ttcn 76 2015-02-26 17:47:42Z pintar $
 *	@desc		This module provides the PIXIT used for the RfRo DIAMETER tests.
 */

module DiameterRfRo_PIXITS
{
    import from LibDiameter_Types_Base_AVPs {type IPv4Addr, IPv6Addr, UTF8String, Subscription_Id_Ty_Type;};
    import from LibDiameter_Types_Gx_AVPs {type IP_CAN_Type, RAT_Type, PCC_Rule_Status;};
    import from LibCommon_BasicTypesAndValues all;
    import from LibDiameter_Types_S9_AVPs all;

    group Port_and_addresses{
        group RfRo_Port_and_addresses{
            
            /** @desc	charstring, PIXIT item A-7/1
             * IP address of the test system
             */
            modulepar charstring PX_DIAMETER_RF_ETS_IPADDR := "1.1.1.10";
    
            /** @desc	charstring,  PIXIT item A-8/1
             * IP address of the system under test
             */
            modulepar charstring PX_DIAMETER_RF_SUT_IPADDR := "1.1.1.20";
    
            /** @desc	charstring, PIXIT item A-7/2
             * Port number of the test system
             */
            modulepar integer PX_DIAMETER_RF_ETS_PORT := 3868;
    
            /** @desc	charstring, PIXIT item A-8/2
             * Port number of the system under test
             */
            modulepar integer PX_DIAMETER_RF_SUT_PORT := 3868;
            
            /** @desc	charstring, PIXIT item A-7/1
             * IP address of the test system
             */
            modulepar charstring PX_DIAMETER_RO_ETS_IPADDR := "1.1.1.12";
    
            /** @desc	charstring,  PIXIT item A-8/1
             * IP address of the system under test
             */
            modulepar charstring PX_DIAMETER_RO_SUT_IPADDR := "1.1.1.21";
    
            /** @desc	charstring, PIXIT item A-7/2
             * Port number of the test system
             */
            modulepar integer PX_DIAMETER_RO_ETS_PORT := 3868;
    
            /** @desc	charstring, PIXIT item A-8/2
             * Port number of the system under test
             */
            modulepar integer PX_DIAMETER_RO_SUT_PORT := 3868;
        }

        group Gm_Port_and_addresses{

            /** @desc    charstring, PIXIT item
             * IP address of the test system
             */
            modulepar charstring PX_DIAMETER_GM_ETS_UE_IPADDR := "1.1.1.100";

            /** @desc    charstring, PIXIT item
             * IP address of the test system
             */
            modulepar charstring PX_DIAMETER_GM_ETS_UE2_IPADDR := "1.1.1.101";

            /** @desc    charstring,  PIXIT item
             * IP address of the system under test
             */
            modulepar charstring PX_DIAMETER_GM_SUT_PCSCF_IPADDR := "1.1.1.52";

            /** @desc    charstring, PIXIT item
             * Port number of the test system UE
             */
            modulepar integer PX_DIAMETER_GM_ETS_UE_PORT := 3868;
            
            /** @desc    charstring, PIXIT item
             * Port number of the test system UE2
             */
            modulepar integer PX_DIAMETER_GM_ETS_UE2_PORT := 3868;

            /** @desc    charstring, PIXIT item
             * Port number of the system under test
             */
            modulepar integer PX_DIAMETER_GM_SUT_PCSCF_PORT := 3868;
        
        }//end group Gm_Port_and_addresses{
    
    }

// SUT specific implementation variants 
    group DiameterCommonRfRoData{

       /** @desc	UTF8String, PIXIT item A-9/1
                     
       The Session-Id AVP (AVP Code 263) is of type UTF8String and is used
       to identify a specific session (see Section 8);  All messages
       pertaining to a specific session MUST include only one Session-Id AVP
       and the same value MUST be used throughout the life of a session;
       When present, the Session-Id SHOULD appear immediately following the
       Diameter Header (see Section 3);
    
                    Ref: RFC 3588 section 8-8
        */
        modulepar UTF8String PX_SessionID := "pcscf.etsi.org;1317059245;52;21823490";
   		
    	
        /** @desc	charstring, PIXIT item A-9/2
                     
       The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and
       MUST be present in all Diameter messages;  This AVP identifies the
       endpoint that originated the Diameter message;  Relay agents MUST NOT
       modify this AVP;
    
       The value of the Origin-Host AVP is guaranteed to be unique within a
       single host;
    
                    Ref: RFC 3588 section 6-3.
                    NOTE: could be AF or PCRF role:
                        pcscf.example.com
                        pcrf.example.com
        */
        modulepar charstring PX_OriginHost := "origin.etsi.org";
    
    
    	
        /** @desc	charstring, PIXIT item A-9/3
                     
       The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity;
       This AVP contains the Realm of the originator of any Diameter message
       and MUST be present in all messages;
    
                    Ref: RFC 3588 section 6-4
        */
        modulepar charstring PX_OriginRealm := "etsi.org";
    
    
    	
        /** @desc	charstring, PIXIT item A-9/4 
                     
       The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity;
       This AVP MUST be present in all unsolicited agent initiated messages,
       MAY be present in request messages, and MUST NOT be present in Answer
       messages;
    
                    Ref: RFC 3588 section 6-5.
                    NOTE: could be AF or PCRF role:
                        pcscf.example.com
                        pcrf.example.com
        */
        modulepar charstring PX_DestinationHost := "destination.etsi.org";
    
    
    	
        /** @desc	charstring, PIXIT item A-9/3 
                     
       The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity,
       and contains the realm the message is to be routed to;  The
       Destination-Realm AVP MUST NOT be present in Answer messages.
       Diameter Clients insert the realm portion of the User-Name AVP;
       Diameter servers initiating a request message use the value of the
       Origin-Realm AVP from a previous message received from the intended
       target host (unless it is known a priori);  When present, the
       Destination-Realm AVP is used to perform message routing decisions;
    
                    Ref: RFC 3588 section 6-6
        */
        modulepar charstring PX_DestinationRealm := "myalupcrf.etsi.org";

       /** @desc	octetstring, PIXIT item A-9/6
                      
                       The Framed-IP-Address AVP (AVP Code 8) [RADIUS] is of type
       OctetString and contains an IPv4 address of the type specified in the
       attribute value to be configured for the user;  It MAY be used in an
       authorization request as a hint to the server that a specific address
       is desired, but the server is not required to honor the hint in the
       corresponding response;
    
       Two values have special significance: 0xFFFFFFFF and 0xFFFFFFFE;  The
       value 0xFFFFFFFF indicates that the NAS should allow the user to
       select an address (ie, negotiated);  The value 0xFFFFFFFE indicates
       that the NAS should select an address for the user (eg, assigned
       from a pool of addresses kept by the NAS);
    
    
                    Ref: TS 129 214 5-4, table 5-4-1
        */
        modulepar octetstring PX_UE1_framedIpAddress := '0a0a0a0a'O;
    	
        /** @desc	octetstring, PIXIT item A-9/7 

       The Framed-IPv6-Prefix AVP (AVP Code 97) is of type OctetString and
       contains the IPv6 prefix to be configured for the user;  One or more
       AVPs MAY be used in authorization requests as a hint to the server
       that specific IPv6 prefixes are desired, but the server is not
       required to honor the hint in the corresponding response;
    
    
                    Ref: TS 129 214 5-4, table 5-4-1
        */
        modulepar octetstring PX_UE1_framedIp6Address := '0a0a0a0a'O;
//        
//        /** @desc	enumerated type Subscription_Id_Ty_Type, PIXIT item A-9/8 
//         * A subscription ID type for the Subscription-Id-Type AVP in Subscription-Id AVPs
//           Available values: END_USER_E164, END_USER_IMSI, END_USER_SIP_URI, END_USER_NAI 
//        */
//        modulepar Subscription_Id_Ty_Type PX_SUBSCRIPTION_ID_TYPE := END_USER_IMSI_E;
//        
//        /** @desc	UTF8String, PIXIT item A-9/9
//         * Subscription data for the Subscription-Id-Data AVP in Subscription-Id AVPs
//        */
//        modulepar UTF8String PX_SUBSCRIPTION_ID_DATA := "SUBS_DATA";
//        
//        /** @desc	enumerated type IP_CAN_Type, PIXIT item A-9/10 
//         * A connectivity access type for the IP-CAN-Type AVP in CCR messages
//           Available values: 3GPP-GPRS, DCOSIS, xDSL, WiMAX, 3GPP2, 3GPP-EPS, Non-3GPP-EPS
//        */
//        modulepar IP_CAN_Type PX_IP_CAN_TYPE := ThreeGPP_GPRS_E;
//        
//        /** @desc	enumerated type RAT_Type, PIXIT item A-9/11 
//         * A radio access technology for the IP-RAT-Type AVP in CCR messages
//           Available values: WLAN, VIRTUAL, UTRAN, GERAN, GAN, HSPA_EVOLUTION, EUTRAN, CDMA2000, HRPD, UMB, EHRPD
//        */
//        modulepar RAT_Type PX_RAT_TYPE := WLAN_E;    	
//        
//        /** @desc	octetstring, PIXIT item A-9/12 
//
//       The QoS_Rule_Name is of type OctetString and
//       contains QoS Rule
//                    Ref: TS 129 212 5a-3, table 5a-3-4
//        */
//        modulepar octetstring PX_QOS_RULE_NAME := '0b'O;
//
//        /** @desc	octetstring, PIXIT item A-9/13 
//       The QoS_Rule_Name is of type OctetString and
//       contains QoS Rule
//                    Ref: TS 129 212 5a-3, table 5a-3-4
//        */
//        modulepar octetstring PX_QOS_RULE_NAME_NOT_ACCEPTABLE := '0b'O;
//
//        /** @desc	UTF8String, PIXIT item A-9/14
//         * A PDN for the Called-Station-Id AVP
//        */
//        modulepar UTF8String PX_CALLED_STATION_ID_PDN := "PDN_ID";
//
//        /** @desc	octetstring, PIXIT item A-9/15
//         * An identity for the PDN connection for the PDN-Connection-ID AVP
//        */
//        modulepar octetstring PX_PDN_CONNECTION_ID_DATA := '08'O;
//
//        /** @desc	 
//        The SGW/AGW in IPv4Addr format (3GPP-EPS and 3GPP2 accesses), PIXIT item A-9/16
//        */
//        modulepar IPv4Addr PX_SGW_AGW_ipv4 := {1,2,3,4};
//
//        /** @desc	
//        The SGW/AGW in type IPv6Addr format (3GPP-EPS and 3GPP2 accesses), PIXIT item A-9/17
//        */
//        modulepar IPv6Addr PX_SGW_AGW_ipv6 := {1,2,3,4,5,6,7,8};
//
//        /** @desc	
//        The max QoS bandwidth in type UInt32 format, PIXIT item A-9/18
//        */
//        modulepar UInt32 PX_max_Requested_Bandwidth_UL := 4294967295;
//
//        /** @desc	
//        The subsession Id in type UInt32 format, PIXIT item A-9/19
//        */
//        modulepar UInt32 PX_SUBSESSION_ID := 100;
//
//        /** @desc	octetstring, PIXIT item A-9/20
//         * First charging rule name for the Charging-Rule-Name AVP
//        */
//        modulepar octetstring PX_CHARGING_RULE_NAME_DATA := '08'O;
//
//        
//        /** @desc	enumerated type PCC_Rule_Status, PIXIT item A-9/21
//         * A status value of PCC rule(s) for the PCC-Rule-Status AVP
//           Available values: ACTIVE,  INACTIVE, TEMPORARILY INACTIVE
//        */
//        modulepar PCC_Rule_Status PX_PCC_RULE_STATUS := ACTIVE_E;
        

    } //end group DiameterCommonRfRoData
    
    
	/** 
	 * @desc    boolean indicator that is true if the Gm interface (SIP protocol) is accessible to trigger Diameter events at the Cx/Dx interface
	*/
	modulepar boolean PX_SIPsupport := false;
    
} // end module DiameterRfRo_PIXITS
 No newline at end of file
+32 −0
Original line number Original line Diff line number Diff line
/**
 *  @author     STF 490
 *  @version    $Id: DiameterRfRo_SIP_TCFunctions.ttcn3 74 2015-02-05 17:15:11Z pintar $
 *  @desc       This module provides RfRo test functions used by the test cases
 *              for IMS-DIAMETER tests.
 */
module DiameterRfRo_SIP_TCFunctions {
    // LibCommon
    import from LibCommon_Sync {function f_selfOrClientSyncAndVerdict;
                                const c_prDone, c_tbDone, c_poDone;}
    import from LibCommon_VerdictControl all ;

    // LibDiameter
    import from LibDiameter_Types_Gx_AVPs all;
    import from LibDiameter_TypesAndValues all;
    import from LibDiameter_Templates all;
    import from LibDiameter_Interface all;
    import from LibDiameter_Steps all;
    import from LibDiameter_Types_Base_AVPs all;

    //DiameterS9
    import from DiameterRfRo_Templates all;
    import from DiameterRfRo_SIP_Templates all;
    import from DiameterRfRo_Steps all;
    import from DiameterRfRo_PIXITS all;


    group TP_VPCRFRole{

    } // group TP_VPCRFRole    
    
}// end module DiameterRfRo_SIP_TCFunctions
 No newline at end of file
+38 −0
Original line number Original line Diff line number Diff line
/**
 *  @author   STF 490
 *  @version  $Id: DiameterRfRo_SIP_Templates.ttcn 74 2015-02-05 17:15:11Z pintar $
 *  @desc     This module defines Gx and Gxx Diameter Templates for message, header, and
 *            structured types. <br>
 *            Note that any changes made to the definitions in this module
 *            may be overwritten by future releases of this library
 *            End users are encouraged to contact the distributers of this
 *            module regarding their modifications or additions.
 *            Note that usage of encvalue command (codec function) returns bitstring 
 *            length of the message or AVP with padding bytes. Therefore this function 
 *            is not used on the first level where length of one single AVP can be 
 *            calculated with lengthof function. It shall be used only on message level 
 *            or in case where one AVP is group of other AVPs.
 *  @remark   Any additions to the templates shall follow the design rules
 *            and always modify base templates only;
 */

module DiameterRfRo_SIP_Templates {

    //LibCommon
    import from LibCommon_BasicTypesAndValues {type UInt32;};
    
    //LibDiameter
    import from LibDiameter_Types_Base_AVPs all;
    import from LibDiameter_TypesAndValues all;
    import from LibDiameter_Templates all;
    
    //DiameterS9
    import from DiameterRfRo_PIXITS all;
    import from DiameterRfRo_Templates all;
    
    

    group SubFields{
    } //end group SubFields

}//end module DiameterRfRo_SIP_Templates
 No newline at end of file
+214 −0
Original line number Original line Diff line number Diff line
/**
 *  @author     STF 490
 *  @version    $Id: DiameterRfRo_Steps.ttcn3 74 2015-02-05 17:15:11Z pintar $
 *  @desc       This module provides ATS specific steps used by the test cases
 *              for IMS-DIAMETER RfRo tests.
 */
 module DiameterRfRo_Steps {

    //LibCommon
    import from LibCommon_DataStrings {type Bit1, Bit4, Bit5, Bit8;}//all;
    import from LibCommon_BasicTypesAndValues {type UInt8;};//LibCommon
    import from LibCommon_Sync all ;
    import from LibCommon_VerdictControl all ;

    //LibDiameter
    import from LibDiameter_Types_S9_AVPs all;
    import from LibDiameter_Types_Base_AVPs all;
    import from LibDiameter_TypesAndValues all;
    import from LibDiameter_Templates all;
    import from LibDiameter_Steps  all;
    import from LibDiameter_PIXITS all;
    import from LibDiameter_Interface all;
    
    //DiameterS9
    import from DiameterRfRo_PIXITS all;
    import from DiameterRfRo_Templates all;
    import from DiameterRfRo_SIP_Templates all;
    import from DiameterRfRo_TestConfiguration all;
    import from DiameterRfRo_TestSystem all;

    group GlobalSteps {

        /*
        *  @desc    This is a test step that init global variables
        *  @param   
        */
        function f_DiameterRf_init()
        runs on DiameterComponent {

            //Defaults
            vc_default_diameter := activate (a_diameter_default());

            //Base LibDiameter init function if there will be any base initialisation
            f_Diameter_Init_Component();

            vc_ETS_address := PX_DIAMETER_RF_ETS_IPADDR;
            vc_ETS_port    := PX_DIAMETER_RF_ETS_PORT;
            vc_SUT_address := PX_DIAMETER_RF_SUT_IPADDR;
            vc_SUT_port    := PX_DIAMETER_RF_SUT_PORT;

            vc_sessionId := m_sessionId(PX_SessionID);

            vc_originHost := m_originHost(PX_OriginHost);
            vc_originRealm := m_originRealm(PX_OriginRealm); // realm of the originator (TS)

            vc_originHost_IUT := m_originHost(PX_DestinationHost);
            vc_originRealm_IUT := m_originRealm(PX_DestinationRealm); // realm of the originator (TS)

            vc_destinationHost := m_destinationHost(PX_DestinationHost);
            vc_destinationRealm := m_destinationRealm(PX_DestinationRealm);

            vc_destinationHost_IUT := m_destinationHost(PX_OriginHost);
            vc_destinationRealm_IUT := m_destinationRealm(PX_OriginRealm);

            vc_hostIPAddress := valueof(f_IPV4or6_String2Address (PX_DIAMETER_RF_ETS_IPADDR));

            vc_send_hopid:=hex2int('00000100'H);
            vc_send_endid:=hex2int('01000000'H);

        } // end function f_DiameterS9_init

        /*
        *  @desc    This is a test step that init global variables
        *  @param   
        */
        function f_DiameterRo_init()
        runs on DiameterComponent {

            //Defaults
            vc_default_diameter := activate (a_diameter_default());

            //Base LibDiameter init function if there will be any base initialisation
            f_Diameter_Init_Component();

            vc_ETS_address := PX_DIAMETER_RO_ETS_IPADDR;
            vc_ETS_port    := PX_DIAMETER_RO_ETS_PORT;
            vc_SUT_address := PX_DIAMETER_RO_SUT_IPADDR;
            vc_SUT_port    := PX_DIAMETER_RO_SUT_PORT;

            vc_sessionId := m_sessionId(PX_SessionID);

            vc_originHost := m_originHost(PX_OriginHost);
            vc_originRealm := m_originRealm(PX_OriginRealm); // realm of the originator (TS)

            vc_originHost_IUT := m_originHost(PX_DestinationHost);
            vc_originRealm_IUT := m_originRealm(PX_DestinationRealm); // realm of the originator (TS)

            vc_destinationHost := m_destinationHost(PX_DestinationHost);
            vc_destinationRealm := m_destinationRealm(PX_DestinationRealm);

            vc_hostIPAddress := valueof(f_IPV4or6_String2Address (PX_DIAMETER_RO_ETS_IPADDR));

            vc_send_hopid:=hex2int('00000100'H);
            vc_send_endid:=hex2int('01000000'H);

        } // end function f_DiameterRo_init
        
        //TODO check for 2nd Ro or Rf configuration!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    } // end group GlobalSteps

    group Preambles{

        function f_preamble_Rf_CDF() runs on DiameterComponent
        {
            if(PX_DIAM_LLP_ENABLED)
            {
                f_preambleClient();
            }
            
            f_DiameterRf_init();
            f_preambleDiameterBaseClient(c_applIdCommonMsg);//TODO change to Rf/Ro
        }

        function f_preamble_Rf_CTF() runs on DiameterComponent
        {
            if(PX_DIAM_LLP_ENABLED)
            {
                f_preambleServer();
            }
            
            f_DiameterRf_init();
            f_preambleDiameterBaseServer(c_applIdCommonMsg);//TODO change to Rf/Ro
        }

        function f_preamble_Ro_OCF() runs on DiameterComponent
        {
            if(PX_DIAM_LLP_ENABLED)
            {
                f_preambleClient();
            }
            
            f_DiameterRo_init();
            f_preambleDiameterBaseClient(c_applIdCommonMsg);//TODO change to Rf/Ro
        }

        function f_preamble_Ro_CTF() runs on DiameterComponent
        {
            if(PX_DIAM_LLP_ENABLED)
            {
                f_preambleServer();
            }
            
            f_DiameterRf_init();
            f_preambleDiameterBaseServer(c_applIdCommonMsg);//TODO change to Rf/Ro
        }

    }// end group Preambles

    group Postambles {

        function f_postamble_CTF() runs on DiameterComponent
        {

            f_postambleDiameterBase();

            if(PX_DIAM_LLP_ENABLED)
            {
                f_postambleDisconnect();
            }

            // Deactivate defaults
            deactivate;
        }

        function f_postamble_CDF() runs on DiameterComponent
        {

            f_postambleDiameterBase();

            if(PX_DIAM_LLP_ENABLED)
            {
                f_postambleDisconnect();
            }

            // Deactivate defaults
            deactivate;
        }

        function f_postamble_OCF() runs on DiameterComponent
        {

            f_postambleDiameterBase();

            if(PX_DIAM_LLP_ENABLED)
            {
                f_postambleDisconnect();
            }

            // Deactivate defaults
            deactivate;
        }

    }// end group Postambles

    group AVPOperations {
    }//end group AVPOperations

    group CheckFunctions {


    } //end group CheckFunctions

} // end module DiameterGx_Steps
 No newline at end of file
Loading