Commit e8ffedb5 authored by pintar's avatar pintar
Browse files

new modules for Gx interface (STF443)

parent 4b58675d
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
/**
 *	@author 	STF 443
 *  @version    $Id: $
 *	@desc		This module provides RX test functions used by the test cases
 *              for IMS-DIAMETER tests.
 */
module DiameterGx_Gx_TCFunctions {
	// LibCommon
	import from LibCommon_Sync {function f_selfOrClientSyncAndVerdict; 
	    						const c_prDone, c_tbDone, c_poDone;}
		
	// LibDiameter
	import from LibDiameter_TypesAndValues all;
	import from LibDiameter_Templates all;
    import from LibDiameter_Interface all;
	import from LibDiameter_Steps all;
	
	//DiameterGx
	import from DiameterGx_PIXITS all;
	import from DiameterGx_Templates all;
	import from DiameterGx_Steps all;

	group TP_PCEFRole{

	} //end group TP_PCEFRole

    group TP_PCRFRole {
        
    } //end group TP_PCRFRole
	
} // end module DiameterGx_Gx_TCFunctions
+19 −0
Original line number Diff line number Diff line
/**
 *	@author 	STF 443
 *  @version    $Id: $
 *	@desc		This module provides the PICS used for the SIP-IMS-DIAMETER tests.
*/

module DiameterGx_PICS
{
	/* ****************************************************************************************************
		PICS used for test case selection
		*************************************************************************************************** */

	/** @desc	Does PCRF support XXXXX 
	 *  @remark	PICS ref: A.X/X
	 *			True, if XXXXX is supported
	*/
	modulepar boolean PC_PCRF_XXXXX;
    
} // end module DiameterGx_PICS
 No newline at end of file
+118 −0
Original line number Diff line number Diff line
/**
 *	@author 	STF 443
 *  @version    $Id: $
 *	@desc		This module provides the PIXIT used for the SIP-IMS-DIAMETER tests.
 */

module DiameterGx_PIXITS
{
    
    import from LibDiameter_TypesAndValues all;
    import from LibCommon_BasicTypesAndValues all;

    //const charstring IPV4or6RegExp:= pattern "/^(?:(?>(?>([a-f0-9]{1,4})(?>:(?1)){7})|(?>(?!(?:.*[a-f0-9](?>:|$)){8,})((?1)(?>:(?1)){0,6})?::(?2)?))|(?>(?>(?>(?1)(?>:(?1)){5}:)|(?>(?!(?:.*[a-f0-9]:){6,})((?1)(?>:(?1)){0,4})?::(?>(?3):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?>\.(?4)){3}))$/iD";

    group Port_and_addresses{
        
        /** @desc	charstring, PIXIT item A.1/3
         * IP address of the test system
         */
        modulepar charstring PX_DIAMETER_GX_ETS_IPADDR := "1.1.1.1";
        /** @desc	charstring,  PIXIT item A.1/4
         * IP address of the system under test
         */
        modulepar charstring PX_DIAMETER_GX_SUT_IPADDR := "1.1.1.2";
        /** @desc	charstring, PIXIT item A.1/5
         * Port number of the test system
         */
        modulepar integer PX_DIAMETER_GX_ETS_PORT := 3868;
        /** @desc	charstring,  PIXIT item A.1/6
         * Port number of the system under test
         */
        modulepar integer PX_DIAMETER_GX_SUT_PORT := 3868;
    
    }

// SUT specific implementation variants 
	group DiameterCommonGxData{
    		
        /** @desc	UTF8String,  PIXIT item A.1/9 
                     
       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.metaswitch.com;1317059245;52;21823490";
    
    
    	
        /** @desc	charstring, PIXIT item A.1/10
                     
       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.metaswitch.com
                    	pcrf.metaswitch.com
        */
        modulepar charstring PX_OriginHost := "origin.metaswitch.com";
    
    
    	
        /** @desc	charstring, PIXIT item A.1/11 
                     
       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 := "metaswitch.com";
    
    
    	
        /** @desc	charstring, PIXIT item A.1/12 
                     
       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.metaswitch.com
                    	pcrf.metaswitch.com
        */
        modulepar charstring PX_DestinationHost := "destination.metaswitch.com";
    
    
    	
        /** @desc	charstring, PIXIT item A.1/13 
                     
       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.vf.de";
        
	} //end group DiameterCommonGxData

} // end module DiameterGx_PIXITS
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
/**
 *	@author 	STF 443
 *  @version    $Id: $
 *	@desc		This module provides GM/UE test functions used by the test cases
 *              for IMS-DIAMETER tests.
 */
module DiameterGx_Rx_TCFunctions {
	// LibCommon
	import from LibCommon_Sync {function f_selfOrClientSyncAndVerdict; 
	    						const c_prDone, c_tbDone, c_poDone;}

	// DiameterRx
	import from DiameterRx_Templates all;
	import from DiameterRx_Steps all;
	


	group TP_B{
		//Used in case if PCRF is TS and ports for Gx and Rx interface will be used
	} //end group TP_B	
	
} // end module DiameterGx_Rx_TCFunctions
 No newline at end of file
+140 −0
Original line number Diff line number Diff line
/**
 *	@author 	STF 443
 *  @version    $Id: $
 *	@desc		This module provides ATS specific templates used by the test cases
 *              for IMS-DIAMETER tests.
 */
 module DiameterGx_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_TypesAndValues all;
    import from LibDiameter_Templates all;
    import from LibDiameter_Steps  all;
    import from LibDiameter_PIXITS all;
    import from LibDiameter_Interface all;	
    
    //DiameterGx
    import from DiameterGx_Templates all;
    import from DiameterGx_PIXITS all;	
    
    group GlobalSteps {

        /*
        *  @desc	This is a test step that init global variables
        *  @param	
        */
        function f_DiameterGx_init()
        runs on DiameterComponent {
            
            //Defaults
    		vc_def_catchSyncStop_diameter := activate(a_Sip_catchSyncStop());
    		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_GX_ETS_IPADDR;
            vc_ETS_port		:= PX_DIAMETER_GX_ETS_PORT;
			vc_SUT_address := PX_DIAMETER_GX_SUT_IPADDR;
			vc_SUT_port 		:= PX_DIAMETER_GX_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_destinationHost := m_destinationHost(PX_DestinationHost);
            vc_destinationRealm := m_destinationRealm(PX_DestinationRealm);
            
            vc_hostIPAddress := valueof(f_IPV4or6_String2Address (PX_DIAMETER_GX_ETS_IPADDR)); 
            
            vc_send_hopid:=hex2int('00000100'H);
            vc_send_endid:=hex2int('01000000'H);
            
        } // end function f_DiameterGx_init
 
        
    } // end group GlobalSteps
    
    group Preambles{
        
        function f_preamble_PCEF() runs on DiameterComponent
        {
            if(PX_DIAM_LLP_ENABLED)
            {
                f_preambleClient();
            }
            f_DiameterGx_init();
            f_preambleDiameterBase();
        }
       
        function f_preamble_PCRF() runs on DiameterComponent
        {
            if(PX_DIAM_LLP_ENABLED)
            {
                f_preambleServer();
            }
            f_DiameterGx_init();
            f_preambleDiameterBase();
        }
    }// end group Preambles
    
    group AVPOperations {
        
    }//end group AVPOperations
             
    group DefaultAltsteps {
    
    	
    	
    	/**
    	* @desc	This default handles receiving of the sync server
    	*		STOP message and calls the RT HUT postamble. (copy from common lib)
    	*/	
    	altstep a_Sip_catchSyncStop() runs on DiameterComponent 
    	{
    		[]	syncPort.receive(m_syncServerStop)
    		{
    			tc_sync.stop ;
    			log("**** a_Sip_catchSyncStop: Test component received STOP signal from MTC - going to IDLE state **** ");
    			syncPort.send(m_syncClientStop);
    			f_terminate_diameter_component();
    			log("**** a_Sip_catchSyncStop: TEST COMPONENT NOW STOPPING ITSELF! **** ") ;
    			setverdict(inconc);
    			stop ;
    		}
    	} 
    
        altstep a_diameter_default() runs on DiameterComponent
        {
            [] any timer.timeout 
             {
               setverdict(fail); 
               all timer.stop;
               //stop
             }
            [] DIAMP.receive (DIAMETER_MSG:{dWR_MSG := mw_DWR_dummy}) -> value vc_recvDiamMsgDefault
              {
                f_send_DWA(m_DWA_dummy);
                repeat;
              };
            [] DIAMP.receive (DIAMETER_MSG:{cER_MSG := mw_CER_dummy}) -> value vc_recvDiamMsgDefault
              {
                f_send_CEA(m_CEA_dummy);
                repeat;
              };
            [] DIAMP.receive (DIAMETER_MSG:?) -> value vc_recvDiamMsgDefault
              {
                  //TODO: need to be done
                  setverdict (fail);
              };
        }
    
    }// end group DefaultAltsteps
} // end module DiameterGx_Steps
 No newline at end of file
Loading