Commit 0be31c6d authored by Yann Garcia's avatar Yann Garcia
Browse files

Unify STF525 TTCN-3 code

parent 4441b867
......@@ -31,7 +31,6 @@ module LibItsBtp_TypesAndValues {
}
with {
variant "FIELDORDER(msb)"
encode "LibIts_Interface"
}
} // end btpPdus
......@@ -46,10 +45,10 @@ module LibItsBtp_TypesAndValues {
*/
type union BtpHeader {
BtpAHeader btpAHeader,
BtpBHeader btpBHeader
} with {
BtpBHeader btpBHeader
} with {
variant "FIELDORDER(msb)"
}
}
/**
......@@ -61,10 +60,9 @@ module LibItsBtp_TypesAndValues {
type record BtpAHeader {
BtpPortId destinationPort,
BtpPortId sourcePort
} with {
} with {
variant "FIELDORDER(msb)"
}
}
/**
* @desc BTP-B Header
......@@ -75,9 +73,9 @@ module LibItsBtp_TypesAndValues {
type record BtpBHeader {
BtpPortId destinationPort,
BtpPortInfo destinationPortInfo
} with {
} with {
variant "FIELDORDER(msb)"
}
}
/**
......@@ -95,17 +93,17 @@ module LibItsBtp_TypesAndValues {
} // end btpHeaders
group utPrimitives {
group utCommonPrimitives {
/**
* @desc Upper Tester message to initialize IUT
* @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use
*/
type record UtBtpInitialize {
Oct8 hashedId8
Oct8 hashedId8
} with {
variant "FIELDORDER(msb)"
variant "FIELDORDER(msb)"
}
/**
......@@ -114,10 +112,10 @@ module LibItsBtp_TypesAndValues {
* @member utBtpTriggerResult -
*/
type union UtBtpResults {
boolean utBtpInitializeResult,
boolean utBtpTriggerResult
boolean utBtpInitializeResult,
boolean utBtpTriggerResult
} with {
variant ""
variant ""
}
/**
......@@ -126,46 +124,46 @@ module LibItsBtp_TypesAndValues {
* @member btpB -
*/
type union UtBtpTrigger {
GenerateBtpA btpA,
GenerateBtpB btpB
GenerateBtpA btpA,
GenerateBtpB btpB
} with {
variant ""
}
variant ""
}
/**
* @desc Upper Tester message to request triggering of an BTPA message at IUT
*/
type record GenerateBtpA {
BtpAHeader btpAHeader
BtpAHeader btpAHeader
} with {
variant "FIELDORDER(msb)"
}
variant "FIELDORDER(msb)"
}
/**
* @desc Upper Tester message to request triggering of an BTPB message at IUT
*/
type record GenerateBtpB {
BtpBHeader btpBHeader
BtpBHeader btpBHeader
} with {
variant "FIELDORDER(msb)"
}
variant "FIELDORDER(msb)"
}
/**
* @desc Upper Tester message to check event/status on BTP IUT
*/
type record UtBtpEventInd {
BtpRawPayload rawPayload
BtpRawPayload rawPayload
} with {
variant "FIELDORDER(msb)"
}
variant "FIELDORDER(msb)"
}
/**
* @desc List of Upper Tester messages to check event/status on CAM IUT
*/
type record of UtBtpEventInd UtBtpEventIndList;
}
} // end utPrimitives
with {
variant ""
......
......@@ -109,7 +109,6 @@ module LibItsCam_Functions {
}
[] utPort.receive(UtCamResults: { utCamChangePositionResult := ? }) {
tc_wait.stop;
log("*** f_utChangePosition: INFO: IUT position change was not successful ***");
f_selfOrClientSyncAndVerdict("error", e_error);
}
[] tc_wait.timeout {
......
/**
* @author ETSI / STF405 / STF449 / STF484 / STF517
* @version $URL$
* $Id$
* @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/CAM/LibItsCam_TypesAndValues.ttcn $
* $Id: LibItsCam_TypesAndValues.ttcn 1318 2017-01-26 10:20:53Z filatov $
* @desc Module containing types and values for CAM Protocol
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
......@@ -165,9 +165,9 @@ module LibItsCam_TypesAndValues {
*/
type record UtCamEventInd {
CAM camMsg // TODO Rename into caMsg to be compliant with UtDenmEventInd
} with {
} with {
encode (camMsg) "LibItsCam_asn1"
}
}
/**
* @desc List of Upper Tester messages to check event/status on CAM IUT
......
......@@ -45,6 +45,7 @@ module LibItsCommon_TypesAndValues {
} // End of type AcDisableSecurity
/**
* @desc Primitive for receiving response from TA
* @desc TA primitives for GNSS
* @member loadScenario -
* @member startScenario -
......@@ -192,14 +193,14 @@ module LibItsCommon_TypesAndValues {
* @see ETSI TS 102 965 Intelligent Transport Systems (ITS); Application Object Identifier (ITS-AID); Registration list ETSI ITS registration list
*/
group securityConstants {
const integer c_its_aid_CAM := 36;
const integer c_its_aid_DENM := 37;
const integer c_its_aid_SPAT := 137;
const integer c_its_aid_MAP := 138;
const integer c_its_aid_IVI := 139;
const integer c_its_aid_CAM := 36;
const integer c_its_aid_DENM := 37;
const integer c_its_aid_SPAT := 137;
const integer c_its_aid_MAP := 138;
const integer c_its_aid_IVI := 139;
const integer c_its_aid_TLC := 140;
const integer c_its_aid_GN := 141;
const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html
const integer c_its_aid_SCR := 623; // Secured Certificate Request, https://standards.ieee.org/products-services/regauth/psid/public.html
}
}
with {
......
......@@ -83,7 +83,7 @@ module LibItsDenm_Functions {
}
[] utPort.receive(UtDenmResults: { utDenmChangePseudonymResult := false}) {
tc_wait.stop;
log("*** " & testcasename() & ": INFO: IUT pseudonym changed ***");
log("*** " & testcasename() & ": INFO: IUT pseudonym unchanged ***");
f_selfOrClientSyncAndVerdict("error", e_error);
}
[] a_utDefault() {
......
......@@ -578,8 +578,6 @@ module LibItsDenm_Templates {
eventPosition := ?,
relevanceDistance := *,
relevanceTrafficDirection := *,
//FIXME (DF) validityDuration is set as mandatory, '*' can not be assigned to it
// validityDuration := *, // It seems that a default value can be omitted (asn1studio)
validityDuration := ?, // It seems that a default value can be omitted (asn1studio)
transmissionInterval := *,
stationType := ?
......
......@@ -106,9 +106,9 @@ module LibItsDenm_TypesAndValues {
TransmissionInterval transmissionInterval optional,
TransmissionInterval repetitionInterval optional,
AlacarteContainer alacarte optional
} with {
} with {
variant "FIELDORDER(msb)"
}
}
/**
* @desc Upper Tester result message of request of triggering of an event at IUT
......@@ -116,9 +116,9 @@ module LibItsDenm_TypesAndValues {
type record UtDenmTriggerResult {
boolean result,
ActionID actionId
} with {
} with {
variant "FIELDORDER(msb)"
}
}
/**
* @desc Upper Tester message to update an event at IUT
......@@ -134,9 +134,9 @@ module LibItsDenm_TypesAndValues {
TransmissionInterval transmissionInterval optional,
TransmissionInterval repetitionInterval optional,
AlacarteContainer alacarte optional
} with {
} with {
variant "FIELDORDER(msb)"
}
}
/**
* @desc Upper Tester result message of an update request of an event on DENM IUT
......@@ -144,18 +144,18 @@ module LibItsDenm_TypesAndValues {
type record UtDenmUpdateResult {
boolean result,
ActionID actionId
} with {
} with {
variant "FIELDORDER(msb)"
}
}
/**
* @desc Upper Tester message to request the termination of an event at IUT
*/
type record UtDenmTermination {
ActionID actionId
} with {
} with {
variant "FIELDORDER(msb)"
}
}
/**
* @desc Upper Tester message to change the position of IUT. Values a relatives
......@@ -175,7 +175,7 @@ module LibItsDenm_TypesAndValues {
// empty on purpose
} with {
variant "FIELDORDER(msb)"
}
}
/**
* @desc Upper Tester message to check event/status on DENM IUT
......
......@@ -77,24 +77,8 @@ module LibItsGeoNetworking_TestSystem {
/**
* @desc ITS Main Test Component
*/
//FIXME RGY ItsMtc can extend ItsBaseGeoNetworking instead of ItsSecurityBaseComponent, as it contains
// everything defined here but vc_componentTable and already extends ItsSecurityBaseComponent
// also, ItsBaseMtc already extends ServerSyncComp
// type component ItsMtc extends ItsBaseMtc, ServerSyncComp, ItsSecurityBaseComponent { // TODO Extend ItsBaseMtc with ItsSecurityBaseComponent? {
type component ItsMtc extends ItsBaseMtc, ItsBaseGeoNetworking {
/*FIXME RGY all these objects are inherited from ItsBaseGeoNetworking, they shall not be defined again: see $6.2.10.2
port UpperTesterPort utPort;
port AdapterControlPort acPort;
*/
var ComponentTable vc_componentTable := {};
/*
// UT indications
var UtGnEventIndList vc_utInds := {};
var boolean vc_utDefaultActive := true;
var boolean vc_acDefaultActive := true;
var boolean vc_gnDefaultActive := true;
*/
} // end ItsMtc
/**
......
......@@ -1065,7 +1065,6 @@ module LibItsGeoNetworking_TypesAndValues {
* @desc Upper Tester message to check Upper Layer message transmission on GN IUT
*/
type record UtGnEventInd {
// GeoNetworkingPdu gnPdu
GnRawPayload rawPayload
} with {
variant "FIELDORDER(msb)"
......
/**
* @author ETSI / STF517
* @version $URL$
* $Id$
* @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Functions.ttcn $
* $Id: LibItsIvim_Functions.ttcn,v 1.2 2018/05/31 15:57:12 dte Exp $
* @desc Module containing functions for IVIM
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
......@@ -44,6 +44,9 @@ module LibItsIvim_Functions {
*/
function f_utInitializeIut(template (value) UtIvimInitialize p_init) runs on ItsIvim {
//deactivate ivimPort default alts
vc_ivimDefaultActive := false;
utPort.send(p_init);
tc_wait.start;
alt {
......@@ -58,11 +61,10 @@ module LibItsIvim_Functions {
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;
}
}
//deactivate ivimPort default alts
vc_ivimDefaultActive := true;
}
/**
......@@ -75,6 +77,9 @@ module LibItsIvim_Functions {
var IviIdentificationNumber v_iviIdentificationNumber;
var UtIvimResults v_result;
//deactivate ivimPort default alts
vc_ivimDefaultActive := false;
utPort.send(p_event);
tc_wait.start;
alt {
......@@ -92,12 +97,11 @@ module LibItsIvim_Functions {
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;
}
}
//deactivate ivimPort default alts
vc_ivimDefaultActive := true;
return v_iviIdentificationNumber;
}
......@@ -111,6 +115,9 @@ module LibItsIvim_Functions {
var IviIdentificationNumber v_iviIdentificationNumber;
var UtIvimResults v_result;
//deactivate ivimPort default alts
vc_ivimDefaultActive := false;
utPort.send(p_event);
tc_wait.start;
alt {
......@@ -128,12 +135,11 @@ module LibItsIvim_Functions {
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;
}
}
//activate ivimPort default alts
vc_ivimDefaultActive := true;
return v_iviIdentificationNumber;
}
......@@ -143,6 +149,9 @@ module LibItsIvim_Functions {
*/
function f_utTerminateEvent(template (value) UtIvimTermination p_event) runs on ItsIvim {
//deactivate ivimPort default alts
vc_ivimDefaultActive := false;
utPort.send(p_event);
tc_wait.start;
alt {
......@@ -156,11 +165,10 @@ module LibItsIvim_Functions {
[] a_utDefault() {
//empty on purpose
}
[else] { // Shortcut defaults
// //f_sleep(0.050); // 50 ms
repeat;
}
}
//deactivate ivimPort default alts
vc_ivimDefaultActive := true;
}
} // End of group utFunctions
......@@ -171,12 +179,12 @@ module LibItsIvim_Functions {
* @desc Initialise secure mode if required
*/
function f_initialiseSecuredMode(
in charstring p_certificate_id := PX_CERT_FOR_TS
in charstring p_certificateId := PX_CERT_FOR_TS
) runs on ItsIvim {
if (PICS_IS_IUT_SECURED == true) {
if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificate_id))) {
if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) {
log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***");
stop;
}
......@@ -226,11 +234,11 @@ module LibItsIvim_Functions {
/**
* @desc Setups default configuration
* @param p_certificate_id The certificate identifier the TA shall use in case of secured IUT
* @param p_certificateId The certificate identifier the TA shall use in case of secured IUT
*/
function f_cfUp(
in charstring p_certificate_id := PX_CERT_FOR_TS
) runs on ItsIvim /* TITAN TODO: system ItsIvimSystem */{
in charstring p_certificateId := PX_CERT_FOR_TS
) runs on ItsIvim system ItsIvimSystem {
map(self:acPort, system:acPort);
map(self:utPort, system:utPort);
......@@ -238,14 +246,14 @@ module LibItsIvim_Functions {
f_connect4SelfOrClientSync();
// Initialise secured mode
f_initialiseSecuredMode(p_certificate_id);
f_initialiseSecuredMode(p_certificateId);
} // End of function f_cfUp
/**
* @desc Deletes default configuration
*/
function f_cfDown() runs on ItsIvim /* TITAN TODO: system ItsIvimSystem */{
function f_cfDown() runs on ItsIvim system ItsIvimSystem {
// Initialise secured mode
f_uninitialiseSecuredMode();
......@@ -265,7 +273,7 @@ module LibItsIvim_Functions {
* @desc The base default.
*/
altstep a_default() runs on ItsIvim {
[] ivimPort.receive(
[vc_ivimDefaultActive] ivimPort.receive(
mw_ivimInd(
mw_ivimPdu(
mw_ivimStructure
......@@ -274,7 +282,7 @@ module LibItsIvim_Functions {
vc_ivimReceived := true;
repeat;
}
[] ivimPort.receive {
[vc_ivimDefaultActive] ivimPort.receive {
log("*** " & testcasename() & ": ERROR: Received an unexpected message ***");
f_selfOrClientSyncAndVerdict("error", e_error);
}
......
/**
* @author ETSI / STF517
* @version $URL$
* $Id$
* @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Pics.ttcn $
* $Id: LibItsIvim_Pics.ttcn 1312 2016-12-14 09:21:45Z garciay $
* @desc IVIM PICS
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
......
/**
* @author ETSI / STF517
* @version $URL$
* $Id$
* @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Pixits.ttcn $
* $Id: LibItsIvim_Pixits.ttcn 1315 2016-12-15 13:25:41Z garciay $
* @desc IVIM PIXITS
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
......
/**
* @author ETSI / STF517
* @version $URL$
* $Id$
* @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_Templates.ttcn $
* $Id: LibItsIvim_Templates.ttcn 1316 2017-01-03 09:03:43Z garciay $
* @desc Module containing base template definitions for IVIM
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
......@@ -171,9 +171,9 @@ module LibItsIvim_Templates {
template (omit) IviStructure.optional_ p_optional_ := omit
) := {
iviIdentificationNumber := p_iviIdentificationNumber,
timeStamp := p_timeStamp,
validFrom := p_validFrom,
validTo := p_validTo,
timeStamp := p_timeStamp,
connectedIviStructures := p_connectedIviStructures,
optional_ := p_optional_
} // End of template m_utIvimUpdateEvent
......@@ -295,7 +295,7 @@ module LibItsIvim_Templates {
* @param p_mandatory The Management Container
* @param p_optional_ A list of IVI Container (Default: omit)
*/
template IviStructure mw_ivimStructure(
template (present) IviStructure mw_ivimStructure(
template (present) IVIManagementContainer p_mandatory := ?,
template IviStructure.optional_ p_optional_ := *
) := {
......@@ -505,11 +505,11 @@ module LibItsIvim_Templates {
} // End of template m_glcPart
template GlcPart mw_glcPart(
template (present) Zid p_zoneId := ?,
template LanePosition p_laneNumber := *,
template GlcPart.zoneExtension p_zoneExtension := *,
template HeadingValue p_zoneHeading := *,
template Zone p_zone := *
template (present) Zid p_zoneId := ?,
template LanePosition p_laneNumber := *,
template GlcPart.zoneExtension p_zoneExtension := *,
template HeadingValue p_zoneHeading := *,
template Zone p_zone := *
) := {
zoneId := p_zoneId,
laneNumber := p_laneNumber,
......
/**
* @author ETSI / STF517
* @version $URL$
* $Id$
* @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_TestSystem.ttcn $
* $Id: LibItsIvim_TestSystem.ttcn,v 1.2 2018/05/31 15:57:12 dte Exp $
* @desc Test System module for ITS IVIM
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
......
/**
* @author ETSI / STF517
* @version $URL$
* $Id$
* @version $Url: https://oldforge.etsi.org/svn/LibIts/tags/20170222_STF527_Final/ttcn/IVIM/LibItsIvim_TypesAndValues.ttcn $
* $Id: LibItsIvim_TypesAndValues.ttcn,v 1.4 2019/01/02 14:14:11 dte Exp $
* @desc Module containing type and value definitions for IVIM
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
......@@ -39,6 +39,7 @@ module LibItsIvim_TypesAndValues {
const TimestampIts c_duration_4sec := 4;
const TimestampIts c_duration_6sec := 6;
type record of float Times;
} // End ofgroup ivimConstants
group otherTypes {
......@@ -93,9 +94,9 @@ module LibItsIvim_TypesAndValues {
TimestampIts repetitionInterval optional/*,
IVIManagementContainer.connectedIviStructures connectedIviStructures optional,
IviStructure.optional_ optional_ optional*/
} with {
} with {
variant "FIELDORDER(msb)"
}
}
/**
* @desc Upper Tester result message of request of triggering of an event at IUT
......@@ -103,23 +104,23 @@ module LibItsIvim_TypesAndValues {
type record UtIvimTriggerResult {
boolean result,
IviIdentificationNumber iviIdentificationNumber
} with {
} with {
variant "FIELDORDER(msb)"
}
}
/**
* @desc Upper Tester message to update an event at IUT
*/
type record UtIvimUpdate {
IviIdentificationNumber iviIdentificationNumber,
TimestampIts timeStamp optional,
TimestampIts validFrom optional,