Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
a4a2b2a2
Commit
a4a2b2a2
authored
Jul 21, 2016
by
filatov
Browse files
AtsCAM, AtsDENM: add SSP tests (some TODOs are important)
parent
fc696cf3
Changes
6
Hide whitespace changes
Inline
Side-by-side
ttcn/AtsCAM/ItsCam_TestCases.ttcn
View file @
a4a2b2a2
...
...
@@ -12,7 +12,7 @@ module ItsCam_TestCases {
import
from
LibItsCam_TestSystem
all
;
// Ats Its
import
from
ItsCam_TpFunctions
all
;
import
from
ItsCam_TpFunctions
all
;
// 5.2.1
group
camMessageDissemination
{
...
...
@@ -2177,6 +2177,111 @@ module ItsCam_TestCases {
}
// end TC_CAM_MSD_PAR_BV_03
}
// end group camLowerLayerParameters
group
camGenerationSSP
{
/**
* @desc Check that the IUT does not send a CAM
* when its content is not permitted by signing certificate
* <pre>
* Pics Selection: PICS_CAM_GENERATION AND PICS_IS_IUT_SECURED
* Initial conditions:
* with {
* the IUT being in the "initial state"
* the IUT is authorized to sign CAMs with the certificate
* containing CAM SSP
* indicating bit at position '1' set to 0
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT generates a CAM
* containing CenDsrcTollingZone
* }
* then {
* the IUT does not send this CAM
* }
* }
* </pre>
*
* @see ETSI TS 102 868-2 TP/CAM/MSD/SSP/BO-01
* @reference ETSI EN 302 637-2 , clause 6.2.2.1
*/
testcase
TC_CAM_MSD_SSP_BO_01
()
runs
on
ItsCam
system
ItsCamSystem
{
f_CAM_MSD_SSP_BO_01
();
}
// end TC_CAM_MSD_SSP_BO_01
/**
* @desc Check that the IUT does not send a CAM
* when its content is not permitted by signing certificate
* <pre>
* Pics Selection: PICS_CAM_GENERATION AND PICS_IS_IUT_SECURED
* AND PICS_SPECIALVEHICLECONTAINER AND PICS_PUBLICTRANS
* Initial conditions:
* with {
* the IUT being in the "initial state"
* the IUT is authorized to sign CAMs with the certificate
* containing CAM SSP
* indicating bit at position '2' set to 0
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT generates a CAM
* containing publicTransportContainer
* }
* then {
* the IUT does not send this CAM
* }
* }
* </pre>
*
* @see ETSI TS 102 868-2 TP/CAM/MSD/SSP/BO-02
* @reference ETSI EN 302 637-2 , clause 6.2.2.1
*/
testcase
TC_CAM_MSD_SSP_BO_02
()
runs
on
ItsCam
system
ItsCamSystem
{
f_CAM_MSD_SSP_BO_02
();
}
// end TC_CAM_MSD_SSP_BO_02
/**
* @desc Check that the IUT does not send a CAM
* when its content is not permitted by signing certificate
* <pre>
* Pics Selection: PICS_CAM_GENERATION AND PICS_IS_IUT_SECURED
* AND PICS_SPECIALVEHICLECONTAINER AND PICS_SPECIALTRANS
* Initial conditions:
* with {
* the IUT being in the "initial state"
* the IUT is authorized to sign CAMs with the certificate
* containing CAM SSP
* indicating bit at position '3' set to 0
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT generates a CAM
* containing specialTransportContainer
* }
* then {
* the IUT does not send this CAM
* }
* }
* </pre>
*
* @see ETSI TS 102 868-2 TP/CAM/MSD/SSP/BO-03
* @reference ETSI EN 302 637-2 , clause 6.2.2.1
*/
testcase
TC_CAM_MSD_SSP_BO_03
()
runs
on
ItsCam
system
ItsCamSystem
{
f_CAM_MSD_SSP_BO_03
();
}
// end TC_CAM_MSD_SSP_BO_03
}
// end group camGenerationSSP
}
// end group camMessageDissemination
...
...
@@ -2212,6 +2317,114 @@ module ItsCam_TestCases {
}
// end TC_CAM_MSP_BV_01
group
camProcessingSSP
{
/**
* @desc Check that IUT discards CAM if SSP value of the signing certificate
* is not consistent with the provided containers.
* <pre>
* Pics Selection: PICS_CAM_RECEPTION AND PICS_IS_IUT_SECURED
* Initial conditions:
* with {
* the IUT being in the "initial state"
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT receives a secured CAM
* containing CenDsrcTollingZone/ProtectedCommunicationZonesRSU
* signed with certificate
* containing CAM SSP bit at position 0
* indicating 0
* }
* then {
* the IUT discards the CAM
* and the IUT does not forward the CAM content to upper layers
* and the IUT does not forward the CAM content to other facilities
* }
* }
* </pre>
*
* @see ETSI TS 102 868-2 TP/CAM/MSP/SSP/BV-01-01
* @reference ETSI EN 302 637-2 , clause 6.2.2.1
*/
testcase
TC_CAM_MSP_SSP_BV_01
()
runs
on
ItsCam
system
ItsCamSystem
{
f_CAM_MSP_SSP_BV_01
();
}
// end TC_CAM_MSP_BV_01
/**
* @desc Check that IUT discards CAM if SSP value of the signing certificate
* is not consistent with the provided containers.
* <pre>
* Pics Selection: PICS_CAM_RECEPTION AND PICS_IS_IUT_SECURED
* Initial conditions:
* with {
* the IUT being in the "initial state"
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT receives a secured CAM
* containing publicTransportContainer
* and signed with certificate
* containing CAM SSP bit at position 1
* indicating 0
* }
* then {
* the IUT discards the CAM
* and the IUT does not forward the CAM content to upper layers
* and the IUT does not forward the CAM content to other facilities
* }
* }
* </pre>
*
* @see ETSI TS 102 868-2 TP/CAM/MSP/SSP/BV-01-02
* @reference ETSI EN 302 637-2 , clause 6.2.2.1
*/
testcase
TC_CAM_MSP_SSP_BV_02
()
runs
on
ItsCam
system
ItsCamSystem
{
f_CAM_MSP_SSP_BV_02
();
}
// end TC_CAM_MSP_BV_02
/**
* @desc Check that IUT discards CAM if SSP value of the signing certificate
* is not consistent with the provided containers.
* <pre>
* Pics Selection: PICS_CAM_RECEPTION AND PICS_IS_IUT_SECURED
* Initial conditions:
* with {
* the IUT being in the "initial state"
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT receives a secured CAM
* containing specialTransportContainer
* and signed with certificate
* containing CAM SSP bit at position 2
* indicating 0
* }
* then {
* the IUT discards the CAM
* and the IUT does not forward the CAM content to upper layers
* and the IUT does not forward the CAM content to other facilities
* }
* }
* </pre>
*
* @see ETSI TS 102 868-2 TP/CAM/MSP/SSP/BV-01-03
* @reference ETSI EN 302 637-2 , clause 6.2.2.1
*/
testcase
TC_CAM_MSP_SSP_BV_03
()
runs
on
ItsCam
system
ItsCamSystem
{
f_CAM_MSP_SSP_BV_03
();
}
// end TC_CAM_MSP_BV_03
}
// end group camProcessingSSP
}
// end group camMessageProcessing
}
// end ItsCam_TestCases
ttcn/AtsCAM/ItsCam_TestControl.ttcn
View file @
a4a2b2a2
...
...
@@ -94,10 +94,23 @@ module ItsCam_TestControl {
execute
(
TC_CAM_MSD_PAR_BV_02
());
execute
(
TC_CAM_MSD_PAR_BV_03
());
if
(
PICS_IS_IUT_SECURED
)
{
if
(
PICS_PUBLICTRANS
)
{
execute
(
TC_CAM_MSD_SSP_BO_02
());
}
if
(
PICS_SPECIALTRANS
)
{
execute
(
TC_CAM_MSD_SSP_BO_02
());
}
}
}
if
(
PICS_CAM_RECEPTION
)
{
execute
(
TC_CAM_MSP_BV_01
());
if
(
PICS_IS_IUT_SECURED
)
{
execute
(
TC_CAM_MSP_SSP_BV_02
());
execute
(
TC_CAM_MSP_SSP_BV_03
());
}
}
}
...
...
ttcn/AtsCAM/ItsCam_TpFunctions.ttcn
View file @
a4a2b2a2
...
...
@@ -15,6 +15,8 @@ module ItsCam_TpFunctions {
import
from
LibCommon_VerdictControl
all
;
import
from
LibCommon_Time
all
;
import
from
LibCommon_BasicTypesAndValues
all
;
import
from
LibCommon_DataStrings
all
;
// LibItsCommon
import
from
LibItsCommon_Pixits
all
;
...
...
@@ -25,7 +27,8 @@ module ItsCam_TpFunctions {
import
from
LibItsCam_Functions
all
;
import
from
LibItsCam_Templates
all
;
import
from
LibItsCam_TypesAndValues
all
;
import
from
LibItsCam_Pics
{
modulepar
all
};
import
from
LibItsCam_Pics
{
modulepar
all
;}
import
from
LibItsCam_Pixits
{
modulepar
all
;}
// ASN.1
import
from
ITS_Container
language
"ASN.1:1997"
all
;
import
from
CAM_PDU_Descriptions
language
"ASN.1:1997"
all
;
...
...
@@ -53,9 +56,8 @@ module ItsCam_TpFunctions {
f_cfUp
();
// Test adapter configuration
// Preamble
f_prInitialState
();
// Preamble
f_prInitialState
();
f_selfOrClientSyncAndVerdictPreamble
(
c_prDone
,
e_success
);
// Test Body
...
...
@@ -2987,11 +2989,106 @@ module ItsCam_TpFunctions {
f_poDefault
();
f_cfDown
();
}
// end f_CAM_MSD_PAR_BV_03
}
// end f_CAM_MSD_PAR_BV_03
}
// end group camLowerLayerParameters
}
// end group camMessageDissemination
group
camGenerationSSP
{
function
f_CAM_MSD_SSP_BO_XX
(
in
Oct8
p_certHashedId8
,
in
template
(
value
)
UtCamTrigger
p_utEvent
,
in
template
(
present
)
CAM
pmw_CamMsg
)
runs
on
ItsCam
{
// Local variables
// 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
// TODO: initialize IUT with given certificate
f_prInitialState
(
e_staticPosition
,
true
,
{
hashedId8
:=
p_certHashedId8
});
f_selfOrClientSyncAndVerdictPreamble
(
c_prDone
,
e_success
);
// execute UT Command
f_utTriggerEvent
(
p_utEvent
);
// Test Body
tc_ac
.
start
;
alt
{
[]
camPort
.
receive
(
mw_camInd
(
pmw_CamMsg
))
{
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
{
// TODO: make template for tolling
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
{
...
...
@@ -3051,6 +3148,102 @@ module ItsCam_TpFunctions {
}
// 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
();
// Test adapter configuration
// TODO: instruct adapter to use certName to sign the message
// 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
{
// TODO: make template for tolling
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_02"
,
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_03"
,
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
ttcn/AtsDENM/ItsDenm_TestCases.ttcn
View file @
a4a2b2a2
...
...
@@ -1269,7 +1269,79 @@ module ItsDenm_TestCases {
}
// end TC_DEN_PAR_BV_02
}
// end denMessageLowerLayerParameters
group
denMessageSSP
{
/**
* @desc Check that IUT does not send a DENM if it is not permitted by signing certificate
*
* <pre>
* PICS Selection: PICS_DENM_GENERATION AND PICS_SECURITY
* Initial conditions:
* with {
* the IUT being in the "initial state"
* the IUT is authorized to sign DENMs with the certificate
* containing DENM SSP
* not containing pemisions to send trafficCondition cause code
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT receives an AppDENM_trigger request from the application layer
* containing situation container
* containing eventType
* containing causeCode
* indicating trafficCondition
* }
* then {
* the IUT does not send this DENM
* }
* }
* </pre>
*
* @see ETSI TS 102 869-2 v1.4.1 TP/DEN/SSP/BV-01, ETSI EN 302 637-3, clause 8.4.2
*/
testcase
TC_DEN_SSP_BV_01
()
runs
on
ItsDenm
system
ItsDenmSystem
{
f_DEN_SSP_BV_01
();
}
// end TC_DEN_SSP_BV_01
/**
* @desc Check that IUT does not send a DENM if it is not permitted by signing certificate
*
* <pre>
* PICS Selection: PICS_DENM_GENERATION AND PICS_SECURITY
* Initial conditions:
* with {
* the IUT being in the "initial state"
* the IUT is authorized to sign DENMs with the certificate
* containing DENM SSP
* not containing pemisions to send 'accident' cause code
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT receives an AppDENM_trigger request from the application layer
* containing situation container
* containing eventType
* containing causeCode
* indicating 'accident'
* }
* then {
* the IUT does not send this DENM
* }
* }
* </pre>
*
* @see ETSI TS 102 869-2 v1.4.1 TP/DEN/SSP/BV-01, ETSI EN 302 637-3, clause 8.4.2
*/
testcase
TC_DEN_SSP_BV_02
()
runs
on
ItsDenm
system
ItsDenmSystem
{
f_DEN_SSP_BV_02
();
}
// end TC_DEN_SSP_BV_02
}
}
// end denMessageTransmission
// 5.2.2
...
...
@@ -1543,6 +1615,199 @@ module ItsDenm_TestCases {
}
// end TC_DEN_MSRV_BV_07
group
denMessageReceptionSSP
{
/**
* @desc Check that receiving ITS-S discards DENM for new event
* if SSP value of the signing certificate is not consistent with the causeCode
*
* <pre>
* PICS Selection: none
* Initial conditions:
* with {
* the IUT being in the "initial state"
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT receives a secured DENM
* containing situation container
* containing eventType
* containing causeCode
* indicating 'trafficCondition'
* containing signing certificate
* containing SSP
* not permitting to send DENM
* containing causeCode
* indicating 'trafficCondition'
* }
* then {
* the IUT discards the DENM
* and the IUT does not forward the DENM content to upper layer
* }
* }
* </pre>