Newer
Older
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 {
3034
3035
3036
3037
3038
3039
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
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
/**
* @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;
// 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_geoNwShbPacketWithNextHeader_cam(
?,
?,
e_btpB,
?/*mw_cam_stationId(
-,
PX_EUT_DESC[p_eut_id].stationId
)*/)))) -> value v_gnInd { // Receive a DEN message
tc_ac.stop;
// Re-send CA message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
// Compute distance from POS3
v_distance := f_distance(
v_gnInd.msgIn.gnPacket.packet.extendedHeader.shbHeader.srcPosVector,
valueof(m_longPosVector(PICS_POS3))
);
if (v_distance >= PX_LATERAL_COLLISION_SECURITY_DISTANCE) { // TODO Check elevation
// Continue
tc_ac.start;
repeat;
} // else, nothing to do
}
[] 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
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
/**
* @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 {
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
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
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
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
/**
* @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_geoNwShbPacketWithNextHeader_cam(
?,
?,
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_geoNwShbPacketWithNextHeader_cam(
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
// 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