Newer
Older
* @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;
import from LibItsCommon_TypesAndValues all;
import from LibItsCommon_Templates all;
import from LibItsCommon_Functions all;
// LibIts
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
import from ITS_Container language "ASN.1:1997" all;
// LibItsDenm
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;
// 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));
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
169
170
171
172
173
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));
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
229
230
231
232
233
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(
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
357
358
359
360
361
)
)
)
)
) {
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));
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
420
421
422
423
424
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]));
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
580
581
582
583
584
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) );
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);
log("*** " & testcasename() & ": FAIL: received expected DENM - Pseudonym not changed. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
}
}
[] 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_;
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
709
710
711
712
713
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_;
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
777
778
779
780
781
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();
//log("v_timestampIts: ", v_timestampIts);
v_actionId := v_denmInd.msgIn.denm.management.actionID;
v_referenceTime1 := v_denmInd.msgIn.denm.management.referenceTime;
//log("v_referenceTime1: ", v_referenceTime1);
v_diff := v_timestampIts - v_referenceTime1;
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_situation.eventType.subCauseCode := VehicleBreakdownSubCauseCode_engineProblem_;
f_utUpdateEvent(m_utUpdateEvent(v_actionId, v_situation));
tc_ac.start;
alt {
[] denmPort.receive(
mw_denmInd(
mw_anyDenmPdu(
mw_itsPduHeader,
mw_denm (
mw_denmMgmtCon(
v_actionId
)
)
)
)
) -> value v_denmInd {
tc_ac.stop;
v_timestampIts := f_getCurrentTime();
//log("v_timestampIts: ", v_timestampIts);
v_msgtimestamp := v_denmInd.msgIn.denm.management.referenceTime;
//log("v_msgtimestamp: ", v_msgtimestamp);
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
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 {
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
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_);