Newer
Older
/**
* @author ETSI / STF484
* @version $URL$
* $Id$
* @desc DENM TP functions
*
*/
module ItsDenm_TpFunctions {
// LibCommon
import from LibCommon_Sync all;
import from LibCommon_Time all;
import from LibCommon_VerdictControl all;
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
// LibIts
import from LibItsCommon_Functions all;
import from LibItsCommon_TypesAndValues all;
import from LibItsDenm_TestSystem all;
import from LibItsDenm_Functions all;
import from LibItsDenm_Templates all;
import from LibItsDenm_TypesAndValues all;
import from LibItsDenm_Pics all;
import from LibItsDenm_Pixits all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
import from ITS_Container language "ASN.1:1997" all;
// 5.2.1
group denMessageTransmission {
// 5.2.1.1
group denMessageFormat {
/**
* @desc TP Function for TC_DEN_MSGF_BV_01
*/
function f_DEN_MSGF_BV_01() runs on ItsDenm {
// Local variables
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_denmInd(
mw_denmPdu(
mw_denm,
mw_anyStationId,
ItsPduHeader_protocolVersion_currentVersion_,
ItsPduHeader_messageID_denm_
)
)
) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received a DENM with incorrect header information. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_MSGF_BV_01
/**
* @desc TP Function for TC_DEN_MSGF_BV_02
*/
function f_DEN_MSGF_BV_02() runs on ItsDenm {
// Local variables
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));
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
tc_ac.start;
alt {
[] denmPort.receive(
mw_denmInd(
mw_denmPdu(
mw_denm(
mw_anyDenmMgmtCon,
-,
mw_denmLocationWithTrace({ ?, * })
)
)
)
) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received a DENM with incorrect location container information. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_MSGF_BV_02
} // end denMessageFormat
// 5.2.1.2
group denEventGeneration {
/**
* @desc TP Function for TC_DEN_EVGN_BV_01
*/
function f_DEN_EVGN_BV_01() runs on ItsDenm {
// Local variables
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));
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
tc_ac.start;
alt {
[] denmPort.receive(
mw_denmInd(
mw_anyDenmPdu(
mw_itsPduHeader,
mw_denm (mw_anyDenmMgmtCon)
)
)
) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received a DENM with incorrect header and management information. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_EVGN_BV_01
/**
* @desc TP Function for TC_DEN_EVGN_BV_02
*/
function f_DEN_EVGN_BV_02() runs on ItsDenm {
// Local variables
var template (value) SituationContainerList v_situations := {
m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_),
m_situation(CauseCodeType_accident_, AccidentSubCauseCode_unavailable_),
m_situation(CauseCodeType_roadworks_, RoadworksSubCauseCode_unavailable_),
m_situation(CauseCodeType_slowVehicle_, SlowVehicleSubCauseCode_unavailable_)
};
var boolean v_success := true;
var ActionIDList v_actionIds;
var DenmInd v_denmInd;
var integer i;
// 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();
for (i := 0; i < lengthof(v_situations) - 1; i := i + 1) {
f_utTriggerEvent(m_utTriggerEvent(v_situations[i]));
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
f_utTriggerEvent(m_utTriggerEvent(v_situations[lengthof(v_situations) - 1]));
f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
v_actionIds[lengthof(v_actionIds) - 1] := v_denmInd.msgIn.denm.management.actionID;
//check the action id
for (i := 0; i < lengthof(v_actionIds) - 1; i := i + 1) {
if (v_actionIds[lengthof(v_actionIds) - 1].sequenceNumber == v_actionIds[i].sequenceNumber) {
v_success := false;
}
}
if (v_success==true) {
log("*** " & testcasename() & ": PASS: actionID field indicating unused value. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
log("*** " & testcasename() & ": FAIL: actionID field indicating used value. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
// Postamble
for (i := 0; i < lengthof(v_actionIds); i := i + 1) {
f_poCancelEvent(e_iut, v_actionIds[i]);
}
f_cfDown();
} // end TC_DEN_EVGN_BV_02
/**
* @desc TP Function for TC_DEN_EVGN_BV_03
*/
function f_DEN_EVGN_BV_03() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var ActionID v_actionId;
var DenmInd v_denmInd;
// 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_denmInd(
mw_denmPdu(
mw_denm(
mw_denmMgmtConWithActionID(
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
)
)
)
)
) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_EVGN_BV_03
/**
* @desc TP Function for TC_DEN_EVGN_BV_04
*/
function f_DEN_EVGN_BV_04() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var ActionID v_actionId;
var DenmInd v_denmInd;
// 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));
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
tc_ac.start;
alt {
[] denmPort.receive(
mw_denmInd(
mw_denmPdu(
mw_denm(
mw_anyDenmMgmtCon,
v_situation
)
)
)
) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_EVGN_BV_04
/**
* @desc TP Function for TC_DEN_EVGN_BV_05
*/
function f_DEN_EVGN_BV_05() runs on ItsDenm {
// Local variables
var template (value) SituationContainerList v_situations := {
m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_),
m_situation(CauseCodeType_accident_, AccidentSubCauseCode_unavailable_),
m_situation(CauseCodeType_roadworks_, RoadworksSubCauseCode_unavailable_),
m_situation(CauseCodeType_slowVehicle_, SlowVehicleSubCauseCode_unavailable_)
};
var ActionIDList v_actionIds;
var DenmInd v_denmInd;
var integer i;
var TimestampIts v_timestampIts;
// 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();
for (i := 0; i < lengthof(v_situations) - 1; i := i + 1) {
f_utTriggerEvent(m_utTriggerEvent(v_situations[i]));
f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
v_actionIds[i] := v_denmInd.msgIn.denm.management.actionID;
v_timestampIts := v_denmInd.msgIn.denm.management.referenceTime;
}
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
f_utTriggerEvent(m_utTriggerEvent(v_situations[lengthof(v_situations) - 1]));
tc_ac.start;
alt {
[] denmPort.receive(
mw_denmInd(
mw_denmPdu(
mw_denm(
mw_denmMgmtConWithReferenceTime(?)
)
)
)
) -> value v_denmInd {
tc_ac.stop;
v_actionIds[lengthof(v_actionIds)] := v_denmInd.msgIn.denm.management.actionID;
if (v_timestampIts<v_denmInd.msgIn.denm.management.referenceTime) {
log("*** " & testcasename() & ": PASS: Reference Time has increased since last received DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
log("*** " & testcasename() & ": FAIL: Reference Time has not increased since last received DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
}
// Postamble
for (i := 0; i < lengthof(v_actionIds); i := i + 1) {
f_poCancelEvent(e_iut, v_actionIds[i]);
}
f_cfDown();
} // end TC_DEN_EVGN_BV_05
/**
* @desc TP Function for TC_DEN_EVGN_BV_07
*/
function f_DEN_EVGN_BV_07() runs on ItsDenm {
// Local variables
var template (value) SituationContainerList v_situations := {
m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_),
m_situation(CauseCodeType_accident_, AccidentSubCauseCode_unavailable_),
m_situation(CauseCodeType_roadworks_, RoadworksSubCauseCode_unavailable_),
m_situation(CauseCodeType_slowVehicle_, SlowVehicleSubCauseCode_unavailable_)
};
var SequenceNumber v_sequenceNumber;
var ActionID v_actionId;
var DenmInd v_denmInd;
var integer i;
// 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();
for (i := 0; i < lengthof(v_situations) - 1; i := i + 1) {
f_utTriggerEvent(m_utTriggerEvent(v_situations[i]));
f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
f_poCancelEvent(e_iut, v_denmInd.msgIn.denm.management.actionID);
}
//save the last sequence number
v_sequenceNumber := v_denmInd.msgIn.denm.management.actionID.sequenceNumber;
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
f_utTriggerEvent(m_utTriggerEvent(v_situations[lengthof(v_situations) - 1]));
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
tc_ac.start;
alt {
[] denmPort.receive(
mw_denmInd(
mw_denmPdu(
mw_denm(
mw_denmMgmtConWithActionID(
mw_actionId(-, f_increaseSequenceNumber(v_sequenceNumber))
)
)
)
)
) -> value v_denmInd {
tc_ac.stop;
v_actionId := v_denmInd.msgIn.denm.management.actionID;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_EVGN_BV_07
/**
* @desc TP Function for TC_DEN_EVGN_BV_10
*/
function f_DEN_EVGN_BV_10() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation (CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_ );
var StationID v_stationId;
var DenmInd v_denmInd;
// 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_stationId := f_getIutStationId ( );
f_utChangePseudonym ( m_utChangePseudonym );
f_utTriggerEvent ( m_utTriggerEvent ( v_situation) );
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
tc_ac.start;
alt {
[] denmPort.receive ( mw_denmInd ( mw_denmPdu ( mw_denm ( mw_anyDenmMgmtCon ) ) ) ) -> value v_denmInd {
tc_ac.stop;
if ( v_denmInd.msgIn.denm.management.actionID.originatingStationID != v_stationId ) {
log("*** " & testcasename() & ": PASS: Successfully received expected DENM - Pseudonym changed. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
log("*** " & testcasename() & ": FAIL: received expected DENM - Pseudonym not changed. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
}
// Postamble
f_cfDown();
} // end TC_DEN_EVGN_BV_10
} // end denEventGeneration
// 5.2.1.3
group denEventUpdate {
/**
* @desc TP Function for TC_DEN_EVUP_BV_02
*/
function f_DEN_EVUP_BV_01() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var ActionID v_actionId;
var DenmInd v_denmInd;
// Test control
if (not PICS_DENM_UPDATE) {
log("*** " & testcasename() & ": PICS_DENM_UPDATE required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(m_utTriggerEvent(v_situation));
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 := VehicleBreakdownSubCauseCode_engineProblem_;
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
f_utUpdateEvent(m_utUpdateEvent(v_actionId, v_situation));
tc_ac.start;
alt {
[] denmPort.receive(
mw_denmInd(
mw_anyDenmPdu(
mw_itsPduHeader,
mw_denm (mw_anyDenmMgmtCon)
)
)
) -> value v_denmInd {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_EVUP_BV_01
/**
* @desc TP Function for TC_DEN_EVUP_BV_02
*/
function f_DEN_EVUP_BV_02() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var ActionID v_actionId;
var DenmInd v_denmInd;
// Test control
if (not PICS_DENM_UPDATE) {
log("*** " & testcasename() & ": PICS_DENM_UPDATE required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(m_utTriggerEvent(v_situation));
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 := VehicleBreakdownSubCauseCode_engineProblem_;
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
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);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_EVUP_BV_02
/**
* @desc TP Function for TC_DEN_EVUP_BV_03
*/
function f_DEN_EVUP_BV_03() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var TimestampIts v_referenceTime1 , v_timestampIts , v_msgtimestamp;
var integer v_diff;
var ActionID v_actionId;
var DenmInd v_denmInd;
// Test control
if (not PICS_DENM_UPDATE) {
log("*** " & testcasename() & ": PICS_DENM_UPDATE required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(m_utTriggerEvent(v_situation));
f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
v_timestampIts := f_getCurrentTime();
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_referenceTime1 := v_denmInd.msgIn.denm.management.referenceTime;
v_diff := v_timestampIts - v_referenceTime1;
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_situation.eventType.subCauseCode := VehicleBreakdownSubCauseCode_engineProblem_;
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
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 ) ) {
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
log("*** " & testcasename() & ": FAIL: ReferenceTime not updated correctly ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_EVUP_BV_03
/**
* @desc TP Function for TC_DEN_EVUP_BO_04
*/
function f_DEN_EVUP_BO_04() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var ActionID v_actionId;
var DenmInd v_denmInd;
// Test control
if (not PICS_DENM_UPDATE) {
log("*** " & testcasename() & ": PICS_DENM_UPDATE required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(m_utTriggerEvent(v_situation));
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 := VehicleBreakdownSubCauseCode_engineProblem_;
f_utUpdateEvent(m_utUpdateEvent(m_actionId(f_increaseSequenceNumber(v_actionId.sequenceNumber), f_getIutStationId()), v_situation));
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 {
log("*** " & testcasename() & ": FAIL: Received updated DENM for the actionId which is not in originator ITS-S message table. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_noac.timeout {
log("*** " & testcasename() & ": PASS: No DENM was sent. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
}
// Postamble
f_poCancelEvent(e_iut, v_actionId);
f_cfDown();
} // end TC_DEN_EVUP_BO_04
} // end denEventUpdate
// 5.2.1.4
group denEventTermination {
/**
* @desc TP Function for TC_DEN_EVTR_BV_01
*/
function f_DEN_EVTR_BV_01() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var ActionID v_actionId;
var DenmInd v_denmInd;
// Test control
if (not PICS_DENM_CANCELLATION) {
log("*** " & testcasename() & ": PICS_DENM_CANCELLATION required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(m_utTriggerEvent(v_situation, c_duration_10sec));
f_awaitDenMessage ( mw_denmInd ( mw_denmPdu ( mw_denm ( mw_denmMgmtCon ( mw_anyActionId, -, -, c_duration_10sec ) ) ) ) , v_denmInd );
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 ( mw_denmMgmtConTermination ( v_actionId, -, -, -, -, isCancellation ))))) -> value v_denmInd {
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
}
// Postamble
f_cfDown();
} // end TC_DEN_EVTR_BV_01
/**
* @desc TP Function for TC_DEN_EVTR_BV_02
*/
function f_DEN_EVTR_BV_02() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var ActionID v_actionId;
var DenmInd v_denmInd;
// Test control
if (not PICS_DENM_NEGATION) {
log("*** " & testcasename() & ": PICS_DENM_NEGATION required for executing the TC ***");
setverdict(inconc);
stop;
}
// 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 ) );
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 ( mw_denmMgmtConTermination ( v_actionId, f_getIutStationType(), -, -, -, isNegation ))))) -> value v_denmInd {
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
}
// Postamble
f_cfDown();
} // end TC_DEN_EVTR_BV_02
/**
* @desc TP Function for TC_DEN_EVTR_BV_03
*/
function f_DEN_EVTR_BV_03() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var TimestampIts v_referenceTime1 := f_getCurrentTime();
var TimestampIts v_referenceTime2;
var ActionID v_actionId;
var DenmInd v_denmInd;
// Test control
if (not PICS_DENM_NEGATION) {
log("*** " & testcasename() & ": PICS_DENM_NEGATION required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
v_actionId := f_sendDenMessage ( m_denm ( m_denmMgmtCon ( m_tsActionId, -, -, -, v_referenceTime1, v_referenceTime1 ), v_situation, m_denmLocation_zeroDelta ) );
v_referenceTime2 := f_getCurrentTime();
v_situation.eventType.subCauseCode := VehicleBreakdownSubCauseCode_engineProblem_;
v_actionId := f_sendDenMessage ( m_denm ( m_denmMgmtCon ( m_tsActionId, -, -, -, v_referenceTime2, v_referenceTime2 ), v_situation, m_denmLocation_zeroDelta ) );
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 ( mw_denmMgmtConTermination ( v_actionId, -, v_referenceTime2, -, -, isNegation ))))) -> value v_denmInd {
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
}
// Postamble
f_cfDown();
} // end TC_DEN_EVTR_BV_03
/**
* @desc TP Function for TC_DEN_EVTR_BV_04
*/
function f_DEN_EVTR_BV_04() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var ActionID v_actionId;
var DenmInd v_denmInd;
// Test control
if (not PICS_DENM_CANCELLATION) {
log("*** " & testcasename() & ": PICS_DENM_CANCELLATION required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(m_utTriggerEvent(v_situation, c_duration_10sec));
f_awaitDenMessage( mw_denmInd ( mw_denmPdu ( mw_denm ( mw_denmMgmtCon ( mw_anyActionId ) ) ) ), v_denmInd );
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 ( mw_denmMgmtConTermination ( v_actionId, -, -, -, -, isCancellation ), omit, omit, omit ) ) ) ) -> value v_denmInd {
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
}
// Postamble
f_cfDown();
} // end TC_DEN_EVTR_BV_04
/**
* @desc TP Function for TC_DEN_EVTR_BV_05
*/
function f_DEN_EVTR_BV_05() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
var ActionID v_actionId;
var DenmInd v_denmInd;
// Test control
if (not PICS_DENM_NEGATION) {
log("*** " & testcasename() & ": PICS_DENM_NEGATION required for executing the TC ***");
setverdict(inconc);
stop;
}
// 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 ) );
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 ( mw_denmMgmtConTermination ( v_actionId, -, -, -, -, isNegation ), omit, omit, omit ) ) ) ) -> value v_denmInd {
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
}
// Postamble
f_cfDown();
} // end TC_DEN_EVTR_BV_05
/**
* @desc TP Function for TC_DEN_EVTR_BO_06
*/
function f_DEN_EVTR_BO_06() runs on ItsDenm {
// Local variables
var template (value) SituationContainerList v_situations := {
m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_),
m_situation(CauseCodeType_accident_, AccidentSubCauseCode_unavailable_),
m_situation(CauseCodeType_roadworks_, RoadworksSubCauseCode_unavailable_),
m_situation(CauseCodeType_slowVehicle_, SlowVehicleSubCauseCode_unavailable_)
};
var ActionID v_unknownActionId;
var ActionIDList v_actionIds;
var DenmInd v_denmInd;
var integer i;
// Test control
if (not PICS_DENM_NEGATION and not PICS_DENM_CANCELLATION) {
log("*** " & testcasename() & ": PICS_DENM_NEGATION OR PICS_DENM_CANCELLATION required for executing the TC ***");
setverdict(inconc);
stop;
}
// 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]));
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(
f_increaseSequenceNumber(
v_actionIds[lengthof(v_actionIds) - 1].sequenceNumber
v_actionIds[lengthof(v_actionIds) - 1].originatingStationID
));
f_utTerminateEvent(m_utEventCancellation(v_unknownActionId));
alt {
[] denmPort.receive(
mw_denmInd(
mw_anyDenmPdu(
mw_itsPduHeader,
mw_denm (
mw_denmMgmtCon(v_unknownActionId)
)
)
)
) -> value v_denmInd {
log("*** " & testcasename() & ": FAIL: Received termination DENM for the unknown actionId. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_noac.timeout {
log("*** " & testcasename() & ": PASS: No termination DENM was sent. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
}
// Postamble
for (i := 0; i < lengthof(v_situations); i := i + 1) {
f_poCancelEvent(e_iut, v_actionIds[i]);
}
f_cfDown();
} // end TC_DEN_EVTR_BO_06
/**
* @desc TP Function for TC_DEN_EVTR_BO_07
*/
function f_DEN_EVTR_BO_07() runs on ItsDenm {
// Local constants
const SequenceNumber v_initialSequenceNumber := 0;
// Local variables
var template (value) SituationContainerList v_situations := {
m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_),
m_situation(CauseCodeType_accident_, AccidentSubCauseCode_unavailable_),
m_situation(CauseCodeType_roadworks_, RoadworksSubCauseCode_unavailable_),
m_situation(CauseCodeType_slowVehicle_, SlowVehicleSubCauseCode_unavailable_)
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
};
var SequenceNumber v_sequenceNumber := v_initialSequenceNumber;
var ActionID v_unknownActionId;
var ActionIDList v_actionIds;
var DenmInd v_denmInd;
var integer i;
// Test control
if (not PICS_DENM_NEGATION and not PICS_DENM_CANCELLATION) {
log("*** " & testcasename() & ": PICS_DENM_NEGATION OR PICS_DENM_CANCELLATION required for executing the TC ***");
setverdict(inconc);
stop;
}
// 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 ) );
}
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_unknownActionId := valueof(m_actionId(
f_increaseSequenceNumber(
v_actionIds[lengthof(v_actionIds) - 1].sequenceNumber
),
f_getTsStationId()
));
f_utTerminateEvent(m_utEventCancellation(v_unknownActionId));
alt {
[] denmPort.receive( mw_denmInd( mw_anyDenmPdu( mw_itsPduHeader, mw_denm ( mw_denmMgmtCon(v_unknownActionId) ) ) ) ) -> value v_denmInd {
log("*** " & testcasename() & ": FAIL: Received termination DENM for the unknown actionId. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_noac.timeout {
log("*** " & testcasename() & ": PASS: No termination DENM was sent. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
}
// 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 TP Function for TC_DEN_EVTR_BV_08
*/
function f_DEN_EVTR_BV_08() runs on ItsDenm {
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var TimestampIts v_referenceTime1 , v_timestampIts , v_msgtimestamp;
var integer v_diff;
var ActionID v_actionId;
var DenmInd v_denmInd;
// Test control
if (not PICS_DENM_CANCELLATION) {
log("*** " & testcasename() & ": PICS_DENM_CANCELLATION required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(m_utTriggerEvent(v_situation));
f_awaitDenMessage(mw_denmInd(mw_anyDenmPdu), v_denmInd);
v_timestampIts := f_getCurrentTime();
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_referenceTime1 := v_denmInd.msgIn.denm.management.referenceTime;
v_diff := v_timestampIts - v_referenceTime1;
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 ( mw_denmMgmtConTermination ( v_actionId, -, -, -, -, isCancellation ) ) ) ) ) -> value v_denmInd {
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
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 ) ) {
log("*** " & testcasename() & ": PASS: Successfully received expected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
log("*** " & testcasename() & ": FAIL: ReferenceTime not updated correctly ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_EVTR_BV_08
} // end denEventTermination
// 5.2.1.5
group denMessageRepetition {
/**
* @desc TP Function for TC_DEN_EVRP_TI_01
*/
function f_DEN_EVRP_TI_01() runs on ItsDenm {
// Local constants
const TransmissionInterval c_repetitionInterval := c_interval_1sec; // INTERVAL_1
const ValidityDuration c_validityDuration := c_duration_10sec; // DURATION_2
const ValidityDuration c_repetitionDuration := c_validityDuration; // DURATION_1
const float c_lowerRepetitionInterval := int2float(c_repetitionInterval)*0.95;
const float c_upperRepetitionInterval := int2float(c_repetitionInterval)*1.05;
// Local variables
var template (value) SituationContainer v_situation := m_situation (CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_ );
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
var template (present) DenmInd v_expectedDenmInd :=
mw_denmInd ( mw_denmPdu ( mw_denm ( mw_denmMgmtCon ( mw_actionId, -, -, c_validityDuration ) ) ) );
var ActionID v_actionId;
var DenmInd v_denmInd;
// 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();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent ( m_utTriggerEvent ( v_situation, c_validityDuration, c_repetitionDuration, c_repetitionInterval ) );
f_awaitDenMessage(v_expectedDenmInd, v_denmInd);
t_repetition.start(2.0 * (int2float(c_repetitionInterval)/1000.0));
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_expectedDenmInd.msgIn.denm.management.actionID := v_actionId;
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
alt {
[] denmPort.receive(v_expectedDenmInd) -> value v_denmInd {
if (match(t_repetition.read*1000.0, (c_lowerRepetitionInterval..c_upperRepetitionInterval))) {
t_repetition.stop;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM in the expected interval. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
t_repetition.stop;
log("*** " & testcasename() & ": FAIL: Received expected DENM, interval was not correct. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
[] 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_error);
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
}
}
// Postamble
f_poCancelEvent(e_iut, v_actionId);
f_cfDown();
} // end TC_DEN_EVRP_TI_01
/**
* @desc TP Function for TC_DEN_EVRP_BV_02
*/
function f_DEN_EVRP_BV_02() runs on ItsDenm {
// Local constants
const ValidityDuration c_validityDuration := c_duration_10sec;
const TransmissionInterval c_repetitionInterval := c_interval_5sec;
const ValidityDuration c_repetitionDuration := c_validityDuration;
const float c_lowerRepetitionInterval := int2float(c_repetitionInterval)*0.95;
const float c_upperRepetitionInterval := int2float(c_repetitionInterval)*1.05;
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
var template (present) DenmInd v_expectedDenmInd :=
mw_denmInd(mw_denmPdu(mw_denm( mw_denmMgmtCon( mw_actionId, -, -, c_validityDuration))));
var ActionID v_actionId;
var DenmInd v_denmInd;
// 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();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent( m_utTriggerEvent( v_situation, c_validityDuration, c_repetitionDuration, c_repetitionInterval ) );
f_awaitDenMessage(v_expectedDenmInd, v_denmInd);
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_expectedDenmInd.msgIn.denm.management.actionID := v_actionId;
//update event after 1 second
tc_noac.start(1.0);
tc_noac.timeout;
v_situation.eventType.subCauseCode := VehicleBreakdownSubCauseCode_engineProblem_;
f_utUpdateEvent(m_utUpdateEvent(v_actionId, v_situation));
v_expectedDenmInd.msgIn.denm.situation := v_situation;
f_awaitDenMessage(v_expectedDenmInd, v_denmInd);
t_repetition.start(2.0 * (int2float(c_repetitionInterval)/1000.0));
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
alt {
[] denmPort.receive(v_expectedDenmInd) -> value v_denmInd {
if (match(t_repetition.read*1000.0, (c_lowerRepetitionInterval..c_upperRepetitionInterval))) {
t_repetition.stop;
log("*** " & testcasename() & ": PASS: Successfully received expected DENM in the expected interval. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
t_repetition.stop;
log("*** " & testcasename() & ": FAIL: Received expected DENM, interval was not correct. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
[] 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_02
/**
* @desc TP Function for TC_DEN_EVRP_BV_03
*/
function f_DEN_EVRP_BV_03() runs on ItsDenm {
// Local constants
const ValidityDuration c_validityDuration := c_duration_10sec;
const TransmissionInterval c_repetitionInterval := c_interval_4sec;
const ValidityDuration c_repetitionDuration := c_validityDuration;
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
var template (present) DenmInd v_expectedDenmInd :=
mw_denmInd(mw_denmPdu(mw_denm(mw_denmMgmtCon(mw_actionId, -, -, c_validityDuration))));
var ActionID v_actionId;
var DenmInd v_denmInd;
var integer i;
// Local timers
timer t_validity;
// 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();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(m_utTriggerEvent( v_situation, c_validityDuration, c_repetitionDuration, c_repetitionInterval ));
f_awaitDenMessage(v_expectedDenmInd, v_denmInd);
t_validity.start(1.5 * int2float(c_validityDuration));
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_expectedDenmInd.msgIn.denm.management.actionID := v_actionId;
//await retransmitted DENM message based on the repetition interval in between the validity duration
for (i:=0; i<(c_validityDuration/(c_repetitionInterval/1000)); i := i + 1) {
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
f_awaitDenMessage(v_expectedDenmInd, v_denmInd);
}
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
alt {
[] t_validity.timeout {
log("*** " & testcasename() & ": PASS: Retransmission of DENM stopped successfully. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(v_expectedDenmInd) {
t_validity.stop;
log("*** " & testcasename() & ": FAIL: Retransmission of DENM was not stopped. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
t_validity.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poCancelEvent(e_iut, v_actionId);
f_cfDown();
} // end TC_DEN_EVRP_BV_03
/**
* @desc TP Function for TC_DEN_EVRP_BV_04
*/
function f_DEN_EVRP_BV_04() runs on ItsDenm {
// Local constants
const ValidityDuration c_validityDuration := c_duration_10sec;
const TransmissionInterval c_repetitionInterval := c_interval_2sec;
const ValidityDuration c_repetitionDuration := c_duration_5sec;
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
var template (present) DenmInd v_expectedDenmInd := mw_denmInd(mw_denmPdu(mw_denm(mw_denmMgmtCon(mw_actionId, -, -, c_validityDuration))));
var ActionID v_actionId;
var DenmInd v_denmInd;
var integer i;
// 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();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(m_utTriggerEvent(v_situation, c_validityDuration, c_repetitionDuration, c_repetitionInterval ));
f_awaitDenMessage(v_expectedDenmInd, v_denmInd);
t_repetition.start(1.5 * int2float(c_repetitionDuration));
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_expectedDenmInd.msgIn.denm.management.actionID := v_actionId;
//await retransmitted DENM message based on the repetition interval in between the repetition duration
for (i:=0; i<(c_repetitionDuration/(c_repetitionInterval/1000)); i := i + 1) {
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
f_awaitDenMessage(v_expectedDenmInd, v_denmInd);
}
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
alt {
[] t_repetition.timeout {
log("*** " & testcasename() & ": PASS: Retransmission of DENM stopped successfully. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(v_expectedDenmInd) -> value v_denmInd {
t_repetition.stop;
log("*** " & testcasename() & ": FAIL: Retransmission of DENM was not stopped. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
t_repetition.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poCancelEvent(e_iut, v_actionId);
f_cfDown();
} // end TC_DEN_EVRP_BV_04
/**
* @desc TP Function for TC_DEN_EVRP_BV_05
*/
function f_DEN_EVRP_BV_05() runs on ItsDenm {
// Local constants
const ValidityDuration c_validityDuration := c_duration_10sec;
const ValidityDuration c_repetitionDuration := c_validityDuration;
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
var template (present) DenmInd v_expectedDenmInd := mw_denmInd(
mw_denmPdu(
mw_denm(
mw_denmMgmtCon(
mw_actionId,
-,
-,
-,
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
)
)
)
);
var ActionID v_actionId;
var DenmInd v_denmInd;
var integer i;
// Local timers
timer t_validity;
// 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();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(
m_utTriggerEvent(
v_situation,
c_validityDuration,
c_repetitionDuration,
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
omit //no repetitionInterval
)
);
f_awaitDenMessage(v_expectedDenmInd, v_denmInd);
t_validity.start(1.5 * int2float(c_validityDuration));
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_expectedDenmInd.msgIn.denm.management.actionID := v_actionId;
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
alt {
[] t_validity.timeout {
log("*** " & testcasename() & ": PASS: No retransmission of DENM occured as expected. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(v_expectedDenmInd) -> value v_denmInd {
t_validity.stop;
log("*** " & testcasename() & ": FAIL: Unexpected retransmission of DENM occured. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
t_validity.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poCancelEvent(e_iut, v_actionId);
f_cfDown();
} // end TC_DEN_EVRP_BV_05
/**
* @desc TP Function for TC_DEN_EVRP_BV_06
*/
function f_DEN_EVRP_BV_06() runs on ItsDenm {
// Local constants
const ValidityDuration c_validityDuration := c_duration_10sec;
const TransmissionInterval c_repetitionInterval := c_interval_2sec;
// Local variables
var template (value) SituationContainer v_situation := m_situation(CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_);
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
var template (present) DenmInd v_expectedDenmInd := mw_denmInd(
mw_denmPdu(
mw_denm(
mw_denmMgmtCon(
mw_actionId,
-,
-,
c_validityDuration
)
)
)
);
var ActionID v_actionId;
var DenmInd v_denmInd;
var integer i;
// Local timers
timer t_validity;
// 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();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent(
m_utTriggerEvent(
v_situation,
c_validityDuration,
omit, //no repetitionDuration
c_repetitionInterval
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
)
);
f_awaitDenMessage(v_expectedDenmInd, v_denmInd);
t_validity.start(1.5 * int2float(c_validityDuration));
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_expectedDenmInd.msgIn.denm.management.actionID := v_actionId;
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
alt {
[] t_validity.timeout {
log("*** " & testcasename() & ": PASS: No retransmission of DENM occured as expected. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] denmPort.receive(v_expectedDenmInd) -> value v_denmInd {
t_validity.stop;
log("*** " & testcasename() & ": FAIL: Unexpected retransmission of DENM occured. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
t_validity.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poCancelEvent(e_iut, v_actionId);
f_cfDown();
} // end TC_DEN_EVRP_BV_06
/**
* @desc TP Function for TC_DEN_EVRP_BV_08
*/
function f_DEN_EVRP_BV_08() 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;
// Local variables
var template (value) SituationContainer v_situation := m_situation (CauseCodeType_vehicleBreakdown_, VehicleBreakdownSubCauseCode_unavailable_ );
var template (present) DenmInd v_expectedDenmInd :=
mw_denmInd ( mw_denmPdu ( mw_denm ( mw_denmMgmtCon ( mw_actionId, -, -, c_duration2 ) ) ) );
var ActionID v_actionId;
var DenmInd v_denmInd;
// 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();
// Test adapter configuration
// Preamble
f_prInitialState();
f_utTriggerEvent ( m_utTriggerEvent ( v_situation, c_duration2, c_duration1, c_interval1 ) );
f_awaitDenMessage ( v_expectedDenmInd, v_denmInd );
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_expectedDenmInd.msgIn.denm.management.actionID := ?;
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
f_utChangePseudonym ( m_utChangePseudonym );
tc_ac.start;
alt {
[] denmPort.receive ( v_expectedDenmInd ) -> value v_denmInd {
tc_ac.stop;
if ( v_denmInd.msgIn.denm.management.actionID.originatingStationID != v_actionId.originatingStationID ) {
log("*** " & testcasename() & ": PASS: Successfully received expected DENM - Pseudonym changed. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
log("*** " & testcasename() & ": FAIL: received expected DENM - Pseudonym not changed. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
[] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.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_08
/**
* @desc TP Function for TC_DEN_EVRP_BV_09
*/
function f_DEN_EVRP_BV_09() 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_expectedDenmInd :=
mw_denmInd(mw_denmPdu(mw_denm( mw_denmMgmtCon( mw_actionId, -, -, c_duration2))));
var ActionID v_actionId;
var DenmInd v_denmInd;
// 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_expectedDenmInd, v_denmInd);
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_expectedDenmInd.msgIn.denm.management.actionID := v_actionId;
t_repetition.start(2.0 * (int2float(c_interval1)/1000.0));
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// 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));
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
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;
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
}
}
[] 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_);