Commit 41238870 authored by Yann Garcia's avatar Yann Garcia
Browse files

Add missimg TLC tests implementation

parent de017eb8
Loading
Loading
Loading
Loading
+77 −0
Original line number Diff line number Diff line
@@ -1304,6 +1304,83 @@ module ItsSrem_TestCases {
            
        } // End of group sseMessageRate
        
        group sseMessageRepetition {
            
            /**
             * @desc Check that TLM service broadcast the signal status message in response to a signal request message until the requestor leaves the intersection
             * <pre>
             * Pics Selection: PICS_SSEM_GENERATION
             * Initial conditions: 
             *   with {
             *        the IUT being in the "SSEM initial state"
             *        and the IUT has received SREM
             *            containing srm.requestor.id
             *                indicating VID
             *        and the IUT has already sent SSEM
             *    }
             * Expected behaviour:
             *    ensure that {
             *        when { 
             *            the IUT received the SREM
             *                containing stationID
             *                    indicating VID
             *                and indicating position inside or approaching the intersection
             *        }
             *        then {
             *            the IUT sends the SSEM
             *                containing srm.requestor.id
             *                    indicating VID
             *        }
             *    }
             * </pre>
             * 
             * @see       ETSI TS 103 191-2 v1.2.5 TP_IS_TLCS_GEN_REP_01
             * @reference CEN ISO TS 19091 Clauses 6.14.4
             */
            testcase TC_IS_TLCS_GEN_REP_01 () runs on ItsSremSsem system ItsSremSsemSystem {
                
                f_IS_TLCS_GEN_REP_01();
                
            } // End of testcase TC_IS_TLCS_GEN_REP_01
            
            /**
             * @desc Check that TLM service stops to broadcast the signal status message in response to a signal request message when the requestor left the intersection
             * <pre>
             * Pics Selection: PICS_SSEM_GENERATION
             * Initial conditions: 
             *   with {
             *        the IUT being in the "SSEM initial state"
             *        and the IUT has received SREM
             *            containing srm.requestor.id
             *                indicating VID
             *        and the IUT has already sent SSEM
             *    }
             * Expected behaviour:
             *    ensure that {
             *        when { 
             *            the IUT during 2 sec has not received the SREM
             *                containing stationID
             *                    indicating VID
             *        }
             *        then {
             *            the IUT stops sending the SSEM
             *                containing srm.requestor.id
             *                    indicating VID
             *        }
             *    }
             * </pre>
             * 
             * @see       ETSI TS 103 191-2 v1.2.5 TP_IS_TLCS_GEN_REP_02
             * @reference CEN ISO TS 19091 Clauses 6.14.4
             */
            testcase TC_IS_TLCS_GEN_REP_02 () runs on ItsSremSsem system ItsSremSsemSystem {
                
                f_IS_TLCS_GEN_REP_02();
                
            } // End of testcase TC_IS_TLCS_GEN_REP_02
            
        } // End of group sseMessageRepetition 
        
    } // End of group ssemGeneration
    
    group ssemReception {
+4 −1
Original line number Diff line number Diff line
@@ -102,9 +102,12 @@ module ItsSrem_TestControl {
              execute(TC_IS_TLCS_GEN_RATE_TI_02());
            }
            
            execute(TC_IS_TLCS_GEN_REP_01());
            execute(TC_IS_TLCS_GEN_REP_02());
            
        }
        
        if (PICS_SSEM_GENERATION) {
        if (PICS_SSEM_RECEPTION) {
            
            execute(TC_IS_TLCS_RCV_MSGF_BV_04());
            
+253 −8
Original line number Diff line number Diff line
@@ -2126,8 +2126,8 @@ module ItsSrem_TpFunctions {
            function f_IS_TLCS_GEN_RATE_TI_01 () runs on ItsSremSsem {
                
                // Local variables
                timer t_minTransInterval := PICS_T_DELAY_GENSSEMMIN * 0.90;
                timer t_maxTransInterval := PICS_T_DELAY_GENSSEMMIN * 1.10;
                timer t_minTransInterval := PICS_T_RATE_GENSSEMMIN * 0.90;
                timer t_maxTransInterval := PICS_T_RATE_GENSSEMMAX * 1.10;
                
                // Test control
                if (not PICS_SSEM_GENERATION or not PICS_SSEM_TRATEMENT_DELAY) {
@@ -2204,7 +2204,7 @@ module ItsSrem_TpFunctions {
                
                // Local variables
                timer t_minTransInterval := PICS_T_RATE_GENSSEMMIN * 0.90;
                timer t_maxTransInterval := PICS_T_RATE_GENSSEMMIN * 1.10;
                timer t_maxTransInterval := PICS_T_RATE_GENSSEMMAX * 1.10;
                
                // Test control
                if (not PICS_SSEM_GENERATION or not PICS_SSEM_TRANSMISSION_RATE) {
@@ -2274,6 +2274,251 @@ module ItsSrem_TpFunctions {
                
            } // End of function f_IS_TLCS_GEN_RATE_TI_02
            
            /**
             * @desc    TP Function for TC_IS_TLCS_GEN_REP_01
             */
            function f_IS_TLCS_GEN_REP_01 () runs on ItsSremSsem {
                
                // Local variables
                var SremReq v_sremReq;
                var SsemInd v_ssem;
                
                // Test control
                if (not PICS_SSEM_GENERATION) {
                    log("*** " & testcasename() & ": PICS_SSEM_GENERATION required for executing the TC ***");
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cfUp();
                    
                // Preamble
                f_prInitialState();
                v_sremReq := valueof(
                                     m_sremReq(
                                               m_sremPdu(
                                                         m_srem(
                                                                m_requestorDescription(
                                                                                       m_vehicleID(
                                                                                                   f_getIutStationId()
                                                                                                   ), 
                                                                                       m_requestorType(
                                                                                                       basicVehicle
                                                                                                       )
                                                                                       ),
                                                                 {
                                                                   m_signalRequestPackage(
                                                                                          m_signalRequest(
                                                                                                          m_intersectionReferenceID(
                                                                                                                                    PX_INTERSECTION_ID
                                                                                                                                    ),
                                                                                                          PX_REQUEST_ID,
                                                                                                          priorityRequest,
                                                                                                          { lane := 1 }
                                                                                                          )
                                                                                          )
                                                                 }
                                     ))));
                sremSsemPort.send(v_sremReq);
                
                tc_ac.start;
                alt {
                    [] sremSsemPort.receive(
                                            mw_ssemInd(
                                                       mw_ssemPdu(
                                                                  mw_ssemWellFormatted(
                                                                                       -,
                                                                                       mw_signalStatus(
                                                                                                       PX_SEQUENCE_NUMBER, 
                                                                                                       m_intersectionReferenceID(
                                                                                                                                 PX_INTERSECTION_ID
                                                                                                                                 ), 
                                                                                                       mw_signalStatusPackage(
                                                                                                                              mw_requester(
                                                                                                                                           m_vehicleID(
                                                                                                                                                       f_getIutStationId()
                                                                                                                                                       ),
                                                                                                                                           PX_REQUEST_ID,
                                                                                                                                           PX_SEQUENCE_NUMBER
                    ))))))) -> value v_ssem {
                        tc_ac.stop;
                        
                        log("*** " & testcasename() & ": INFO: SSE message was received ***");
                        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: SSE message not received ***");
                        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
                    }
                }
                
                // Test Body
                v_sremReq.msgOut.srm.requests[0].request.inBoundLane := { lane := 2 };
                v_sremReq.msgOut.srm.requests[0].request.outBoundLane := { lane := 2 };
                sremSsemPort.send(v_sremReq);
                
                tc_ac.start;
                alt {
                    [] sremSsemPort.receive(
                                            mw_ssemInd(
                                                       mw_ssemPdu(
                                                                  mw_ssemWellFormatted(
                                                                                       -,
                                                                                       mw_signalStatus(
                                                                                                       PX_SEQUENCE_NUMBER, 
                                                                                                       m_intersectionReferenceID(
                                                                                                                                 PX_INTERSECTION_ID
                                                                                                                                 ), 
                                                                                                       mw_signalStatusPackage(
                                                                                                                              mw_requester(
                                                                                                                                           m_vehicleID(
                                                                                                                                                       f_getIutStationId()
                                                                                                                                                       ),
                                                                                                                                           PX_REQUEST_ID,
                                                                                                                                           PX_SEQUENCE_NUMBER
                    ))))))) {
                        tc_ac.stop;
                        
                        log("*** " & testcasename() & ": INFO: SSE message was received ***");
                        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: SSE message not received ***");
                        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
                    }
                }
                
                // Postamble
                f_poDefault();
                f_cfDown();
                
            } // End of function f_IS_TLCS_GEN_REP_01
            
            /**
             * @desc    TP Function for TC_IS_TLCS_GEN_REP_02
             */
            function f_IS_TLCS_GEN_REP_02 () runs on ItsSremSsem {
                
                // Local variables
                var SremReq v_sremReq;
                var SsemInd v_ssem;
                timer t_maxTransInterval := PICS_T_RATE_GENSSEMMAX * 1.10;
                
                // Test control
                if (not PICS_SSEM_GENERATION) {
                    log("*** " & testcasename() & ": PICS_SSEM_GENERATION required for executing the TC ***");
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cfUp();
                    
                // Preamble
                f_prInitialState();
                v_sremReq := valueof(
                                     m_sremReq(
                                               m_sremPdu(
                                                         m_srem(
                                                                m_requestorDescription(
                                                                                       m_vehicleID(
                                                                                                   f_getIutStationId()
                                                                                                   ), 
                                                                                       m_requestorType(
                                                                                                       basicVehicle
                                                                                                       )
                                                                                       ),
                                                                 {
                                                                   m_signalRequestPackage(
                                                                                          m_signalRequest(
                                                                                                          m_intersectionReferenceID(
                                                                                                                                    PX_INTERSECTION_ID
                                                                                                                                    ),
                                                                                                          PX_REQUEST_ID,
                                                                                                          priorityRequest,
                                                                                                          { lane := 1 }
                                                                                                          )
                                                                                          )
                                                                 }
                                     ))));
                sremSsemPort.send(v_sremReq);
                
                tc_ac.start;
                alt {
                    [] sremSsemPort.receive(
                                            mw_ssemInd(
                                                       mw_ssemPdu(
                                                                  mw_ssemWellFormatted(
                                                                                       -,
                                                                                       mw_signalStatus(
                                                                                                       PX_SEQUENCE_NUMBER, 
                                                                                                       m_intersectionReferenceID(
                                                                                                                                 PX_INTERSECTION_ID
                                                                                                                                 ), 
                                                                                                       mw_signalStatusPackage(
                                                                                                                              mw_requester(
                                                                                                                                           m_vehicleID(
                                                                                                                                                       f_getIutStationId()
                                                                                                                                                       ),
                                                                                                                                           PX_REQUEST_ID,
                                                                                                                                           PX_SEQUENCE_NUMBER
                    ))))))) -> value v_ssem {
                        tc_ac.stop;
                        
                        log("*** " & testcasename() & ": INFO: SSE message was received ***");
                        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: SSE message not received ***");
                        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
                    }
                }
                
                // Test Body
                t_maxTransInterval.start;
                alt {
                    [] t_maxTransInterval.timeout {
                        log("*** " & testcasename() & ": INFO: 2 seconds expired ***");
                    }
                }
                
                // Test Body
                tc_noac.start;
                alt {
                    [] sremSsemPort.receive(
                                            mw_ssemInd(
                                                       mw_ssemPdu(
                                                                  mw_ssemWellFormatted(
                                                                                       -,
                                                                                       mw_signalStatus(
                                                                                                       PX_SEQUENCE_NUMBER, 
                                                                                                       m_intersectionReferenceID(
                                                                                                                                 PX_INTERSECTION_ID
                                                                                                                                 ), 
                                                                                                       mw_signalStatusPackage(
                                                                                                                              mw_requester(
                                                                                                                                           m_vehicleID(
                                                                                                                                                       f_getIutStationId()
                                                                                                                                                       ),
                                                                                                                                           PX_REQUEST_ID,
                                                                                                                                           PX_SEQUENCE_NUMBER
                    ))))))) {
                        log("*** " & testcasename() & ": FAIL: SSEM was transmitted after 2 seconds without receiving SREM***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                    }
                    [] tc_noac.timeout {
                        log("*** " & testcasename() & ": PASS: SSEM was not transmitted ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    }
                }
                
                // Postamble
                f_poDefault();
                f_cfDown();
                
            } // End of function f_IS_TLCS_GEN_REP_02
            
        } // End of group sseMessageRate
        
    } // End of group ssemGeneration {