ItsDenm_TestCases.ttcn 222 KB
Newer Older
filatov's avatar
filatov committed
         * Initial conditions:
         *  with {
         *      the IUT being in the "initial state"
         *      and the IUT having received a DENM
         *          containing actionID
         *              indicating ACTION_ID1
         *          and containing transmissionInterval
         *              indicating TRANS_INTERVAL1
         *          and containing referenceTime
         *              indicating REFERENCETIME_1
         *          and containing validityDuration
         *              indicating value more than 3 times greater than TRANS_INTERVAL1
         *      and the IUT having starting timer T_Forwarding for this DENM
         *      and the IUT having received DENM
         *          containing actionID
         *              indicating ACTION_ID1
         *          and containing referenceTime
         *              indicating value REFERENCETIME_2 < REFERENCETIME_1
         *      and the IUT not having received further DENM 
         *          containing actionID
         *              indicating ACTION_ID1
         *          and containing referenceTime
         *              indicating value REFERENCETIME_3 > REFERENCETIME_1
         *  }
         * Expected behaviour:
         *  ensure that {
         *      when { 
         *          the timer T_Forwarding expires
         *      }
         *      then {
         *          the IUT reconstructs and sends the DENM associated to ACTION_ID1
         *      }
         *  }
         * </pre>
         * 
         * @version 1.2.1
         * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/KAFW/BV-02, ETSI EN 302 637-3, clause 8.2.2
         */
        testcase TC_DEN_KAFW_BV_02() runs on ItsDenm system ItsDenmSystem {
            
            //Local constants
            const TransmissionInterval c_transmissionInterval := c_interval_10sec;
filatov's avatar
filatov committed
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
            var TimestampIts v_referenceTime1 := f_getCurrentTime();
            var TimestampIts v_referenceTime2 := v_referenceTime1 - 1000;
            var ActionID v_actionId;
            // Local timers
            timer t_forwarding := 2.0 * int2float(c_transmissionInterval) /1000.0;
            
            // Test control
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -,
                        c_transmissionInterval * 3,
                        c_transmissionInterval,
                        v_referenceTime1
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            t_forwarding.start;
            f_sleep(5.0);
            
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -,
                        c_transmissionInterval * 3,
                        c_transmissionInterval,
                        v_referenceTime2
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            alt {
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId, v_referenceTime1)
                            )
                        )
                    ) 
                ) {
                    if(t_forwarding.running) {
                        t_forwarding.stop;
                        log("*** TC_DEN_KAFW_BV_02: INFO: IUT re-forwarded the packet too early ***");
                    }
                    else {
                        tc_ac.stop;
                        log("*** TC_DEN_KAFW_BV_02: PASS: DENM re-forwarded ***");
                    }  
                    f_clientSyncAndVerdict(c_tbDone, e_success);
                }
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId)
                            )
                        )
                    ) 
                ) {
                    tc_ac.stop;
                    t_forwarding.stop;
                    log("*** " & testcasename() & ": FAIL: IUT re-forwarded wrong version of DENM ***");
                }
                [] t_forwarding.timeout {
                    tc_ac.start;
                    log("*** " & testcasename() & ": INFO: Ready for receiving re-forwarded DENM ***");
                    repeat;
                }
                [] tc_ac.timeout {
                    log("*** " & testcasename() & ": FAIL: DENM was not forwarded ***");
                    f_clientSyncAndVerdict(c_tbDone, e_error);  
                }
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_KAFW_BV_02
                
        /**
         * @desc    Check that forwarding delay is set to min(2*transmissionInterval + rnd(0, 150ms), validityDuration)
         * <pre>
         * PICS Selection: PICS_KAF 
         * Initial conditions:
         *  with {
         *      the IUT being in the "initial state"
         *      and the IUT having received a DENM
         *          containing actionID
         *              indicating ACTION_ID1
         *          and containing transmissionInterval
         *              indicating TRANS_INTERVAL1
         *          and containing validityDuration
         *              indicating value DURATION_1 more than 3 times greater than TRANS_INTERVAL1
         *  }
         * Expected behaviour:
         *  ensure that {
         *      when { 
         *          the timer T_Forwarding expires
         *      }
         *      then {
         *          the IUT reconstructs and sends the DENM associated to ACTION_ID1 at a point of time corresponding to
         *          min ( 2*transmissionInterval + rnd ( 0, 150ms ), validityDuration )
         *      }
         *  }
         * </pre>
         * 
         * @version 1.2.1
         * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/KAFW/BV-03, ETSI EN 302 637-3, clause 8.2.1.4
         */
        testcase TC_DEN_KAFW_BV_03() runs on ItsDenm system ItsDenmSystem {
            
            //Local constants
            const TransmissionInterval c_transmissionInterval := c_interval_10sec;
filatov's avatar
filatov committed
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
            var ActionID v_actionId;
            // Local timers
            timer t_forwardingMin := 2.0 * int2float(c_transmissionInterval) / 1000.0;
            timer t_forwardingMax := 2.0 * int2float(c_transmissionInterval) / 1000.0 + 0.15;
            
            // Test control
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -,
                        c_transmissionInterval * 3,
                        c_transmissionInterval
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            t_forwardingMin.start;
            t_forwardingMax.start;
            alt {
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId)
                            )
                        )
                    ) 
                ) { 
                    t_forwardingMax.stop;
                    if(t_forwardingMin.running) {
                        t_forwardingMin.stop;
                        log("*** " & testcasename() & ": FAIL: IUT re-forwarded the packet too early ***");
                        f_clientSyncAndVerdict(c_tbDone, e_error);
                    }
                    else {
                        log("*** " & testcasename() & ": PASS: DENM re-forwarded correctly ***");
                        f_clientSyncAndVerdict(c_tbDone, e_success);
                    }  
                }
                [] t_forwardingMin.timeout {
                    log("*** " & testcasename() & ": INFO: Ready for receiving re-forwarded DENM ***");
                    repeat;   
                }
                [] t_forwardingMax.timeout {
                    log("*** " & testcasename() & ": FAIL: DENM was not forwarded on time ***");
                    f_clientSyncAndVerdict(c_tbDone, e_error);  
                }
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_KAFW_BV_03

        /**
         * @desc    Check that Forwarding ITS-S replaces the ITS PDU header of forwarded DENMs
filatov's avatar
filatov committed
         * <pre>
         * PICS Selection: PICS_KAF 
         * Initial conditions:
         *  with {
         *      the IUT being in the "initial state"
         *      and the IUT having received a DENM
         *          containing actionID
         *              indicating ACTION_ID1
         *          and containing transmissionInterval
         *              indicating TRANS_INTERVAL1
         *          and containing validityDuration
         *              indicating value more than 3 times greater than TRANS_INTERVAL1
         *      and the IUT having starting timer T_Forwarding for this DENM
         *      and the IUT not having received further DENM 
         *          containing actionID
         *              indicating ACTION_ID1
         *  }
         * Expected behaviour:
         *  ensure that {
         *      when { 
         *          the timer T_Forwarding expires
         *      }
         *      then {
         *          the IUT reconstructs and sends the DENM associated to ACTION_ID1
         *              containing ITS PDU header
         *                  containing StationID
         *                      indicating its own stationID
         *      }
         *  }
         * </pre>
         * 
         * @version 1.2.1
         * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/KAFW/BV-04, ETSI EN 302 637-3, clause 8.2.1.6
         */
        testcase TC_DEN_KAFW_BV_04() runs on ItsDenm system ItsDenmSystem {
            
            //Local constants
            const TransmissionInterval c_transmissionInterval := c_interval_10sec;
filatov's avatar
filatov committed
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
            var ActionID v_actionId;
            
            // Test control
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -,
                        c_transmissionInterval * 3,
                        c_transmissionInterval
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            tc_ac.start;
            alt {
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId)
                            ),
                            f_getIutStationId()
                        )
                    ) 
                ) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": PASS: DENM re-forwarded with correct stationID ***");
                    f_clientSyncAndVerdict(c_tbDone, e_success);
                }
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId)
                            ),
                            mw_anyStationId
                        )
                    ) 
                ) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": FAIL: DENM re-forwarded with incorrect stationID ***");
                    f_clientSyncAndVerdict(c_tbDone, e_error);
                }
                [] tc_ac.timeout {
                    log("*** " & testcasename() & ": INCONC: DENM was not forwarded ***");
                    f_clientSyncAndVerdict(c_tbDone, e_timeout);
                }
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_KAFW_BV_04

        /**
         * @desc    Check that forwarding ITS-S does not change actionID
filatov's avatar
filatov committed
         * <pre>
         * PICS Selection: PICS_KAF 
         * Initial conditions:
         *  with {
         *      the IUT being in the "initial state"
         *      and the IUT having received a DENM
         *          containing actionID
         *              indicating ACTION_ID1
         *          and containing transmissionInterval
         *              indicating TRANS_INTERVAL1
         *          and containing validityDuration
         *              indicating value more than 3 times greater than TRANS_INTERVAL1
         *      and the IUT having starting timer T_Forwarding for this DENM
         *      and the IUT not having received further DENM 
         *          containing actionID
         *              indicating ACTION_ID1
         *  }
         * Expected behaviour:
         *  ensure that {
         *      when { 
         *          the timer T_Forwarding expires
         *      }
         *      then {
         *          the IUT reconstructs and sends the DENM 
         *              containing management container
         *                  containing actionID
         *                      indicating ACTION_ID1
         *  }
         * </pre>
         * 
         * @version 1.2.1
         * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/KAFW/BV-05, ETSI EN 302 637-3, clause 8.2.1.1
         */
        testcase TC_DEN_KAFW_BV_05() runs on ItsDenm system ItsDenmSystem {
            
            //Local constants
            const TransmissionInterval c_transmissionInterval := c_interval_10sec;
filatov's avatar
filatov committed
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
            var ActionID v_actionId;
            
            // Test control
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -,
                        c_transmissionInterval * 3,
                        c_transmissionInterval
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            tc_ac.start;
            alt {
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId)
                            )
                        )
                    ) 
                ) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": PASS: DENM re-forwarded with correct actionID ***");
                    f_clientSyncAndVerdict(c_tbDone, e_success);
                }
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(mw_anyActionId)
                            )
                        )
                    ) 
                ) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": FAIL: DENM re-forwarded with incorrect actionID ***");
                    f_clientSyncAndVerdict(c_tbDone, e_error);
                }
                [] tc_ac.timeout {
                    log("*** " & testcasename() & ": INCONC: DENM was not forwarded ***");
                    f_clientSyncAndVerdict(c_tbDone, e_timeout);
                }
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_KAFW_BV_05
        
        /**
         * @desc    Check that forwarding ITS-S does not change referenceTime
filatov's avatar
filatov committed
         * <pre>
         * PICS Selection: PICS_KAF 
         * Initial conditions:
         *  with {
         *      the IUT being in the "initial state"
         *      and the IUT having received a DENM
         *          containing actionID
         *              indicating ACTION_ID1
         *          and containing transmissionInterval
         *              indicating TRANS_INTERVAL1
         *          and containing validityDuration
         *              indicating value DURATION_1 more than 3 times greater than TRANS_INTERVAL1
         *          and containing referenceTime
         *              indicating REFERENCETIME_1
         *      and the IUT having starting timer T_Forwarding for this DENM
         *      and the IUT not having received further DENM 
         *          containing actionID
         *              indicating ACTION_ID1
         *  }
         * Expected behaviour:
         *  ensure that {
         *      when { 
         *          the timer T_Forwarding expires
         *      }
         *      then {
         *          the IUT reconstructs and sends the DENM associated to ACTION_ID1
         *              containing management container
         *                  containing referenceTime
         *                      indicating REFERENCETIME_1
         *      }
         *  }
         * </pre>
         * 
         * @version 1.2.1
         * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/KAFW/BV-06, ETSI EN 302 637-3, clause 8.2.1.2
         */
        testcase TC_DEN_KAFW_BV_06() runs on ItsDenm system ItsDenmSystem {
            
            //Local constants
            const TransmissionInterval c_transmissionInterval := c_interval_10sec;
filatov's avatar
filatov committed
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
            var TimestampIts v_referenceTime1 := f_getCurrentTime();
            var ActionID v_actionId;
            
            // Test control
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -,
                        c_transmissionInterval * 3,
                        c_transmissionInterval,
                        v_referenceTime1
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            tc_ac.start;
            alt {
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId, v_referenceTime1)
                            )
                        )
                    ) 
                ) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": PASS: DENM re-forwarded with correct referenceTime ***");
                    f_clientSyncAndVerdict(c_tbDone, e_success);
                }
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId)
                            )
                        )
                    ) 
                ) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": FAIL: DENM re-forwarded with incorrect referenceTime ***");
                    f_clientSyncAndVerdict(c_tbDone, e_error);
                }
                [] tc_ac.timeout {
                    log("*** " & testcasename() & ": INCONC: DENM was not forwarded ***");
                    f_clientSyncAndVerdict(c_tbDone, e_timeout);
                }
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_KAFW_BV_06

        /**
         * @desc    Check that forwarding ITS-S does not change termination
filatov's avatar
filatov committed
         * <pre>
         * PICS Selection: PICS_KAF 
         * Initial conditions:
         *  with {
         *      the IUT being in the "initial state"
         *      and the IUT having received a DENM
         *          containing actionID
         *              indicating ACTION_ID1
         *          and containing transmissionInterval
         *              indicating TRANS_INTERVAL1
         *          and containing validityDuration
         *              indicating value DURATION_1 more than 3 times greater than TRANS_INTERVAL1
         *          and containing termination
         *              indicating isNegation
filatov's avatar
filatov committed
         *      and the IUT having starting timer T_Forwarding for this DENM
         *      and the IUT not having received further DENM 
         *          containing actionID
         *              indicating ACTION_ID1
         *  }
         * Expected behaviour:
         *  ensure that {
         *      when { 
         *          the timer T_Forwarding expires
         *      }
         *      then {
         *          the IUT reconstructs and sends the DENM associated to ACTION_ID1
         *              containing management container
         *                  containing termination
         *                      indicating isNegation
filatov's avatar
filatov committed
         *      }
         *  }
         * </pre>
         * 
         * @version 1.2.1
         * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/KAFW/BV-07, ETSI EN 302 637-3, clause 8.2.1.3
         */
        testcase TC_DEN_KAFW_BV_07() runs on ItsDenm system ItsDenmSystem {
            
            //Local constants
            const TransmissionInterval c_transmissionInterval := c_interval_10sec;
filatov's avatar
filatov committed
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
            var ActionID v_actionId;
            
            // Test control
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -,
                        c_transmissionInterval * 3,
                        c_transmissionInterval
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            tc_ac.start;
            alt {
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(
                                    v_actionId
filatov's avatar
filatov committed
                ) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": PASS: DENM re-forwarded with correct isNegation ***");
                    f_clientSyncAndVerdict(c_tbDone, e_success);
                }
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(
                                    v_actionId
filatov's avatar
filatov committed
                ) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": FAIL: DENM re-forwarded with incorrect isNegation ***");
                    f_clientSyncAndVerdict(c_tbDone, e_error);
                }
                [] tc_ac.timeout {
                    log("*** " & testcasename() & ": INCONC: DENM was not forwarded ***");
                    f_clientSyncAndVerdict(c_tbDone, e_timeout);
                }
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_KAFW_BV_07

        /**
         * @desc    Check that Forwarding ITS-S does not modify management, situation, location and alacarte containers 
filatov's avatar
filatov committed
         *          when forwarding a DENM
         * <pre>
         * PICS Selection: PICS_KAF 
         * Initial conditions:
         *  with {
         *      the IUT being in the "initial state"
         *      and the IUT having received a DENM
         *          containing management container
         *              indicating MANACEMENTCONTAINER_1
         *          and containing situation container
         *              indicating SITUATION_1
         *          and containing location container
         *              indicating LOCATION_1
         *          and containing alacarte container
         *              indicating ALACARTE_1
         *          and containing transmissionInterval
         *              indicating TRANS_INTERVAL1
filatov's avatar
filatov committed
         *      and the IUT having starting timer T_Forwarding for this DENM
         *      and the IUT not having received further DENM 
         *          containing actionID
         *              indicating ACTION_ID1
         *  }
         * Expected behaviour:
         *  ensure that {
         *      when { 
         *          the timer T_Forwarding expires
         *      }
         *      then {
         *          the IUT reconstructs and sends the DENM associated to ACTION_ID1
         *              containing management container
         *                  indicating MANACEMENTCONTAINER_1
         *              and containing situation container
         *                  indicating SITUATION_1
         *              and containing location container
         *                  indicating LOCATION_1
         *              and containing alacarte container
         *                  indicating ALACARTE_1
         *      }
         *  }
         * </pre>
         * 
         * @version 1.2.1
         * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/KAFW/BV-08, ETSI EN 302 637-3, clause 8.2.1.6
         */
        testcase TC_DEN_KAFW_BV_08() runs on ItsDenm system ItsDenmSystem {
            
            //Local constants
            const TransmissionInterval c_transmissionInterval := c_interval_10sec;
filatov's avatar
filatov committed
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
            var ActionID v_actionId;
            
            // Test control
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -,
                        c_transmissionInterval * 3,
                        c_transmissionInterval
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta,
                    m_alacarteConLaneCount
                )
            );
            
            tc_ac.start;
            alt {
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId),
                                v_situation,
                                m_denmLocation_zeroDelta,
                                m_alacarteConLaneCount
                            )
                        )
                    ) 
                ) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": PASS: DENM re-forwarded with correct containers ***");
                    f_clientSyncAndVerdict(c_tbDone, e_success);
                }
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId)
                            )
                        )
                    ) 
                ) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": FAIL: DENM re-forwarded with incorrect containers ***");
                    f_clientSyncAndVerdict(c_tbDone, e_error);
                }
                [] tc_ac.timeout {
                    log("*** " & testcasename() & ": INCONC: DENM was not forwarded ***");
                    f_clientSyncAndVerdict(c_tbDone, e_timeout);
                }
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_KAFW_BV_08

        /**
         * @desc    Check that forwarding ITS-S stops forwarding DENM after validity expiration
filatov's avatar
filatov committed
         * <pre>
         * PICS Selection: PICS_KAF 
         * Initial conditions:
         *  with {
         *      the IUT being in the "initial state"
         *      and the IUT having received an event
         *          containing management container
         *              containing actionID
         *                  indicating ACTION_ID1
         *              and containing validityDuration
         *                  indicating DURATION_1
         *          	and containing transmissionInterval
         *              	indicating TRANS_INTERVAL1
filatov's avatar
filatov committed
         *      and the IUT having starting timer T_Forwarding for this DENM
         *      and the IUT not having received further DENM 
         *          containing actionID
         *              indicating ACTION_ID1
         *  }
         * Expected behaviour:
         *  ensure that {
         *      when { 
         *          the IUT is alerted of expiration of the time associated with DURATION_1
         *      }
         *      then {
         *          the IUT stops to reconstruct and to send the DENM associated with ACTION_ID1
         *      }
         *  }
         * </pre>
         * 
         * @version 1.2.1
         * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/KAFW/BV-09, ETSI EN 302 637-3, clause 8.2.2
         */
        testcase TC_DEN_KAFW_BV_09() runs on ItsDenm system ItsDenmSystem {
            
            //Local constants
            const TransmissionInterval c_transmissionInterval := c_interval_10sec;
filatov's avatar
filatov committed
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
            var ActionID v_actionId;
            // Local timers
            timer t_validity := int2float(c_transmissionInterval * 3) / 1000.0;
            
            // Test control
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -,
                        c_transmissionInterval * 3,
                        c_transmissionInterval
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            t_validity.start;
            tc_ac.start;
            alt {
                [] denmPort.receive(
                    mw_denmInd(
                        mw_denmPdu(
                            mw_denm(
                                mw_denmMgmtCon(v_actionId)
                            )
                        )
                    ) 
                ) {
                    tc_ac.stop;
                    if(t_validity.running) {
                        log("*** " & testcasename() & ": INFO: DENM re-forwarded during validity period ***");
                        tc_ac.start;
                        repeat;
                    }
                    else {
                        log("*** " & testcasename() & ": FAIL: DENM re-forwarded after validity expiration ***");
                        f_clientSyncAndVerdict(c_tbDone, e_error);
                    }
                }
                [] tc_ac.timeout {
                    if(t_validity.running) {
                        log("*** " & testcasename() & ": INCONC: DENM was not forwarded ***");
                        f_clientSyncAndVerdict(c_tbDone, e_timeout);
                    }
                    else {
                        log("*** " & testcasename() & ": PASS: DENM not reforwarded after validity expiration ***");
                        f_clientSyncAndVerdict(c_tbDone, e_success);
                    }
                }
                
                [] t_validity.timeout {
                    log("*** " & testcasename() & ": INFO: End of validity period ***");
                    repeat;
                }
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_KAFW_BV_09
                                  
        /**
         * @desc    Check that forwarding ITS-S stops forwarding DENM if it is outside relevance area
filatov's avatar
filatov committed
         * <pre>
         * PICS Selection: PICS_KAF 
         * Initial conditions:
         *  with {
         *      the IUT being in the "initial state"
         *      and the IUT having received an event
         *          containing management container
         *              containing actionID
         *                  indicating ACTION_ID1
         *          	and containing transmissionInterval
         *              	indicating TRANS_INTERVAL1
filatov's avatar
filatov committed
         *      and the IUT having starting timer T_Forwarding for this DENM
         *      and the IUT not having received further DENM 
         *          containing actionID
         *              indicating ACTION_ID1
         *  }
         * Expected behaviour:
         *  ensure that {
         *      when { 
         *          the IUT is alerted that its position is now outside of the relevance area associated with ACTION_ID1
         *      }
         *      then {
         *          the IUT stops to reconstruct and to send the DENM associated with ACTION_ID1
         *      }
         *  }
         * </pre>
         * 
         * @version 1.2.1
         * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/KAFW/BV-10, ETSI EN 302 637-3, clause 8.2.2
         */
        testcase TC_DEN_KAFW_BV_10() runs on ItsDenm system ItsDenmSystem {
            
            //Local constants
            const TransmissionInterval c_transmissionInterval := c_interval_10sec;
filatov's avatar
filatov committed
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
            var ActionID v_actionId;
            var boolean v_positionChanged := false;
            
            // Test control
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -,
                        c_transmissionInterval * 5,
                        c_transmissionInterval
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            tc_ac.start;