Commit 8e35b3db authored by berge's avatar berge
Browse files

split CAM DENM GN BTP GN6

parent 44539f4d
Loading
Loading
Loading
Loading
+105 −8
Original line number Original line Diff line number Diff line
@@ -13,18 +13,115 @@
    import from LibCommon_VerdictControl all;
    import from LibCommon_VerdictControl all;
    
    
    // LibIts
    // LibIts
    import from LibIts_Interface all;
    import from LibItsCommon_Functions all;
    import from LibItsBtp_TestSystem all;
    import from LibItsBtp_TypesAndValues all;
    import from LibItsBtp_TypesAndValues all;
    import from LibItsBtp_Templates all;
    import from LibItsBtp_Templates all;
    import from LibItsBtp_Pixits all;
    import from LibItsBtp_Pixits all;
    import from LibItsCommon_Functions all;

    group utFuntions { 
            
        /**
         * @desc    Requests to bring the IUT in an initial state
         * @param   p_init The initialisation to trigger.
         */
        function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsBtp {
            
            utPort.send(p_init);
            tc_wait.start;
            alt {
                [] utPort.receive(UtResult:true) {
                    tc_wait.stop;
                    log("*** f_utInitializeIut: INFO: IUT initialized ***");
                }
                [] utPort.receive {
                    tc_wait.stop;
                    log("*** f_utInitializeIut: INFO: IUT could not be initialized ***");
                    f_selfOrClientSyncAndVerdict("error", e_error);
                }
                [] tc_wait.timeout {
                    log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***");
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
                }
                [else] { // Shortcut defaults
                    repeat; 
                }
            }
            
        }
        
        /**
         * @desc    Triggers event from the application layer
         * @param   p_event The event to trigger.
         */
        function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsBtp {
            var template (value) UtTrigger v_utMsg := { p_event };
            
            utPort.send(v_utMsg);
            alt {
                [] utPort.receive(UtResult:true) {
                    tc_wait.stop;
                }
                [] utPort.receive {
                    tc_wait.stop;
                }
                [] tc_wait.timeout {
                }
                [else] { // Shortcut defaults
                    repeat; 
                }
            }
        }
        
        /**
         * @desc Checks that the event was indicated at the application layer
         * @param p_event The event to check.
         * @param   p_discard The event should not appear. Default value: FALSE.
         */
        function f_utCheckEvent(template (value) UtEvent p_event, boolean p_discard) runs on ItsBtp {
            var template (value) UtCheck v_utMsg := { p_event };
            
            utPort.send(v_utMsg);
            tc_wait.start;
            alt {
                [] utPort.receive(UtResult:true) {
                    tc_wait.stop;
                    if (p_discard == false) {
                        log("*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***");
                    }
                    else {
                        log("*** f_utCheckEvent: ERROR: Event indicated at application layer where it should be discarded ***");
                        f_selfOrClientSyncAndVerdict("error", e_error);
                    }
                }
                [] utPort.receive(UtResult:false) {
                    tc_wait.stop;
                    if (p_discard == false) {
                        log("*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***");
                        f_selfOrClientSyncAndVerdict("error", e_error);
                    }
                    else {
                        log("*** f_utCheckEvent: INFO: Event not indicated at application layer***");
                    }
                }
                [] tc_wait.timeout {
                    log("*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***");
                    f_selfOrClientSyncAndVerdict("error", e_timeout);                    
                }
                [else] { // Shortcut defaults
                    repeat; 
                }
            }
        }
                    
    } // End of group utFunctions
     
     
    group configurationFunctions {
    group configurationFunctions {
        
        
        /**
        /**
         * @desc    Setups default configuration   
         * @desc    Setups default configuration   
         */
         */
        function f_cfUp() runs on ItsNt {
        function f_cfUp() runs on ItsBtp {
            
            
            map(self:utPort, system:utPort);
            map(self:utPort, system:utPort);
            map(self:btpPort, system:btpPort);
            map(self:btpPort, system:btpPort);
@@ -35,7 +132,7 @@
        /**
        /**
         * @desc    Deletes default configuration 
         * @desc    Deletes default configuration 
         */
         */
        function f_cfDown() runs on ItsNt {
        function f_cfDown() runs on ItsBtp {
            
            
            unmap(self:utPort, system:utPort);
            unmap(self:utPort, system:utPort);
            unmap(self:btpPort, system:btpPort);
            unmap(self:btpPort, system:btpPort);
@@ -50,7 +147,7 @@
        /**
        /**
         * @desc The base default.
         * @desc The base default.
         */
         */
        altstep a_default() runs on ItsNt {
        altstep a_default() runs on ItsBtp {
            
            
            [] btpPort.receive {
            [] btpPort.receive {
                log("*** a_default: ERROR: Received an unexpected message ***");
                log("*** a_default: ERROR: Received an unexpected message ***");
@@ -78,14 +175,14 @@
        /**
        /**
         * @desc The default preamble.
         * @desc The default preamble.
         */
         */
        function f_prDefault() runs on ItsNt {
        function f_prDefault() runs on ItsBtp {
            activate(a_default());
            activate(a_default());
        }
        }
        
        
        /**
        /**
         * @desc Brings the IUT into an initial state.
         * @desc Brings the IUT into an initial state.
         */
         */
        function f_prInitialState() runs on ItsNt {
        function f_prInitialState() runs on ItsBtp {
            
            
            f_utInitializeIut(m_btpInitialize);
            f_utInitializeIut(m_btpInitialize);
			f_prDefault();
			f_prDefault();
@@ -100,7 +197,7 @@
        /**
        /**
         * @desc The default postamble.
         * @desc The default postamble.
         */
         */
        function f_poDefault() runs on ItsNt {
        function f_poDefault() runs on ItsBtp {
            //empty
            //empty
        }
        }
        
        
+0 −1
Original line number Original line Diff line number Diff line
@@ -8,7 +8,6 @@
module LibItsBtp_Pixits {
module LibItsBtp_Pixits {
    
    
    // LibIts
    // LibIts
    import from LibIts_Interface all;
    import from LibItsBtp_TypesAndValues all;
    import from LibItsBtp_TypesAndValues all;
    
    


+1 −2
Original line number Original line Diff line number Diff line
@@ -8,10 +8,9 @@
module LibItsBtp_Templates {
module LibItsBtp_Templates {
    
    
    // LibIts
    // LibIts
    import from LibIts_Interface all;
    import from LibItsBtp_TestSystem all;
    import from LibItsBtp_TypesAndValues all;
    import from LibItsBtp_TypesAndValues all;
    import from LibItsBtp_Pixits all;
    import from LibItsBtp_Pixits all;
    import from LibItsCommon_TypesAndValues all;
        
        
    group btpPrimitivesTemplates {
    group btpPrimitivesTemplates {


+40 −1
Original line number Original line Diff line number Diff line
@@ -98,6 +98,45 @@ module LibItsBtp_TypesAndValues {


    group utPrimitives {
    group utPrimitives {
    	
    	
    	group utCommonPrimitives {
    		
	        /**
	         * @desc Upper Tester message to initialize IUT 
	         */
	        type union UtInitialize {
	            UtBtpInitialize utBtpInitialize
	        }
	
	        /**
	         * @desc Upper Tester message describing an action/event 
	         */
	        type union UtEvent {
	            UtBtpEvent utBtpEvent
	        }
	                
	        /**
	         * @desc Upper Tester message to trigger an action on IUT 
	         */
	        type record UtTrigger {
	            UtEvent utEvent
	        }
	        
	        /**
	         * @desc Upper Tester message to check event/status on IUT 
	         */    
	        type record UtCheck {
	            UtEvent utEvent
	        }
	        
	        /**
	         * @desc Upper Tester response message  
	         */    
	        type boolean UtResult;
        }
        with {
            encode "LibItsCommon_TypesAndValues"
        }
                
        /**
        /**
         * @desc Upper Tester message to initialize BTP IUT 
         * @desc Upper Tester message to initialize BTP IUT 
         */
         */
+104 −11
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 *    @author     ETSI / STF405
 *    @author     ETSI / STF405
 *    @version    $URL$
 *    @version    $URL$
 *                $Id$
 *                $Id$
 *    @desc       Module containing common functions for ITS
 *    @desc       Module containing common functions for ITS CAM
 *
 *
 */
 */
module LibItsCam_Functions {
module LibItsCam_Functions {
@@ -12,8 +12,7 @@ module LibItsCam_Functions {
    import from LibCommon_VerdictControl all;
    import from LibCommon_VerdictControl all;
    
    
    // LibIts
    // LibIts
    import from LibIts_TestSystem all;
    import from LibItsCam_TestSystem all;
    import from LibIts_Interface all; 
    import from LibItsCam_Templates all;
    import from LibItsCam_Templates all;
    import from LibItsCam_Pixits all;
    import from LibItsCam_Pixits all;
    import from LibItsCam_TypesAndValues all;
    import from LibItsCam_TypesAndValues all;
@@ -21,15 +20,109 @@ module LibItsCam_Functions {
    import from CAM_PDU_Descriptions language "ASN.1:1997" all;
    import from CAM_PDU_Descriptions language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;    
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;    


    // LibCommon
    group utFuntions { 
    import from LibCommon_VerdictControl all;
            
        /**
         * @desc    Requests to bring the IUT in an initial state
         * @param   p_init The initialisation to trigger.
         */
        function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsCam {
            
            utPort.send(p_init);
            tc_wait.start;
            alt {
                [] utPort.receive(UtResult:true) {
                    tc_wait.stop;
                    log("*** f_utInitializeIut: INFO: IUT initialized ***");
                }
                [] utPort.receive {
                    tc_wait.stop;
                    log("*** f_utInitializeIut: INFO: IUT could not be initialized ***");
                    f_selfOrClientSyncAndVerdict("error", e_error);
                }
                [] tc_wait.timeout {
                    log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***");
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
                }
                [else] { // Shortcut defaults
                    repeat; 
                }
            }
            
        }
        
        /**
         * @desc    Triggers event from the application layer
         * @param   p_event The event to trigger.
         */
        function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsCam {
            var template (value) UtTrigger v_utMsg := { p_event };
            
            utPort.send(v_utMsg);
            alt {
                [] utPort.receive(UtResult:true) {
                    tc_wait.stop;
                }
                [] utPort.receive {
                    tc_wait.stop;
                }
                [] tc_wait.timeout {
                }
                [else] { // Shortcut defaults
                    repeat; 
                }
            }
        }
        
        /**
         * @desc Checks that the event was indicated at the application layer
         * @param p_event The event to check.
         * @param   p_discard The event should not appear. Default value: FALSE.
         */
        function f_utCheckEvent(template (value) UtEvent p_event, boolean p_discard) runs on ItsCam {
            var template (value) UtCheck v_utMsg := { p_event };
            
            utPort.send(v_utMsg);
            tc_wait.start;
            alt {
                [] utPort.receive(UtResult:true) {
                    tc_wait.stop;
                    if (p_discard == false) {
                        log("*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***");
                    }
                    else {
                        log("*** f_utCheckEvent: ERROR: Event indicated at application layer where it should be discarded ***");
                        f_selfOrClientSyncAndVerdict("error", e_error);
                    }
                }
                [] utPort.receive(UtResult:false) {
                    tc_wait.stop;
                    if (p_discard == false) {
                        log("*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***");
                        f_selfOrClientSyncAndVerdict("error", e_error);
                    }
                    else {
                        log("*** f_utCheckEvent: INFO: Event not indicated at application layer***");
                    }
                }
                [] tc_wait.timeout {
                    log("*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***");
                    f_selfOrClientSyncAndVerdict("error", e_timeout);                    
                }
                [else] { // Shortcut defaults
                    repeat; 
                }
            }
        }
                    
    } // End of group utFunctions


    group camConfigurationFunctions {
    group camConfigurationFunctions {
        
        
        /**
        /**
         * @desc    Setups default configuration   
         * @desc    Setups default configuration   
         */
         */
        function f_cfUp() runs on ItsFa {
        function f_cfUp() runs on ItsCam {
            
            
            map(self:utPort, system:utPort);
            map(self:utPort, system:utPort);
            map(self:camPort, system:camPort);
            map(self:camPort, system:camPort);
@@ -40,7 +133,7 @@ module LibItsCam_Functions {
        /**
        /**
         * @desc    Deletes default configuration 
         * @desc    Deletes default configuration 
         */
         */
        function f_cfDown() runs on ItsFa {
        function f_cfDown() runs on ItsCam {
            
            
            unmap(self:utPort, system:utPort);
            unmap(self:utPort, system:utPort);
            unmap(self:camPort, system:camPort);
            unmap(self:camPort, system:camPort);
@@ -55,7 +148,7 @@ module LibItsCam_Functions {
        /**
        /**
         * @desc    basic default behaviour handling
         * @desc    basic default behaviour handling
         */    
         */    
        altstep a_default() runs on ItsFa {
        altstep a_default() runs on ItsCam {
    
    
            [] camPort.receive(mw_camInd ( mw_camMsg_any )){ 
            [] camPort.receive(mw_camInd ( mw_camMsg_any )){ 
                log("*** a_default: INFO: CAM message received in default ***");
                log("*** a_default: INFO: CAM message received in default ***");
@@ -88,7 +181,7 @@ module LibItsCam_Functions {
         * @desc    Initialize the IUT
         * @desc    Initialize the IUT
         * @remark  No specific actions specified in the base standard
         * @remark  No specific actions specified in the base standard
         */    
         */    
        function f_prInitialState() runs on ItsFa {
        function f_prInitialState() runs on ItsCam {
            
            
            f_utInitializeIut(m_camInitialize);
            f_utInitializeIut(m_camInitialize);
            
            
@@ -104,7 +197,7 @@ module LibItsCam_Functions {
        /**
        /**
         * @desc The default postamble.
         * @desc The default postamble.
         */
         */
        function f_poDefault() runs on ItsFa {
        function f_poDefault() runs on ItsCam {
            //empty
            //empty
        }
        }
        
        
Loading