Commit 889efd8c authored by garciay's avatar garciay
Browse files

Add support of LibCommon v1.4.0

parent fdc8c5d4
Loading
Loading
Loading
Loading
+22 −13
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
    import from DiameterS9_Templates all;
    import from DiameterS9_Gxx_Templates all;
    import from DiameterS9_TestConfiguration all;
    import from DiameterS9_TestSystem all;

    group GlobalSteps {

@@ -36,7 +37,6 @@
        runs on DiameterComponent {

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

            //Base LibDiameter init function if there will be any base initialisation
@@ -73,7 +73,6 @@
        runs on DiameterComponent {

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

            //Base LibDiameter init function if there will be any base initialisation
@@ -110,7 +109,6 @@
        runs on DiameterComponent {

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

            //Base LibDiameter init function if there will be any base initialisation
@@ -147,7 +145,6 @@
        runs on DiameterComponent {

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

            //Base LibDiameter init function if there will be any base initialisation
@@ -188,6 +185,7 @@
            {
                f_preambleClient();
            }
            
            f_DiameterS9_init();
            f_preambleDiameterBaseClient(c_applIdS9);
        }
@@ -198,6 +196,7 @@
            {
                f_preambleServer();
            }
            
            f_DiameterS9_init();
            f_preambleDiameterBaseServer(c_applIdS9);
        }
@@ -208,6 +207,7 @@
            {
                f_preambleClient();
            }
            
            f_DiameterGxx1_init();
            f_preambleDiameterBaseClient(c_applIdGxx);
        }
@@ -228,6 +228,7 @@
            {
                f_preambleClient();
            }
            
            f_DiameterGx_init();
            f_preambleDiameterBaseClient(c_applIdGx);
        }
@@ -318,6 +319,8 @@
                f_postambleDisconnect();
            }

            // Deactivate defaults
            deactivate;
        }

        function f_postamble_HPCRF() runs on DiameterComponent
@@ -330,6 +333,8 @@
                f_postambleDisconnect();
            }

            // Deactivate defaults
            deactivate;
        }

        function f_postamble_BBERF() runs on DiameterComponent
@@ -340,6 +345,8 @@
            if(PX_DIAM_LLP_ENABLED)
            {
                f_postambleDisconnect();
            // Deactivate defaults
            deactivate;
            }

        }
@@ -354,6 +361,8 @@
                f_postambleDisconnect();
            }

            // Deactivate defaults
            deactivate;
        }

        /**
@@ -408,16 +417,16 @@

        function f_ConfigRun_HPCRF_PCEF(DiameterComponent p_diameterComponent_hpcrf,
                                        DiameterComponent p_diameterComponent_pcef,
                                        in SyncPointList p_syncPointIds ) runs on ServerSyncComp
                                        in SyncPointList p_syncPointIds ) runs on DiameterS9
        {
            if (PX_Gxsupport) {
                // synchronize PTCs on 3 sychronization points
                f_serverSync2Clients(p_syncPointIds);
                f_serverSync2ClientsAndStop(p_syncPointIds);
                f_cf_1S9_1Gx_hpcrfDown(p_diameterComponent_hpcrf,
                                       p_diameterComponent_pcef);
            } else {
                // synchronize single PTC on 3 sychronization points
                f_serverSync1Client(p_syncPointIds);
                f_serverSyncNClientsAndStop(f_NrofComps(), p_syncPointIds);
                f_cf_1S9_hpcrfDown(p_diameterComponent_hpcrf);
            }
        }
@@ -455,16 +464,16 @@

        function f_ConfigRun_HPCRF_BBERF(DiameterComponent p_diameterComponent_hpcrf,
                                         DiameterComponent p_diameterComponent_bberf,
                                         in SyncPointList p_syncPointIds ) runs on ServerSyncComp
                                         in SyncPointList p_syncPointIds ) runs on DiameterS9
        {
            if (PX_Gxxsupport) {
                // synchronize PTCs on 3 sychronization points
                f_serverSync2Clients(p_syncPointIds );
                f_serverSync2ClientsAndStop(p_syncPointIds );
                f_cf_1S9_1Gxx_hpcrfDown(p_diameterComponent_hpcrf,
                                        p_diameterComponent_bberf);
            } else {
                // synchronize single PTC on 3 sychronization points
                f_serverSync1Client(p_syncPointIds );
                f_serverSyncNClientsAndStop(f_NrofComps(), p_syncPointIds );
                f_cf_1S9_hpcrfDown(p_diameterComponent_hpcrf);
            }
        }
@@ -472,17 +481,17 @@
        function f_ConfigRun_HPCRF_2BBERF(DiameterComponent p_diameterComponent_hpcrf,
                                          DiameterComponent p_diameterComponent_bberf1,
                                          DiameterComponent p_diameterComponent_bberf2,
                                          in SyncPointList p_syncPointIds ) runs on ServerSyncComp
                                          in SyncPointList p_syncPointIds ) runs on DiameterS9
        {
            if (PX_Gxxsupport) {
                // synchronize PTCs on 3 sychronization points
                f_serverSync3Clients(p_syncPointIds);
                f_serverSync3ClientsAndStop(p_syncPointIds);
                f_cf_1S9_2Gxx_hpcrfDown(p_diameterComponent_hpcrf,
                                        p_diameterComponent_bberf1,
                                        p_diameterComponent_bberf2);
            } else {
                // synchronize single PTC on 3 sychronization points
                f_serverSync1Client(p_syncPointIds);
                f_serverSyncNClientsAndStop(f_NrofComps(), p_syncPointIds);
                f_cf_1S9_hpcrfDown(p_diameterComponent_hpcrf);
            }
        }
+120 −119

File changed.

Preview size limit exceeded, changes collapsed.

+117 −178
Original line number Diff line number Diff line
@@ -8,11 +8,10 @@
module DiameterS9_TestConfiguration
{
    //LibCommon
    import from LibCommon_Sync {type ServerSyncComp,SyncPointList;
                                modulepar PX_TSYNC_TIME_LIMIT;
                                function f_serverWaitForAllClientsToStop, f_serverSyncClientsTimed;} ;
    import from LibCommon_Sync all;
    import from LibCommon_VerdictControl {type FncRetCode;
                                          function f_setVerdict;}
    import from LibCommon_BasicTypesAndValues { type UInt };

    //LibDiameter
    import from LibDiameter_Interface all;
@@ -25,7 +24,7 @@ module DiameterS9_TestConfiguration
    ** @desc f_NrofComps returns the number of test components
    ** based on the PIXIT value PX_Rxsupportt
    */
	function f_NrofComps() return integer
    function f_NrofComps() return UInt
        {    if (PX_Gxsupport or PX_Gxxsupport)
            { return 2 }
            else
@@ -41,7 +40,7 @@ module DiameterS9_TestConfiguration
         * @param p_diameterComponent_vpcrf    v-pcrf component
         */
        function f_cf_1S9_vpcrfUp(out DiameterComponent p_diameterComponent_vpcrf)
        runs on ServerSyncComp
        runs on DiameterS9
        {
            //Variables
            var FncRetCode v_ret := e_success;
@@ -49,7 +48,9 @@ module DiameterS9_TestConfiguration
            //Create
            p_diameterComponent_vpcrf := DiameterComponent.create ;

            //Connect
            // Connect mtc sync port
            connect(self:syncPort, self:syncPort);
            // Connect client sync port
            connect(p_diameterComponent_vpcrf:syncPort, self:syncPort) ;
            //Map
            map(p_diameterComponent_vpcrf:DIAMP, system:V_PCRF_S9);// Diameter Init test Configuration
@@ -57,6 +58,8 @@ module DiameterS9_TestConfiguration
                map(p_diameterComponent_vpcrf:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
            }
            
            activate(a_mtc_shutdown());
            
            f_setVerdict(v_ret);
        }//end f_cf_1S9_vpcrfUp

@@ -66,7 +69,7 @@ module DiameterS9_TestConfiguration
         * @param p_diameterComponent_hpcrf    h-pcrf component
         */
        function f_cf_1S9_hpcrfUp(out DiameterComponent p_diameterComponent_hpcrf)
        runs on ServerSyncComp
        runs on DiameterS9
        {
            //Variables
            var FncRetCode v_ret := e_success;
@@ -74,15 +77,18 @@ module DiameterS9_TestConfiguration
            //Create
            p_diameterComponent_hpcrf := DiameterComponent.create ;

            //Connect
            // Connect mtc sync port
            connect(self:syncPort, self:syncPort);
            // Connect client sync port
            connect(p_diameterComponent_hpcrf:syncPort, self:syncPort) ;

            //Map
            map(p_diameterComponent_hpcrf:DIAMP, system:H_PCRF_S9);// Diameter Init test Configuration
            if (PX_DIAM_LLP_ENABLED){
                map(p_diameterComponent_hpcrf:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
            }

            activate(a_mtc_shutdown());
            
            f_setVerdict(v_ret);
        }//end f_cf_1S9_hpcrfUp

@@ -93,7 +99,7 @@ module DiameterS9_TestConfiguration
         * @param p_diameterComponent_pcef    pcef component
         */
        function f_cf_1S9_1Gx_hpcrfUp(out DiameterComponent p_diameterComponent_hpcrf, out DiameterComponent p_diameterComponent_pcef)
        runs on ServerSyncComp
        runs on DiameterS9
        {
            //Variables
            var FncRetCode v_ret := e_success;
@@ -103,7 +109,9 @@ module DiameterS9_TestConfiguration
            if (PX_Gxsupport) {
                p_diameterComponent_pcef := DiameterComponent.create ;
            }
            //Connect
            // Connect mtc sync port
            connect(self:syncPort, self:syncPort);
            // Connect client sync port
            connect(p_diameterComponent_hpcrf:syncPort, self:syncPort) ;
            if (PX_Gxsupport) {
                connect(p_diameterComponent_pcef:syncPort, self:syncPort) ;
@@ -118,6 +126,8 @@ module DiameterS9_TestConfiguration
                map(p_diameterComponent_pcef:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
            }

            activate(a_mtc_shutdown());
            
            f_setVerdict(v_ret);
        }//end f_cf_1S9_1Gx_hpcrfUp

@@ -128,17 +138,18 @@ module DiameterS9_TestConfiguration
         * @param p_diameterComponent_bberf bberf component
         */
        function f_cf_1S9_1Gxx_hpcrfUp(out DiameterComponent p_diameterComponent_hpcrf, out DiameterComponent p_diameterComponent_bberf)
        runs on ServerSyncComp
        runs on DiameterS9
        {
            //Variables
            var FncRetCode v_ret := e_success;

            //Create
            p_diameterComponent_hpcrf := DiameterComponent.create ;
            if (PX_Gxxsupport) {
                p_diameterComponent_bberf := DiameterComponent.create ;
            }
            //Connect
            // Connect mtc sync port
            connect(self:syncPort, self:syncPort);
            // Connect client sync port
            connect(p_diameterComponent_hpcrf:syncPort, self:syncPort) ;
            if (PX_Gxxsupport) {
                connect(p_diameterComponent_bberf:syncPort, self:syncPort) ;
@@ -153,6 +164,8 @@ module DiameterS9_TestConfiguration
                map(p_diameterComponent_bberf:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
            }

            activate(a_mtc_shutdown());
            
            f_setVerdict(v_ret);
        }//end f_cf_1S9_1Gxx_hpcrfUp

@@ -164,7 +177,7 @@ module DiameterS9_TestConfiguration
         * @param p_diameterComponent_bberf2 bberf2 represents new bberf component
         */
        function f_cf_1S9_2Gxx_hpcrfUp(out DiameterComponent p_diameterComponent_hpcrf, out DiameterComponent p_diameterComponent_bberf1, out DiameterComponent p_diameterComponent_bberf2)
        runs on ServerSyncComp
        runs on DiameterS9
        {
            //Variables
            var FncRetCode v_ret := e_success;
@@ -175,7 +188,9 @@ module DiameterS9_TestConfiguration
                p_diameterComponent_bberf1 := DiameterComponent.create ;
                p_diameterComponent_bberf2 := DiameterComponent.create ;
            }
            //Connect
            // Connect mtc sync port
            connect(self:syncPort, self:syncPort);
            // Connect client sync port
            connect(p_diameterComponent_hpcrf:syncPort, self:syncPort) ;
            if (PX_Gxxsupport) {
                connect(p_diameterComponent_bberf1:syncPort, self:syncPort) ;
@@ -193,6 +208,8 @@ module DiameterS9_TestConfiguration
                map(p_diameterComponent_bberf2:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
            }

            activate(a_mtc_shutdown());
            
            f_setVerdict(v_ret);
        }//end f_cf_1S9_2Gxx_hpcrfUp

@@ -206,9 +223,9 @@ module DiameterS9_TestConfiguration
        * @param p_diameterComponent_vpcrf diameter component
        */
        function f_cf_1S9_vpcrfDown(in DiameterComponent p_diameterComponent_vpcrf)
        runs on ServerSyncComp
        runs on DiameterS9
        {
            f_serverWaitForAllClientsToStop();
            deactivate;
            
            //Disconnect
            disconnect(p_diameterComponent_vpcrf:syncPort, self:syncPort);
@@ -225,9 +242,9 @@ module DiameterS9_TestConfiguration
        * @param p_diameterComponent_hpcrf diameter component
        */
        function f_cf_1S9_hpcrfDown(in DiameterComponent p_diameterComponent_hpcrf)
        runs on ServerSyncComp
        runs on DiameterS9
        {
            f_serverWaitForAllClientsToStop();
            deactivate;
            
            //Disconnect
            disconnect(p_diameterComponent_hpcrf:syncPort, self:syncPort);
@@ -237,6 +254,7 @@ module DiameterS9_TestConfiguration
            if (PX_DIAM_LLP_ENABLED){
                unmap(p_diameterComponent_hpcrf:LLPP, system:LLIMS);
            }
            
        }//end f_cf_1S9_hpcrfDown

        /**
@@ -246,9 +264,9 @@ module DiameterS9_TestConfiguration
        * @param p_diameterComponent_pcef diameter component
        */
        function f_cf_1S9_1Gx_hpcrfDown(in DiameterComponent p_diameterComponent_hpcrf, in DiameterComponent p_diameterComponent_pcef)
        runs on ServerSyncComp
        runs on DiameterS9
        {
            f_serverWaitForAllClientsToStop();
            deactivate;
            
            //Disconnect
            disconnect(p_diameterComponent_hpcrf:syncPort, self:syncPort);
@@ -264,6 +282,7 @@ module DiameterS9_TestConfiguration
                unmap(p_diameterComponent_hpcrf:LLPP, system:LLIMS);
                unmap(p_diameterComponent_pcef:LLPP, system:LLIMS);
            }
            
        }//end f_cf_1S9_1Gx_hpcrfDown

        /**
@@ -273,9 +292,9 @@ module DiameterS9_TestConfiguration
        * @param p_diameterComponent_bberf diameter component
        */
        function f_cf_1S9_1Gxx_hpcrfDown(in DiameterComponent p_diameterComponent_hpcrf, in DiameterComponent p_diameterComponent_bberf)
        runs on ServerSyncComp
        runs on DiameterS9
        {
            f_serverWaitForAllClientsToStop();
            deactivate;
            
            //Disconnect
            disconnect(p_diameterComponent_hpcrf:syncPort, self:syncPort);
@@ -291,6 +310,7 @@ module DiameterS9_TestConfiguration
                unmap(p_diameterComponent_hpcrf:LLPP, system:LLIMS);
                unmap(p_diameterComponent_bberf:LLPP, system:LLIMS);
            }
            
        }//end f_cf_1S9_1Gxx_hpcrfDown

        /**
@@ -300,9 +320,9 @@ module DiameterS9_TestConfiguration
        * @param p_diameterComponent_bberf diameter component
        */
        function f_cf_1S9_2Gxx_hpcrfDown(in DiameterComponent p_diameterComponent_hpcrf, in DiameterComponent p_diameterComponent_bberf1, in DiameterComponent p_diameterComponent_bberf2)
        runs on ServerSyncComp
        runs on DiameterS9
        {
            f_serverWaitForAllClientsToStop();
            deactivate;
            
            //Disconnect
            disconnect(p_diameterComponent_hpcrf:syncPort, self:syncPort);
@@ -321,102 +341,21 @@ module DiameterS9_TestConfiguration
                unmap(p_diameterComponent_bberf1:LLPP, system:LLIMS);
                unmap(p_diameterComponent_bberf2:LLPP, system:LLIMS);
            }
            
        }//end f_cf_1S9_2Gxx_hpcrfDown

    } //end group cfDown

	group syncNoStop // Same functions as in LibCommon but without call of f_serverWaitForAllClientsToStop()
	{
        /**
         * @desc   Implements synchronization of N clients from server side
         *         on one or more synchronization points.
         *         If problem occurs, then server sends STOP to all clients.
         *         Waits for PX_TSYNC_TIME_LIMIT to let clients
         *         finish executing their behavior until this
         *         synchronization point. After passing all synchronization
         *         points successfuly the server waits for all clients
         *         to stop.
         *         See f_serverSyncClientsTimed for overwriting this
         *         the timing constraint!
         *         This function sets the server component verdict.
         * @remark The use of this function requires prior connection  of
         *         the server sync ports!
         * @see    LibCommon_Sync.f_connect4SelfOrClientSync
         * @see    LibCommon_Sync.PX_TSYNC_TIME_LIMIT
         * @see    LibCommon_Sync.f_serverSyncClientsTimed
         * @see    LibCommon_Sync.f_serverWaitForAllClientsToStop
         * @param  p_numClients number of synchronization clients
         * @param  p_syncPointIds list of synchronization point name/ids
         */
        function f_serverSyncNClients (
          in integer p_numClients,
          in SyncPointList p_syncPointIds )
        runs on ServerSyncComp {
          var integer i, v_noOfSyncIds := lengthof(p_syncPointIds);
          for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
            f_serverSyncClientsTimed (
              p_numClients,
              p_syncPointIds[i],
              PX_TSYNC_TIME_LIMIT );
          }
        }

	/* @desc	Implements synchronization of client from server side
	 *          on one or more synchronization points.
	 *			If problem occurs, then server sends STOP to client.
	 *			Waits for PX_TSYNC_TIME_LIMIT to let client
	 *			finish executing behavior until this
	 *			synchronization point.
	 * @remark	The use of this function requires prior connection  of
	 *			the server sync ports!
	 * @param   p_syncPointIds list of synchronization point name/ids
	 * @return  execution status
	 */
	function f_serverSync1Client( in SyncPointList p_syncPointIds )
	runs on ServerSyncComp {
		var integer i, v_noOfSyncIds := lengthof(p_syncPointIds);
		for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
			f_serverSyncClientsTimed(1,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
		}
	}
    group shutDownAltsteps {
        
    /* @desc	Implements synchronization of 2 clients from server side
     *          on one or more synchronization points.
     *			If problem occurs, then server sends STOP to all clients.
     *			Waits for PX_TSYNC_TIME_LIMIT to let clients
     *			finish executing their behavior until this
     *			synchronization point.
     * @remark	The use of this function requires prior connection  of
     *			the server sync ports!
     * @param   p_syncPointIds list of synchronization point name/ids
     * @return  execution status
     */
    function f_serverSync2Clients( in SyncPointList p_syncPointIds )
    runs on ServerSyncComp {
        var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
        for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
            f_serverSyncClientsTimed(2,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
        altstep a_mtc_shutdown() 
        runs on SelfSyncComp {
          []  syncSendPort.receive(m_syncServerStop){
              tc_sync.stop ;
              log("**** a_mtc_shutdown: MTC component received STOP signal **** ");
            }
        }
    
    /* @desc	Implements synchronization of 3 clients from server side
     *          on one or more synchronization points.
     *			If problem occurs, then server sends STOP to all clients.
     *			Waits for PX_TSYNC_TIME_LIMIT to let clients
     *			finish executing their behavior until this
     *			synchronization point.
     * @remark	The use of this function requires prior connection  of
     *			the server sync ports!
     * @param   p_syncPointIds list of synchronization point name/ids
     * @return  execution status
     */
    function f_serverSync3Clients( in SyncPointList p_syncPointIds )
    runs on ServerSyncComp {
        var integer i, v_noOfSyncIds := sizeof(p_syncPointIds);
        for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
            f_serverSyncClientsTimed(3,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
        }
    }
    } // end group shutDownAltsteps
    
	} //end group syncNoStop
} // end module DiameterS9_TestConfiguration
+7 −0
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@

module DiameterS9_TestSystem {	

    // LibCommon
    import from LibCommon_Sync all;
    
    //LibDiameter
    import from LibDiameter_Interface {type DiameterPort;};

@@ -25,6 +28,10 @@ module DiameterS9_TestSystem {

            }
        } // end Group TestSystemInterfaces
        
        type component DiameterS9 extends ServerSyncComp, SelfSyncComp { 
        } // End of component DiameterS9
        
      }// end group TestComponents
    } //end group SystemConfiguration
} // end module DiameterS9_TestSystem