Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TTCN-3 Libraries
LibIts
Commits
faf5e0e9
Commit
faf5e0e9
authored
Jul 25, 2016
by
garciay
Browse files
Add AcSecPrimitive/AcSecResponse support for CAM & DENM
parent
692cf76e
Changes
6
Hide whitespace changes
Inline
Side-by-side
ttcn/CAM/LibItsCam_Functions.ttcn
View file @
faf5e0e9
...
...
@@ -95,13 +95,13 @@ module LibItsCam_Functions {
tc_wait
.
stop
;
}
[]
tc_wait
.
timeout
{
log
(
"*** "
&
testcasename
()
&
": INFO: Could not receive expected UT message from IUT in time ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
log
(
"*** "
&
testcasename
()
&
": INFO: Could not receive expected UT message from IUT in time ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
repeat
;
}
}
}
...
...
@@ -109,6 +109,34 @@ module LibItsCam_Functions {
group
adapterControl
{
/**
* @desc Triggers event in the test system adaptation.
* @param p_event The event to trigger
* @return FncRetCode
*/
function
f_acTriggerSecEvent
(
template
(
value
)
AcSecPrimitive
p_event
)
runs
on
ItsCam
return
FncRetCode
{
var
FncRetCode
v_ret
:=
e_success
;
acPort
.
send
(
p_event
);
tc_ac
.
start
;
alt
{
[]
acPort
.
receive
(
m_acSecResponseSuccess
)
{
tc_ac
.
stop
;
}
[]
acPort
.
receive
{
tc_ac
.
stop
;
log
(
"*** "
&
__SCOPE__
&
": ERROR: Received unexpected message ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_error
);
}
[]
tc_ac
.
timeout
{
log
(
"*** "
&
__SCOPE__
&
": ERROR: Timeout while waiting for adapter control event result ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
}
return
v_ret
;
}
/**
* @desc Triggers event in the test system adaptation.
* @param p_event The event to trigger
...
...
@@ -302,9 +330,9 @@ module LibItsCam_Functions {
* @remark No specific actions specified in the base standard
*/
function
f_prInitialState
(
Scenario
p_scenario
:=
e_staticPosition
,
boolean
p_awaitInitialCAM
:=
true
,
template
(
value
)
UtInitialize
p_init
:=
m_camInitialize
Scenario
p_scenario
:=
e_staticPosition
,
boolean
p_awaitInitialCAM
:=
true
,
template
(
value
)
UtInitialize
p_init
:=
m_camInitialize
)
runs
on
ItsCam
{
f_utInitializeIut
(
p_init
);
...
...
ttcn/CAM/LibItsCam_TestSystem.ttcn
View file @
faf5e0e9
...
...
@@ -31,9 +31,9 @@ module LibItsCam_TestSystem {
*/
type
port
AdapterControlPort
message
{
out
AcGnssPrimitive
;
AcGnssPrimitive
,
AcSecPrimitive
;
in
AcGnssResponse
,
AcGnssDistanceCovered
;
AcGnssResponse
,
AcGnssDistanceCovered
,
AcSecResponse
;
}
// end AdapterControlPort
/**
...
...
ttcn/Common/LibItsCommon_Templates.ttcn
View file @
faf5e0e9
...
...
@@ -14,6 +14,15 @@ module LibItsCommon_Templates {
group
taPrimitives
{
template
(
value
)
AcSecResponse
m_acSecResponseSuccess
:=
true
;
template
(
value
)
AcSecPrimitive
m_setAtCertificate
(
in
charstring
p_atCertifcate
)
:=
{
acSetAtCertificate
:=
{
atCertificateName
:=
p_atCertifcate
}
}
template
AcGnssResponse
m_acGnssResponseSuccess
:=
true
;
template
AcGnssDistanceCovered
m_acGnssDistanceCovered
:=
true
;
...
...
ttcn/Common/LibItsCommon_TypesAndValues.ttcn
View file @
faf5e0e9
...
...
@@ -85,6 +85,28 @@ module LibItsCommon_TypesAndValues {
group
acPrimitives
{
/**
* @desc TA primitives for security support
* @member acSetCertificate Set the AT certificate to be used by the TA
*/
type
union
AcSecPrimitive
{
AcSetAtCertificate
acSetAtCertificate
}
// End of type AcSecPrimitive
/**
* @desc Describes the AT certificate to be used by the TA
* @member atCertificateName The AT certificate name
*/
type
record
AcSetAtCertificate
{
charstring
atCertificateName
}
// End of type AcSetAtCertificate
/**
* @desc Primitive for receiving response from TA
*/
type
boolean
AcSecResponse
;
/**
* @desc TA primitives for DENM
* @member loadScenario -
...
...
ttcn/DENM/LibItsDenm_Functions.ttcn
View file @
faf5e0e9
...
...
@@ -210,6 +210,34 @@ module LibItsDenm_Functions {
group
adapterControl
{
/**
* @desc Triggers event in the test system adaptation.
* @param p_event The event to trigger
* @return FncRetCode
*/
function
f_acTriggerSecEvent
(
template
(
value
)
AcSecPrimitive
p_event
)
runs
on
ItsDenm
return
FncRetCode
{
var
FncRetCode
v_ret
:=
e_success
;
acPort
.
send
(
p_event
);
tc_ac
.
start
;
alt
{
[]
acPort
.
receive
(
m_acSecResponseSuccess
)
{
tc_ac
.
stop
;
}
[]
acPort
.
receive
{
tc_ac
.
stop
;
log
(
"*** "
&
__SCOPE__
&
": ERROR: Received unexpected message ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_error
);
}
[]
tc_ac
.
timeout
{
log
(
"*** "
&
__SCOPE__
&
": ERROR: Timeout while waiting for adapter control event result ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
}
return
v_ret
;
}
/**
* @desc Triggers event in the test system adaptation.
* @param p_event The event to trigger
...
...
@@ -391,9 +419,10 @@ module LibItsDenm_Functions {
* @desc Brings the IUT into an initial state.
* @return FncRetCode
*/
function
f_prInitialState
(
Scenario
p_scenario
:=
e_staticPosition
,
template
(
value
)
UtInitialize
p_denmInitialize
:=
m_denmInitialize
)
runs
on
ItsDenm
return
FncRetCode
{
function
f_prInitialState
(
in
Scenario
p_scenario
:=
e_staticPosition
,
in
template
(
value
)
UtInitialize
p_denmInitialize
:=
m_denmInitialize
)
runs
on
ItsDenm
return
FncRetCode
{
var
FncRetCode
v_ret
:=
e_success
;
f_utInitializeIut
(
p_denmInitialize
);
...
...
ttcn/DENM/LibItsDenm_TestSystem.ttcn
View file @
faf5e0e9
...
...
@@ -31,9 +31,9 @@ module LibItsDenm_TestSystem {
*/
type
port
AdapterControlPort
message
{
out
AcGnssPrimitive
;
AcGnssPrimitive
,
AcSecPrimitive
;
in
AcGnssResponse
,
AcGnssDistanceCovered
;
AcGnssResponse
,
AcGnssDistanceCovered
,
AcSecResponse
;
}
// end AdapterControlPort
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment