ItsDenm_TestCases.ttcn 222 KB
Newer Older
filatov's avatar
filatov committed
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT receives an AppDENM_update request associated with ACTION_ID1 from the application layer
           *      }
           *      then {
           *          the IUT sends a valid 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/EVUP/BV-02, ETSI EN 302 637-3, clauses 6.1.2.2, 8.1.1.1
           */
          testcase TC_DEN_EVUP_BV_02() runs on ItsDenm system ItsDenmSystem {
              
              // Local variables
              var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_utTriggerEvent(m_utTriggerEvent(v_situation, m_denmLocation_zeroDelta));
              f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              v_situation.eventType.subCauseCode := c_vehicleBreakDownSubCauseCode_engineProblem;
              f_utUpdateEvent(m_utUpdateEvent(v_actionId, v_situation));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_anyDenmPdu(
                              mw_itsPduHeader,
                              mw_denm (
                                  mw_denmMgmtConWithActionID(
                                      v_actionId
                                  )
                              )
                          )
                      )
                  ) -> value v_denmInd {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVUP_BV_02
          
          /**
           * @desc    Check that referenceTime is set to the current time when generating a DENM for an updated eventCheck 
filatov's avatar
filatov committed
           * <pre>        
           * PICS Selection: none 
           * Initial conditions:
           *  with {
           *      the IUT being in the "initial state"
           *      and the IUT having generated an event
           *          containing management container
           *              containing actionID
           *                  indicating ACTION_ID1
           *              containing referenceTime
           *                  indicating REFERENCETIME1
           *  }
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT receives an AppDENM_update request associated with ACTION_ID1 from the application layer
           *      }
           *      then {
           *          the IUT sends a valid DENM
           *              containing management container
           *                  containing actionID
           *                      indicating ACTION_ID1
           *                  and containing referenceTime
           *                      indicating CLT > REFERENCETIME1
filatov's avatar
filatov committed
           *      }
           *  }
           * </pre>
           * 
           * @version 1.2.1
           * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/EVUP/BV-03, ETSI EN 302 637-3, clause 6.1.2.2
           */
          testcase TC_DEN_EVUP_BV_03() runs on ItsDenm system ItsDenmSystem {
              
              // Local variables
              var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
              var TimestampIts v_referenceTime1 , v_timestampIts , v_msgtimestamp;
              var Int16 v_diff;
filatov's avatar
filatov committed
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_utTriggerEvent(m_utTriggerEvent(v_situation, m_denmLocation_zeroDelta));
              f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              v_referenceTime1 := v_denmInd.msgIn.denm.management.referenceTime;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              v_situation.eventType.subCauseCode := c_vehicleBreakDownSubCauseCode_engineProblem;
              f_utUpdateEvent(m_utUpdateEvent(v_actionId, v_situation));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_anyDenmPdu(
                              mw_itsPduHeader,
                              mw_denm (
                                  mw_denmMgmtCon(
                                      v_actionId
                                  )
                              )
                          )
                      )
                  ) -> value v_denmInd {
                      tc_ac.stop;
                      v_timestampIts := f_getCurrentTime();
                      v_msgtimestamp := v_denmInd.msgIn.denm.management.referenceTime;
                      if ( ( ( v_timestampIts + v_diff ) > v_msgtimestamp ) and ( v_msgtimestamp > v_referenceTime1 ) ) {
filatov's avatar
filatov committed
                          log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                      }
                      else {
                          log("*** " & testcasename() & ": FAIL: ReferenceTime not updated correctly ***");
                          f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                      }
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVUP_BV_03
          
          /**
           * @desc    Check that DEN Basic Service does not send any update DENM if actionID is not in originating ITS-S message table
filatov's avatar
filatov committed
           * <pre>        
           * PICS Selection: none 
           * Initial conditions:
           *  with {
           *      the IUT being in the "initial state"
           *      and the IUT having generated an event
           *      and the IUT not having sent an event being associated with actionID ACTION_ID1
filatov's avatar
filatov committed
           *          containing originatorStationID
           *              indicating its own stationID
           *          and containing sequenceNumber
           *              indicating SEQ1
           *  }
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT is requested to update an event associated to ACTION_ID1
           *      }
           *      then {
           *          the IUT does not send send any DENM for this event
           *      }
           *  }
           * </pre>
           * 
           * @version 1.2.1
           * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/EVUP/BV-05, ETSI EN 302 637-3, clause 8.1.2
           */
          testcase TC_DEN_EVUP_BV_04() runs on ItsDenm system ItsDenmSystem {
              
              // Local variables
              var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_utTriggerEvent(m_utTriggerEvent(v_situation, m_denmLocation_zeroDelta));
              f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              v_situation.eventType.subCauseCode := c_vehicleBreakDownSubCauseCode_engineProblem;
              f_utUpdateEvent(m_utUpdateEvent(m_actionId(f_increaseSequenceNumber(v_actionId.sequenceNumber), f_getIutStationId()), v_situation));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_anyDenmPdu(
                              mw_itsPduHeader,
                              mw_denm (
                                  mw_denmMgmtCon(
                                      m_actionId(
                                          f_increaseSequenceNumber(v_actionId.sequenceNumber),
                                          f_getIutStationId()
                                      )
                                  )
                              )
                          )
                      )
                  ) -> value v_denmInd {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received updated DENM for the actionId which is not in originator ITS-S message table. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": PASS: No DENM was sent. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_EVUP_BV_05
          
      } // end denEventUpdate
      
      // 5.2.1.4
      group denEventTermination {
          
          /**
           * @desc    Check that DEN Basic Service generates a cancellation DENM when application indicates the 
           *          premature termination of an event for which it is the originator
           * <pre>        
           * PICS Selection: none 
           * Initial conditions:
           *  with {
           *      the IUT being in the "initial state"
           *      and the IUT having generated an event
           *          containing management container
           *              containing actionID
           *                  indicating ACTION_ID1
           *              and containing validityDuration
           *                  indicating DURATION_1
           *  }
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT receives an AppDENM_termination request associated to ACTION_ID1 from the application layer
           *      }
           *      then {
           *          the IUT sends a valid DENM
           *              containing management container
           *                  containing actionID
           *                      indicating ACTION_ID1
           *                  and containing termination
           *                     indicating value isCancellation
filatov's avatar
filatov committed
           *      }
           *  }
           * </pre>
           * 
           * @version 1.2.1
           * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/EVTR/BV-01, ETSI EN 302 637-3, clauses 6.1.2.4, 8.2.1.3
filatov's avatar
filatov committed
           */
          testcase TC_DEN_EVTR_BV_01() runs on ItsDenm system ItsDenmSystem {
              
              // Local variables
              var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_utTriggerEvent(m_utTriggerEvent(v_situation, m_denmLocation_zeroDelta, c_duration_10sec));
              f_awaitDenMessage(
                  mw_denmInd(
                      mw_denmPdu(
                          mw_denm(
                              mw_denmMgmtCon(
                                  mw_anyActionId, -, -, -,
                                  c_duration_2sec
                              )
                          )
                      )
                  ), 
                  v_denmInd
              );
filatov's avatar
filatov committed
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              f_utTerminateEvent(m_utEventCancellation(v_actionId));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive ( mw_denmInd ( mw_denmPdu (
                  										mw_denm ( m_denmMgmtConTermination ( v_actionId, -, -, -, -, -, isCancellation ))))) -> value v_denmInd {
filatov's avatar
filatov committed
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                  }
              }
              
              // Postamble
              f_cfDown();
             
          } // end TC_DEN_EVTR_BV_01
          
          /**
           * @desc    Check that DEN Basic Service generates a negation DENM when application indicates the 
           *          premature termination of an event for which it is not the originator
           * <pre>        
           * PICS Selection: none 
           * 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
           *                      containing originatorStationID
           *                          indicating stationID different from its own stationID
           *  }
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT receives an AppDENM_termination request associated to ACTION_ID1 from the application layer
           *      }
           *      then {
           *          the IUT sends a valid DENM
           *              containing management container
           *                  containing actionID
           *                      indicating ACTION_ID1
           *                  and containing termination
           *                      indicating value isNegation
filatov's avatar
filatov committed
           *      }
           *  }
           * </pre>
           * 
           * @version 1.2.1
           * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/EVTR/BV-02, ETSI EN 302 637-3, clause 6.1.2.4
           */
          testcase TC_DEN_EVTR_BV_02() runs on ItsDenm system ItsDenmSystem {
              
              // Local variables
              var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              v_actionId := f_sendDenMessage ( m_denm ( m_denmMgmtCon ( m_tsActionId ), v_situation, m_denmLocation_zeroDelta ) );
filatov's avatar
filatov committed
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              f_utTerminateEvent(m_utEventCancellation(v_actionId));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive ( mw_denmInd ( mw_denmPdu (
                  										mw_denm ( m_denmMgmtConTermination ( v_actionId, -, -, -, -, -, isNegation ))))) -> value v_denmInd {
filatov's avatar
filatov committed
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                  }
              }
              
              // Postamble
              f_cfDown();
             
          } // end TC_DEN_EVTR_BV_02
          
          /**
           * @desc   Check that referenceTime is set to the latest value received for this event in negation DENM
           * <pre>        
           * PICS Selection: none 
           * 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
           *                      containing originatorStationID
           *                          indicating stationID different from its own stationID
           *              and containing referenceTime
           *                  indicating REFERENCETIME1
           *      and the IUT having received an event
           *          containing management container
           *              containing actionID
           *                  indicating ACTION_ID1
           *              and containing referenceTime
           *                  indicating REFERENCETIME2 > REFERENCETIME1
           *  }
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT receives an AppDENM_termination request associated to ACTION_ID1 from the application layer
           *      }
           *      then {
           *          the IUT sends a valid DENM
           *              containing management container
           *                  containing actionID
           *                      indicating ACTION_ID1
           *                  and containing referenceTime
           *                      indicating value REFERENCETIME2
           *                  and containing termination
           *                      indicating value isNegation
filatov's avatar
filatov committed
           *      }
           *  }
           * </pre>
           * 
           * @version 1.2.1
           * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/EVTR/BV-03, ETSI EN 302 637-3, clauses 6.1.2.4, 8.2.1.3
filatov's avatar
filatov committed
           */
          testcase TC_DEN_EVTR_BV_03() runs on ItsDenm system ItsDenmSystem {
              
              // 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;
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              v_actionId := f_sendDenMessage(
                  m_denm(
                      m_denmMgmtCon(
                          m_tsActionId, 
                          -, 
                          -, 
                          -, 
                          v_referenceTime1
                      ),
                      v_situation,
                      m_denmLocation_zeroDelta
                  )
              );
filatov's avatar
filatov committed
              
              v_referenceTime2 := f_getCurrentTime();
              v_situation.eventType.subCauseCode := c_vehicleBreakDownSubCauseCode_engineProblem;
              v_actionId := f_sendDenMessage(
                  m_denm(
                      m_denmMgmtCon(
                          m_tsActionId, 
                          -, 
                          -, 
                          -, 
                          v_referenceTime2
                      ),
                      v_situation,
                      m_denmLocation_zeroDelta
                  )
              );
filatov's avatar
filatov committed
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              f_utTerminateEvent(m_utEventCancellation(v_actionId));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_denmPdu(
                              mw_denm (
                                  m_denmMgmtConTermination(
                                      v_actionId, 
                                      -, 
                                      -, 
                                      -, 
                                      -, 
                                      v_referenceTime2, 
                                      isNegation
                                  )
                              )
                          )
                      )
                  ) -> value v_denmInd {
filatov's avatar
filatov committed
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                  }
              }
              
              // Postamble
              f_cfDown();
             
          } // end TC_DEN_EVTR_BV_03
          
          /**
           * @desc    Check that situation container, location container  and alacarte container are not present in a cancellation DENM
filatov's avatar
filatov committed
           * <pre>        
           * PICS Selection: none 
           * Initial conditions:
           *  with {
           *      the IUT being in the "initial state"
           *      and the IUT having generated an event
           *          containing management container
           *              containing actionID
           *                  indicating ACTION_ID1
           *  }
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT receives an AppDENM_termination request associated to ACTION_ID1 from the application layer
           *      }
           *      then {
           *          the IUT sends a valid DENM
           *              containing management container
           *                  containing actionID
           *                      indicating ACTION_ID1
           *                  and containing termination
           *                      indicating value isCancellation
filatov's avatar
filatov committed
           *              and not containing situation container
           *              and not containing location container
           *              and not containing alacarte container
filatov's avatar
filatov committed
           *      }
           *  }
           * </pre>
           * 
           * @version 1.2.1
           * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/EVTR/BV-04, ETSI EN 302 637-3, clause 7.1.1
filatov's avatar
filatov committed
           */
          testcase TC_DEN_EVTR_BV_04() runs on ItsDenm system ItsDenmSystem {
              
              // Local variables
              var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_utTriggerEvent(m_utTriggerEvent(v_situation, m_denmLocation_zeroDelta, c_duration_10sec));
              f_awaitDenMessage(
                  mw_denmInd(
                      mw_denmPdu(
                          mw_denm(
                              mw_denmMgmtCon(
                                  mw_anyActionId
                              )
                          )
                      )
                  ), 
                  v_denmInd
              );
filatov's avatar
filatov committed
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              f_utTerminateEvent(m_utEventCancellation(v_actionId));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_denmPdu(
                  				mw_denm ( m_denmMgmtConTermination ( v_actionId, -, -, -, -, -, isCancellation ), omit, omit, omit ) ) ) ) -> value v_denmInd {
filatov's avatar
filatov committed
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                  }
              }
              
              // Postamble
              f_cfDown();
             
          } // end TC_DEN_EVTR_BV_04
          
          /**
           * @desc    Check that situation container, location container and alacarte container are not present in a negation DENM
filatov's avatar
filatov committed
           * <pre>        
           * PICS Selection: none 
           * 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
           *                      containing originatorStationID
           *                          indicating stationID different from its own stationID
           *  }
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT receives an AppDENM_termination request associated to ACTION_ID1 from the application layer
           *      }
           *      then {
           *          the IUT sends a valid DENM
           *              containing management container
           *                  containing actionID
           *                      indicating ACTION_ID1
           *                  and containing termination
           *                      indicating value isNegation
filatov's avatar
filatov committed
           *              and not containing situation container
           *              and not containing location container
           *              and not containing alacarte container
filatov's avatar
filatov committed
           *      }
           *  }
           * </pre>
           * 
           * @version 1.2.1
           * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/EVTR/BV-05, ETSI EN 302 637-3, clause 7.1.1
filatov's avatar
filatov committed
           */
          testcase TC_DEN_EVTR_BV_05() runs on ItsDenm system ItsDenmSystem {
              
              // Local variables
              var template (value) SituationContainer v_situation := m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable);
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              
              // Test control
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              v_actionId := f_sendDenMessage ( m_denm ( m_denmMgmtCon ( m_tsActionId ), v_situation, m_denmLocation_zeroDelta ) );
filatov's avatar
filatov committed
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              f_utTerminateEvent(m_utEventCancellation(v_actionId));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_denmPdu(
                  				mw_denm ( m_denmMgmtConTermination ( v_actionId, -, -, -, -, -, isNegation ), omit, omit, omit ) ) ) ) -> value v_denmInd {
filatov's avatar
filatov committed
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                  }
              }
              
              // Postamble
              f_cfDown();
             
          } // end TC_DEN_EVTR_BV_05
          
          /**
           * @desc    Check that DEN Basic Service does not send any termination DENM if actionID is not in 
           *          originating ITS-S message table or receiving ITS-S message table (own stationID)
filatov's avatar
filatov committed
           * <pre>        
           * PICS Selection: none 
           * Initial conditions:
           *  with {
           *      the IUT being in the "initial state"
           *      and the IUT having generated several events
           *      and the IUT not having send event being associated with ACTION_ID1
           *          containing originatingStationID
filatov's avatar
filatov committed
           *              indicating its own stationID
           *          and containing sequenceNumber
           *              indicating SEQ1
           *  }
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT is requested to terminate an event associated to ACTION_ID1
           *              containing originatingStationID
filatov's avatar
filatov committed
           *                  indicating its own stationID
           *              and containing sequenceNumber
           *                  indicating SEQ1
           *      }
           *      then {
           *          the IUT does not send send any termination DENM for this event
           *      }
           *  }
           *  NOTE: Event associated to ACTION_ID1 cannot be present in receiving ITS-S message 
filatov's avatar
filatov committed
           *        table as its stationID is IUT’s stationID (see TP/DEN/EVTR/BV-07)
           * </pre>
           * 
           * @version 1.2.1
           * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/EVTR/BV-06, ETSI EN 302 637-3, clauses 8.2.2
filatov's avatar
filatov committed
           */
          testcase TC_DEN_EVTR_BV_06() runs on ItsDenm system ItsDenmSystem {
              
              // Local variables
              var template (value) SituationContainerList v_situations := {
                  m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable),
                  m_situation(c_causeAccident, c_subCauseCode_Unavailable),
                  m_situation(c_causeRoadworks, c_subCauseCode_Unavailable),
                  m_situation(c_causeSlowVehicle, c_subCauseCode_Unavailable)
              };
              var ActionID v_unknownActionId;
              var ActionIDList v_actionIds;
filatov's avatar
filatov committed
              var DenmInd v_denmInd;
              var integer i;
              
              // Test control
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              for (i := 0; i < lengthof(v_situations); i:=i + 1) {
                  f_utTriggerEvent(m_utTriggerEvent(v_situations[i], m_denmLocation_zeroDelta));
                  f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
                  v_actionIds[i] := v_denmInd.msgIn.denm.management.actionID;
              }
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              v_unknownActionId := valueof(m_actionId(
filatov's avatar
filatov committed
                                        f_increaseSequenceNumber(
                                            v_actionIds[lengthof(v_actionIds)].sequenceNumber
                                        ),
                                        f_getIutStationId()
filatov's avatar
filatov committed
              f_utTerminateEvent(m_utEventCancellation(v_unknownActionId));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(
                      mw_denmInd(
                          mw_anyDenmPdu(
                              mw_itsPduHeader,
                              mw_denm (
                                  mw_denmMgmtCon(v_unknownActionId)
                              )
                          )
                      )
                  ) -> value v_denmInd {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received termination DENM for the unknown actionId. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": PASS: No termination DENM was sent. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                  }
              }
              
              // Postamble
              for (i := 0; i < lengthof(v_situations); i:=i + 1) {
                  f_poCancelEvent(e_iut, v_actionIds[i]);
              }
              f_cfDown();
             
          } // end TC_DEN_EVTR_BV_06
          
          /**
           * @desc    Check that DEN Basic Service does not send any termination DENM if actionID is not in 
           *          originating ITS-S message table or receiving ITS-S message table (other stationID)
filatov's avatar
filatov committed
           * <pre>        
           * PICS Selection: none 
           * Initial conditions:
           *  with {
           *      the IUT being in the "initial state"
           *      and the IUT having received several events
           *      and the IUT not having received event being associated with ACTION_ID1
           *          containing originatingStationID
filatov's avatar
filatov committed
           *              indicating STATION_ID1 different from its own stationID
           *          and containing sequenceNumber
           *              indicating SEQ1
           *  }
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT is requested to terminate an event associated to ACTION_ID1
           *              containing originatingStationID
filatov's avatar
filatov committed
           *                  indicating STATION_ID1
           *              and containing sequenceNumber
           *                  indicating SEQ1
           *      }
           *      then {
           *          the IUT does not send send any termination DENM for this event
           *      }
           *  }
           *  NOTE: Event associated to ACTION_ID1 cannot be present in originating ITS-S message table as its 
filatov's avatar
filatov committed
           *        stationID is not IUT’s stationID (see TP/DEN/EVTR/BV-06)
           * </pre>
           * 
           * @version 1.2.1
           * @see     ETSI TS 102 869-2 v1.2.1 TP/DEN/EVTR/BV-07, ETSI EN 302 637-3, clauses 8.2.2
filatov's avatar
filatov committed
           */
          testcase TC_DEN_EVTR_BV_07() runs on ItsDenm system ItsDenmSystem {
              
              // Local constants
              const SequenceNumber v_initialSequenceNumber := 0;
              // Local variables
              var template (value) SituationContainerList v_situations := {
                  m_situation(c_causeVehicleBreakdown, c_subCauseCode_Unavailable),
                  m_situation(c_causeAccident, c_subCauseCode_Unavailable),
                  m_situation(c_causeRoadworks, c_subCauseCode_Unavailable),
                  m_situation(c_causeSlowVehicle, c_subCauseCode_Unavailable)
              };
              var SequenceNumber v_sequenceNumber := v_initialSequenceNumber;
              var ActionID v_unknownActionId;
              var ActionIDList v_actionIds; 
filatov's avatar
filatov committed
              var DenmInd v_denmInd;
              var integer i;
              
              // Test control
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              for (i := 0; i < lengthof(v_situations); i:=i + 1) {
                  v_sequenceNumber := f_increaseSequenceNumber(v_sequenceNumber);
                  v_actionIds[i] := f_sendDenMessage( m_denm( m_denmMgmtCon( m_tsActionId(v_sequenceNumber) ), v_situations[i], m_denmLocation_zeroDelta ) );
filatov's avatar
filatov committed
              }
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              v_unknownActionId := valueof(m_actionId(
filatov's avatar
filatov committed
                                        f_increaseSequenceNumber(
                                            v_actionIds[lengthof(v_actionIds)].sequenceNumber
                                        ),
                                        f_getTsStationId()
filatov's avatar
filatov committed
              f_utTerminateEvent(m_utEventCancellation(v_unknownActionId));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive( mw_denmInd( mw_anyDenmPdu( mw_itsPduHeader, mw_denm ( mw_denmMgmtCon(v_unknownActionId) ) ) ) ) -> value v_denmInd {
filatov's avatar
filatov committed
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received termination DENM for the unknown actionId. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": PASS: No termination DENM was sent. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                  }
              }
              
              // Postamble
              for (i := 0; i < lengthof(v_situations); i:=i + 1) {
                  f_poCancelEvent(e_ets, v_actionIds[i]);
              }
              f_cfDown();
             
          } // end TC_DEN_EVTR_BV_07
          
          /**
           * @desc    Check that referenceTime is set to to the current time when generating a cancellation DENM
filatov's avatar
filatov committed
           * <pre>        
           * PICS Selection: none 
           * Initial conditions:
           *  with {
           *      the IUT being in the "initial state"
           *      and the IUT having generated an event
           *          containing management container
           *              containing actionID
           *                  indicating ACTION_ID1
		   *	          and containing validityDuration
		   * 		          indicating DURATION_1
           *              and containing referenceTime
           *                  indicating REFERENCETIME1
filatov's avatar
filatov committed
           *  }
           * Expected behaviour:
           *  ensure that {
           *      when { 
           *          the IUT receives an AppDENM_termination request associated with ACTION_ID1 from the application layer
filatov's avatar
filatov committed
           *      }
           *      then {
           *          the IUT sends a valid DENM
           *              containing management container
           *                  containing actionID