Newer
Older
// Store my current position
v_distance := f_distance(
v_position,
v_myPosition
);
if (v_distance >= PX_FORWARD_COLLISION_SECURITY_DISTANCE) { // TODO Check elevation
tc_ac.start;
repeat;
} // else, nothing to do
} else {
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: CAM messages for EUT ", PX_EUT_DESC[p_eut_id].stationId, " not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
tc_ac.start;
alt { // Check that Forward Collision Risk was received
[] hmiPort.receive(mw_hmiSignageEventInd_forwardCollisionRisk) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: The Forward Collision Risk signage was received on EUT ", PX_EUT_DESC[p_eut_id].stationId, "***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": FAIL: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_CAM_CRW_BV_01_eut
} // End of group g_TC_AUTO_IOT_CAM_CRW_BV_01
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
/**
* @desc Verify complete intersection collision risk scenario based on CA messages
* <pre>
* Pics Selection:
* Config Id: CF-04
* Initial conditions:
* with {
* EUT1 having moved from Start1 position to End1 position
* and EUT2 having moved from Start2 position to End2 position
* }
* Expected behaviour:
* ensure that {
* when {
* EUT1 and EUT2 approach simultaneously POS3
* }
* then {
* EUT1 indicates the lateral collision risk
* and EUT2 indicates the lateral collision risk
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_CAM_CRW_BV_02
* @reference ETSI EN 302 637-2 [4]
*/
testcase TC_AUTO_IOT_CAM_CRW_BV_02() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf02Up(v_eut1, v_eut2);
// Start components
v_eut1.start(f_TC_AUTO_IOT_CAM_CRW_BV_02_eut(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_CAM_CRW_BV_02_eut(v_eut2, PX_EUT2_ID));
// Synchronization
f_serverSyncNClientsAndStop(2, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf02Down(v_eut1, v_eut2);
} // End of TC_AUTO_IOT_CAM_CRW_BV_02
group g_TC_AUTO_IOT_CAM_CRW_BV_02 {
/**
* @desc Behavior function for EUT1 (TC_AUTO_IOT_CAM_CRW_BV_02)
*/
function f_TC_AUTO_IOT_CAM_CRW_BV_02_eut(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var float v_distance;
var ThreeDLocation v_position; // CAM reference position
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// Nothing to do
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_cam_stationId(
-,
PX_EUT_DESC[p_eut_id].stationId
)*/)))) -> value v_gnInd { // Receive a DEN message
if (f_check_payload_cam(
v_gnInd,
mw_camMsg_BC_refPos(?),
v_position) == true) {
// Re-send CA message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
// Compute distance from POS3
v_distance := f_distance(
v_position,
PICS_POS3
);
if (v_distance >= PX_LATERAL_COLLISION_SECURITY_DISTANCE) { // TODO Check elevation
// Continue
tc_ac.start;
repeat;
} // else, nothing to do
} else {
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: CAM messages for EUT ", PX_EUT_DESC[p_eut_id].stationId, " not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
tc_ac.start;
alt { // Check that Lateral Collision Risk was received
[] hmiPort.receive(mw_hmiSignageEventInd_lateralCollisionRisk) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: The Lateral Collision Risk signage was received on EUT ", PX_EUT_DESC[p_eut_id].stationId, "***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": FAIL: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_CAM_CRW_BV_02_eut
} // End of group g_TC_AUTO_IOT_CAM_CRW_BV_02
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
/**
* @desc Verify complete resolution of duplicate address conflict scenario based on GN messages
* <pre>
* Pics Selection:
* Config Id: CF-01
* Initial conditions:
* with {
* EUT1 and EUT2 being configured with the same GN address
* and EUT1 and EUT2 being off-link
* }
* Expected behaviour:
* ensure that {
* when {
* EUT1 and EUT2 become on-link
* }
* then {
* EUT1 changes its GN address
* and EUT2 changes its GN address
* }
* when {
* EUT1 sends CA messages
* containing cam
* containing camParameters
* containing basicContainer
* containing referencePosition
* }
* then {
* EUT2 indicates EUT1 as neighbour
* }
* when {
* EUT2 sends CA messages
* containing cam
* containing camParameters
* containing basicContainer
* containing referencePosition
* }
* then {
* EUT1 indicates EUT2 as neighbour
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_GN_DAD_BV_01
* @reference ETSI EN 302 636-4-1 [2] Clause 9.2.1.5
*/
testcase TC_AUTO_IOT_GN_DAD_BV_01() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf02Up(v_eut1, v_eut2);
// Start components
v_eut1.start(f_TC_AUTO_IOT_GN_DAD_BV_01_eut(v_eut1, PX_EUT1_ID, PX_EUT2_ID));
v_eut2.start(f_TC_AUTO_IOT_GN_DAD_BV_01_eut(v_eut2, PX_EUT2_ID, PX_EUT1_ID));
// Synchronization
f_serverSyncNClientsAndStop(2, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf02Down(v_eut1, v_eut2);
} // End of TC_AUTO_IOT_GN_DAD_BV_01
group g_TC_AUTO_IOT_GN_DAD_BV_01 {
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
/**
* @desc Behavior function for EUTs (TC_AUTO_IOT_GN_DAD_BV_01)
*/
function f_TC_AUTO_IOT_GN_DAD_BV_01_eut(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id,
in integer p_eut_id_neighbour
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var GN_Address v_gnAddr;
var boolean v_getFirstCam := false;
var HmiNeighborEventInds v_hmiNeighborEventInds;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// EUT1 and EUT2 become on-link
if (PX_CAPTURE_MODE == "on-link") {
ItsAutoInterop_Functions.f_utTriggerEvent(UtAutoInteropTrigger:{utRadioOnOff := true});
}
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[v_getFirstCam == false] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_cam_stationId(
-,
PX_EUT_DESC[p_eut_id].stationId
)*/)))) -> value v_gnInd { // Receive a CAM message
v_gnAddr := v_gnInd.msgIn.gnPacket.packet.extendedHeader.shbHeader.srcPosVector.gnAddr;
v_getFirstCam := true;
// Re-send CAM message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
repeat;
}
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
mw_longPosVectorAny(
? /* FIXME complement(
v_gnAddr
)*/),
?,
e_btpB,
?/*mw_cam_stationId(
-,
PX_EUT_DESC[p_eut_id].stationId
)*/
)))) -> value v_gnInd { // Receive a CAM message
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
// Re-send CA message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
tc_wait.stop;
log("*** " & testcasename() & ": INFO: GN duplicated address conflict resolved ***");
hmiPort.clear;
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": INCONC: GN duplicate address conflict scenario is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
tc_ac.start;
alt { // Check neighbours
[] hmiPort.receive(
HmiNeighborEventInds:?
) -> value v_hmiNeighborEventInds {
var boolean v_found := false;
tc_ac.stop;
for (var integer v_i := 0; v_i < lengthof(v_hmiNeighborEventInds); v_i := v_i + 1) {
if (
(PX_EUT_DESC[p_eut_id_neighbour].mid == v_hmiNeighborEventInds[v_i].mid) and
(PX_EUT_DESC[p_eut_id_neighbour].stationId == v_hmiNeighborEventInds[v_i].stationId)
) {
v_found := true;
break; // Got it, leave the loop
} // else, continue
} // End of 'for' statement
if (v_found) {
log("*** " & testcasename() & ": PASS: GN duplicate address conflict scenario compeleted for EUT ", PX_EUT_DESC[p_eut_id].stationId, "***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
} else {
log("*** " & testcasename() & ": FAIL: GN duplicate address conflict scenario is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": FAIL: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_GN_DAD_BV_01_eut
} // End of group g_TC_AUTO_IOT_GN_DAD_BV_01
} // End of module AtsInterop_TestCases