Commit 385f19be authored by garciay's avatar garciay
Browse files

Comment TestSystem code from LibItsSecurity

parent 91a3f8da
Loading
Loading
Loading
Loading
+87 −98
Original line number Original line Diff line number Diff line
@@ -8,107 +8,96 @@
module LibItsSecurity_Functions {
module LibItsSecurity_Functions {
    
    
    // LibCommon
    // LibCommon
    import from LibCommon_BasicTypesAndValues {
        type 
          UInt64 
    }
    import from LibCommon_DataStrings {
        type 
            Oct32
    }
    import from LibCommon_Sync all;
    
    
    // LibItsSecurity
    // LibItsSecurity
    import from LibItsSecurity_Templates all;
    import from LibItsSecurity_TestSystem all;
    
    group configurationFunctions {
        
       /**
        * @desc 
        */
        function f_cf01Up() runs on ItsGnSecurity {
            
            // Map
            map(self:acPort, system:acPort);
            map(self:utPort, system:utPort);
            map(self:gnSecurityPort, system:gnSecurityPort);
            
            // Connect
            f_connect4SelfOrClientSync();
            activate(a_cf01Down());
            
            // Initialze the IUT/DUT
            f_initialState();
            
        } // End of function f_cf01Up
        
        function f_cf01Down() runs on ItsGnSecurity {
            
            // Unmap
            unmap(self:acPort, system:acPort);
            unmap(self:utPort, system:utPort);
            unmap(self:gnSecurityPort, system:gnSecurityPort);
            
            // Disconnect
            f_disconnect4SelfOrClientSync();
        } // End of function f_cf01Down
        
    } // End of group configurationFunctions
    
    group preambles {
        
        /**
         * @desc Brings the IUT into an initial state.
         */
        function f_initialState() runs on ItsBaseGnSecurity {
            // TODO
        }
        
    } // End of group preambles
    
    group postambles {
        
    } // End of group postambles
    
    group securityAltsteps {
        
        /**
         * @desc The base default behavior.
         */
        altstep a_default() runs on ItsGnSecurity {
            [] gnSecurityPort.receive(mw_gnSecurityInd(?)) {
                log("*** a_default: WARNING: Received an unexpected message ***");
                repeat;
            }
            [] gnSecurityPort.receive {
                log("*** a_default: WARNING: Received an unexpected message ***");
                repeat;
            }
            [] tc_wait.timeout {
                log("*** a_default: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] tc_ac.timeout {
                log("*** a_default: ERROR: Timeout while awaiting the reception of a message ***");
                f_selfOrClientSyncAndVerdict("error", e_timeout);
            }
            [] a_shutdown() {
                log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        } // End of 'altstep' statement
        
        altstep a_cf01Down() runs on ItsGnSecurity {
            [] a_shutdown() {
                f_cf01Down();
                log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
                stop;
            }
        } // End of 'altstep' statement
        
    } // End of group securityAltsteps
    
    
//    group configurationFunctions {
//        
//       /**
//        * @desc 
//        */
//        function f_cf01Up() runs on ItsGnSecurity {
//            
//            // Map
//            map(self:acPort, system:acPort);
//            map(self:utPort, system:utPort);
//            map(self:gnSecurityPort, system:gnSecurityPort);
//            
//            // Connect
//            f_connect4SelfOrClientSync();
//            activate(a_cf01Down());
//            
//            // Initialze the IUT/DUT
//            f_initialState();
//            
//        } // End of function f_cf01Up
//        
//        function f_cf01Down() runs on ItsGnSecurity {
//            
//            // Unmap
//            unmap(self:acPort, system:acPort);
//            unmap(self:utPort, system:utPort);
//            unmap(self:gnSecurityPort, system:gnSecurityPort);
//            
//            // Disconnect
//            f_disconnect4SelfOrClientSync();
//        } // End of function f_cf01Down
//        
//    } // End of group configurationFunctions
//    
//    group preambles {
//        
//        /**
//         * @desc Brings the IUT into an initial state.
//         */
//        function f_initialState() runs on ItsBaseGnSecurity {
//            // TODO
//        }
//        
//    } // End of group preambles
//    
//    group postambles {
//        
//    } // End of group postambles
//    
//    group securityAltsteps {
//        
//        /**
//         * @desc The base default behavior.
//         */
//        altstep a_default() runs on ItsGnSecurity {
//            [] gnSecurityPort.receive(mw_gnSecurityInd(?)) {
//                log("*** a_default: WARNING: Received an unexpected message ***");
//                repeat;
//            }
//            [] gnSecurityPort.receive {
//                log("*** a_default: WARNING: Received an unexpected message ***");
//                repeat;
//            }
//            [] tc_wait.timeout {
//                log("*** a_default: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***");
//                f_selfOrClientSyncAndVerdict("error", e_timeout);
//            }
//            [] tc_ac.timeout {
//                log("*** a_default: ERROR: Timeout while awaiting the reception of a message ***");
//                f_selfOrClientSyncAndVerdict("error", e_timeout);
//            }
//            [] a_shutdown() {
//                log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
//                stop;
//            }
//        } // End of 'altstep' statement
//        
//        altstep a_cf01Down() runs on ItsGnSecurity {
//            [] a_shutdown() {
//                f_cf01Down();
//                log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
//                stop;
//            }
//        } // End of 'altstep' statement
//        
//    } // End of group securityAltsteps
//    
    group helpersFunctions {
    group helpersFunctions {
        
        
        /**
        /**
+16 −16
Original line number Original line Diff line number Diff line
@@ -29,23 +29,23 @@ module LibItsSecurity_Templates {
    // LibItsSecurity
    // LibItsSecurity
    import from LibItsSecurity_TypesAndValues all;
    import from LibItsSecurity_TypesAndValues all;
    import from LibItsSecurity_Pixits all;
    import from LibItsSecurity_Pixits all;
    import from LibItsSecurity_TestSystem {
//    import from LibItsSecurity_TestSystem {
        type
//        type
            GnSecurityReq, GnSecurityInd
//            GnSecurityReq, GnSecurityInd
    }
//    }
    
    template (value) GnSecurityReq m_gnSecurityReq(
                                                   in template (value) SecuredMessage p_msgReq
    ) := {
        msgReq := p_msgReq
    } // End of template m_gnSecurityReq
    
    template (present) GnSecurityInd mw_gnSecurityInd(
                                                      in template (present) SecuredMessage p_msgInd
    ) := {
        msgInd := p_msgInd
    } // End of template mw_gnSecurityIng
    
    
//    template (value) GnSecurityReq m_gnSecurityReq(
//                                                   in template (value) SecuredMessage p_msgReq
//    ) := {
//        msgReq := p_msgReq
//    } // End of template m_gnSecurityReq
//    
//    template (present) GnSecurityInd mw_gnSecurityInd(
//                                                      in template (present) SecuredMessage p_msgInd
//    ) := {
//        msgInd := p_msgInd
//    } // End of template mw_gnSecurityIng
//    
    /**
    /**
     * @desc Constants declaration
     * @desc Constants declaration
     */
     */
+130 −130
Original line number Original line Diff line number Diff line
@@ -6,134 +6,134 @@
 *
 *
 */
 */
module LibItsSecurity_TestSystem {
module LibItsSecurity_TestSystem {
    
//    
    // LibCommon
//    // LibCommon
    import from LibCommon_Sync {
//    import from LibCommon_Sync {
        type ServerSyncComp
//        type ServerSyncComp
    };
//    };
    
//    
    // LibItsCommon
//    // LibItsCommon
    import from LibItsCommon_TestSystem all;
//    import from LibItsCommon_TestSystem all;
    import from LibItsCommon_TypesAndValues all;
//    import from LibItsCommon_TypesAndValues all;
    
//    
    // LibItsSecurity
//    // LibItsSecurity
    import from LibItsSecurity_TypesAndValues all;
//    import from LibItsSecurity_TypesAndValues all;
    
//    
    group portDefinitions {
//    group portDefinitions {
        
//        
        /**
//        /**
         * @desc Adapter control port
//         * @desc Adapter control port
         */
//         */
        type port AdapterControlPort message {
//        type port AdapterControlPort message {
            out
//            out
                AcGnSecurityPrimitive;
//                AcGnSecurityPrimitive;
            in
//            in
                AcGnSecurityResponse;
//                AcGnSecurityResponse;
        } // End of AdapterControlPort
//        } // End of AdapterControlPort
        
//        
        /**
//        /**
         * @desc Upper Tester port
//         * @desc Upper Tester port
         */
//         */
        type port UpperTesterPort message {
//        type port UpperTesterPort message {
            out
//            out
                UtInitialize;
//                UtInitialize;
            in
//            in
                UtInitializeResult;
//                UtInitializeResult;
        } // End of UpperTesterPort
//        } // End of UpperTesterPort
        
//        
    } // End of portDefinitions
//    } // End of portDefinitions
    
//    
    group interfacePorts {
//    group interfacePorts {
        
//        
        group networkAndTransportPorts {
//        group networkAndTransportPorts {
            
//            
            group nt2Ports {
//            group nt2Ports {
                
//                
                /**
//                /**
                 * @desc NT2 GeoNetworking Secutity Port (GnSec/G5)
//                 * @desc NT2 GeoNetworking Secutity Port (GnSec/G5)
                 */
//                 */
                type port GnSecurityPort message {
//                type port GnSecurityPort message {
                    in GnSecurityInd;
//                    in GnSecurityInd;
                    out GnSecurityReq;
//                    out GnSecurityReq;
                } // End of GnSecurityPort
//                } // End of GnSecurityPort
                
//                
            } // End of group nt2Ports
//            } // End of group nt2Ports
            
//            
        } // End of group networkAndTransportPorts
//        } // End of group networkAndTransportPorts
    
//    
    } // End of group interfacePorts
//    } // End of group interfacePorts
    
//    
    group componentDefinitions {
//    group componentDefinitions {
        
//        
        /**
//        /**
         * @desc ITS Main Test Component
//         * @desc ITS Main Test Component
         */
//         */
        type component ItsMtc extends ItsBaseMtc, ServerSyncComp {
//        type component ItsMtc extends ItsBaseMtc, ServerSyncComp {
            
//            
            port UpperTesterPort utPort;
//            port UpperTesterPort utPort;
            port AdapterControlPort acPort;
//            port AdapterControlPort acPort;
            
//            
        } // End of type ItsMtc
//        } // End of type ItsMtc
        
//        
        /**
//        /**
         * @desc ITS System Adapter
//         * @desc ITS System Adapter
         */
//         */
        type component ItsGnSecuritySystem {
//        type component ItsGnSecuritySystem {
            
//            
            port UpperTesterPort utPort;
//            port UpperTesterPort utPort;
            port AdapterControlPort acPort;
//            port AdapterControlPort acPort;
            
//            
            // NT2 ports
//            // NT2 ports
            port GnSecurityPort gnSecurityPort;
//            port GnSecurityPort gnSecurityPort;
            
//            
        } // End of type ItsGnSecuritySystem
//        } // End of type ItsGnSecuritySystem
        
//        
    } // End of group componentDefinitions
//    } // End of group componentDefinitions
    
//    
    type component ItsBaseGnSecurity extends ItsBaseComponent {
//    type component ItsBaseGnSecurity extends ItsBaseComponent {
        
//        
        port UpperTesterPort utPort;
//        port UpperTesterPort utPort;
        port AdapterControlPort acPort;
//        port AdapterControlPort acPort;
        
//        
    }
//    }
    
//    
    /**
//    /**
     * @desc Test component for ITS Network and Transport layer
//     * @desc Test component for ITS Network and Transport layer
     */
//     */
    type component ItsGnSecurity extends ItsBaseGnSecurity {
//    type component ItsGnSecurity extends ItsBaseGnSecurity {
        
//        
        // NT2 ports
//        // NT2 ports
        port GnSecurityPort gnSecurityPort;
//        port GnSecurityPort gnSecurityPort;
        
//        
        // Variables for GnSecurity
//        // Variables for GnSecurity
        
//        
    } // End of component ItsGeoNetworking
//    } // End of component ItsGeoNetworking
    
//    
    group networkAndTransportPrimitives {
//    group networkAndTransportPrimitives {
        
//        
        group nt2Primitives {
//        group nt2Primitives {
            
//            
            /**
//            /**
             * @desc NT2 GeoNetworking Security Indication Primitive
//             * @desc NT2 GeoNetworking Security Indication Primitive
             * @member msgInd TODO
//             * @member msgInd TODO
             */
//             */
            type record GnSecurityInd {
//            type record GnSecurityInd {
                SecuredMessage msgInd
//                SecuredMessage msgInd
            } // End of type GnSecurityInd
//            } // End of type GnSecurityInd
            
//            
            /**
//            /**
             * @desc NT2 GeoNetworking Security Request Primitive
//             * @desc NT2 GeoNetworking Security Request Primitive
             * @member msgReq TODO
//             * @member msgReq TODO
             */
//             */
            type record GnSecurityReq {
//            type record GnSecurityReq {
                SecuredMessage msgReq
//                SecuredMessage msgReq
            } // End of type GnSecurityReq
//            } // End of type GnSecurityReq
            
//            
        } // End of group nt2Primitives
//        } // End of group nt2Primitives
        
//        
    } // End of group networkAndTransportPrimitives
//    } // End of group networkAndTransportPrimitives
    with {
//    with {
        encode "LibIts_Interface"
//        encode "LibIts_Interface"
    } // End of group interfacePrimitives
//    } // End of group interfacePrimitives
    
//    
} // End of module LibItsSecurity_TestSystem
} // End of module LibItsSecurity_TestSystem
 No newline at end of file