Newer
Older
/**
* @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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
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 {
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.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 := LibItsCommon_ASN1_NamedNumbers.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 {
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.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 {
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
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 {
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_),
m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_accident_, LibItsCommon_ASN1_NamedNumbers.AccidentSubCauseCode_unavailable_),
m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_roadworks_, LibItsCommon_ASN1_NamedNumbers.RoadworksSubCauseCode_unavailable_),
m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_slowVehicle_, LibItsCommon_ASN1_NamedNumbers.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(valueof(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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_),
m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_accident_, LibItsCommon_ASN1_NamedNumbers.AccidentSubCauseCode_unavailable_),
m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_roadworks_, LibItsCommon_ASN1_NamedNumbers.RoadworksSubCauseCode_unavailable_),
m_situation(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_slowVehicle_, LibItsCommon_ASN1_NamedNumbers.SlowVehicleSubCauseCode_unavailable_)
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
};
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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.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 {
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
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
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 (LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_ );
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));
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
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);
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
}
}
// 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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
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 := LibItsCommon_ASN1_NamedNumbers.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));
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
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
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) {
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
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) {
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
var template (present) DenmInd v_expectedDenmInd := mw_denmInd(
mw_denmPdu(
mw_denm(
mw_denmMgmtCon(
mw_actionId,
-,
-,
-,
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
)
)
)
);
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,
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
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
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
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
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
)
);
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 (LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.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 := ?;
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
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);
log("*** " & testcasename() & ": FAIL: received expected DENM - Pseudonym not changed. ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
}
}
[] 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(LibItsCommon_ASN1_NamedNumbers.CauseCodeType_vehicleBreakdown_, LibItsCommon_ASN1_NamedNumbers.VehicleBreakdownSubCauseCode_unavailable_);
var template (present) DenmInd v_expectedDenmInd :=
mw_denmInd(mw_denmPdu(mw_denm( mw_denmMgmtCon( mw_actionId, -, -, c_duration2))));