Commit 075d89e1 authored by garciay's avatar garciay
Browse files

Add AcSecPrimitive/AcSecResponse support for CAM & DENM

parent 4c3c7dfe
...@@ -19,15 +19,17 @@ module ItsCam_TpFunctions { ...@@ -19,15 +19,17 @@ module ItsCam_TpFunctions {
// LibItsCommon // LibItsCommon
import from LibItsCommon_Pixits all;
import from LibItsCommon_Functions all;
import from LibItsCommon_TypesAndValues all; import from LibItsCommon_TypesAndValues all;
import from LibItsCommon_Templates all;
import from LibItsCommon_Functions all;
import from LibItsCommon_Pixits all;
// LibItsCAM // LibItsCAM
import from LibItsCam_TestSystem all; import from LibItsCam_TestSystem all;
import from LibItsCam_Functions all; import from LibItsCam_Functions all;
import from LibItsCam_Templates all; import from LibItsCam_Templates all;
import from LibItsCam_TypesAndValues all; import from LibItsCam_TypesAndValues all;
import from LibItsCam_Pics {modulepar all;} import from LibItsCam_Pics {modulepar all;}
import from LibItsCam_Pixits {modulepar all;} import from LibItsCam_Pixits {modulepar all;}
// ASN.1 // ASN.1
import from ITS_Container language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all;
...@@ -56,8 +58,8 @@ module ItsCam_TpFunctions { ...@@ -56,8 +58,8 @@ module ItsCam_TpFunctions {
f_cfUp(); f_cfUp();
// Test adapter configuration // Test adapter configuration
// Preamble // Preamble
f_prInitialState(); f_prInitialState();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body // Test Body
...@@ -2994,37 +2996,38 @@ module ItsCam_TpFunctions { ...@@ -2994,37 +2996,38 @@ module ItsCam_TpFunctions {
group camGenerationSSP{ group camGenerationSSP{
function f_CAM_MSD_SSP_BO_XX( function f_CAM_MSD_SSP_BO_XX(
in Oct8 p_certHashedId8, in Oct8 p_certHashedId8,
in template(value) UtCamTrigger p_utEvent, in template(value) UtCamTrigger p_utEvent,
in template(present) CAM pmw_CamMsg in template(present) CAM pmw_CamMsg
) runs on ItsCam { ) runs on ItsCam {
// Local variables // Local variables
// Test control // Test control
if (not PICS_CAM_GENERATION) { if (not PICS_CAM_GENERATION) {
log("*** " & testcasename() & ": PICS_CAM_GENERATION required for executing the TC ***"); log("*** " & testcasename() & ": PICS_CAM_GENERATION required for executing the TC ***");
setverdict(inconc); setverdict(inconc);
stop; stop;
} }
if (not PICS_IS_IUT_SECURED) { if (not PICS_IS_IUT_SECURED) {
log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***"); log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***");
setverdict(inconc); setverdict(inconc);
stop; stop;
} }
// Test component configuration // Test component configuration
f_cfUp(); f_cfUp();
// Test adapter configuration // Test adapter configuration
f_acTriggerSecEvent(m_setAtCertificate("")); // TODO Set constants for the certificate names
// Preamble // Preamble
// TODO: initialize IUT with given certificate // TODO: initialize IUT with given certificate
f_prInitialState( e_staticPosition, true, { f_prInitialState( e_staticPosition, true, {
hashedId8 := p_certHashedId8 hashedId8 := p_certHashedId8
}); });
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// execute UT Command // execute UT Command
...@@ -3051,14 +3054,14 @@ module ItsCam_TpFunctions { ...@@ -3051,14 +3054,14 @@ module ItsCam_TpFunctions {
} // end f_CAM_MSD_SSP_BO_XX } // end f_CAM_MSD_SSP_BO_XX
function f_CAM_MSD_SSP_BO_01() runs on ItsCam { function f_CAM_MSD_SSP_BO_01() runs on ItsCam {
// TODO: make template for tolling // TODO: make template for tolling
log("*** " & testcasename() & ": This TC is not implemented yet ***"); log("*** " & testcasename() & ": This TC is not implemented yet ***");
setverdict(inconc); setverdict(inconc);
stop; stop;
} // end f_CAM_MSD_SSP_BO_01 } // end f_CAM_MSD_SSP_BO_01
function f_CAM_MSD_SSP_BO_02() runs on ItsCam { function f_CAM_MSD_SSP_BO_02() runs on ItsCam {
...@@ -3067,24 +3070,24 @@ module ItsCam_TpFunctions { ...@@ -3067,24 +3070,24 @@ module ItsCam_TpFunctions {
& ": PICS_SPECIALVEHICLECONTAINER and PICS_PUBLICTRANS need to be set to true"); & ": PICS_SPECIALVEHICLECONTAINER and PICS_PUBLICTRANS need to be set to true");
} }
f_CAM_MSD_SSP_BO_XX(PX_CERT_IUT_CAM_02, f_CAM_MSD_SSP_BO_XX(PX_CERT_IUT_CAM_02,
m_setVehicleRole(c_vehicleRole_publicTransport), m_setVehicleRole(c_vehicleRole_publicTransport),
mw_camMsg_SVC ( mw_publicTransport_any ) mw_camMsg_SVC ( mw_publicTransport_any )
); );
} // end f_CAM_MSD_SSP_BO_02 } // end f_CAM_MSD_SSP_BO_02
function f_CAM_MSD_SSP_BO_03() runs on ItsCam { function f_CAM_MSD_SSP_BO_03() runs on ItsCam {
if (not PICS_SPECIALVEHICLECONTAINER and not PICS_SPECIALTRANS) { if (not PICS_SPECIALVEHICLECONTAINER and not PICS_SPECIALTRANS) {
testcase.stop(testcasename() testcase.stop(testcasename()
& ": PICS_SPECIALVEHICLECONTAINER and PICS_SPECIALTRANS need to be set to true"); & ": PICS_SPECIALVEHICLECONTAINER and PICS_SPECIALTRANS need to be set to true");
} }
f_CAM_MSD_SSP_BO_XX(PX_CERT_IUT_CAM_03, f_CAM_MSD_SSP_BO_XX(PX_CERT_IUT_CAM_03,
m_setVehicleRole(c_vehicleRole_specialTransport), m_setVehicleRole(c_vehicleRole_specialTransport),
mw_camMsg_SVC ( mw_specialTransport_any ) mw_camMsg_SVC ( mw_specialTransport_any )
); );
} // end f_CAM_MSD_SSP_BO_03 } // end f_CAM_MSD_SSP_BO_03
} }
...@@ -3149,15 +3152,15 @@ module ItsCam_TpFunctions { ...@@ -3149,15 +3152,15 @@ module ItsCam_TpFunctions {
} // end f_CAM_MSP_BV_01 } // end f_CAM_MSP_BV_01
group camProcessingSSP{ group camProcessingSSP{
/** /**
* @desc TP Function for TC_CAM_MSP_SSP_BV_XX * @desc TP Function for TC_CAM_MSP_SSP_BV_XX
* @param p_certName Certificate to be used to sign the CAM message * @param p_certName Certificate to be used to sign the CAM message
* @param p_camMsg CAM value template to be sent to IUT * @param p_camMsg CAM value template to be sent to IUT
*/ */
function f_CAM_MSP_SSP_BV_XX( function f_CAM_MSP_SSP_BV_XX(
in charstring p_certName, in charstring p_certName,
in template (value) CAM p_camMsg in template (value) CAM p_camMsg
) runs on ItsCam { ) runs on ItsCam {
// Local variables // Local variables
...@@ -3165,11 +3168,11 @@ module ItsCam_TpFunctions { ...@@ -3165,11 +3168,11 @@ module ItsCam_TpFunctions {
var integer i; var integer i;
// Test control // Test control
if (not PICS_CAM_RECEPTION) { if (not PICS_CAM_RECEPTION) {
log("*** " & testcasename() & ": PICS_CAM_RECEPTION required for executing the TC ***"); log("*** " & testcasename() & ": PICS_CAM_RECEPTION required for executing the TC ***");
setverdict(inconc); setverdict(inconc);
stop; stop;
} }
if (not PICS_IS_IUT_SECURED) { if (not PICS_IS_IUT_SECURED) {
log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***"); log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***");
...@@ -3190,7 +3193,7 @@ module ItsCam_TpFunctions { ...@@ -3190,7 +3193,7 @@ module ItsCam_TpFunctions {
// Test Body // Test Body
v_camReq := valueof( v_camReq := valueof(
m_camReq( m_camReq(
p_camMsg p_camMsg
) )
); );
camPort.send( v_camReq ) ; camPort.send( v_camReq ) ;
...@@ -3215,7 +3218,7 @@ module ItsCam_TpFunctions { ...@@ -3215,7 +3218,7 @@ module ItsCam_TpFunctions {
} // end f_CAM_MSP_SSP_BV_XX } // end f_CAM_MSP_SSP_BV_XX
function f_CAM_MSP_SSP_BV_01() runs on ItsCam { function f_CAM_MSP_SSP_BV_01() runs on ItsCam {
// TODO: make template for tolling // TODO: make template for tolling
log("*** " & testcasename() & ": This TC is not implemented yet ***"); log("*** " & testcasename() & ": This TC is not implemented yet ***");
setverdict(inconc); setverdict(inconc);
...@@ -3224,23 +3227,23 @@ module ItsCam_TpFunctions { ...@@ -3224,23 +3227,23 @@ module ItsCam_TpFunctions {
function f_CAM_MSP_SSP_BV_02() runs on ItsCam { function f_CAM_MSP_SSP_BV_02() runs on ItsCam {
f_CAM_MSP_SSP_BV_XX("CERT_TS_CAM_02", f_CAM_MSP_SSP_BV_XX("CERT_TS_CAM_02",
m_camMsg_publicTransport( m_camMsg_publicTransport(
f_getTsStationId(), f_getTsStationId(),
f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
m_tsPosition m_tsPosition
) )
); );
} // end f_CAM_MSP_SSP_BV_03 } // end f_CAM_MSP_SSP_BV_03
function f_CAM_MSP_SSP_BV_03() runs on ItsCam { function f_CAM_MSP_SSP_BV_03() runs on ItsCam {
f_CAM_MSP_SSP_BV_XX("CERT_TS_CAM_03", f_CAM_MSP_SSP_BV_XX("CERT_TS_CAM_03",
m_camMsg_specialTransport( m_camMsg_specialTransport(
f_getTsStationId(), f_getTsStationId(),
f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
m_tsPosition m_tsPosition
) )
); );
} // end f_CAM_MSP_SSP_BV_03 } // end f_CAM_MSP_SSP_BV_03
}// end group camProcessingSSP }// end group camProcessingSSP
......
...@@ -14,17 +14,22 @@ module ItsDenm_TpFunctions { ...@@ -14,17 +14,22 @@ module ItsDenm_TpFunctions {
import from LibCommon_BasicTypesAndValues all; import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all; import from LibCommon_DataStrings all;
// LibIts // LibItsCommon
import from LibItsCommon_Functions all;
import from LibItsCommon_TypesAndValues all; import from LibItsCommon_TypesAndValues all;
import from LibItsCommon_Templates all;
import from LibItsCommon_Functions all;
// LibIts
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
import from ITS_Container language "ASN.1:1997" all;
// LibItsDenm
import from LibItsDenm_TestSystem all; import from LibItsDenm_TestSystem all;
import from LibItsDenm_Functions all; import from LibItsDenm_Functions all;
import from LibItsDenm_Templates all; import from LibItsDenm_Templates all;
import from LibItsDenm_TypesAndValues all; import from LibItsDenm_TypesAndValues all;
import from LibItsDenm_Pics all; import from LibItsDenm_Pics all;
import from LibItsDenm_Pixits all; import from LibItsDenm_Pixits all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
import from ITS_Container language "ASN.1:1997" all;
// 5.2.1 // 5.2.1
group denMessageTransmission { group denMessageTransmission {
...@@ -2319,6 +2324,7 @@ module ItsDenm_TpFunctions { ...@@ -2319,6 +2324,7 @@ module ItsDenm_TpFunctions {
f_cfUp(); f_cfUp();
// Test adapter configuration // Test adapter configuration
f_acTriggerSecEvent(m_setAtCertificate("")); // TODO Set constants for the certificate names
// Preamble // Preamble
f_prInitialState(e_staticPosition, { f_prInitialState(e_staticPosition, {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment