ItsDenm_TpFunctions.ttcn 172 KB
Newer Older
              
              // Test Body
              alt {
                  [] denmPort.receive(v_expectedDenmInd) -> value v_denmInd {
                      t_repetition.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      t_repetition.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] t_repetition.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();

          } // end TC_DEN_EVRP_BV_09
           
          /**
           * @desc    TP Function for TC_DEN_EVRP_BV_10
           */
          function f_DEN_EVRP_BV_10() runs on ItsDenm {
              // Local constants
              const ValidityDuration c_duration1 := 3 * c_duration_2sec;
              const ValidityDuration c_duration2 := c_duration_10sec;
              const TransmissionInterval c_interval1 := c_interval_1sec;
              const float c_lowerTransmissionInterval := int2float(c_interval1)*0.95;
              const float c_upperTransmissionInterval := int2float(c_interval1)*1.05;
              // Local variables
              var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
              var template (present) DenmInd v_expected := mw_denmInd(mw_denmPdu(mw_denm( mw_denmMgmtCon( mw_actionId, -, -, c_duration2 )))); 
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              var TimestampIts v_referenceTime;
              // Local timers
              timer t_repetition;

              // Test control
              if (not PICS_DENM_REPETITION) {
                  log("*** " & testcasename() & ": PICS_DENM_REPETITION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Preamble
              f_prInitialState();
              f_utTriggerEvent( m_utTriggerEvent( v_situation, c_duration2, c_duration1, c_interval1 ) );
              f_awaitDenMessage ( v_expected, v_denmInd );
              t_repetition.start(2.0 * (int2float(c_interval1)/1000.0));
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              v_referenceTime := v_denmInd.msgIn.denm.management.referenceTime;
              v_expected.msgIn.denm.management.actionID := v_actionId;
              v_expected.msgIn.denm.management.referenceTime := v_referenceTime;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              alt {
                  [] denmPort.receive ( v_expected ) -> value v_denmInd {
                      t_repetition.stop;
                      log("*** " & testcasename() & ": PASS: Successfully received expected DENM in the expected interval. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      t_repetition.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] t_repetition.timeout {
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();

          } // end TC_DEN_EVRP_BV_10
           
          /**
           * @desc    TP Function for TC_DEN_EVRP_BV_11
           */
          function f_DEN_EVRP_BV_11() runs on ItsDenm {
              // Local constants
              const ValidityDuration c_duration1 := defaultValidity + 100;
              const ValidityDuration c_duration2 := defaultValidity;
              const TransmissionInterval c_interval1 := c_interval_10sec;
              const float c_diffValidity := int2float ( ( c_duration1 - c_duration2 ) );
              // Local variables
              var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
              var template (present) DenmInd v_expected := mw_denmInd(mw_denmPdu(mw_denm( mw_denmMgmtCon( mw_actionId, -, -, c_duration2 ifpresent)))); 
              var ActionID v_actionId;
              var DenmInd v_denmInd;
              var TimestampIts v_referenceTime;
              // Local timers
              timer t_repetition;
              timer t_default;

              // Test control
              if (not PICS_DENM_REPETITION) {
                  log("*** " & testcasename() & ": PICS_DENM_REPETITION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Preamble
              f_prInitialState();
              f_utTriggerEvent( m_utTriggerEvent( v_situation, omit, c_duration1, c_interval1 ) );
              f_awaitDenMessage ( v_expected, v_denmInd );
              t_repetition.start(2.0 * int2float(c_interval1)/1000.0);
              t_default.start ( int2float(c_duration1) );
              v_actionId := v_denmInd.msgIn.denm.management.actionID;
              v_expected.msgIn.denm.management.actionID := v_actionId;
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              alt {
                  [] denmPort.receive ( v_expected ) -> value v_denmInd {
                      t_repetition.stop;
                      if ( t_default.read*1000.0 < c_diffValidity ) {
                          log("*** " & testcasename() & ": FAIL: DENM received after validity duration. ***");
                          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                      }
                      else {
                          log("*** " & testcasename() & ": INFO: DENM retransmission. ***");
                          t_repetition.start(2.0 * (int2float(c_interval1)/1000.0));
                          repeat;
                      }
                  }
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                      t_repetition.stop;
                      log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                  }
                  [] t_repetition.timeout {
                      if ( t_default.read*1000.0 < c_diffValidity ) {
                          t_default.stop;
                          log("*** " & testcasename() & ": PASS: Retransmission of DENM stopped. ***");
                          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                      }
                      else {
                          t_default.stop;
                      	  log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      	  f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                      }
                  }
                  [] t_default.timeout {
                      t_repetition.stop;
                      log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();

          } // end TC_DEN_EVRP_BV_11
          
      } // end denMessageRepetition
      
      group denMessageLowerLayerParameters {
          
          /**
           * @desc    TP Function for TC_DEN_PAR_BV_01
           */
          function f_DEN_PAR_BV_01() runs on ItsDenm {
              
              // Local variables
              const UInt8 c_gnNhBtpB := 2;
              var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
              var ActionID v_actionId;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              v_actionId := f_utTriggerEvent(m_utTriggerEvent(v_situation));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(mw_denmIndWithGnParameters(mw_anyDenmPdu, c_gnNhBtpB)) { 
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Expected DENM message encapsultated in BTP-B packet received ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);  
                  }
                  [] denmPort.receive(mw_denmIndWithGnParameters(mw_anyDenmPdu, omit)) { 
                      tc_ac.stop;
                      log("*** " & testcasename() & ": INCONC: no GN NH information in DenmInd ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);  
                  }                    
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) { 
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Expected DENM message received, but not encapsulated in BTP-B packet ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);  
                  }                    
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: DENM message not received ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_PAR_BV_01

          /**
           * @desc    TP Function for TC_DEN_PAR_BV_02
           */
          function f_DEN_PAR_BV_02() runs on ItsDenm {
              
              // Local variables
              const UInt8 c_gnHtGbc := 4;
              var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
              var ActionID v_actionId;
              
              // Test control
              if (not PICS_DENM_GENERATION) {
                  log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
                  setverdict(inconc);
                  stop;
              }
              
              // Test component configuration
              f_cfUp();
              
              // Test adapter configuration
              
              // Preamble
              f_prInitialState();
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
              
              // Test Body
              v_actionId := f_utTriggerEvent(m_utTriggerEvent(v_situation));
              
              tc_ac.start;
              alt {
                  [] denmPort.receive(mw_denmIndWithGnParameters(mw_anyDenmPdu, -, c_gnHtGbc)) { 
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Expected DENM message encapsulated in GBC packet received ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);  
                  }
                  [] denmPort.receive(mw_denmIndWithGnParameters(mw_anyDenmPdu, -, omit)) { 
                      tc_ac.stop;
                      log("*** " & testcasename() & ": INCONC: no GN HT information in DenmInd ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);  
                  }                    
                  [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) { 
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Expected DENM message received, but not encapsulated in GBC packet ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);  
                  }                    
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: DENM message not received ***");
                      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                  }
              }
              
              // Postamble
              f_poCancelEvent(e_iut, v_actionId);
              f_cfDown();
             
          } // end TC_DEN_PAR_BV_02
      
      } // end denMessageLowerLayerParameters
      
      group denMessageSSP {
      	
		  function f_DEN_SSP_BV_XX( in Oct8 p_certHashedId8,
								  in template (value) SituationContainer p_situation,
								  in template (present) bitstring pmw_ssp)
		  runs on ItsDenm {
              
			var ActionID v_actionId;
			var DenmInd v_denmInd;
              
			// Test control
			if (not PICS_IS_IUT_SECURED) {
				log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***");
				setverdict(inconc);
				stop;
			}
              
			if (not PICS_DENM_GENERATION) {
				log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***");
				setverdict(inconc);
				stop;
			}
              
			// Test component configuration
			f_cfUp();
            
			// Test adapter configuration
            
			// Preamble
			f_prInitialState(e_staticPosition, {
			    hashedId8 := p_certHashedId8
			});
			
			f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
			// Test Body
			v_actionId := f_utTriggerEvent(m_utTriggerEvent(p_situation));
            
			tc_ac.start;
			alt {
			  [] denmPort.receive(
				  mw_denmInd_SSP(
					  mw_denmPdu(
						  mw_denm(
							  mw_anyDenmMgmtCon,
							  p_situation
						  )
					  ),
					  pmw_ssp
				  )
			  ) {
				  tc_ac.stop;
				  log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
				  f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
			  }
              [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
                  log("*** " & testcasename() & ": INFO: Received a DENM with other cause code. ***");
                  repeat;
              }
			  [] tc_ac.timeout {
				  log("*** " & testcasename() & ": PASS: No unexpected DENM received. ***");
				  f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
			  }
			}
            
			// Postamble
			f_poCancelEvent(e_iut, v_actionId);
			f_cfDown();
            
		} // end TC_DEN_SSP_BV_XX
		
		function f_DEN_SSP_BV_01( ) runs on ItsDenm {
			f_DEN_SSP_BV_XX (
				PX_CERT_IUT_DENM_01,
				m_situation(CauseCodeType_trafficCondition_, TrafficConditionSubCauseCode_unavailable_),
			    mw_sspTrafficCondition
			);
		}
              
		function f_DEN_SSP_BV_02( ) runs on ItsDenm {
			f_DEN_SSP_BV_XX (
				PX_CERT_IUT_DENM_02,
				m_situation(CauseCodeType_accident_, AccidentSubCauseCode_unavailable_),
				mw_sspAccident
			);
		}
		
      } // end group denMessageSSP
      
    } // end denMessageTransmission
    
    // 5.2.2
    group denMessageReception {
        
        /**
         * @desc    TP Function for TC_DEN_MSRV_BV_01
         */
        function f_DEN_MSRV_BV_01() runs on ItsDenm {
            
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
            var ActionID v_actionId;
            var integer i;
            
            // Test control
	        if (not PICS_DENM_RECEPTION) {
                log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***");
                setverdict(inconc);
                stop;
    	    }
            
            // 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
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            f_sleep(PX_TNOAC);
            for ( i := 0; i < lengthof(vc_utEvents) and not match(v_actionId, vc_utEvents[i].denMsg.denm.management.actionID); i := i + 1) {
            if (i < lengthof(vc_utEvents)) {
                log("*** " & testcasename() & ": PASS: DENM was transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            }
            else {
                log("*** " & testcasename() & ": FAIL: DENM was not transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_MSRV_BV_01
        
        /**
         * @desc    TP Function for TC_DEN_MSRV_BV_02
         */
        function f_DEN_MSRV_BV_02() runs on ItsDenm {
            
            // Local variables
            var template (value) SituationContainer v_situation1 := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
            var template (value) SituationContainer v_situation2 := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_engineProblem_);
            var TimestampIts v_referenceTime2;
            var ActionID v_actionId;
            var integer i;
            
            // Test control
	        if (not PICS_DENM_RECEPTION) {
                log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***");
                setverdict(inconc);
                stop;
    	    }
            
            // 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
                    ),
                    v_situation1,
                    m_denmLocation_zeroDelta
                )
            );
            
            f_sleep(1.0);
            v_referenceTime2 := f_getCurrentTime();
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        v_actionId,
                        -, -, -, v_referenceTime2
                    ),
                    v_situation2,
                    m_denmLocation_zeroDelta
                )
            );
            
            f_sleep(PX_TAC);
            for ( i := 0; i < lengthof(vc_utEvents) 
                      and not match(v_actionId, vc_utEvents[i].denMsg.denm.management.actionID)
                      and vc_utEvents[i].denMsg.denm.management.referenceTime != v_referenceTime2; i := i + 1) {
            if (i < lengthof(vc_utEvents)) {
                log("*** " & testcasename() & ": PASS: DENM was transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            }
            else {
                log("*** " & testcasename() & ": FAIL: DENM was not transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_MSRV_BV_02
                
        /**
         * @desc    TP Function for TC_DEN_MSRV_BO_03
         */
        function f_DEN_MSRV_BO_03() runs on ItsDenm {
            
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
            var ActionID v_actionId;
            var integer i;
            
            // Test control
	        if (not PICS_DENM_RECEPTION) {
                log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***");
                setverdict(inconc);
                stop;
    	    }
            
            // 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_denmMgmtConTermination(
                    v_situation,
                    m_denmLocation_zeroDelta
                )
            );
            
            f_sleep(PX_TNOAC);
            if (0 != lengthof(vc_utEvents)) {
                log("*** " & testcasename() & ": FAIL: DENM was transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
            }
            else {
                log("*** " & testcasename() & ": PASS: DENM was not transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_MSRV_BO_03
        
        /**
         * @desc    TP Function for TC_DEN_MSRV_BO_04
         */
        function f_DEN_MSRV_BO_04() runs on ItsDenm {
            
            // Local variables
            var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
            var ActionID v_actionId, v_actionIdIut;
            var integer i;
            
            // Test control
	        if (not PICS_DENM_RECEPTION) {
                log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***");
                setverdict(inconc);
                stop;
    	    }
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            v_actionId := f_utTriggerEvent(m_utTriggerEvent(v_situation));
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_actionIdIut := f_sendDenMessage(
                m_denm(
                    m_denmMgmtConTermination(
                        m_actionId(
                            f_increaseSequenceNumber(v_actionId.sequenceNumber)
                    ),
                    v_situation,
                    m_denmLocation_zeroDelta
            if (0 != lengthof(vc_utEvents)) {
                log("*** " & testcasename() & ": FAIL: DENM was transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
            }
            else {
                log("*** " & testcasename() & ": PASS: DENM was not transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            }
            
            // Postamble
            f_poCancelEvent(e_iut, v_actionIdIut);
            f_cfDown();
            
        } // end TC_DEN_MSRV_BO_04
        
        /**
         * @desc    TP Function for TC_DEN_MSRV_BO_05
         */
        function f_DEN_MSRV_BO_05() runs on ItsDenm {
            
            // Local variables
            var template (value) SituationContainer v_situation1 := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
            var template (value) SituationContainer v_situation2 := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_engineProblem_);
            var TimestampIts v_detectionTime := f_getCurrentTime();
            var TimestampIts v_referenceTime1 := f_getCurrentTime();
            var TimestampIts v_referenceTime2 := v_referenceTime1 - 1000;
            var ActionID v_actionId;
            var integer i;
            
            // Test control
	        if (not PICS_DENM_RECEPTION) {
                log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***");
                setverdict(inconc);
                stop;
    	    }
            
            // 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,
                        -, -, -, v_detectionTime, v_referenceTime1
                    ),
                    v_situation1,
                    m_denmLocation_zeroDelta
                )
            );
            
            f_sleep(1.0);
			vc_utEvents := {};
            v_actionId := f_sendDenMessage ( m_denm ( m_denmMgmtCon ( v_actionId, -, -, -, v_detectionTime, v_referenceTime2 ), v_situation2, m_denmLocation_zeroDelta ) );
            for ( i := 0; i < lengthof(vc_utEvents) 
                      and not match(v_actionId, vc_utEvents[i].denMsg.denm.management.actionID)
                      and vc_utEvents[i].denMsg.denm.management.referenceTime != v_referenceTime2; i := i + 1) {
            if (i < lengthof(vc_utEvents)) {
                log("*** " & testcasename() & ": FAIL: DENM was transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
            }
            else {
                log("*** " & testcasename() & ": PASS: DENM was not transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_MSRV_BO_05
        
        /**
         * @desc    TP Function for TC_DEN_MSRV_BO_06
         */
        function f_DEN_MSRV_BO_06() runs on ItsDenm {
            
            // Local variables
            var template (value) SituationContainer v_situation1 := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
            var template (value) SituationContainer v_situation2 := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_engineProblem_);
            var template (value) DecentralizedEnvironmentalNotificationMessage v_denm;
            var TimestampIts v_detectionTime1 := f_getCurrentTime();
            var TimestampIts v_detectionTime2 := v_detectionTime1 - 1000;
            var TimestampIts v_referenceTime1 := v_detectionTime1;
            var ActionID v_actionId;
            var integer i;
            
            // Test control
	        if (not PICS_DENM_RECEPTION) {
                log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***");
                setverdict(inconc);
                stop;
    	    }
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_denm := m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -, - , -, 
                        v_detectionTime1,
                        v_referenceTime1
                    ),
                    v_situation1,
                    m_denmLocation_zeroDelta
                );
            v_actionId := f_sendDenMessage(v_denm);
            
            f_sleep(1.0);
            v_detectionTime2 := valueof(v_denm.management.detectionTime) - 1000;
            v_actionId := f_sendDenMessage ( 
                            m_denm ( m_denmMgmtCon ( v_actionId, -, - , -, v_detectionTime2, v_referenceTime1 ), v_situation2,  m_denmLocation_zeroDelta ) );
            for ( i := 0; i < lengthof(vc_utEvents) 
                      and not match(v_actionId, vc_utEvents[i].denMsg.denm.management.actionID)
                      and vc_utEvents[i].denMsg.denm.management.detectionTime != v_detectionTime2; i := i + 1) {
            if (i < lengthof(vc_utEvents)) {
                log("*** " & testcasename() & ": FAIL: DENM was transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
            }
            else {
                log("*** " & testcasename() & ": PASS: DENM was not transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_MSRV_BO_06
        
        /**
         * @desc    TP Function for TC_DEN_MSRV_BV_07
         */
        function f_DEN_MSRV_BV_07() runs on ItsDenm {
            
            // Local variables
            var template (value) SituationContainer v_situation1 := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
            var template (value) SituationContainer v_situation2 := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_engineProblem_);
            var template (value) DecentralizedEnvironmentalNotificationMessage v_denm;
            var TimestampIts v_detectionTime2 := f_getCurrentTime();
            var TimestampIts v_detectionTime1 :=v_detectionTime2 - 1000;
            var TimestampIts v_referenceTime1 := v_detectionTime2;
            var ActionID v_actionId;
            var integer i;
            
            // Test control
	        if (not PICS_DENM_RECEPTION) {
                log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***");
                setverdict(inconc);
                stop;
    	    }
            
            // Test component configuration
            f_cfUp();
            
            // Test adapter configuration
            
            // Preamble
            f_prInitialState();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            v_denm := m_denm(
                    m_denmMgmtCon(
                        m_tsActionId,
                        -, - , -,
                        v_detectionTime1,
                        v_referenceTime1
                    ),
                    v_situation1,
                    m_denmLocation_zeroDelta
            v_actionId := f_sendDenMessage(v_denm);
            
            f_sleep(1.0);
            v_detectionTime2 := valueof(v_denm.management.detectionTime) + 1000;
            v_actionId := f_sendDenMessage(
                m_denm(
                    m_denmMgmtCon(
                        v_actionId,
                        -, - , -,
                        v_detectionTime2,
                        v_referenceTime1
                    ),
                    v_situation2,
                    m_denmLocation_zeroDelta
                )
            );
            
            f_sleep(PX_TAC);
            for ( i := 0; i < lengthof(vc_utEvents) 
                      and not match(v_actionId, vc_utEvents[i].denMsg.denm.management.actionID)
                      and vc_utEvents[i].denMsg.denm.management.detectionTime != v_detectionTime2; i := i + 1) {
            if (i < lengthof(vc_utEvents)) {
                log("*** " & testcasename() & ": PASS: DENM was transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            }
            else {
                log("*** " & testcasename() & ": FAIL: DENM was not transmitted to upper layer ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
            }
            
            // Postamble
            f_poCancelEvent(e_ets, v_actionId);
            f_cfDown();
            
        } // end TC_DEN_MSRV_BV_07
        
        group denMessageSSP {

            function f_DEN_MSRV_BO_08_XX(
            	in charstring p_certName,
			    in template (value) SituationContainer p_situation
            ) runs on ItsDenm {
                
                // Local variables
                var ActionID v_actionId;
                var integer i;
                
				// Test control
				if (not PICS_DENM_RECEPTION) {
					log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***");
					setverdict(inconc);
					stop;
				}
    	        if (not PICS_IS_IUT_SECURED) {
                    log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***");
                    setverdict(inconc);
                    stop;
        	    }
                
                // Test component configuration
                f_cfUp();
                
                // Test adapter configuration
                // TODO: instruct adapter to use p_certName to sign message 
                
                // Preamble
                f_prInitialState();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_actionId := f_sendDenMessage(
                    m_denm(
                        m_denmMgmtCon(
                            m_tsActionId
                        ),
                        p_situation,
                        m_denmLocation_zeroDelta
                    )
                );
                
                f_sleep(PX_TNOAC);
                for ( i := 0; i < lengthof(vc_utEvents) and not match(v_actionId, vc_utEvents[i].denMsg.denm.management.actionID); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utEvents)) {
                    log("*** " & testcasename() & ": FAIL: DENM was treated as valid and transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: DENM was treated as invalid and was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                }
                
                // Postamble
                f_poCancelEvent(e_ets, v_actionId);
                f_cfDown();
                
            } // end TC_DEN_MSRV_BV_01
            
			function f_DEN_MSRV_BO_08_01 () runs on ItsDenm {
				
				f_DEN_MSRV_BO_08_XX(
					"CERT_TS_DENM_01",
					m_situation(CauseCodeType_trafficCondition_, TrafficConditionSubCauseCode_unavailable_)
				);
			}

            function f_DEN_MSRV_BO_08_02 () runs on ItsDenm {
				
				f_DEN_MSRV_BO_08_XX(
					"CERT_TS_DENM_02",
					m_situation(CauseCodeType_accident_, AccidentSubCauseCode_unavailable_)
				);
            }

        	function f_DEN_MSRV_BO_09_XX(
            	in charstring p_certName,
				in template (value) SituationContainer p_situation1,
			    in template (value) SituationContainer p_situation2
            ) runs on ItsDenm {
                
                // Local variables
                var TimestampIts v_referenceTime2;
                var ActionID v_actionId;
                var integer i;
                
                // Test control
    	        if (not PICS_DENM_RECEPTION) {
                    log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***");
                    setverdict(inconc);
                    stop;
        	    }
       	        if (not PICS_IS_IUT_SECURED) {
                    log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***");
                    setverdict(inconc);
                    stop;
            	}
                
                // Test component configuration
                f_cfUp();
                
                // Test adapter configuration
                
                // TODO: instruct adapter to use c_certName_FullSSP to sign message 
                
                // Preamble
                f_prInitialState();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_actionId := f_sendDenMessage(
                    m_denm(
                        m_denmMgmtCon(
                            m_tsActionId
                        ),
                        p_situation1,
                        m_denmLocation_zeroDelta
                    )
                );
                
                f_sleep(1.0);
                // TODO: instruct adapter to use p_certName to sign message 
                v_referenceTime2 := f_getCurrentTime();
                v_actionId := f_sendDenMessage(
                    m_denm(
                        m_denmMgmtCon(
                            v_actionId,
                            -, -, -, v_referenceTime2
                        ),
                        p_situation2,
                        m_denmLocation_zeroDelta
                    )
                );
                
                f_sleep(PX_TAC);
                for ( i := 0; i < lengthof(vc_utEvents) 
                          and not match(v_actionId, vc_utEvents[i].denMsg.denm.management.actionID)
                          and vc_utEvents[i].denMsg.denm.management.referenceTime != v_referenceTime2; i := i + 1) {
                    // empty on purpose 
                }