Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
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
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
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
3156
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
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
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
} // end f_CAM_MSD_PAR_BV_03
} // end group camLowerLayerParameters
group camGenerationSSP {
function f_CAM_MSD_SSP_BO_XX(
in charstring p_certName,
in template(value) UtCamTrigger p_utEvent,
in template(present) CAM pmw_CamMsg,
in template(present) Bit256 pmw_ssp := ?
) runs on ItsCam {
// Local variables
var Oct8 v_certHashedId8;
// Test control
if (not PICS_CAM_GENERATION) {
log("*** " & testcasename() & ": PICS_CAM_GENERATION required for executing the TC ***");
setverdict(inconc);
stop;
}
if (not PICS_IS_IUT_SECURED) {
log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
// initialize IUT with given certificate
fx_readCertificateDigest(p_certName, v_certHashedId8);
if( '0000000000000000'O == v_certHashedId8) {
// Certificate not found
log("*** " & testcasename() & ": Required IUT certificate is not found on the test system ***");
setverdict(inconc);
stop;
}
f_prInitialState(
e_staticPosition,
true,
{ hashedId8 := v_certHashedId8 }
);
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// execute UT Command
f_utTriggerEvent(p_utEvent);
// Test Body
tc_ac.start;
alt {
[] camPort.receive(mw_camIndWithSecurityParameters (
pmw_CamMsg,
pmw_ssp
)) {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Expected CAM message received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": PASS: CAM message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
}
// Postamble
f_poDefault();
f_cfDown();
} // end f_CAM_MSD_SSP_BO_XX
function f_CAM_MSD_SSP_BO_01() runs on ItsCam {
log("*** " & testcasename() & ": This TC is not implemented yet ***");
setverdict(inconc);
stop;
} // end f_CAM_MSD_SSP_BO_01
function f_CAM_MSD_SSP_BO_02() runs on ItsCam {
if (not PICS_SPECIALVEHICLECONTAINER and not PICS_PUBLICTRANS) {
testcase.stop(testcasename()
& ": PICS_SPECIALVEHICLECONTAINER and PICS_PUBLICTRANS need to be set to true");
}
f_CAM_MSD_SSP_BO_XX(PX_CERT_IUT_CAM_02,
m_setVehicleRole(c_vehicleRole_publicTransport),
mw_camMsg_SVC ( mw_publicTransport_any )
);
} // end f_CAM_MSD_SSP_BO_02
function f_CAM_MSD_SSP_BO_03() runs on ItsCam {
if (not PICS_SPECIALVEHICLECONTAINER and not PICS_SPECIALTRANS) {
testcase.stop(testcasename()
& ": PICS_SPECIALVEHICLECONTAINER and PICS_SPECIALTRANS need to be set to true");
}
f_CAM_MSD_SSP_BO_XX(PX_CERT_IUT_CAM_03,
m_setVehicleRole(c_vehicleRole_specialTransport),
mw_camMsg_SVC ( mw_specialTransport_any )
);
} // end f_CAM_MSD_SSP_BO_03
}
} // end group camSSP
group camMessageProcessing {
/**
* @desc TP Function for TC_CAM_MSP_BV_01
*/
function f_CAM_MSP_BV_01() runs on ItsCam {
// Local variables
var CamReq v_camReq;
var integer i;
// Test control
if (not PICS_CAM_RECEPTION) {
log("*** " & testcasename() & ": PICS_CAM_RECEPTION 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_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.msgOut, vc_utEvents[i].camMsg); i:=i+1) {
// empty on purpose
}
if(i < lengthof(vc_utEvents)) {
log("*** " & testcasename() & ": PASS: CAM was transmitted to upper layer ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
log("*** " & testcasename() & ": FAIL: CAM was not transmitted to upper layer ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
// Postamble
f_poDefault();
f_cfDown();
} // end f_CAM_MSP_BV_01
group camProcessingSSP{
/**
* @desc TP Function for TC_CAM_MSP_SSP_BV_XX
* @param p_certName Certificate to be used to sign the CAM message
* @param p_camMsg CAM value template to be sent to IUT
*/
function f_CAM_MSP_SSP_BV_XX(
in charstring p_certName,
in template (value) CAM p_camMsg
) runs on ItsCam {
// Local variables
var CamReq v_camReq;
var integer i;
// Test control
if (not PICS_CAM_RECEPTION) {
log("*** " & testcasename() & ": PICS_CAM_RECEPTION required for executing the TC ***");
setverdict(inconc);
stop;
}
if (not PICS_IS_IUT_SECURED) {
log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp(p_certName);
// Preamble
f_prInitialState();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_camReq := valueof(
m_camReq(
p_camMsg
)
);
camPort.send( v_camReq ) ;
f_sleep(PX_TNOAC);
for(i:=0; i < lengthof(vc_utEvents) and not match(v_camReq.msgOut, vc_utEvents[i].camMsg); i:=i+1) {
// empty on purpose
}
if(i < lengthof(vc_utEvents)) {
log("*** " & testcasename() & ": FAIL: CAM was not transmitted to upper layer ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
else {
log("*** " & testcasename() & ": PASS: CAM was transmitted to upper layer ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
// Postamble
f_poDefault();
f_cfDown();
} // end f_CAM_MSP_SSP_BV_XX
function f_CAM_MSP_SSP_BV_01() runs on ItsCam {
log("*** " & testcasename() & ": This TC is not implemented yet ***");
setverdict(inconc);
stop;
} // end f_CAM_MSP_SSP_BV_01
function f_CAM_MSP_SSP_BV_02() runs on ItsCam {
f_CAM_MSP_SSP_BV_XX("CERT_TS_CAM_BO_02_AT",
m_camMsg_publicTransport(
f_getTsStationId(),
f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
m_tsPosition
)
);
} // end f_CAM_MSP_SSP_BV_03
function f_CAM_MSP_SSP_BV_03() runs on ItsCam {
f_CAM_MSP_SSP_BV_XX("CERT_TS_CAM_BO_03_AT",
m_camMsg_specialTransport(
f_getTsStationId(),
f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
m_tsPosition
)
);
} // end f_CAM_MSP_SSP_BV_03
}// end group camProcessingSSP
} // end group camMessageProcessing
} // end ItsCam_TpFunctions