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
b9ccb54e
Commit
b9ccb54e
authored
Jun 03, 2015
by
mullers
Browse files
Merged revision(s) 1090-1195 from branches/STF484_VALIDATION
parent
19ba9213
Changes
36
Hide whitespace changes
Inline
Side-by-side
ttcn/BTP/LibItsBtp_Functions.ttcn
View file @
b9ccb54e
...
...
@@ -10,10 +10,14 @@
// LibCommon
import
from
LibCommon_Sync
all
;
import
from
LibCommon_Time
all
;
import
from
LibCommon_VerdictControl
all
;
// LibIts
// LibIts
Common
import
from
LibItsCommon_Functions
all
;
import
from
LibItsCommon_TypesAndValues
all
;
// LibItsBtp
import
from
LibItsBtp_TestSystem
all
;
import
from
LibItsBtp_TypesAndValues
all
;
import
from
LibItsBtp_Templates
all
;
...
...
@@ -30,7 +34,7 @@
utPort
.
send
(
p_init
);
tc_wait
.
start
;
alt
{
[]
utPort
.
receive
(
UtResult
:
true
)
{
[]
utPort
.
receive
(
Ut
Initialize
Result
:
true
)
{
tc_wait
.
stop
;
log
(
"*** f_utInitializeIut: INFO: IUT initialized ***"
);
}
...
...
@@ -44,6 +48,7 @@
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
...
...
@@ -54,12 +59,11 @@
* @desc Triggers event from the application layer
* @param p_event The event to trigger.
*/
function
f_utTriggerEvent
(
template
(
value
)
UtEvent
p_event
)
runs
on
ItsBtp
{
var
template
(
value
)
UtTrigger
v_utMsg
:=
{
p_event
};
function
f_utTriggerEvent
(
template
(
value
)
UtBtpTrigger
p_event
)
runs
on
ItsBtp
{
utPort
.
send
(
v_utMsg
);
utPort
.
send
(
p_event
);
alt
{
[]
utPort
.
receive
(
UtResult
:
true
)
{
[]
utPort
.
receive
(
Ut
BtpTrigger
Result
:
true
)
{
tc_wait
.
stop
;
}
[]
utPort
.
receive
{
...
...
@@ -68,58 +72,18 @@
[]
tc_wait
.
timeout
{
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
}
/**
* @desc Checks that the event was indicated at the application layer
* @param p_event The event to check.
* @param p_discard The event should not appear. Default value: FALSE.
*/
function
f_utCheckEvent
(
template
(
value
)
UtEvent
p_event
,
boolean
p_discard
)
runs
on
ItsBtp
{
var
template
(
value
)
UtCheck
v_utMsg
:=
{
p_event
};
utPort
.
send
(
v_utMsg
);
tc_wait
.
start
;
alt
{
[]
utPort
.
receive
(
UtResult
:
true
)
{
tc_wait
.
stop
;
if
(
p_discard
==
false
)
{
log
(
"*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***"
);
}
else
{
log
(
"*** f_utCheckEvent: ERROR: Event indicated at application layer where it should be discarded ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_error
);
}
}
[]
utPort
.
receive
(
UtResult
:
false
)
{
tc_wait
.
stop
;
if
(
p_discard
==
false
)
{
log
(
"*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_error
);
}
else
{
log
(
"*** f_utCheckEvent: INFO: Event not indicated at application layer***"
);
}
}
[]
tc_wait
.
timeout
{
log
(
"*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
repeat
;
}
}
}
}
// End of group utFunctions
group
configurationFunctions
{
/**
* @desc Setups default configuration
/**
* @desc Setups default configuration
*/
function
f_cfUp
()
runs
on
ItsBtp
{
...
...
@@ -129,8 +93,8 @@
}
// end f_cfUp
/**
* @desc Deletes default configuration
/**
* @desc Deletes default configuration
*/
function
f_cfDown
()
runs
on
ItsBtp
{
...
...
@@ -168,6 +132,23 @@
stop
;
}
}
/**
* @desc The default for handling upper tester messages.
*/
altstep
a_utDefault
()
runs
on
ItsBtp
{
var
UtBtpEventInd
v_ind
;
[]
utPort
.
receive
(
UtBtpEventInd
:?
)
->
value
v_ind
{
//store every upper tester indication received
vc_utEvents
[
lengthof
(
vc_utEvents
)]
:=
v_ind
;
repeat
;
}
[]
utPort
.
receive
{
log
(
"*** "
&
testcasename
()
&
": INFO: Received unhandled/unknown UT message from IUT ***"
);
repeat
;
}
}
}
//end btpAltsteps
group
preambles
{
...
...
@@ -177,6 +158,7 @@
*/
function
f_prDefault
()
runs
on
ItsBtp
{
activate
(
a_default
());
activate
(
a_utDefault
());
}
/**
...
...
@@ -185,7 +167,7 @@
function
f_prInitialState
()
runs
on
ItsBtp
{
f_utInitializeIut
(
m_btpInitialize
);
f_prDefault
();
f_prDefault
();
}
...
...
@@ -205,9 +187,9 @@
group
getFunctions
{
/**
* @desc Gets the BTP source port of the IUT.
* @return BTP source port ID
/**
* @desc Gets the BTP source port of the IUT.
* @return BTP source port ID
*/
function
f_getBtpSrcPort
()
return
BtpPortId
{
return
PX_SOURCE_PORT
;
...
...
ttcn/BTP/LibItsBtp_Templates.ttcn
View file @
b9ccb54e
...
...
@@ -11,12 +11,13 @@ module LibItsBtp_Templates {
import
from
LibItsBtp_TestSystem
all
;
import
from
LibItsBtp_TypesAndValues
all
;
import
from
LibItsBtp_Pixits
all
;
import
from
LibItsCommon_TypesAndValues
all
;
group
btpPrimitivesTemplates
{
/**
/**
* @desc Send template for BTP packet (BtpPort Primitive)
* @param p_btpPkt BTP Packet to be sent
* @param p_btpPkt BTP Packet to be sent
*/
template
(
value
)
BtpReq
m_btpReq
(
template
(
value
)
BtpPacket
p_btpPkt
...
...
@@ -24,9 +25,9 @@ module LibItsBtp_Templates {
msgOut
:=
p_btpPkt
}
/**
* @desc Receive template for BTP packet (BtpPort Primitive)
* @param p_btpPkt BTP Packet to be received
/**
* @desc Receive template for BTP packet (BtpPort Primitive)
* @param p_btpPkt BTP Packet to be received
*/
template
BtpInd
mw_btpInd
(
template
(
present
)
BtpPacket
p_btpPkt
...
...
@@ -36,22 +37,21 @@ module LibItsBtp_Templates {
group
utPrimitives
{
/**
* @desc Initializes the BTP IUT.
/**
* @desc Initializes the BTP IUT.
*/
template
(
value
)
UtInitialize
m_btpInitialize
:=
{
utBtpInitialize
:=
{
}
hashedId8
:=
'0000000000000000'O
}
/**
* @desc Generate a BTP A packet
* @param p_destPort The destination port
* @param p_srcPort The source port
* @param p_destPort The destination port
* @param p_srcPort The source port
*/
template
(
value
)
Ut
Event
m_generateBtpA
(
in
BtpPortId
p_destPort
,
in
BtpPortId
p_srcPort
)
:=
{
utBtpEvent
:=
{
btpA
:=
{
template
(
value
)
Ut
BtpTrigger
m_generateBtpA
(
in
BtpPortId
p_destPort
,
in
BtpPortId
p_srcPort
)
:=
{
btpA
:=
{
btpA
Header
:=
{
destinationPort
:=
p_destPort
,
sourcePort
:=
p_srcPort
}
...
...
@@ -63,25 +63,15 @@ module LibItsBtp_Templates {
* @param p_destPort The destination port
* @param p_destPortInfo The destination port information
*/
template
(
value
)
Ut
Event
m_generateBtpB
(
in
BtpPortId
p_destPort
,
in
BtpPortInfo
p_destPortInfo
)
:=
{
utBtpEvent
:=
{
btpB
:=
{
template
(
value
)
Ut
BtpTrigger
m_generateBtpB
(
in
BtpPortId
p_destPort
,
in
BtpPortInfo
p_destPortInfo
)
:=
{
btpB
:=
{
btpB
Header
:=
{
destinationPort
:=
p_destPort
,
destinationPortInfo
:=
p_destPortInfo
}
}
}
/**
* @desc Upper Tester template for checking that BTP payload has been transmitted to upper layer
* @param p_payload Payload to be checked
*/
template
(
value
)
UtEvent
m_checkPayload
(
in
BtpPayload
p_payload
)
:=
{
utBtpEvent
:=
{
payload
:=
p_payload
}
}
}
// end utPrimitives
}
// btpPrimitivesTemplates
...
...
@@ -124,11 +114,11 @@ module LibItsBtp_Templates {
payload
:=
p_payload
}
/**
* @desc Send template for BTP-A packet with port parameters
* @param p_destPort Destination port
* @param p_srcPort Source port
* @param p_payload Payload
/**
* @desc Send template for BTP-A packet with port parameters
* @param p_destPort Destination port
* @param p_srcPort Source port
* @param p_payload Payload
*/
template
(
value
)
BtpPacket
m_btpAWithPorts
(
template
(
value
)
BtpPortId
p_destPort
,
...
...
@@ -144,11 +134,11 @@ module LibItsBtp_Templates {
payload
:=
p_payload
}
/**
* @desc Send template for BTP-B packet with port parameters
* @param p_destPort Destination port
* @param p_destPortInfo Destination port information
* @param p_payload Payload
/**
* @desc Send template for BTP-B packet with port parameters
* @param p_destPort Destination port
* @param p_destPortInfo Destination port information
* @param p_payload Payload
*/
template
(
value
)
BtpPacket
m_btpBWithPorts
(
template
(
value
)
BtpPortId
p_destPort
,
...
...
@@ -164,11 +154,11 @@ module LibItsBtp_Templates {
payload
:=
p_payload
}
/**
* @desc Receive template for BTP-A packet
* @param p_destPort Destination port
* @param p_srcPort Source port
* @param p_payload Payload
/**
* @desc Receive template for BTP-A packet
* @param p_destPort Destination port
* @param p_srcPort Source port
* @param p_payload Payload
*/
template
BtpPacket
mw_btpA
(
template
(
present
)
BtpPortId
p_destPort
,
...
...
@@ -184,11 +174,11 @@ module LibItsBtp_Templates {
payload
:=
p_payload
}
/**
* @desc Receive template for BTP-B packet
* @param p_destPort Destination port
* @param p_destPortInfo Destination port information
* @param p_payload Payload
/**
* @desc Receive template for BTP-B packet
* @param p_destPort Destination port
* @param p_destPortInfo Destination port information
* @param p_payload Payload
*/
template
BtpPacket
mw_btpB
(
template
(
present
)
BtpPortId
p_destPort
,
...
...
ttcn/BTP/LibItsBtp_TestSystem.ttcn
View file @
b9ccb54e
...
...
@@ -13,6 +13,7 @@ module LibItsBtp_TestSystem {
// LibIts
import
from
LibItsCommon_TestSystem
all
;
import
from
LibItsCommon_TypesAndValues
all
;
import
from
LibItsBtp_TypesAndValues
all
;
group
portDefinitions
{
...
...
@@ -22,9 +23,9 @@ module LibItsBtp_TestSystem {
*/
type
port
UpperTesterPort
message
{
out
UtInitialize
,
UtTrigger
,
UtCheck
;
UtInitialize
,
Ut
Btp
Trigger
;
in
Ut
Result
;
Ut
InitializeResult
,
UtBtpTriggerResult
,
UtBtpEventInd
;
}
// end UpperTesterPort
}
// end portDefinitions
...
...
@@ -77,6 +78,8 @@ module LibItsBtp_TestSystem {
// timers
var
UtBtpEventIndList
vc_utEvents
:=
{};
}
// End of component ItsBtp
group
networkAndTransportPrimitives
{
...
...
ttcn/BTP/LibItsBtp_TypesAndValues.ttcn
View file @
b9ccb54e
...
...
@@ -117,58 +117,52 @@ module LibItsBtp_TypesAndValues {
group
utCommonPrimitives
{
/**
* @desc Upper Tester message to initialize IUT
* @desc UT primitives for BTP
* @member btpA -
* @member btpB -
*/
type
union
UtInitialize
{
UtBtpInitialize
utBtpInitialize
type
union
UtBtpTrigger
{
GenerateBtpA
btpA
,
GenerateBtpB
btpB
}
type
boolean
UtBtpTriggerResult
;
/**
* @desc Upper Tester message
describing an action/event
* @desc Upper Tester message
to request triggering of an BTPA message at IUT
*/
type
union
UtEvent
{
Ut
Btp
Event
utBtpEvent
type
record
GenerateBtpA
{
Btp
AHeader
btpAHeader
}
/**
* @desc Upper Tester message to
trigger an action on
IUT
* @desc Upper Tester message to
request triggering of an BTPB message at
IUT
*/
type
record
UtTrigger
{
UtEvent
utEvent
type
record
GenerateBtpB
{
BtpBHeader
btpBHeader
}
/**
* @desc Upper Tester message to check event/status on IUT
* @desc Upper Tester message to check event/status on
BTP
IUT
*/
type
record
Ut
Check
{
UtEvent
utEvent
type
record
Ut
BtpEventInd
{
BtpRawPayload
rawPayload
}
/**
* @desc Upper Tester
response message
* @desc
List of
Upper Tester
messages to check event/status on CAM IUT
*/
type
boolean
UtResult
;
}
with
{
encode
"LibItsCommon"
type
record
of
UtBtpEventInd
UtBtpEventIndList
;
}
// with {
// encode "LibItsCommon"
// }
/**
* @desc Upper Tester message to initialize BTP IUT
*/
type
record
UtBtpInitialize
{
}
/**
* @desc Upper Tester message generating BTP packet
*/
type
union
UtBtpEvent
{
BtpAHeader
btpA
,
BtpBHeader
btpB
,
BtpPayload
payload
}
}
// end utPrimitives
with
{
encode
"UpperTester"
}
}
with
{
...
...
ttcn/CALM/ATSP/LibItsAtsp_Functions.ttcn3
View file @
b9ccb54e
...
...
@@ -17,7 +17,7 @@ module LibItsAtsp_Functions {
type
FncRetCode
};
import
from
LibCommon_Time
{
function
f_sleepIgnoreDef
function
f_sleep
,
f_sleepIgnoreDef
};
import
from
LibCommon_BasicTypesAndValues
{
type
UInt6
,
UInt8
...
...
@@ -99,6 +99,7 @@ module LibItsAtsp_Functions {
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
// End of 'alt' statement
...
...
@@ -210,6 +211,7 @@ module LibItsAtsp_Functions {
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
// End of 'alt' statement
...
...
ttcn/CALM/FNTP/LibItsFntp_Functions.ttcn3
View file @
b9ccb54e
...
...
@@ -17,7 +17,7 @@ module LibItsFntp_Functions {
type
FncRetCode
};
import
from
LibCommon_Time
{
function
f_sleepIgnoreDef
function
f_sleep
,
f_sleepIgnoreDef
};
import
from
LibCommon_BasicTypesAndValues
{
type
UInt16
...
...
@@ -99,6 +99,7 @@ module LibItsFntp_Functions {
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
// End of 'alt' statement
...
...
@@ -219,6 +220,7 @@ module LibItsFntp_Functions {
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
// End of 'alt' statement
...
...
ttcn/CALM/FSAP/LibItsFsap_Functions.ttcn3
View file @
b9ccb54e
...
...
@@ -9,7 +9,7 @@ module LibItsFsap_Functions {
// Libcommon
import
from
LibCommon_Sync
all
;
import
from
LibCommon_Time
{
function
f_sleepIgnoreDef
function
f_sleep
,
f_sleepIgnoreDef
};
// LibIts
...
...
@@ -91,6 +91,7 @@ module LibItsFsap_Functions {
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
// End of 'alt' statement
...
...
@@ -201,6 +202,7 @@ module LibItsFsap_Functions {
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
// End of 'alt' statement
...
...
ttcn/CALM/IICP/LibItsIicp_Functions.ttcn3
View file @
b9ccb54e
...
...
@@ -9,7 +9,7 @@ module LibItsIicp_Functions {
// LibCommon
import
from
LibCommon_Sync
all
;
import
from
LibCommon_Time
{
function
f_sleepIgnoreDef
function
f_sleep
,
f_sleepIgnoreDef
};
import
from
LibCommon_BasicTypesAndValues
{
const
...
...
@@ -98,6 +98,7 @@ module LibItsIicp_Functions {
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
// End of 'alt' statement
...
...
ttcn/CAM/LibItsCam_Functions.ttcn
View file @
b9ccb54e
...
...
@@ -8,8 +8,9 @@
module
LibItsCam_Functions
{
// LibCommon
import
from
LibCommon_
Sync
all
;
import
from
LibCommon_
Time
all
;
import
from
LibCommon_VerdictControl
all
;
import
from
LibCommon_Sync
all
;
// LibIts
import
from
LibItsCam_TestSystem
all
;
...
...
@@ -46,6 +47,7 @@ module LibItsCam_Functions {
f_selfOrClientSyncAndVerdict
(
"error"
,
e_timeout
);
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
...
...
@@ -70,6 +72,7 @@ module LibItsCam_Functions {
[]
tc_wait
.
timeout
{
}
[
else
]
{
// Shortcut defaults
//f_sleep(0.050); // 50 ms
repeat
;
}
}
...
...
@@ -86,11 +89,15 @@ module LibItsCam_Functions {
[]
utPort
.
receive
(
UtChangePositionResult
:?
)
{
tc_wait
.
stop
;
}
[]
utPort
.
receive
{
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
//f_sleep(0.050); // 50 ms
repeat
;
}
}
...
...
@@ -163,9 +170,8 @@ module LibItsCam_Functions {
repeat
;
}
[]
utPort
.
receive
{
tc_wait
.
stop
;
log
(
"*** "
&
testcasename
()
&
": INFO: Received unexpected UT message from IUT ***"
);
f_selfOrClientSyncAndVerdict
(
"error"
,
e_error
);
log
(
"*** "
&
testcasename
()
&
": INFO: Received unhandled/unknown UT message from IUT ***"
);
repeat
;
}
}
...
...
@@ -191,6 +197,9 @@ module LibItsCam_Functions {
f_prDefault
();
//Allow burst mode at the beginning
f_sleep
(
1.0
);
camPort
.
clear
;
tc_ac
.
start
;
alt
{
...
...
ttcn/CAM/LibItsCam_Pics.ttcn
View file @
b9ccb54e
...
...
@@ -94,8 +94,11 @@ module LibItsCam_Pics {
* @see ETSI TS 102 868-2 Table 3
*/
modulepar
boolean
PICS_CAM_RECEPTION
:=
true
;
/**
* @desc Is the IUT RSU?
*/
modulepar
boolean
PICS_RSU
:=
false
;
}
// end camPics
}
// end LibItsCam_Pics
ttcn/CAM/LibItsCam_Templates.ttcn
View file @
b9ccb54e
...
...
@@ -74,8 +74,8 @@ module LibItsCam_Templates {
*/
template
CamInd
mw_camIndWithBtpParameters
(
in
template
(
present
)
CAM
p_camMsg
,
in
template
UInt
8
p_btpDestinationPort
:=
*
,
in
template
UInt
8
p_btpInfo
:=
*
in
template
UInt
16
p_btpDestinationPort
:=
*
,
in
template
UInt
16
p_btpInfo
:=
*
)
modifies
mw_camInd
:=
{
btpDestinationPort
:=
p_btpDestinationPort
,
btpInfo
:=
p_btpInfo
...
...
@@ -112,7 +112,7 @@ module LibItsCam_Templates {
* @desc Change the speed
* @param p_offset The speed value offset
*/
template
(
value
)
UtCamTrigger
m_changeSpeed
(
SpeedValue
p_changeSpeed
)
:=
{