Commit fa8b4489 authored by garciay's avatar garciay
Browse files

Add support of LibCommon v1.4.0

parent aea69cdf
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -6,8 +6,7 @@
 */
 */
module DiameterGx_Gx_TCFunctions {
module DiameterGx_Gx_TCFunctions {
    // LibCommon
    // LibCommon
    import from LibCommon_Sync {function f_selfOrClientSyncAndVerdict;
    import from LibCommon_Sync all;
                                const c_prDone, c_tbDone, c_poDone;}
    import from LibCommon_VerdictControl all ;
    import from LibCommon_VerdictControl all ;


    // LibDiameter
    // LibDiameter
+0 −1
Original line number Original line Diff line number Diff line
@@ -33,7 +33,6 @@
        runs on DiameterComponent {
        runs on DiameterComponent {


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


            //Base LibDiameter init function if there will be any base initialisation
            //Base LibDiameter init function if there will be any base initialisation
+7 −7
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@
    import from DiameterGx_PIXITS all;
    import from DiameterGx_PIXITS all;
    import from DiameterGx_Gx_TCFunctions all;
    import from DiameterGx_Gx_TCFunctions all;
    import from DiameterGx_TestConfiguration all;
    import from DiameterGx_TestConfiguration all;
    import from DiameterGx_TestSystem all;


    // GPRS tunneling protocol
    // GPRS tunneling protocol
    // import from LibGtp_TypesAndValues all;
    // import from LibGtp_TypesAndValues all;
@@ -39,7 +40,6 @@
        runs on DiameterComponent {
        runs on DiameterComponent {


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


            //Base LibDiameter init function if there will be any base initialisation
            //Base LibDiameter init function if there will be any base initialisation
@@ -162,35 +162,35 @@
        }
        }


        function f_ConfigRun_PCRF(DiameterComponent p_diameterComponent_pcrf,
        function f_ConfigRun_PCRF(DiameterComponent p_diameterComponent_pcrf,
                                 GtpComponent p_gtpComponent1, GtpComponent p_gtpComponent2) runs on ServerSyncComp
                                 GtpComponent p_gtpComponent1, GtpComponent p_gtpComponent2) runs on DiameterGx
        {
        {
            if (PX_GTPsupport) {
            if (PX_GTPsupport) {
                p_gtpComponent1.start(f_TC_GTP_01());
                p_gtpComponent1.start(f_TC_GTP_01());
                p_gtpComponent2.start(f_TC_GTP_02());
                p_gtpComponent2.start(f_TC_GTP_02());
                // synchronize PTCs on 3 sychronization points
                // synchronize PTCs on 3 sychronization points
                f_serverSync3Clients({c_prDone, c_tbDone, c_poDone});
                f_serverSync3ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                f_cf_1Gx2GtpRDown(p_diameterComponent_pcrf,
                f_cf_1Gx2GtpRDown(p_diameterComponent_pcrf,
                                  p_gtpComponent1, p_gtpComponent2);
                                  p_gtpComponent1, p_gtpComponent2);
            } else {
            } else {
                // synchronize single PTC on 3 sychronization points
                // synchronize single PTC on 3 sychronization points
                f_serverSync1Client({c_prDone, c_tbDone, c_poDone});
                f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                f_cf_1GxRDown(p_diameterComponent_pcrf);
                f_cf_1GxRDown(p_diameterComponent_pcrf);
            }
            }
        }
        }


        function f_ConfigRun2_PCRF(DiameterComponent p_diameterComponent_pcrf,
        function f_ConfigRun2_PCRF(DiameterComponent p_diameterComponent_pcrf,
                                 GtpComponent p_gtpComponent1, GtpComponent p_gtpComponent2) runs on ServerSyncComp
                                 GtpComponent p_gtpComponent1, GtpComponent p_gtpComponent2) runs on DiameterGx
        {
        {
            if (PX_GTPsupport) {
            if (PX_GTPsupport) {
                p_gtpComponent1.start(f_TC_GTP_01());
                p_gtpComponent1.start(f_TC_GTP_01());
                p_gtpComponent2.start(f_TC_GTP_02_neg()); // <== neg. behaviour!
                p_gtpComponent2.start(f_TC_GTP_02_neg()); // <== neg. behaviour!
                // synchronize PTCs on 3 sychronization points
                // synchronize PTCs on 3 sychronization points
                f_serverSync3Clients({c_prDone, c_tbDone, c_poDone});
                f_serverSync3ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                f_cf_1Gx2GtpRDown(p_diameterComponent_pcrf,
                f_cf_1Gx2GtpRDown(p_diameterComponent_pcrf,
                                  p_gtpComponent1, p_gtpComponent2);
                                  p_gtpComponent1, p_gtpComponent2);
            } else {
            } else {
                // synchronize single PTC on 3 sychronization points
                // synchronize single PTC on 3 sychronization points
                f_serverSync1Client({c_prDone, c_tbDone, c_poDone});
                f_serverSyncNClientsAndStop(f_NrofComps(), {c_prDone, c_tbDone, c_poDone});
                f_cf_1GxRDown(p_diameterComponent_pcrf);
                f_cf_1GxRDown(p_diameterComponent_pcrf);
            }
            }
        }
        }
+114 −114

File changed.

Preview size limit exceeded, changes collapsed.

+93 −165
Original line number Original line Diff line number Diff line
@@ -10,6 +10,8 @@ module DiameterGx_TestConfiguration
    //LibCommon
    //LibCommon
    import from LibCommon_Sync all ;
    import from LibCommon_Sync all ;
    import from LibCommon_VerdictControl all;
    import from LibCommon_VerdictControl all;
    import from LibCommon_BasicTypesAndValues { type UInt };
    
    //LibSip
    //LibSip
    //import from LibSip_Interface all;
    //import from LibSip_Interface all;
    import from LibSip_SIPTypesAndValues all;
    import from LibSip_SIPTypesAndValues all;
@@ -28,7 +30,7 @@ module DiameterGx_TestConfiguration
    ** @desc f_NrofComps returns the number of test components
    ** @desc f_NrofComps returns the number of test components
    ** based on the PIXIT value PX_Rxsupportt
    ** based on the PIXIT value PX_Rxsupportt
    */
    */
	function f_NrofComps() return integer
    function f_NrofComps() return UInt
        {    if (PX_Rxsupport)
        {    if (PX_Rxsupport)
            { return 2 }
            { return 2 }
            else
            else
@@ -44,7 +46,7 @@ module DiameterGx_TestConfiguration
         * @param p_diameterComponent_pcef    pcef component
         * @param p_diameterComponent_pcef    pcef component
         */
         */
        function f_cf_1GxEUp(out DiameterComponent p_diameterComponent_pcef)
        function f_cf_1GxEUp(out DiameterComponent p_diameterComponent_pcef)
        runs on ServerSyncComp
        runs on DiameterGx
        {
        {
            //Variables
            //Variables
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;
@@ -52,7 +54,9 @@ module DiameterGx_TestConfiguration
            //Create
            //Create
            p_diameterComponent_pcef := DiameterComponent.create ;
            p_diameterComponent_pcef := DiameterComponent.create ;


            //Connect
            // Connect mtc sync port
            connect(self:syncPort, self:syncPort);
            // Connect client sync port
            connect(p_diameterComponent_pcef:syncPort, self:syncPort) ;
            connect(p_diameterComponent_pcef:syncPort, self:syncPort) ;
            //Map
            //Map
            map(p_diameterComponent_pcef:DIAMP, system:PCEF_Gx);// Diameter Init test Configuration
            map(p_diameterComponent_pcef:DIAMP, system:PCEF_Gx);// Diameter Init test Configuration
@@ -60,6 +64,8 @@ module DiameterGx_TestConfiguration
                map(p_diameterComponent_pcef:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
                map(p_diameterComponent_pcef:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
            }
            }


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


@@ -69,7 +75,7 @@ module DiameterGx_TestConfiguration
         * @param p_diameterComponent_pcrf    pcrf component
         * @param p_diameterComponent_pcrf    pcrf component
         */
         */
        function f_cf_1GxRUp(out DiameterComponent p_diameterComponent_pcrf)
        function f_cf_1GxRUp(out DiameterComponent p_diameterComponent_pcrf)
        runs on ServerSyncComp
        runs on DiameterGx
        {
        {
            //Variables
            //Variables
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;
@@ -77,7 +83,9 @@ module DiameterGx_TestConfiguration
            //Create
            //Create
            p_diameterComponent_pcrf := DiameterComponent.create ;
            p_diameterComponent_pcrf := DiameterComponent.create ;


            //Connect
            // Connect mtc sync port
            connect(self:syncPort, self:syncPort);
            // Connect client sync port
            connect(p_diameterComponent_pcrf:syncPort, self:syncPort) ;
            connect(p_diameterComponent_pcrf:syncPort, self:syncPort) ;
            //Map
            //Map
            map(p_diameterComponent_pcrf:DIAMP, system:PCRF_Gx);// Diameter Init test Configuration
            map(p_diameterComponent_pcrf:DIAMP, system:PCRF_Gx);// Diameter Init test Configuration
@@ -85,6 +93,8 @@ module DiameterGx_TestConfiguration
                map(p_diameterComponent_pcrf:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
                map(p_diameterComponent_pcrf:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
            }
            }


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


@@ -94,12 +104,14 @@ module DiameterGx_TestConfiguration
         * @param p_diameterComponent_pcef    pcef component
         * @param p_diameterComponent_pcef    pcef component
         */
         */
        function f_cf_1Gx1RxUp(out DiameterComponent p_diameterComponent_pcef, out DiameterComponent p_diameterComponent_af)
        function f_cf_1Gx1RxUp(out DiameterComponent p_diameterComponent_pcef, out DiameterComponent p_diameterComponent_af)
        runs on ServerSyncComp
        runs on DiameterGx
        {
        {
            //Variables
            //Variables
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;


            //Create
            // Connect mtc sync port
            connect(self:syncPort, self:syncPort);
            // Connect client sync port
            p_diameterComponent_pcef := DiameterComponent.create ;
            p_diameterComponent_pcef := DiameterComponent.create ;
            if (PX_Rxsupport) {
            if (PX_Rxsupport) {
                p_diameterComponent_af := DiameterComponent.create ;
                p_diameterComponent_af := DiameterComponent.create ;
@@ -119,6 +131,8 @@ module DiameterGx_TestConfiguration
                map(p_diameterComponent_af:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
                map(p_diameterComponent_af:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
            }
            }


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


@@ -129,7 +143,7 @@ module DiameterGx_TestConfiguration
         */
         */
        function f_cf_1Gx2GtpRUp(out DiameterComponent p_diameterComponent_pcrf,
        function f_cf_1Gx2GtpRUp(out DiameterComponent p_diameterComponent_pcrf,
                                 out GtpComponent p_gtpComponent1, out GtpComponent p_gtpComponent2)
                                 out GtpComponent p_gtpComponent1, out GtpComponent p_gtpComponent2)
        runs on ServerSyncComp
        runs on DiameterGx
        {
        {
            //Variables
            //Variables
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;
@@ -141,7 +155,9 @@ module DiameterGx_TestConfiguration
                p_gtpComponent2 := GtpComponent.create ;
                p_gtpComponent2 := GtpComponent.create ;
            }
            }


            //Connect
            // Connect mtc sync port
            connect(self:syncPort, self:syncPort);
            // Connect client sync port
            connect(p_diameterComponent_pcrf:syncPort, self:syncPort) ;
            connect(p_diameterComponent_pcrf:syncPort, self:syncPort) ;
            if (PX_GTPsupport) {
            if (PX_GTPsupport) {
                connect(p_gtpComponent1:syncPort, self:syncPort) ;
                connect(p_gtpComponent1:syncPort, self:syncPort) ;
@@ -159,6 +175,8 @@ module DiameterGx_TestConfiguration
                map(p_diameterComponent_pcrf:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
                map(p_diameterComponent_pcrf:LLPP, system:LLIMS);// Lower Layer Primitive Init test Configuration
            }
            }


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


@@ -172,17 +190,13 @@ module DiameterGx_TestConfiguration
        * @param p_diameterComponent_ims diameter component
        * @param p_diameterComponent_ims diameter component
        */
        */
        function f_cf_1GxEDown(in DiameterComponent p_diameterComponent_pcef)
        function f_cf_1GxEDown(in DiameterComponent p_diameterComponent_pcef)
        runs on ServerSyncComp
        runs on DiameterGx
        {
        {
            f_serverWaitForAllClientsToStop();
            deactivate;

            //Disconnect
            //Disconnect
            disconnect(p_diameterComponent_pcef:syncPort, self:syncPort);
            disconnect;
            //Unmap
            //Unmap
            unmap(p_diameterComponent_pcef:DIAMP, system:PCEF_Gx);
            unmap;
            if (PX_DIAM_LLP_ENABLED){
            	unmap(p_diameterComponent_pcef:LLPP, system:LLIMS);
            }
        }//end f_cf_1GxEDown
        }//end f_cf_1GxEDown


        /**
        /**
@@ -191,24 +205,13 @@ module DiameterGx_TestConfiguration
        * @param p_diameterComponent_ims diameter component
        * @param p_diameterComponent_ims diameter component
        */
        */
        function f_cf_1Gx1RxDown(in DiameterComponent p_diameterComponent_pcef, in DiameterComponent p_diameterComponent_af)
        function f_cf_1Gx1RxDown(in DiameterComponent p_diameterComponent_pcef, in DiameterComponent p_diameterComponent_af)
        runs on ServerSyncComp
        runs on DiameterGx
        {
        {
            f_serverWaitForAllClientsToStop();
            deactivate;

            //Disconnect
            //Disconnect
            disconnect(p_diameterComponent_pcef:syncPort, self:syncPort);
            disconnect;
            if (PX_Rxsupport) {
	            disconnect(p_diameterComponent_af:syncPort, self:syncPort);
            }
            //Unmap
            //Unmap
            unmap(p_diameterComponent_pcef:DIAMP, system:PCEF_Gx);
            unmap;
            if (PX_Rxsupport) {
	            unmap(p_diameterComponent_af:DIAMP, system:AF_Rx);
            }
            if (PX_DIAM_LLP_ENABLED){
            	unmap(p_diameterComponent_pcef:LLPP, system:LLIMS);
            	unmap(p_diameterComponent_af:LLPP, system:LLIMS);
            }
        }//end f_cf_1Gx1RxEDown
        }//end f_cf_1Gx1RxEDown


        /**
        /**
@@ -217,17 +220,13 @@ module DiameterGx_TestConfiguration
        * @param p_diameterComponent_ims diameter component
        * @param p_diameterComponent_ims diameter component
        */
        */
        function f_cf_1GxRDown(in DiameterComponent p_diameterComponent_pcrf)
        function f_cf_1GxRDown(in DiameterComponent p_diameterComponent_pcrf)
        runs on ServerSyncComp
        runs on DiameterGx
        {
        {
            f_serverWaitForAllClientsToStop();
            deactivate;

            //Disconnect
            //Disconnect
            disconnect(p_diameterComponent_pcrf:syncPort, self:syncPort);
            disconnect;
            //Unmap
            //Unmap
            unmap(p_diameterComponent_pcrf:DIAMP, system:PCRF_Gx);
            unmap;
            if (PX_DIAM_LLP_ENABLED){
            	unmap(p_diameterComponent_pcrf:LLPP, system:LLIMS);
            }
        }//end f_cf_1GxRDown
        }//end f_cf_1GxRDown


        /**
        /**
@@ -237,98 +236,27 @@ module DiameterGx_TestConfiguration
        */
        */
        function f_cf_1Gx2GtpRDown(in DiameterComponent p_diameterComponent_pcrf,
        function f_cf_1Gx2GtpRDown(in DiameterComponent p_diameterComponent_pcrf,
                                   in GtpComponent p_gtpComponent1, in GtpComponent p_gtpComponent2)
                                   in GtpComponent p_gtpComponent1, in GtpComponent p_gtpComponent2)
        runs on ServerSyncComp
        runs on DiameterGx
        {
        {
            f_serverWaitForAllClientsToStop();
            deactivate;

            //Disconnect
            //Disconnect
            disconnect(p_diameterComponent_pcrf:syncPort, self:syncPort);
            disconnect;
            disconnect(p_gtpComponent1:syncPort, self:syncPort);
            disconnect(p_gtpComponent2:syncPort, self:syncPort);
            //Unmap
            //Unmap
            unmap(p_diameterComponent_pcrf:DIAMP, system:PCRF_Gx);
            unmap;
            unmap(p_gtpComponent1:GTP, system:GTP1);// Diameter Init test Configuration
            unmap(p_gtpComponent2:GTP, system:GTP2);// Diameter Init test Configuration
            if (PX_DIAM_LLP_ENABLED){
                unmap(p_diameterComponent_pcrf:LLPP, system:LLIMS);
            }
        }//end f_cf_1Gx2GtpRDown
        }//end f_cf_1Gx2GtpRDown


    } //end group cfDown
    } //end group cfDown


	group syncNoStop // Same functions as in LibCommon but without call of f_serverWaitForAllClientsToStop()
    group shutDownAltsteps {
	{
        /**
         * @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
        altstep a_mtc_shutdown() 
	 *          on one or more synchronization points.
        runs on SelfSyncComp {
	 *			If problem occurs, then server sends STOP to client.
          []  syncSendPort.receive(m_syncServerStop){
	 *			Waits for PX_TSYNC_TIME_LIMIT to let client
              tc_sync.stop ;
	 *			finish executing behavior until this
              log("**** a_mtc_shutdown: MTC component received STOP signal **** ");
	 *			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);
            }
            }
        }
        }
    
    
	/* @desc	Implements synchronization of 3 clients from server side
    } // end group shutDownAltsteps
	 *          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 := lengthof(p_syncPointIds);
		for ( i := 0; i < v_noOfSyncIds; i := i+1 ) {
			f_serverSyncClientsTimed(3,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT);
		}
	}
    
    
	} //end group syncNoStop
} // end module DiameterGx_TestConfiguration
} // end module DiameterGx_TestConfiguration
Loading