Newer
Older
// Test control
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
camPort.clear;
tc_ac.start;
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_any )){
tc_ac.stop;
t_genCam_measure.start;
log("*** " & testcasename() & ": INFO: Initial conditions: First CAM message received ***");
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Initial conditions: CAM message not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
}
}
f_utTriggerEvent(m_changeSpeed(1000));
tc_ac.start;
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_any )){
var float v_measured := t_genCam_measure.read;
tc_ac.stop;
v_genCam_min := v_measured * 0.9;
v_genCam_max := v_measured * 1.1;
log("*** " & testcasename() & ": INFO: Initial conditions: Anticipated CAM message received ***");
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Initial conditions: Anticipated CAM message not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
}
}
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
t_genCam_min.start(v_genCam_min);
t_genCam_max.start(v_genCam_max);
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_any )){
if (t_genCam_min.running) {
log("*** " & testcasename() & ": FAIL: Anticipated CAM message received BEFORE T_GenCam expired ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
t_genCam_max.stop;
log("*** " & testcasename() & ": PASS: Anticipated CAM message received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] t_genCam_min.timeout {
repeat;
}
[] t_genCam_max.timeout {
log("*** " & testcasename() & ": FAIL: Anticipated CAM message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poDefault();
f_cfDown();
} // end TC_CAM_MSD_GFQ_BV_07
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
/**
* @desc Check that maximum CAM generation frequency for RSU ITS-S is 1Hz
*
* <pre>
* Pics Selection: PICS_RSU
* Initial conditions:
* with {
* the IUT being in the "initial state"
* }
* Expected behaviour:
* ensure that {
* when {
* IUT sends a CAM
* }
* then {
* the IUT does not send another CAM afterbefore 1s
* }
* }
* </pre>
*
* @version 0.0.2
* @see ETSI TS 102 868-2 v0.0.2 TP/CAM/MSD/GFQ/BV-08
* @reference ETSI EN 302 637-2 , clause 6.1.4
*/
testcase TC_CAM_MSD_GFQ_BV_08() runs on ItsCam system ItsCamSystem {
// Local constants
const float c_minTime := 0.95;
const float c_maxTime := 1.05;
// Local variables
// Test component configuration
f_cfUp();
// Preamble
f_prInitialState();
camPort.clear;
tc_ac.start;
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_any )){
tc_ac.stop;
log("*** " & testcasename() & ": INFO: Initial conditions: First CAM message received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Initial conditions: CAM message not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
}
}
// Test Body
tc_ac.start;
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_any )){
if ( ( tc_ac.read*1000.0 > c_minTime ) and ( tc_ac.read*1000.0 < c_maxTime )) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: CAM message received in time***");
f_selfOrClientSyncAndVerdictPreamble(c_tbDone, e_success);
}
else {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: CAM message not received in time***");
f_selfOrClientSyncAndVerdictPreamble(c_tbDone, e_error);
}
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": FAIL: CAM message not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_tbDone, e_timeout);
}
}
// Postamble
f_poDefault();
f_cfDown();
} // end TC_CAM_MSD_GFQ_BV_08
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
} // end group camGenerationFrequency
} // end group camMessageDissemination
group camMessageProcessing {
/**
* @desc Check that content of received CAM is transmitted to
* applications and other facilities.
* <pre>
* Pics Selection: PICS_CANRECEPTION
* Initial conditions:
* with {
* the IUT being in the "initial state"
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT receives a valid CAM
* }
* then {
* the IUT forwards the CAM content to upper layers
* and the IUT forwards the CAM content to other facilities
* }
* }
* </pre>
*
* @version 0.0.2
* @see ETSI TS 102 868-2 v0.0.2 TP/CAM/MSP/BV-01
* @reference ETSI EN 302 637-2 , clause 4.2.2
*/
testcase TC_CAM_MSP_BV_01() runs on ItsCam system ItsCamSystem {
// Local variables
var CamReq v_camReq;
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
// Test control
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_camReq := valueof(
m_camReq(
m_camMsg_vehicle(
f_getTsStationId(),
f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
m_tsPosition
)
)
);
camPort.send( v_camReq ) ;
f_sleep(PX_TNOAC);
for(i:=0; i < lengthof(vc_utEvents) and not match(v_camReq, vc_utEvents[i].camMsg); i:=i+1) {
// empty on purpose
}
if(i < lengthof(vc_utEvents)) {
log("*** " & testcasename() & ": FAIL: CAM was transmitted to upper layer ***");
f_clientSyncAndVerdict(c_tbDone, e_error);
}
else {
log("*** " & testcasename() & ": PASS: CAM was not transmitted to upper layer ***");
f_clientSyncAndVerdict(c_tbDone, e_success);
}