Commits (2)
module ItsAutoInterop_Functions {
// LibCommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
import from LibCommon_VerdictControl all;
import from LibCommon_Sync all;
// LibIts
import from ITS_Container language "ASN.1:1997" all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all;
import from IEEE1609dot2BaseTypes language "ASN.1:1997" all;
import from IEEE1609dot2 language "ASN.1:1997" all;
import from EtsiTs103097Module language "ASN.1:1997" all;
// LibItsCommon
import from LibItsCommon_TypesAndValues all;
import from LibItsCommon_Templates all;
import from LibItsCommon_Functions all;
import from LibItsCommon_Pixits all;
import from LibItsCommon_TestSystem all;
import from LibItsCommon_ASN1_NamedNumbers all;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TypesAndValues all;
import from LibItsGeoNetworking_Templates all;
import from LibItsGeoNetworking_Pics all;
import from LibItsGeoNetworking_Functions all;
import from LibItsGeoNetworking_TestSystem all;
// LibItsBtp
import from LibItsBtp_TypesAndValues all;
// LibItsSecurity
import from LibItsSecurity_TypesAndValues all;
import from LibItsSecurity_Templates all;
import from LibItsSecurity_Functions all;
import from LibItsSecurity_Pixits all;
// ItsInterop
import from ItsAutoInterop_TypesAndValues all;
import from ItsAutoInterop_Templates all;
import from ItsAutoInterop_TestSystem all;
import from ItsAutoInterop_Pixits all;
group utFunctions {
/**
* @desc Triggers event from the application layer
* @param p_event The event to trigger.
*/
function f_utTriggerEvent(template (value) UtAutoInteropTrigger p_event) runs on ItsBaseGeoNetworking {
//deactivate autoInteropPort default alts
vc_gnDefaultActive := false;
utPort.send(p_event);
tc_wait.start;
alt {
[] utPort.receive(UtGnResults: { utAutoInteropTriggerResult := true }) {
tc_wait.stop;
}
[] utPort.receive(UtGnResults: { utAutoInteropTriggerResult := false }) {
tc_wait.stop;
log("*** f_utTriggerEvent: INFO: IUT trigger was not successful ***");
f_selfOrClientSyncAndVerdict("error", e_error);
}
[] utPort.receive {
tc_wait.stop;
log("*** f_utTriggerEvent: INFO: IUT trigger was not successful ***");
f_selfOrClientSyncAndVerdict("error", e_error);
}
[] tc_wait.timeout {
}
}
//activate autoInteropPort default alts
vc_gnDefaultActive := true;
}
} // End of group utFunctions
group hmiFunctions {
/**
* @desc Requests to bring the HMI in an initial state
* @param p_init The initialisation to trigger.
*/
function f_hmiInitializeIut(template (value) HmiInitialize p_init) runs on ItsAutoInteropGeonetworking {
//deactivate autoInteropPort default alts
vc_gnDefaultActive := false;
hmiPort.send(p_init);
tc_wait.start;
alt {
//FIXME RGY As discussed, port in type is changed to a top-level union type
// [] hmiPort.receive(HmiInitializeResult:true) {
[] hmiPort.receive(HmiAutoInteropResults:{hmiInitializeResult:=true}) {
tc_wait.stop;
log("*** f_hmiInitializeIhmi: INFO: EUT's HMI initialized ***");
}
[] hmiPort.receive {
tc_wait.stop;
log("*** f_hmiInitializeIhmi: INFO: EUT's HMI could not be initialized ***");
f_selfOrClientSyncAndVerdict("error", e_error);
}
[] tc_wait.timeout {
log("*** f_hmiInitializeIhmi: INFO: EUT's HMI could not be initialized in time ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
}
//activate autoInteropPort default alts
vc_gnDefaultActive := true;
}
} // End of group hmiFunctions
group preambles {
/**
* @desc Set up an EUT component
* @param p_eut The component reference
* @param p_scenario The GNSS scenario. Default: e_staticPosition
*/
function f_cfPtcUp(
in ItsAutoInteropGeonetworking p_eut,
in Scenario p_scenario := e_staticPosition // TODO Not used
) runs on ItsAutoInteropGeonetworking /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
// EUT
if (PX_CAPTURE_MODE == "on-link") {
map(p_eut:acPort, system:acPort);
map(p_eut:utPort, system:utPort);
map(p_eut:hmiPort, system:hmiPort);
}
map(p_eut:geoNetworkingPort, system:geoNetworkingPort);
//activate(a_cfPtcDown()); // FIXME To be done
//Initialze the IUT
LibItsGeoNetworking_Functions.f_initialiseSecuredMode();
// MTC intializes IUT
ItsAutoInterop_Functions.f_initialState(p_scenario); // TODO Create an AtsAtoInterop f_initialState function
} // End of function f_cfPtcUp
/**
* @desc Set up MTC for configuration #1
* @param p_eut1 The component reference for EUT1
* @param p_eut2 The component reference for EUT2
* @param p_eut3 The component reference for EUT3
* @param p_eut4 The component reference for EUT4
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-02) Clause 5.3.1 CF-01: Verify complete forwarding message scenario
*/
function f_mtcCf01Up(
inout ItsAutoInteropGeonetworking p_eut1,
inout ItsAutoInteropGeonetworking p_eut2,
inout ItsAutoInteropGeonetworking p_eut3,
inout ItsAutoInteropGeonetworking p_eut4
) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
// Create components
p_eut1 := ItsAutoInteropGeonetworking.create(c_compNodeB) alive;
p_eut2 := ItsAutoInteropGeonetworking.create(c_compNodeC) alive;
p_eut3 := ItsAutoInteropGeonetworking.create(c_compNodeD) alive;
p_eut4 := ItsAutoInteropGeonetworking.create(c_compNodeE) alive;
// Map & Connect
if (PX_CAPTURE_MODE == "on-link") {
map(self:acPort, system:acPort);
map(self:utPort, system:utPort);
}
connect(self:syncPort, mtc:syncPort);
connect(p_eut1:syncPort, self:syncPort);
connect(p_eut2:syncPort, self:syncPort);
connect(p_eut3:syncPort, self:syncPort);
connect(p_eut4:syncPort, self:syncPort);
// EUT1/EUT2/EUT3/EUT4
connect(p_eut1:eutGeoNetworkingPort, p_eut2:eutGeoNetworkingPort); // EUT1 & EUT2 are on-link
connect(p_eut1:eutGeoNetworkingPort, p_eut3:eutGeoNetworkingPort); // EUT1 & EUT3 are on-link
connect(p_eut2:eutGeoNetworkingPort, p_eut3:eutGeoNetworkingPort); // EUT2 & EUT3 are on-link
connect(p_eut2:eutGeoNetworkingPort, p_eut4:eutGeoNetworkingPort); // EUT2 & EUT4 are on-link
connect(p_eut3:eutGeoNetworkingPort, p_eut3:eutGeoNetworkingPort); // EUT3 & EUT4 are on-link
// EUT1 & EUT4 are of-link
activate(a_mtcCf01Down());
} // End of function f_mtcCf01Up
/**
* @desc Set up MTC for configuration #2
* @param p_eut1 The component reference for EUT1
* @param p_eut2 The component reference for EUT2
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-02) Clause 5.3.2 CF-02: Road Works Warning configuration
*/
function f_mtcCf02Up(
inout ItsAutoInteropGeonetworking p_eut1,
inout ItsAutoInteropGeonetworking p_eut2
) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
// Create components
p_eut1 := ItsAutoInteropGeonetworking.create(c_compNodeB);
p_eut2 := ItsAutoInteropGeonetworking.create(c_compNodeC);
// Map & Connect
if (PX_CAPTURE_MODE == "on-link") {
map(self:acPort, system:acPort);
map(self:utPort, system:utPort);
}
connect(self:syncPort, mtc:syncPort);
connect(p_eut1:syncPort, self:syncPort);
connect(p_eut2:syncPort, self:syncPort);
// EUT1/EUT2
connect(p_eut1:eutGeoNetworkingPort, p_eut2:eutGeoNetworkingPort);
activate(a_mtcCf02Down());
} // End of function f_mtcCf02Up
/**
* @desc Set up MTC for configuration #3
* @param p_eut1 The component reference for EUT1
* @param p_eut2 The component reference for EUT2
* @param p_eut3 The component reference for EUT3
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-02) Clause 5.3.3 CF-03: CA messages
*/
function f_mtcCf03Up(
inout ItsAutoInteropGeonetworking p_eut1,
inout ItsAutoInteropGeonetworking p_eut2,
inout ItsAutoInteropGeonetworking p_eut3
) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
// Create components
p_eut1 := ItsAutoInteropGeonetworking.create(c_compNodeB) alive;
p_eut2 := ItsAutoInteropGeonetworking.create(c_compNodeC) alive;
p_eut3 := ItsAutoInteropGeonetworking.create(c_compNodeD) alive;
// Map & Connect
if (PX_CAPTURE_MODE == "on-link") {
map(self:acPort, system:acPort);
map(self:utPort, system:utPort);
}
connect(self:syncPort, mtc:syncPort);
connect(p_eut1:syncPort, self:syncPort);
connect(p_eut2:syncPort, self:syncPort);
connect(p_eut3:syncPort, self:syncPort);
// EUT1/EUT2/EUT3
connect(p_eut1:eutGeoNetworkingPort, p_eut2:eutGeoNetworkingPort);
connect(p_eut1:eutGeoNetworkingPort, p_eut3:eutGeoNetworkingPort);
connect(p_eut2:eutGeoNetworkingPort, p_eut3:eutGeoNetworkingPort);
activate(a_mtcCf03Down());
} // End of function f_mtcCf03Up
/**
* @desc Brings the IUT into an initial state.
* @remark Component variable vc_hashedId8ToBeUsed shall be set with the IUT certificate to be used
*/
function f_initialState(Scenario p_scenario := e_staticPosition) runs on ItsBaseGeoNetworking {
if (PICS_GN_SECURITY) {
var Oct8 v_hashedId8ToBeUsed := f_setupIutCertificate(vc_hashedId8ToBeUsed);
if (oct2int(v_hashedId8ToBeUsed) == 0) {
v_hashedId8ToBeUsed := 'FFFFFFFFFFFFFFFF'O; // Reset to unknown value, the IUT will use its own certificates
}
if (PX_CAPTURE_MODE == "on-link") {
f_utInitializeIut(m_secGnInitialize(v_hashedId8ToBeUsed));
}
} // else, default behavior
else {
if (PX_CAPTURE_MODE == "on-link") {
f_utInitializeIut(m_gnInitialize);
}
}
f_acLoadScenario(p_scenario);
f_acStartScenario();
}
/**
* @desc The default preamble.
*/
function f_prDefault() runs on ItsAutoInteropGeonetworking {
activate(ItsAutoInterop_Functions.a_default());
activate(LibItsGeoNetworking_Functions.a_default());
if (PX_CAPTURE_MODE == "on-link") {
activate(LibItsGeoNetworking_Functions.a_utDefault());
activate(a_hmiDefault());
}
}
} // End of group preambles
group postambles {
/**
* @desc Shutdown an EUT component
* @param p_eut The component reference
*/
function f_cfPtcDown(
inout ItsAutoInteropGeonetworking p_eut
) runs on ItsAutoInteropGeonetworking /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
// Wait components done
deactivate;
// EUT
if (PX_CAPTURE_MODE == "on-link") {
unmap(p_eut:acPort, system:acPort);
unmap(p_eut:utPort, system:utPort);
unmap(p_eut:hmiPort, system:hmiPort);
}
unmap(p_eut:geoNetworkingPort, system:geoNetworkingPort);
disconnect(p_eut:syncPort, self:syncPort);
} // End of function f_cfPtcDown
/**
* @desc Shutdown MTC for configuration #1
* @param p_eut1 The component reference for EUT1
* @param p_eut2 The component reference for EUT2
* @param p_eut3 The component reference for EUT3
* @param p_eut4 The component reference for EUT4
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-02) Clause 5.3.1 CF-01: Verify complete forwarding message scenario
*/
function f_mtcCf01Down(
inout ItsAutoInteropGeonetworking p_eut1,
inout ItsAutoInteropGeonetworking p_eut2,
inout ItsAutoInteropGeonetworking p_eut3,
inout ItsAutoInteropGeonetworking p_eut4
) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
// Wait components done
p_eut1.done;
p_eut2.done;
p_eut3.done;
p_eut4.done;
deactivate;
// Unmap & disconnect
if (PX_CAPTURE_MODE == "on-link") {
unmap(self:acPort, system:acPort);
unmap(self:utPort, system:utPort);
}
disconnect(self:syncPort, mtc:syncPort);
// EUT1/EUT2/EUT3/EUT4
disconnect(p_eut1:eutGeoNetworkingPort, p_eut2:eutGeoNetworkingPort);
disconnect(p_eut1:eutGeoNetworkingPort, p_eut3:eutGeoNetworkingPort);
disconnect(p_eut2:eutGeoNetworkingPort, p_eut3:eutGeoNetworkingPort);
disconnect(p_eut2:eutGeoNetworkingPort, p_eut4:eutGeoNetworkingPort);
disconnect(p_eut3:eutGeoNetworkingPort, p_eut3:eutGeoNetworkingPort);
} // End of function f_mtcCf01Down
/**
* @desc Shutdown MTC for configuration #2
* @param p_eut1 The component reference for EUT1
* @param p_eut2 The component reference for EUT2
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-02) Clause 5.3.2 CF-02: Road Works Warning configuration
*/
function f_mtcCf02Down(
inout ItsAutoInteropGeonetworking p_eut1,
inout ItsAutoInteropGeonetworking p_eut2
) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
// Wait components done
p_eut1.done;
p_eut2.done;
deactivate;
// Unmap & disconnect
if (PX_CAPTURE_MODE == "on-link") {
unmap(self:acPort, system:acPort);
unmap(self:utPort, system:utPort);
}
disconnect(self:syncPort, mtc:syncPort);
// EUT1/EUT2
disconnect(p_eut1:eutGeoNetworkingPort, p_eut2:eutGeoNetworkingPort);
} // End of function f_mtcCf02Down
/**
* @desc Shutdown MTC with three components
* @param p_eut1 The component reference for EUT1
* @param p_eut2 The component reference for EUT2
* @param p_eut3 The component reference for EUT3
*/
function f_mtcCf03Down(
inout ItsAutoInteropGeonetworking p_eut1,
inout ItsAutoInteropGeonetworking p_eut2,
inout ItsAutoInteropGeonetworking p_eut3
) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
// Wait components done
p_eut1.done;
p_eut2.done;
p_eut3.done;
deactivate;
// Unmap & disconnect
if (PX_CAPTURE_MODE == "on-link") {
unmap(self:acPort, system:acPort);
unmap(self:utPort, system:utPort);
}
disconnect(self:syncPort, mtc:syncPort);
// EUT1/EUT2/EUT3
disconnect(p_eut1:eutGeoNetworkingPort, p_eut2:eutGeoNetworkingPort);
disconnect(p_eut1:eutGeoNetworkingPort, p_eut3:eutGeoNetworkingPort);
disconnect(p_eut3:eutGeoNetworkingPort, p_eut3:eutGeoNetworkingPort);
} // End of function f_mtcCf03Down
/**
* @desc The default postamble.
*/
function f_poDefault() runs on ItsAutoInteropGeonetworking {
deactivate;
LibItsGeoNetworking_Functions.f_acStopScenario();
}
} // End of group postambles
group checkFunctions {
function f_payload_template(
in BtpPortId p_dst_port,
in BtpPortId p_src_port,
in ItsPduHeader.messageID p_messageID,
in integer p_stationID
) return template octetstring {
var template octetstring v_out := int2oct(p_dst_port, 2) &
int2oct(p_src_port, 2) &
int2oct(LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, 1) &
int2oct(p_messageID, 1) & int2oct(p_stationID, 4) &
? length (1) &
?;
return v_out;
}
function f_check_payload_cam(
in GeoNetworkingInd v_gnInd,
template (present) CAM p_cam,
out ThreeDLocation p_position
) return boolean {
var bitstring v_btp_payload := oct2bit(substr(v_gnInd.msgIn.gnPacket.packet.payload, 0, 4)); // FIXMEM Skip BTP, check if it is acceptable in an ATS
var bitstring v_cam_payload := oct2bit(substr(v_gnInd.msgIn.gnPacket.packet.payload, 4, lengthof(v_gnInd.msgIn.gnPacket.packet.payload) - 4)); // FIXMEM Skip BTP, check if it is acceptable in an ATS
var CAM v_decoded_cam;
// TODO Check BTP
// Check Btp paylod
if (decvalue(v_cam_payload, v_decoded_cam) == 0) {
log("f_check_payload_cam: checking ", v_decoded_cam);
if (match(valueof(v_decoded_cam), p_cam) == true) {
p_position.latitude := v_decoded_cam.cam.camParameters.basicContainer.referencePosition.latitude;
p_position.longitude := v_decoded_cam.cam.camParameters.basicContainer.referencePosition.longitude;
p_position.elevation := 0;//v_decoded_cam.cam.camParameters.basicContainer.referencePosition.altitude;
log("<<< f_check_payload_cam: true");
return true;
}
} else {
log("f_check_payload_cam: decvalue failed: ", bit2oct(v_cam_payload));
}
log("<<< f_check_payload_cam: false");
return false;
} // End of function f_check_payload_cam
function f_check_payload_denm(
in GeoNetworkingInd v_gnInd,
template (present) DENM p_denm
) return boolean {
var bitstring v_btp_payload := oct2bit(substr(v_gnInd.msgIn.gnPacket.packet.payload,0, 4)); // FIXMEM Skip BTP, check if it is acceptable in an ATS
var bitstring v_denm_payload := oct2bit(substr(v_gnInd.msgIn.gnPacket.packet.payload, 4, lengthof(v_gnInd.msgIn.gnPacket.packet.payload) - 4)); // FIXMEM Skip BTP, check if it is acceptable in an ATS
var DENM v_decoded_denm;
// TODO Check BTP
// Check Btp paylod
log(">>> f_check_payload_denm");
if (decvalue(v_denm_payload, v_decoded_denm) == 0) {
log("f_check_payload_denm: checking ", v_decoded_denm);
if (match(valueof(v_decoded_denm), p_denm) == true) {
log("<<< f_check_payload_denm: true");
return true;
}
} else {
log("f_check_payload_denm: decvalue failed: ", bit2oct(v_denm_payload));
}
log("<<< f_check_payload_denm: false");
return false;
} // End of function f_check_payload_denm
} // End of group checkFunctions
group autoInteropPosition {
/**
* @desc Compute distance between two points
* @param p_pointA First point
* @param p_pointB Second point
* @return Computed distance in meters
* @see fx_computeDistance
*/
function f_distance(
in ThreeDLocation p_pointA,
in ThreeDLocation p_pointB
) return float {
log("*** f_distance: INFO: calling PointA: ", p_pointA);
log("*** f_distance: INFO: calling PointB: ", p_pointB);
return fx_computeDistance(p_pointA.latitude, p_pointA.longitude, p_pointB.latitude, p_pointB.longitude);
}
} // End of group autoInteropPosition
group autoInteropAltsteps {
/**
* @desc The base default.
*/
altstep a_default() runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
[vc_gnDefaultActive] geoNetworkingPort.receive(
mw_geoNwInd(
?
)) -> value v_gnInd { // Unexpected GeoNetworking message ==> require refine filtering above
log("*** a_default: ERROR: Received a GN message", v_gnInd, " ***");
f_selfOrClientSyncAndVerdict("error", e_error);
// Re-send DEN message to the other EUTs
// eutGeoNetworkingPort.send(
// m_forward_geoNetworkingInd(
// v_gnInd
// ));
}
[] eutGeoNetworkingPort.receive(
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(?, ?, ?, ?)
))) {
log("*** a_default: INFO: Received a GeoBroadcast message ***");
repeat;
}
[] eutGeoNetworkingPort.receive(
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload
))) {
log("*** a_default: INFO: Received a SHB message ***");
repeat;
}
[] eutGeoNetworkingPort.receive { // Unexpected EutGeoNetworking message ==> require refine filtering above
log("*** a_default: INFO: Received an unexpected message ***");
f_selfOrClientSyncAndVerdict("error", e_error);
}
[] a_shutdown() {
log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
stop;
}
}
/**
* @desc The default for handling HMI messages.
*/
altstep a_hmiDefault() runs on ItsAutoInteropGeonetworking {
var HmiNeighborEventInds v_hmiNeighborEventInds;
var HmiSignageEventInd v_hmiSignageEventInd;
[vc_hmiDefaultActive] hmiPort.receive(HmiNeighborEventInds:?) -> value v_hmiNeighborEventInds {
//store every upper tester indication received
vc_hmiNeighborEventIndsList[lengthof(vc_hmiNeighborEventIndsList)] := v_hmiNeighborEventInds;
repeat;
}
[vc_hmiDefaultActive] hmiPort.receive {
log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***");
repeat;
}
[vc_hmiDefaultActive] hmiPort.receive(HmiSignageEventInd:?) -> value v_hmiSignageEventInd {
//store every upper tester indication received
vc_hmiSignageEventIndList[lengthof(vc_hmiSignageEventIndList)] := v_hmiSignageEventInd;
repeat;
}
[vc_hmiDefaultActive] hmiPort.receive {
log("*** " & testcasename() & ": INFO: Received unexpected UT message from IUT ***");
repeat;
}
}
/**
* @desc Default handling cf01 de-initialisation.
*/
altstep a_mtcCf01Down(/*
inout ItsAutoInteropGeonetworking p_eut1,
inout ItsAutoInteropGeonetworking p_eut2,
inout ItsAutoInteropGeonetworking p_eut3,
inout ItsAutoInteropGeonetworking p_eut4*/
) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
[] a_shutdown() {
// f_mtcCf01Down(p_eut1, p_eut2, p_eut3, p_eut4);
log("*** a_mtcCf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
stop;
}
}
/**
* @desc Default handling cf02 de-initialisation.
*/
altstep a_mtcCf02Down(
/*inout ItsAutoInteropGeonetworking p_eut1,
inout ItsAutoInteropGeonetworking p_eut2*/
) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
[] a_shutdown() {
// f_mtcCf02Down(p_eut1, p_eut2);
log("*** a_mtcCf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
stop;
}
}
/**
* @desc Default handling cf03 de-initialisation.
*/
altstep a_mtcCf03Down(
/*inout ItsAutoInteropGeonetworking p_eut1,
inout ItsAutoInteropGeonetworking p_eut2,
inout ItsAutoInteropGeonetworking p_eut3*/
) runs on ItsMtc /* TITAN TODO: mtc ItsMtc system ItsAutoInteropGeoNetworkingSystem */ {
[] a_shutdown() {
// f_mtcCf03Down(p_eut1, p_eut2, p_eut3);
log("*** a_mtcCf03Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
stop;
}
}
} // End of group autoInteropAltsteps
} // End of module ItsAutoInterop_Functions
module ItsAutoInterop_Pics {
// LibCommon
import from LibCommon_BasicTypesAndValues all;
// LibIts
import from IEEE1609dot2BaseTypes language "ASN.1:1997" all;
import from IEEE1609dot2 language "ASN.1:1997" all;
import from EtsiTs103097Module language "ASN.1:1997" all;
// LibItsBtp
import from LibItsBtp_TypesAndValues all;
// LibItsSecurity
import from LibItsSecurity_TypesAndValues all;
/**
* @desc BTP destination port identifier for CAM protocol
* @see ETSI DTS/ITS0144 Table
*/
modulepar BtpPortId PICS_CAM_BTP_DESTINATION_PORT := 2001;
/**
* @desc BTP source port identifier for CAM protocol
* @see TODO
*/
modulepar BtpPortId PICS_CAM_BTP_SOURCE_PORT := 0;
/**
* @desc ItsAid for CAM protocol
* @see TODO
*/
modulepar UInt32 PICS_CAM_ITS_AID := 36;
/**
* @desc BTP destination port identifier for DENM protocol
* @see TODO
*/
modulepar BtpPortId PICS_DENM_BTP_DESTINATION_PORT := 2002;
/**
* @desc BTP source port identifier for DENM protocol
* @see TODO
*/
modulepar BtpPortId PICS_DENM_BTP_SOURCE_PORT := 0;
/**
* @desc ItsAid for DENM protocol
* @see TODO
*/
modulepar UInt32 PICS_DENM_ITS_AID := 37;
/**
* @desc Z1-D1-EP/POS1
*/
modulepar ThreeDLocation PICS_Z1_D1_EP := {
latitude := 435525352, // Z1-D1-EP/latitude
longitude := 103003415, // Z1-D1-EP/longitude
elevation := 0
}; // End of PICS_Z1_D1_EP
/**
* @desc Z1-D2-EP/POS2
*/
modulepar ThreeDLocation PICS_Z1_D2_EP := {
latitude := 435519107, // Z1-D2-EP/latitude
longitude := 102993930, // Z1-D2-EP/longitude
elevation := 0
}; // End of PICS_Z1_D2_EP
/**
* @desc Z1-D3-EP/POS3
*/
modulepar ThreeDLocation PICS_Z1_D3_EP := {
latitude := 435513421, // Z1-D3-EP/latitude
longitude := 102986038, // Z1-D3-EP/longitude
elevation := 0
}; // End of PICS_Z1_D3_EP
/**
* @desc Use the GPS position of each heavy truck
*/
modulepar ThreeDLocation PICS_UC2_HEAVY_TRUCK_POS := {
latitude := 435536690,
longitude := 103031060,
elevation := 0
}; // End of PICS_Z1_D3_EP
/**
* @desc DENM cause variant for TC_AUTO_IOT_DENM_SVW_BV_01
* @see Draft ETSI TS yyy xxx-2 V0.0.87 (2017-03) Table 4: Possible DENM cause values (ETSI EN 302 637-3 [5] Table 10: Cause description and cause code assignment for ETSI use case)
*/
modulepar integer PICS_UC2_CAUSE := 94;
/**
* @desc DENM subcause variant for TC_AUTO_IOT_DENM_SVW_BV_01
* @see Draft ETSI TS yyy xxx-2 V0.0.87 (2017-03) Table 5: Possible DENM sub-cause values (ETSI EN 302 637-3 [5] Table 10: Cause description and cause code assignment for ETSI use case)
*/
modulepar integer PICS_UC2_SUBCAUSE := 5;
/**
* @desc Absolute coordinate for position 0
* @see TODO
*/
modulepar ThreeDLocation PICS_POS0 := {
latitude := 435522970,
longitude := 103000170,
elevation := 0
}
/**
* @desc Absolute coordinate for position 1
* @see TODO
*/
modulepar ThreeDLocation PICS_POS1 := {
latitude := 435525352,
longitude := 103000415,
elevation := 0
}
/**
* @desc Absolute coordinate for position 2
* @see TODO
*/
modulepar ThreeDLocation PICS_POS2 := {
latitude := 435519107,
longitude := 102993930,
elevation := 0
}
/**
* @desc Absolute coordinate for position 3
* @see TODO
*/
modulepar ThreeDLocation PICS_POS3 := {
latitude := 435513421,
longitude := 102986038,
elevation := 0
}
/**
* @desc Absolute coordinate for position 4
* @see TODO
*/
modulepar ThreeDLocation PICS_POS4 := {
latitude := 435522970,
longitude := 103000170,
elevation := 0
}
/**
* @desc Absolute coordinate for TARGET_GEOAREA
* @see TODO
*/
modulepar ThreeDLocation PICS_TARGET_GEOAREA := {
latitude := 435522970,
longitude := 103000170,
elevation := 0
}
} // End of module ItsAutoInterop_Pics
module ItsAutoInterop_Pixits {
// Libcommon
import from LibCommon_BasicTypesAndValues all;
// ItsInterop
import from ItsAutoInterop_TypesAndValues all;
/**
* @desc
* Possible values: on-link or off-link
*/
modulepar charstring PX_CAPTURE_MODE := "on-link"; // TODO Change it into boolean
/**
* EUTs descriptions
*/
modulepar EutDescriptions PX_EUT_DESC := {
{
'b482fe4433eb'O,
10002,
'b482fe4433eb'O
}, // EUT_1
{
'ce6b359a0c57'O,
10152,
'ce6b359a0c57'O
}, // EUT_2
{
'000000000003'O,
333,
'000000000003'O
}, // EUT_3
{
'000000000004'O,
444,
'000000000004'O
} // EUT_4
}
/**
* @desc EUT1 identifier to refer to its @see EutDescriptions
*/
modulepar integer PX_EUT1_ID := 0;
/**
* @desc EUT2 identifier to refer to its @see EutDescriptions
*/
modulepar integer PX_EUT2_ID := 1;
/**
* @desc EUT3 identifier to refer to its @see EutDescriptions
*/
modulepar integer PX_EUT3_ID := 2;
/**
* @desc EUT4 identifier to refer to its @see EutDescriptions
*/
modulepar integer PX_EUT4_ID := 3;
/**
* @desc Pre-defined security distance
*/
modulepar float PX_PRE_DEFINED_SECURITY_DISTANCE := 10.0;
/**
* @desc Pre-defined security distance
*/
modulepar float PX_DISTANCE_EPSILON := 1.0;
/**
* @desc Pre-defined security distance for forward collision risk condition
*/
modulepar float PX_FORWARD_COLLISION_SECURITY_DISTANCE := 0.0;
/**
* @desc Pre-defined security distance for forward collision risk condition
*/
modulepar float PX_LATERAL_COLLISION_SECURITY_DISTANCE := 0.0;
/**
* @desc DENM cause variant
* @see Draft ETSI TS yyy xxx-2 V0.0.87 (2017-03) Table 4: Possible DENM cause values (ETSI EN 302 637-3 [5] Table 10: Cause description and cause code assignment for ETSI use case)
*/
modulepar integer PX_DENM_CAUSE_VA := 94;
/**
* @desc DENM subcause variant
* @see Draft ETSI TS yyy xxx-2 V0.0.87 (2017-03) Table 5: Possible DENM sub-cause values (ETSI EN 302 637-3 [5] Table 10: Cause description and cause code assignment for ETSI use case)
*/
modulepar integer PX_DENM_SUBCAUSE_VA := 5;
} // End of module ItsAutoInterop_Pixits
module ItsAutoInterop_Templates {
// LibCommon
import from LibCommon_BasicTypesAndValues all;
// LibIts
import from ITS_Container language "ASN.1:1997" all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
import from IEEE1609dot2BaseTypes language "ASN.1:1997" all;
import from IEEE1609dot2 language "ASN.1:1997" all;
import from EtsiTs103097Module language "ASN.1:1997" all;
// LibItsCommon
import from LibCommon_DataStrings all;
import from LibItsExternal_TypesAndValues all;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TestSystem all;
import from LibItsGeoNetworking_Templates all;
import from LibItsGeoNetworking_TypesAndValues all;
// LibItsBtp
import from LibItsBtp_Templates all;
// LibItsCam
import from LibItsCam_Templates all;
// LibItsDenm
import from LibItsDenm_Templates all;
// LibItsSecurity
import from LibItsSecurity_TypesAndValues all;
// ItsInterop
import from ItsAutoInterop_TypesAndValues all;
import from ItsAutoInterop_Pics all;
import from ItsAutoInterop_TestSystem all;
group eutGeoNetworkingTemplates {
/**
* @desc Re-send template for inter-EUT message exchanges
* @param p_geoNetworkingInd GeoNetworking message indication received on GeoNetworking protocol port
*/
template (value) EutGeoNetworking m_forward_geoNetworkingInd(
in template (value) GeoNetworkingInd p_geoNetworkingInd
) := {
msg := valueof(p_geoNetworkingInd.msgIn),
macDestinationAddress := valueof(p_geoNetworkingInd.macDestinationAddress),
ssp := omit,
its_aid := omit
} // End of template m_forward_geoNetworkingInd
/**
* @desc Receive template for EUT GeoNetworking packet (GeonetworkingPort Primitive)
* @param p_geoNwMsg GeoNetworking packet to be received
*/
template (present) EutGeoNetworking mw_eutGeoNwInd(
template (present) GeoNetworkingPdu p_geoNwMsg
) := {
msg := p_geoNwMsg,
macDestinationAddress := ?,
ssp := *,
its_aid := *
} // End of template mw_eutGeoNwInd
/**
* @desc Receive template for EUT GeoNetworking packet (GeonetworkingPort Primitive)
* @param p_geoNwMsg GeoNetworking packet to be received
* @param p_llDestinationAdress Link-layer destination address
*/
template(present) EutGeoNetworking mw_eutGeoNwInd_withLinkLayerDestination(
template (present) GeoNetworkingPdu p_geoNwMsg,
template (present) MacAddress p_llDestinationAdress
) modifies mw_eutGeoNwInd := {
macDestinationAddress := p_llDestinationAdress
} // End of template mw_eutGeoNwInd_withLinkLayerDestination
} // End of group eutGeoNetworkingTemplates
group geoNetworkingTemplates {
/**
* @desc Conversion template from ThreeDLocation to LongPosVector for distance calculus
* @param p_position ThreeDLocation
*/
template (value) LongPosVector m_longPosVector(
in template (value) ThreeDLocation p_position
) modifies m_dummyLongPosVector := {
latitude := valueof(p_position.latitude),
longitude := valueof(p_position.longitude)
} // End of template mw_denm_stationId
/**
* @desc Dummy template for long position vector
*/
template (present) LongPosVector mw_dummyLongPosVector := {
gnAddr := mw_gnAddressMid(?),
timestamp_ := ?,
latitude := ?,
longitude := ?,
pai := ?,
speed := ?,
heading := ?
}
/**
* @desc Receive template for the destinationArea which indicates the TARGET_GEOAREA
* @param p_gnAddress GN_Address to be contained in the long position vector
*/
template (present) LongPosVector mw_longPosVector(
template (value) ThreeDLocation p_position
) modifies mw_dummyLongPosVector := { // TODO use mw_longPosVectorAny instead of mw_dummyLongPosVector
latitude := valueof(p_position.latitude),
longitude := valueof(p_position.longitude)
} // End of template mw_longPosVector
/**
* @desc Receive template for GeoNetworking CAM Packet
* @param p_sourceLongPosVec Source position vector of destination
* @param p_hopLimit Sequence number of GeoUnicast packet
* @param p_nextHeader Expected next header
* @param p_cam Expected CA message
*/
template (present) GnNonSecuredPacket mw_geoNwShbPacketWithNextHeaderAndPayload(
template (present) LongPosVector p_sourceLongPosVec := ?,
template (present) UInt8 p_hopLimit := ?,
template (present) NextHeader p_nextHeader := ?,
template (present) octetstring p_payload := ?
) modifies mw_geoNwShbPacket := {
commonHeader := mw_commonHeaderWithHopLimit(
p_nextHeader,
m_shbHeaderType,
p_hopLimit
),
payload := p_payload
} // End of template mw_geoNwShbPacketWithNextHeaderAndPayload
} // End of group geoNetworkingTemplates
group camTemplates {
/**
* @desc Receive template for CAM station ID
* @param p_basicVehicleContainer CA basic vehicle container
* @param p_stationId Vehicle station ID
* @param p_referencePosition Expected reference position
*/
template (present) CAM mw_cam_stationId(
template (present) BasicVehicleContainerHighFrequency p_basicVehicleContainer := mw_HF_BV_speed(?),
template (present) StationID p_stationId := ?,
template (present) ReferencePosition p_referencePosition := ?
) modifies mw_camMsg_HF_BV := {
header := {
stationID := p_stationId
},
cam := {
camParameters := {
basicContainer := {
stationType := ?,
referencePosition := p_referencePosition
}
}
}
} // End of template mw_cam_stationId
} // End of group camTemplates
group denmTemplates {
/**
* @desc Receive template for DENM station ID
* @param p_stationId Vehicle station ID
* @param p_denm Expected DENM packet
*/
template (present) DENM mw_denm_stationId(
template (present) StationID p_stationId := ?,
template (present) DecentralizedEnvironmentalNotificationMessage p_denm := ?
) := mw_denmPdu(p_denm, p_stationId); // End of template mw_denm_stationId
/**
* @desc Receive template for Management Container
* @param p_actionID The expected action id
* @param p_referenceTime The reference time (Default: any)
* @param p_isNegation The expected negation flag (Default: false)
* @param p_validityDuration The expected validity duration (Default: any or omit)
* @param p_transmissionInterval The expected transmission interval (Default: any or omit)
*/
template (present) ManagementContainer mw_denmMgmtCon_with_relevances(
template (present) ActionID p_actionID := ?,
template (present) ITS_Container.StationType p_stationType := ?,
template (present) TimestampIts p_referenceTime := ?,
template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit
template TransmissionInterval p_transmissionInterval := *,
template Termination p_termination := *,
template (present) RelevanceDistance p_relevanceDistance := ?,
template (present) RelevanceTrafficDirection p_relevanceTrafficDirection := ?,
template (present) ReferencePosition p_eventPosition := ?
) modifies mw_denmMgmtCon := {
eventPosition := p_eventPosition,
relevanceDistance := p_relevanceDistance,
relevanceTrafficDirection := p_relevanceTrafficDirection
} // End of tamplate mw_denmMgmtCon_with_relevances
/**
* @desc Receive template for Management Container
* @param p_actionID The expected action id
* @param p_referenceTime The reference time (Default: any)
* @param p_isNegation The expected negation flag (Default: false)
* @param p_validityDuration The expected validity duration (Default: any or omit)
* @param p_transmissionInterval The expected transmission interval (Default: any or omit)
*/
template (present) ManagementContainer mw_denmMgmtCon_with_relevances_position(
template (present) ActionID p_actionID := ?,
template (present) ITS_Container.StationType p_stationType := ?,
template (present) TimestampIts p_referenceTime := ?,
template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit
template TransmissionInterval p_transmissionInterval := *,
template Termination p_termination := *,
template (present) ReferencePosition p_eventPosition := ?
) modifies mw_denmMgmtCon := {
eventPosition := p_eventPosition
} // End of tamplate mw_denmMgmtCon_with_relevances_position
/**
* @desc Receive template for the test system position
* @param p_longitude The longitude (Default: Test system's longitude)
* @param p_latitude The latitude (Default: Test system's latitude)
* @see m_posConfidenceEllipse
* @see m_elevation
*/
template (present) ReferencePosition mw_referencePosition(
template (present) ThreeDLocation p_location := ?
) := {
latitude := p_location.latitude,
longitude := p_location.longitude,
positionConfidenceEllipse := ?,
altitude := ? // FIXME Create a convertion function SecElevation to intteger for p_location.elevation
} // End of tamplate mw_referencePosition
} // End of group denmTemplates
group hmiPrimitiveTemplates {
/**
* @desc Initializes the EUT's HMI.
*/
template (value) HmiInitialize m_hmiInitialize := {
hashedId8 := '0000000000000000'O
}
/**
* @desc Value template for NeighborEventInd matching
* @param p_mid MID value
* @param p_stationId Vehicle station ID
*/
template (value) HmiNeighborEventInd m_hmiNeighborEventInd(
in Oct6 p_mid,
in UInt32 p_stationId
) := {
mid := p_mid,
stationId := p_stationId
} // End of template m_hmiNeighborEventInd
/**
* @desc Value template for NeighborEventInd matching
* @param p_mid MID value
* @param p_stationId Vehicle station ID
*/
template (present) HmiNeighborEventInd mw_hmiNeighborEventInd(
template (present) Oct6 p_mid := ?,
template (present) UInt32 p_stationId := ?
) := {
mid := p_mid,
stationId := p_stationId
} // End of template mw_hmiNeighborEventInd
/**
* @desc Received indication generic template HMI indications
*/
template (present) HmiSignageEventInd mw_hmiSignageEventInd := {
countryCode := ?,
trafficSignPictogramClass := *,
trafficSignPictogramNature := *,
ambientOrRoadConditionPictogramClass := *,
ambientOrRoadConditionPictogramNature := *
} // End of template mw_hmiSignageEventInd
/**
* @desc Received indication template for Road Work Warning/Speed limit
*/
template (present) HmiSignageEventInd mw_hmiSignageEventInd_roadworks_limitedspeed(
template (present) integer p_seed := 30
) modifies mw_hmiSignageEventInd := {
ambientOrRoadConditionPictogramClass := e_roadCondition,
ambientOrRoadConditionPictogramNature := (1..9)
} // End of template mw_hmiSignageEventInd_roadworks_limitedspeed
/**
* @desc Received indication template for Road Hazard Signals
*/
template (present) HmiSignageEventInd mw_hmiSignageEventInd_roadHazardSignal modifies mw_hmiSignageEventInd := {
ambientOrRoadConditionPictogramClass := e_roadCondition,
ambientOrRoadConditionPictogramNature := (1..9)
} // End of template mw_hmiSignageEventInd_roadHazardSignal
/**
* @desc Received indication template for Stationary Vehicle Information
*/
template (present) HmiSignageEventInd mw_hmiSignageEventInd_stationaryVehicleWarning modifies mw_hmiSignageEventInd := {
ambientOrRoadConditionPictogramClass := e_roadCondition,
ambientOrRoadConditionPictogramNature := (1..9)
} // End of template mw_hmiSignageEventInd_stationaryVehicleWarning
/**
* @desc Received indication template for Forward Collision Risk
*/
template (present) HmiSignageEventInd mw_hmiSignageEventInd_forwardCollisionRisk modifies mw_hmiSignageEventInd := {
trafficSignPictogramClass := e_dangerWarning,
trafficSignPictogramNature := (1..9)
} // End of template mw_hmiSignageEventInd_forwardCollisionRisk
/**
* @desc Received indication template for Lateral Collision Risk
*/
template (present) HmiSignageEventInd mw_hmiSignageEventInd_lateralCollisionRisk modifies mw_hmiSignageEventInd := {
trafficSignPictogramClass := e_dangerWarning,
trafficSignPictogramNature := (1..9)
} // End of template mw_hmiSignageEventInd_lateralCollisionRisk
} // End of group hmiPrimitiveTemplates
group utPrimitiveTemplates {
} // End of group utPrimitiveTemplates
} // End of module ItsAutoInterop_Templates
module ItsAutoInterop_TestCases {
// LibCommon
import from LibCommon_VerdictControl all;
import from LibCommon_Sync all;
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
import from LibCommon_Time all;
// LibIts
import from ITS_Container language "ASN.1:1997" all;
import from IEEE1609dot2BaseTypes language "ASN.1:1997" all;
import from IEEE1609dot2 language "ASN.1:1997" all;
import from EtsiTs103097Module language "ASN.1:1997" all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all; // TODO To be removed
// LibItsCommon
import from LibItsCommon_TestSystem all;
import from LibItsCommon_Functions all;
import from LibItsExternal_TypesAndValues all;
import from LibItsCommon_ASN1_NamedNumbers all;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TypesAndValues all;
import from LibItsGeoNetworking_Templates all;
import from LibItsGeoNetworking_Pixits all;
import from LibItsGeoNetworking_TestSystem all;
// LibItsDenm
import from LibItsDenm_Templates all;
// LibItsCam
import from LibItsCam_Templates all;
// LibItsSecurity
import from LibItsSecurity_TypesAndValues all;
// AtsInterop
import from ItsAutoInterop_TypesAndValues all;
import from ItsAutoInterop_Templates all;
import from ItsAutoInterop_Functions all;
import from ItsAutoInterop_Pics all;
import from ItsAutoInterop_Pixits all;
import from ItsAutoInterop_TestSystem all;
/**
* @desc Verify complete forwarding message scenario (GREEDY, GREEDY, GREEDY)
* <pre>
* Pics Selection:
* Config Id: CF-01
* Initial conditions:
* with {
* itsGnNonAreaForwardingAlgorithm of EUT1 set to GREEDY
* itsGnNonAreaForwardingAlgorithm of EUT2 set to GREEDY
* itsGnNonAreaForwardingAlgorithm of EUT3 set to GREEDY
* itsGnNonAreaForwardingAlgorithm of EUT4 is SIMPLE
* }
* Expected behaviour:
* ensure that {
* when {
* EUT1 is requested to send DEN message
* encapsulated in a GBC packet
* containing Basic Header
* containing RHL field
* indicating a value > 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* }
* then {
* EUT1 sends a GBC packet
* containing Basic Header
* containing RHL field
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating the EUT2 address
* }
* when {
* EUT2 receives the GBC packet from EUT1
* }
* then {
* EUT2 sends a GBC packet
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating the EUT4 address
* and EUT3 does not receive the GBC packet from EUT1
* }
* when {
* EUT4 receives the GBC packet from EUT2
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* }
* then {
* EUT4 provides the DEN message to upper layers
* and EUT4 sends a GBC packet
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating broadcast address
* }
* when {
* EUT2 receives the GBC packet from EUT4
* }
* then {
* EUT2 discards the GBC packet
* }
* when {
* EUT3 receives the GBC packet from EUT4
* }
* then {
* EUT3 discards the GBC packet
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_DENM_MFW_BV_01
* @reference ETSI EN 302 636-4-1 Clauses D & E2
*/
testcase TC_AUTO_IOT_DENM_MFW_BV_01() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
var ItsAutoInteropGeonetworking v_eut3 := null;
var ItsAutoInteropGeonetworking v_eut4 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf01Up(v_eut1, v_eut2, v_eut3, v_eut4);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_DENM_MFW_BV_01_eut1(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_DENM_MFW_BV_01_eut2(v_eut2, PX_EUT2_ID));
v_eut3.start(f_TC_AUTO_IOT_DENM_MFW_BV_01_eut3(v_eut3, PX_EUT3_ID));
v_eut4.start(f_TC_AUTO_IOT_DENM_MFW_BV_01_eut4(v_eut4, PX_EUT4_ID));
// Synchronization
f_serverSyncNClientsAndStop(4, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf01Down(v_eut1, v_eut2, v_eut3, v_eut4);
} // End of TC_AUTO_IOT_DENM_MFW_BV_01
group g_TC_AUTO_IOT_DENM_MFW_BV_01 {
/**
* @desc Behavior function for EUT1 (TC_AUTO_IOT_DENM_MFW_BV_01)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_01_eut1(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
tc_ac.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT1 is requested to send DEN message
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
mw_longPosVector(
PICS_TARGET_GEOAREA
),
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[p_eut_id].stationId
)*/)),
PX_EUT_DESC[PX_EUT2_ID].ll_mac_address
)) { // Receives the triggered DENM message
tc_ac.stop;
log("*** " & testcasename() & ": INFO: EUT1 sends a GBC packet ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: EUT1 does not send the requested DEN message ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT1 shall not receive any more DEN messages
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
? // FIXME complement(PX_EUT_DESC[p_eut_id].stationId)
)*/)),
?
)) {
tc_wait.stop;
log("*** " & testcasename() & ": FAIL: Unexpected DEN message received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, GREEDY, GREEDY) succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_01_eut1
/**
* @desc Behavior function for EUT2 (TC_AUTO_IOT_DENM_MFW_BV_01)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_01_eut2(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT2 receives the GBC packet from EUT1
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
mw_longPosVector(
PICS_TARGET_GEOAREA
),
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[PX_EUT1_ID].stationId
)*/)))) -> value v_eutGeoNw {
// Now, we have to check for EUT4 to broadcast the DENM message
repeat;
}
[] eutGeoNetworkingPort.receive( // EUT2 receives the GBC packet from EUT4
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[PX_EUT4_ID].stationId
)*/)),
c_llBroadcast
)) -> value v_eutGeoNw {
tc_wait.stop;
log("*** " & testcasename() & ": INFO: EUT2 receives the GBC packet from EUT4 ***");
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Forwarding message scenario (GREEDY, GREEDY, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// EUT2 discards the GBC packet
f_sleep(PX_TNOAC);
if(0 < lengthof(vc_utInds)) {
log("*** " & testcasename() & ": INCONC: Forwarding message scenario (GREEDY, GREEDY, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
else {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, GREEDY, GREEDY) is succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_01_eut2
/**
* @desc Behavior function for EUT3 (TC_AUTO_IOT_DENM_MFW_BV_01)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_01_eut3(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT3 receives the GBC packet from EUT4
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?//mw_denm_stationId
)),
?
)) -> value v_eutGeoNw {
tc_wait.stop;
log("*** " & testcasename() & ": INFO: EUT3 received DEN message from EUT ", v_eutGeoNw.msg.gnPacket.packet.extendedHeader.tsbHeader.srcPosVector.gnAddr.mid, " ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Forwarding message scenario (GREEDY, GREEDY, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// EUT3 discards the GBC packet
f_sleep(PX_TNOAC);
if(0 < lengthof(vc_utInds)) {
log("*** " & testcasename() & ": INCONC: Forwarding message scenario (GREEDY, GREEDY, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
else {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, GREEDY, GREEDY) is succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_01_eut3
/**
* @desc Behavior function for EUT4 (TC_AUTO_IOT_DENM_MFW_BV_01)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_01_eut4(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT4 receives the GBC packet from EUT2
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
mw_longPosVector(
PICS_TARGET_GEOAREA
),
?,
e_btpB,
?//mw_denm_stationId
)),
PX_EUT_DESC[p_eut_id].ll_mac_address
)) -> value v_eutGeoNw { // Receive a DEN message from EUT2
tc_wait.stop;
// Now check that EUT4 brodcasts the DENM message
log("*** " & testcasename() & ": INFO: EUT4 receives the GBC packet from EUT2 ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Forwarding message scenario (GREEDY, GREEDY, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// EUT4 provides the DEN message to upper layers
f_sleep(PX_TNOAC);
if(0 < lengthof(vc_utInds)) {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, GREEDY, GREEDY) is succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
log("*** " & testcasename() & ": INCONC: EUT4 does not provide the DEN message to upper layers ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_01_eut4
} // End of group g_TC_AUTO_IOT_DENM_MFW_BV_01
/**
* @desc Verify complete forwarding message scenario (GREEDY, GREEDY, CBF)
* <pre>
* Pics Selection:
* Config Id: CF-01
* Initial conditions:
* with {
* itsGnNonAreaForwardingAlgorithm of EUT1 set to GREEDY
* itsGnNonAreaForwardingAlgorithm of EUT2 set to GREEDY
* itsGnNonAreaForwardingAlgorithm of EUT3 set to CBF
* itsGnNonAreaForwardingAlgorithm of EUT4 is SIMPLE
* }
* Expected behaviour:
* ensure that {
* when {
* EUT1 is requested to send DEN message
* encapsulated in a GBC packet
* containing Basic Header
* containing RHL field
* indicating a value > 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* }
* then {
* EUT1 sends a GBC packet
* containing Basic Header
* containing RHL field
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating the EUT2 address
* }
* when {
* EUT2 receives the GBC packet from EUT1
* }
* then {
* EUT2 sends a GBC packet
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating the EUT4 address
* and EUT3 does not receive the GBC packet from EUT1
* }
* when {
* EUT4 receives the GBC packet from EUT2
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* }
* then {
* EUT4 provides the DEN message to upper layers
* and EUT4 sends a GBC packet
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating broadcast address
* }
* when {
* EUT2 receives the GBC packet from EUT4
* }
* then {
* EUT2 discards the GBC packet
* }
* when {
* EUT3 receives the GBC packet from EUT4
* }
* then {
* EUT3 discards the GBC packet
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_DENM_MFW_BV_02
* @reference ETSI EN 302 636-4-1 Clauses D & E2
*/
testcase TC_AUTO_IOT_DENM_MFW_BV_02() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
var ItsAutoInteropGeonetworking v_eut3 := null;
var ItsAutoInteropGeonetworking v_eut4 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf01Up(v_eut1, v_eut2, v_eut3, v_eut4);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_DENM_MFW_BV_02_eut1(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_DENM_MFW_BV_02_eut2(v_eut2, PX_EUT2_ID));
v_eut3.start(f_TC_AUTO_IOT_DENM_MFW_BV_02_eut3(v_eut3, PX_EUT3_ID));
v_eut4.start(f_TC_AUTO_IOT_DENM_MFW_BV_02_eut4(v_eut4, PX_EUT4_ID));
// Synchronization
f_serverSyncNClientsAndStop(4, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf01Down(v_eut1, v_eut2, v_eut3, v_eut4);
} // End of TC_AUTO_IOT_DENM_MFW_BV_02
group g_TC_AUTO_IOT_DENM_MFW_BV_02 {
/**
* @desc Behavior function for EUT1 (TC_AUTO_IOT_DENM_MFW_BV_02)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_02_eut1(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
tc_ac.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT1 is requested to send DEN message
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
mw_longPosVector(
PICS_TARGET_GEOAREA
),
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[p_eut_id].stationId
)*/)),
PX_EUT_DESC[PX_EUT2_ID].ll_mac_address
)) { // Receives the triggered DENM message
tc_ac.stop;
log("*** " & testcasename() & ": INFO: EUT1 sends a GBC packet ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: EUT1 does not send the requested DEN message ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT1 shall not receive any more DEN messages
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
? // FIXME complement(PX_EUT_DESC[p_eut_id].stationId)
)*/)),
?
)) {
tc_wait.stop;
log("*** " & testcasename() & ": FAIL: Unexpected DEN message received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, GREEDY, CBF) succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_02_eut1
/**
* @desc Behavior function for EUT2 (TC_AUTO_IOT_DENM_MFW_BV_02)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_02_eut2(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT2 receives the GBC packet from EUT1
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
mw_longPosVector(
PICS_TARGET_GEOAREA
),
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[PX_EUT1_ID].stationId
)*/)))) -> value v_eutGeoNw {
// Now, we have to check for EUT4 to broadcast the DENM message
repeat;
}
[] eutGeoNetworkingPort.receive( // EUT2 receives the GBC packet from EUT4
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[PX_EUT4_ID].stationId
)*/)),
c_llBroadcast
)) -> value v_eutGeoNw {
tc_wait.stop;
log("*** " & testcasename() & ": INFO: EUT2 receives the GBC packet from EUT4 ***");
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Forwarding message scenario (GREEDY, GREEDY, CBF) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// EUT2 discards the GBC packet
f_sleep(PX_TNOAC);
if(0 < lengthof(vc_utInds)) {
log("*** " & testcasename() & ": INCONC: Forwarding message scenario (GREEDY, GREEDY, CBF) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
else {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, GREEDY, CBF) is succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_02_eut2
/**
* @desc Behavior function for EUT3 (TC_AUTO_IOT_DENM_MFW_BV_02)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_02_eut3(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT3 receives the GBC packet from EUT4
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?//mw_denm_stationId
)),
?
)) -> value v_eutGeoNw {
tc_wait.stop;
log("*** " & testcasename() & ": INFO: EUT3 received DEN message from EUT ", v_eutGeoNw.msg.gnPacket.packet.extendedHeader.tsbHeader.srcPosVector.gnAddr.mid, " ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Forwarding message scenario (GREEDY, GREEDY, CBF) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// EUT3 discards the GBC packet
f_sleep(PX_TNOAC);
if(0 < lengthof(vc_utInds)) {
log("*** " & testcasename() & ": INCONC: Forwarding message scenario (GREEDY, GREEDY, CBF) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
else {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, GREEDY, CBF) is succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_02_eut3
/**
* @desc Behavior function for EUT4 (TC_AUTO_IOT_DENM_MFW_BV_02)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_02_eut4(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT4 receives the GBC packet from EUT2
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
mw_longPosVector(
PICS_TARGET_GEOAREA
),
?,
e_btpB,
?//mw_denm_stationId
)),
PX_EUT_DESC[p_eut_id].ll_mac_address
)) -> value v_eutGeoNw { // Receive a DEN message from EUT2
tc_wait.stop;
// Now check that EUT4 brodcasts the DENM message
log("*** " & testcasename() & ": INFO: EUT4 receives the GBC packet from EUT2 ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Forwarding message scenario (GREEDY, GREEDY, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// EUT4 provides the DEN message to upper layers
f_sleep(PX_TNOAC);
if(0 < lengthof(vc_utInds)) {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, GREEDY, CBF) is succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
log("*** " & testcasename() & ": INCONC: EUT4 does not provide the DEN message to upper layers ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_02_eut4
} // End of group g_TC_AUTO_IOT_DENM_MFW_BV_02
/**
* @desc Verify complete forwarding message scenario (GREEDY, CBF, GREEDY)
* <pre>
* Pics Selection:
* Config Id: CF-01
* Initial conditions:
* with {
* itsGnNonAreaForwardingAlgorithm of EUT1 set to GREEDY
* itsGnNonAreaForwardingAlgorithm of EUT2 set to CBF
* itsGnNonAreaForwardingAlgorithm of EUT3 set to GREEDY
* itsGnNonAreaForwardingAlgorithm of EUT4 is SIMPLE
* }
* Expected behaviour:
* ensure that {
* when {
* EUT1 is requested to send DEN message
* encapsulated in a GBC packet
* containing Basic Header
* containing RHL field
* indicating a value > 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* }
* then {
* EUT1 sends a GBC packet
* containing Basic Header
* containing RHL field
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating the EUT2 address
* }
* when {
* EUT2 receives the GBC packet from EUT1
* }
* then {
* EUT2 sends a GBC packet
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating broadcast address
* }
* when {
* EUT1 receives the GBC packet from EUT2
* }
* then {
* EUT1 discards the GBC packet
* }
* when {
* EUT4 receives the GBC packet from EUT2
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* }
* then {
* EUT4 provides the DEN message to upper layers
* and EUT4 sends a GBC packet
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating broadcast address
* }
* when {
* EUT3 received the GBC packet from EUT2
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* }
* then {
* EUT3 sends a GBC packet
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating EUT4 address
* }
* when {
* EUT4 receives the GBC packet from EUT3
* }
* then {
* EUT4 discards the GBC packet (duplicated)
* }
* when {
* EUT3 receives the GBC packet from EUT4
* }
* then {
* EUT3 discards the GBC packet
* }
* when {
* EUT2 receives the GBC packet from EUT4
* }
* then {
* EUT2 discards the GBC packet
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_DENM_MFW_BV_03
* @reference ETSI EN 302 636-4-1 Clauses D & E2
*/
testcase TC_AUTO_IOT_DENM_MFW_BV_03() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
var ItsAutoInteropGeonetworking v_eut3 := null;
var ItsAutoInteropGeonetworking v_eut4 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf01Up(v_eut1, v_eut2, v_eut3, v_eut4);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_DENM_MFW_BV_03_eut1(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_DENM_MFW_BV_03_eut2(v_eut2, PX_EUT2_ID));
v_eut3.start(f_TC_AUTO_IOT_DENM_MFW_BV_03_eut3(v_eut3, PX_EUT3_ID));
v_eut4.start(f_TC_AUTO_IOT_DENM_MFW_BV_03_eut4(v_eut4, PX_EUT4_ID));
// Synchronization
f_serverSyncNClientsAndStop(4, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf01Down(v_eut1, v_eut2, v_eut3, v_eut4);
} // End of TC_AUTO_IOT_DENM_MFW_BV_03
group g_TC_AUTO_IOT_DENM_MFW_BV_03 {
/**
* @desc Behavior function for EUT1 (TC_AUTO_IOT_DENM_MFW_BV_03)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_03_eut1(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
tc_ac.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT1 is requested to send DEN message
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
mw_longPosVector(
PICS_TARGET_GEOAREA
),
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[p_eut_id].stationId
)*/)),
PX_EUT_DESC[PX_EUT2_ID].ll_mac_address
)) { // Receives the triggered DENM message
tc_ac.stop;
log("*** " & testcasename() & ": INFO: EUT1 sends a GBC packet ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: EUT1 does not send the requested DEN message ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT1 receives the GBC packet from EUT2
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
? // FIXME complement(PX_EUT_DESC[p_eut_id].stationId)
)*/)),
c_llBroadcast
)) {
tc_wait.stop;
log("*** " & testcasename() & ": Info: EUT1 receives the GBC packet from EUT2 ***");
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": INFO: Forwarding message scenario (GREEDY, CBF, GREEDY) succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
// EUT1 discards the GBC packet
f_sleep(PX_TNOAC);
if(0 < lengthof(vc_utInds)) {
log("*** " & testcasename() & ": INCONC: Forwarding message scenario (GREEDY, CBF, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
else {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, CBF, GREEDY) succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_03_eut1
/**
* @desc Behavior function for EUT2 (TC_AUTO_IOT_DENM_MFW_BV_03)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_03_eut2(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT2 receives the GBC packet from EUT1
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
mw_longPosVector(
PICS_TARGET_GEOAREA
),
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[PX_EUT1_ID].stationId
)*/)))) -> value v_eutGeoNw {
// Now, we have to check for EUT4 to broadcast the DENM message
repeat;
}
[] eutGeoNetworkingPort.receive( // EUT2 receives the GBC packet from EUT4
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[PX_EUT4_ID].stationId
)*/)),
c_llBroadcast
)) -> value v_eutGeoNw {
tc_wait.stop;
log("*** " & testcasename() & ": INFO: EUT2 receives the GBC packet from EUT4 ***");
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Forwarding message scenario (GREEDY, CBF, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// EUT2 discards the GBC packet
f_sleep(PX_TNOAC);
if(0 < lengthof(vc_utInds)) {
log("*** " & testcasename() & ": INCONC: Forwarding message scenario (GREEDY, CBF, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
else {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, CBF, GREEDY) succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_03_eut2
/**
* @desc Behavior function for EUT3 (TC_AUTO_IOT_DENM_MFW_BV_03)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_03_eut3(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT3 receives the GBC packet from EUT2
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
? // FIXME complement(PX_EUT_DESC[p_eut_id].stationId)
)*/)),
c_llBroadcast
)) {
log("*** " & testcasename() & ": Info: EUT3 receives the GBC packet from EUT2 ***");
repeat;
}
[] eutGeoNetworkingPort.receive( // EUT3 receives the GBC packet from EUT4
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?//mw_denm_stationId
)),
?
)) -> value v_eutGeoNw {
tc_wait.stop;
log("*** " & testcasename() & ": INFO: EUT3 received DEN message from EUT ", v_eutGeoNw.msg.gnPacket.packet.extendedHeader.tsbHeader.srcPosVector.gnAddr.mid, " ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Forwarding message scenario (GREEDY, CBF, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// EUT3 discards the GBC packet
f_sleep(PX_TNOAC);
if(0 < lengthof(vc_utInds)) {
log("*** " & testcasename() & ": INCONC: Forwarding message scenario (GREEDY, CBF, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
else {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, CBF, GREEDY) is succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_03_eut3
/**
* @desc Behavior function for EUT4 (TC_AUTO_IOT_DENM_MFW_BV_03)
*/
function f_TC_AUTO_IOT_DENM_MFW_BV_03_eut4(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT4 receives the GBC packet from EUT2
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
mw_longPosVector(
PICS_TARGET_GEOAREA
),
?,
e_btpB,
?//mw_denm_stationId
)),
PX_EUT_DESC[p_eut_id].ll_mac_address
)) -> value v_eutGeoNw { // Receive a DEN message from EUT2
tc_wait.stop;
// Now check that EUT4 brodcasts the DENM message
log("*** " & testcasename() & ": INFO: EUT4 receives the GBC packet from EUT2 ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Forwarding message scenario (GREEDY, CBF, GREEDY) is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// EUT4 provides the DEN message to upper layers
f_sleep(PX_TNOAC);
if(0 < lengthof(vc_utInds)) {
log("*** " & testcasename() & ": PASS: Forwarding message scenario (GREEDY, CBF, GREEDY) is succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
else {
log("*** " & testcasename() & ": INCONC: EUT4 does not provide the DEN message to upper layers ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_MFW_BV_03_eut4
} // End of group g_TC_AUTO_IOT_DENM_MFW_BV_03
/**
* @desc Verify complete Road Works Warning scenario
* <pre>
* Pics Selection:
* Config Id: CF-02
* Initial conditions:
* with {
* EUT1 having sent Road Work Warning DEN messages D1
* containing a 'speedLimit'
* indicating the value 30
* containing a 'drivingLaneStatus'
* indicating the value '0001'B
* containing a 'trafficFlowRule'
* indicating the value 'passToRight'
* and EUT1 having sent a DEN message D2
* containing a 'speedLimit'
* indicating the value 30
* containing a 'drivingLaneStatus'
* indicating the value '0011'B
* containing a 'trafficFlowRule
* indicating the value 'passToRight'
* and EUT1 having sent a DEN message D3
* containing a 'speedLimit'
* indicating the value 30
* containing a 'drivingLaneStatus'
* indicating the value '0101'B
* containing a 'trafficFlowRule'
* indicating the value 'passToLeft'
* and EUT2 having received the DEN messages D1, D2 and D3
* }
* Expected behaviour:
* ensure that {
* when {
* EUT2 reaches the position POS0
* }
* then {
* EUT2 already indicates the speed limit information
* }
* when {
* EUT2 reaches the position POS1
* }
* then {
* EUT2 still indicates the speed limit information
* and EUT2 already indicates the most outer lane closed
* and EUT2 already indicates the hardshoulder opened
* }
* when {
* EUT2 reaches the position POS2
* }
* then {
* EUT2 still indicates the speed limit information
* and EUT2 already indicates the two most outer lanes closed
* and EUT2 already indicates the hardshoulder opened
* }
* when {
* EUT2 reaches the position POS3
* }
* then {
* EUT2 still indicates the speed limit information
* and EUT2 already indicates the most right lane closed
* and EUT2 already indicates the hardshoulder closed
* }
* when {
* EUT2 reaches the position POS4
* }
* then {
* EUT2 stops indicating the speed limit information
* and EUT2 stops indicating the lanes status
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_DENM_RWW_BV_01
* @reference ETSI EN 302 637-3 [5]
*/
testcase TC_AUTO_IOT_DENM_RWW_BV_01() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf02Up(v_eut1, v_eut2);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_DENM_RWW_BV_01_eut1(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_DENM_RWW_BV_01_eut2(v_eut2, PX_EUT2_ID));
// Synchronization
f_serverSyncNClientsAndStop(2, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf02Down(v_eut1, v_eut2);
} // End of TC_AUTO_IOT_DENM_RWW_BV_01
group g_TC_AUTO_IOT_DENM_RWW_BV_01 {
/**
* @desc Behavior function for EUT1 (TC_AUTO_IOT_DENM_RWW_BV_01)
*/
function f_TC_AUTO_IOT_DENM_RWW_BV_01_eut1(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var integer v_states := 0;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// Wait for DENM1
tc_ac.start;
alt {
[v_states == 0] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
f_payload_template(
PICS_DENM_BTP_DESTINATION_PORT,
PICS_DENM_BTP_SOURCE_PORT,
LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_,
PX_EUT_DESC[p_eut_id].stationId
)
)))) -> value v_gnInd { // Receive a DEN message
tc_ac.stop;
// Check DENM paylod
if (f_check_payload_denm(
v_gnInd,
mw_denm_stationId(
PX_EUT_DESC[p_eut_id].stationId,
mw_denm(
mw_denmMgmtCon_with_relevances(
?,
LibItsCommon_ASN1_NamedNumbers.StationType_roadSideUnit_,
-,
-,
-,
-,
-,
-,
mw_referencePosition(PICS_Z1_D1_EP)
),
mw_situation(
LibItsCommon_ASN1_NamedNumbers.CauseCodeType_roadworks_,
?
)))) == true) {
v_states := v_states + 1;
// Re-send DEN message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
}
tc_ac.start;
repeat;
}
[v_states == 1] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
f_payload_template(
PICS_DENM_BTP_DESTINATION_PORT,
PICS_DENM_BTP_SOURCE_PORT,
LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_,
PX_EUT_DESC[p_eut_id].stationId
)
)))) -> value v_gnInd { // Receive a DEN message
tc_ac.stop;
// Check DENM paylod
if (f_check_payload_denm(
v_gnInd,
mw_denm_stationId(
PX_EUT_DESC[p_eut_id].stationId,
mw_denm(
mw_denmMgmtCon_with_relevances(
?,
LibItsCommon_ASN1_NamedNumbers.StationType_roadSideUnit_,
-,
-,
-,
-,
-,
-,
mw_referencePosition(PICS_Z1_D2_EP)
),
mw_situation(
LibItsCommon_ASN1_NamedNumbers.CauseCodeType_roadworks_,
?
)))) == true) {
v_states := v_states + 1;
// Re-send DEN message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
}
tc_ac.start;
repeat;
}
[v_states == 2] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
f_payload_template(
PICS_DENM_BTP_DESTINATION_PORT,
PICS_DENM_BTP_SOURCE_PORT,
LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_,
PX_EUT_DESC[p_eut_id].stationId
)
)))) -> value v_gnInd { // Receive a DEN message
tc_ac.stop;
// Check DENM paylod
if (f_check_payload_denm(
v_gnInd,
mw_denm_stationId(
PX_EUT_DESC[p_eut_id].stationId,
mw_denm(
mw_denmMgmtCon_with_relevances(
?,
LibItsCommon_ASN1_NamedNumbers.StationType_roadSideUnit_,
-,
-,
-,
-,
-,
-,
mw_referencePosition(PICS_Z1_D3_EP)
),
mw_situation(
LibItsCommon_ASN1_NamedNumbers.CauseCodeType_roadworks_,
?
)))) == true) {
// Re-send DEN message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
log("*** " & testcasename() & ": PASS: The three expected DEN messages were received ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
} else {
tc_ac.start;
repeat;
}
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: The three expected DEN messages were not received in time ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
// Nothing to do
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_RWW_BV_01_eut1
/**
* @desc Behavior function for EUT2 (TC_AUTO_IOT_DENM_RWW_BV_01)
*/
function f_TC_AUTO_IOT_DENM_RWW_BV_01_eut2(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var HmiSignageEventInd v_hmiSignageEventInd;
var EutGeoNetworking v_eutGeoNw;
var integer v_counter; // DEN message counter
var ThreeDLocation v_nextPosition2reach := PICS_POS0; // The different position to reach
var float v_distance; // The vehicle position calculated using GN messages
var integer v_isOnPosition := -1; // Set to unknown position
var ThreeDLocation v_position; // CAM reference position
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// Wait for EUT_1 DEN messages
v_counter := 0;
tc_wait.start;
tc_ac.start;
alt {
[] eutGeoNetworkingPort.receive(
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?
)))) -> value v_eutGeoNw { // Receive a DEN message
tc_ac.stop;
v_counter := v_counter + 1;
log("v_counter = ", v_counter);
if (v_counter < 3) {
tc_ac.start;
repeat;
} else {
log("*** " & testcasename() & ": INFO: EUT2 (vehicle) receives RWW DENMs D1, D2 and D3 ***");
tc_wait.stop;
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
}
}
[] tc_ac.timeout {
log("*** " & testcasename() & ":FAIL: EUT2 (vehicle) does not receive RWW DENMs D1, D2 and D3 ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_error);
}
} // End of 'alt' statement
// Test Body
//tc_wait.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
f_payload_template(
PICS_CAM_BTP_DESTINATION_PORT,
PICS_CAM_BTP_SOURCE_PORT,
LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_cam_,
PX_EUT_DESC[p_eut_id].stationId
)
)),
c_llBroadcast
)) -> value v_gnInd {
tc_ac.stop;
if (f_check_payload_cam(
v_gnInd,
mw_camMsg_BC_refPos(?),
v_position) == true) {
// Re-send DEN message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
// Compute distance from v_nextPosition2reach
v_distance := f_distance(
v_position,
v_nextPosition2reach
);
log("v_distance = ", v_distance, " - diff = ", v_distance - PX_PRE_DEFINED_SECURITY_DISTANCE, " - v_isOnPosition = ", v_isOnPosition);
if (ff_abs(v_distance - PX_PRE_DEFINED_SECURITY_DISTANCE) < PX_DISTANCE_EPSILON) { // The expected position was reached
select (v_isOnPosition) {
case (-1) {
v_isOnPosition := 0;
v_nextPosition2reach := PICS_POS1;
log("Next position to reach (-1): ", v_nextPosition2reach);
tc_ac.start;
repeat;
}
case (0) {
v_isOnPosition := 1;
v_nextPosition2reach := PICS_POS2;
log("Next position to reach (0): ", v_nextPosition2reach);
tc_ac.start;
repeat;
}
case (1) {
v_isOnPosition := 2;
v_nextPosition2reach := PICS_POS3;
log("Next position to reach (1): ", v_nextPosition2reach);
tc_ac.start;
repeat;
}
case (2) {
log("Reach final position");
v_isOnPosition := 3;
if (PX_CAPTURE_MODE == "off-link") {
log("*** " & testcasename() & ": PASS: Road Works Warning scenario complete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
} else {
repeat;
}
}
} // End of 'select' statement
}
} else {
tc_ac.start;
repeat;
}
}
[PX_CAPTURE_MODE == "on-link" and v_isOnPosition == 0] hmiPort.receive(
mw_hmiSignageEventInd_roadworks_limitedspeed
) -> value v_hmiSignageEventInd {
log("*** " & testcasename() & ": INFO: EUT2 reaches position ", v_isOnPosition, " ***");
tc_ac.stop;
repeat; // Continue
}
[PX_CAPTURE_MODE == "on-link" and v_isOnPosition == 1] hmiPort.receive(
HmiSignageEventInd:?/*TODO*/
) -> value v_hmiSignageEventInd {
log("*** " & testcasename() & ": INFO: EUT2 reaches position ", v_isOnPosition, " ***");
tc_ac.stop;
repeat; // Continue
}
[PX_CAPTURE_MODE == "on-link" and v_isOnPosition == 2] hmiPort.receive(
HmiSignageEventInd:?/*TODO*/
) -> value v_hmiSignageEventInd {
log("*** " & testcasename() & ": INFO: EUT2 reaches position ", v_isOnPosition, " ***");
tc_ac.stop;
repeat; // Continue
}
[PX_CAPTURE_MODE == "on-link" and v_isOnPosition == 3] hmiPort.receive(
HmiSignageEventInd:?/*TODO*/
) -> value v_hmiSignageEventInd {
log("*** " & testcasename() & ": PASS: Road Works Warning scenario complete ***");
tc_ac.stop;
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": FAIL: Road Works Warning scenario failure in position ", v_isOnPosition, " ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
/*[] tc_wait.timeout {
log("*** " & testcasename() & ": INCONC: Road Works Warning scenario is incomplet ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}*/
} // End of 'alt' statement
// Postamble
log("f_TC_AUTO_IOT_DENM_RWW_BV_01_eut2: verdict: ", getverdict);
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_RWW_BV_01_eut2
} // End of group g_TC_AUTO_IOT_DENM_RWW_BV_01
/**
* @desc Verify complete Road hazard Signals scenario
* <pre>
* Pics Selection:
* Config Id: CF-02
* Initial conditions:
* with {
* EUT1 having sent Road Work Warning DEN messages D
* containing a management
* containing eventPosition
* indicating POS1
* containing relevanceDistance
* indicating lessThan100m
* containing relevanceTrafficDirection
* indicating allTrafficDirections
* containing situation
* containing eventType
* containing causeCode
* indicating a valid CAUSE_CODE (Table 4)
* containing subCauseCode
* indicating a valid SUB_CAUSE_CODE (Table 5)
* }
* Expected behaviour:
* ensure that {
* when {
* EUT2 reaches the position POS0
* }
* then {
* EUT2 already indicates the Road Hazard information
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_DENM_RHS_BV_01
* @reference ETSI EN 302 637-3 [5]
*/
testcase TC_AUTO_IOT_DENM_RHS_BV_01() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf02Up(v_eut1, v_eut2);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_DENM_RHS_BV_01_eut1(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_DENM_RHS_BV_01_eut2(v_eut2, PX_EUT2_ID));
// Synchronization
f_serverSyncNClientsAndStop(2, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf02Down(v_eut1, v_eut2);
} // End of TC_AUTO_IOT_DENM_RHS_BV_01
group g_TC_AUTO_IOT_DENM_RHS_BV_01 {
/**
* @desc Behavior function for EUT1 (TC_AUTO_IOT_DENM_RHS_BV_01)
*/
function f_TC_AUTO_IOT_DENM_RHS_BV_01_eut1(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// Wait for DENM1
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
f_payload_template(
PICS_DENM_BTP_DESTINATION_PORT,
PICS_DENM_BTP_SOURCE_PORT,
LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_,
PX_EUT_DESC[p_eut_id].stationId
)
)))) -> value v_gnInd { // Receive a DEN message
tc_ac.stop;
// Check DENM paylod
if (f_check_payload_denm(
v_gnInd,
mw_denm_stationId(
PX_EUT_DESC[p_eut_id].stationId,
mw_denm(
mw_denmMgmtCon_with_relevances(
?,
LibItsCommon_ASN1_NamedNumbers.StationType_roadSideUnit_,
-,
-,
-,
-,
lessThan100m,
allTrafficDirections,
mw_referencePosition(PICS_Z1_D1_EP)
),
mw_situation(
PX_DENM_CAUSE_VA,
PX_DENM_SUBCAUSE_VA
)))) == true) {
// Re-send DEN message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
log("*** " & testcasename() & ": PASS: The expected DEN messages were received ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
} else {
tc_ac.start;
repeat;
}
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: The expected DEN message were not received in time ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
// Nothing to do
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_RHS_BV_01_eut1
/**
* @desc Behavior function for EUT2 (TC_AUTO_IOT_DENM_RHS_BV_01)
*/
function f_TC_AUTO_IOT_DENM_RHS_BV_01_eut2(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var EutGeoNetworking v_eutGeoNw;
var float v_distance;
var ThreeDLocation v_position; // CAM reference position
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// EUT2 having received a DEN message
tc_ac.start;
alt {
[] eutGeoNetworkingPort.receive(
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?
)))) {
tc_ac.stop;
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected DEN message not received ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
f_payload_template(
PICS_CAM_BTP_DESTINATION_PORT,
PICS_CAM_BTP_SOURCE_PORT,
LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_cam_,
PX_EUT_DESC[p_eut_id].stationId
)
)),
c_llBroadcast
)) -> value v_gnInd {
tc_ac.stop;
if (f_check_payload_cam(
v_gnInd,
mw_camMsg_BC_refPos(?),
v_position) == true) {
// Compute distance from POS0
v_distance := f_distance(
v_position,
PICS_POS0
);
log("v_distance = ", v_distance, " - diff = ", v_distance - PX_PRE_DEFINED_SECURITY_DISTANCE);
if (ff_abs(v_distance - PX_LATERAL_COLLISION_SECURITY_DISTANCE) < PX_DISTANCE_EPSILON) { // Position PICS_POS0 was reached
log("*** " & testcasename() & ": INFO: EUT2 has reached POS0 ***");
if (PX_CAPTURE_MODE == "off-link") {
log("*** " & testcasename() & ": PASS: The Road Hazard Signal information was received on EUT ", PX_EUT_DESC[p_eut_id].stationId, "***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} else {
// Continue
tc_ac.start;
repeat;
}
} else {
tc_ac.start;
repeat;
}
}
[PX_CAPTURE_MODE == "on-link"] hmiPort.receive(mw_hmiSignageEventInd_roadHazardSignal) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: The Road Hazard Signal information was received on EUT ", PX_EUT_DESC[p_eut_id].stationId, "***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: CAM messages for EUT ", PX_EUT_DESC[p_eut_id].stationId, " not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_RHS_BV_01_eut2
} // End of group g_TC_AUTO_IOT_DENM_RHS_BV_01
/**
* @desc Verify complete Stationary Vehicle Warning scenario
* <pre>
* Pics Selection:
* Config Id: CF-02
* Initial conditions:
* with {
* EUT1 having sent Road Work Warning DEN messages D
* containing a management
* containing eventPosition
* indicating POS1
* containing relevanceDistance
* indicating lessThan100m
* containing relevanceTrafficDirection
* indicating allTrafficDirections
* containing situation
* containing eventType
* containing causeCode
* indicating a valid CAUSE_CODE (Table 4)
* containing subCauseCode
* indicating a valid SUB_CAUSE_CODE (Table 5)
* }
* Expected behaviour:
* ensure that {
* when {
* EUT2 reaches the position POS0
* }
* then {
* EUT2 already indicates the Stationary Vehicle Information
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_DENM_SVW_BV_01
* @reference ETSI EN 302 637-3 [5]
*/
testcase TC_AUTO_IOT_DENM_SVW_BV_01() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf02Up(v_eut1, v_eut2);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_DENM_SVW_BV_01_eut1(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_DENM_SVW_BV_01_eut2(v_eut2, PX_EUT2_ID));
// Synchronization
f_serverSyncNClientsAndStop(2, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf02Down(v_eut1, v_eut2);
} // End of TC_AUTO_IOT_DENM_SVW_BV_01
group g_TC_AUTO_IOT_DENM_SVW_BV_01 {
/**
* @desc Behavior function for EUT1 (TC_AUTO_IOT_DENM_SVW_BV_01)
*/
function f_TC_AUTO_IOT_DENM_SVW_BV_01_eut1(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// EUT1 having sent a DEN message
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
f_payload_template(
PICS_DENM_BTP_DESTINATION_PORT,
PICS_DENM_BTP_SOURCE_PORT,
LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_denm_,
PX_EUT_DESC[p_eut_id].stationId
)
)))) -> value v_gnInd { // Receive a DEN message
tc_ac.stop;
// Check DENM paylod
if (f_check_payload_denm(
v_gnInd,
mw_denm_stationId(
PX_EUT_DESC[p_eut_id].stationId,
mw_denm(
mw_denmMgmtCon_with_relevances_position(
?,
LibItsCommon_ASN1_NamedNumbers.StationType_heavyTruck_,
-,
4,
-,
-,
mw_referencePosition(PICS_UC2_HEAVY_TRUCK_POS)
),
mw_situation(
PICS_UC2_CAUSE,
PICS_UC2_SUBCAUSE
)))) == true) {
// Re-send DEN message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
log("*** " & testcasename() & ": PASS: The expected DEN message were received ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
} else {
tc_ac.start;
repeat;
}
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected DEN message not received ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
// Nothing to do
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_SVW_BV_01_eut1
/**
* @desc Behavior function for EUT2 (TC_AUTO_IOT_DENM_SVW_BV_01)
*/
function f_TC_AUTO_IOT_DENM_SVW_BV_01_eut2(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var EutGeoNetworking v_eutGeoNw;
var float v_distance;
var ThreeDLocation v_position; // CAM reference position
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// EUT2 having received a DEN message
tc_ac.start;
alt {
[] eutGeoNetworkingPort.receive(
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?
)))) { // Receive a DEN message
tc_ac.stop;
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected DEN message not received ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
f_payload_template(
PICS_CAM_BTP_DESTINATION_PORT,
PICS_CAM_BTP_SOURCE_PORT,
LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageID_cam_,
PX_EUT_DESC[p_eut_id].stationId
)
)),
c_llBroadcast
)) -> value v_gnInd {
tc_ac.stop;
if (f_check_payload_cam(
v_gnInd,
mw_camMsg_BC_refPos(?),
v_position) == true) {
// Compute distance from POS0
v_distance := f_distance(
v_position,
PICS_POS0
);
log("v_distance = ", v_distance, " - diff = ", v_distance - PX_PRE_DEFINED_SECURITY_DISTANCE);
if (ff_abs(v_distance - PX_PRE_DEFINED_SECURITY_DISTANCE) < PX_DISTANCE_EPSILON) { // Position PICS_POS0 was reached
log("*** " & testcasename() & ": INFO: EUT2 has reached POS0 ***");
if (PX_CAPTURE_MODE == "off-link") {
log("*** " & testcasename() & ": PASS: The Stationary Vehicle Warning information was received on EUT ", PX_EUT_DESC[p_eut_id].stationId, "***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} else {
tc_ac.start;
repeat;
}
} else {
tc_ac.start;
repeat;
}
}
[PX_CAPTURE_MODE == "on-link"] hmiPort.receive(mw_hmiSignageEventInd_stationaryVehicleWarning) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: The Stationary Vehicle Warning information was received on EUT ", PX_EUT_DESC[p_eut_id].stationId, "***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: CAM messages for EUT ", PX_EUT_DESC[p_eut_id].stationId, " not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_SVW_BV_01_eut2
} // End of group g_TC_AUTO_IOT_DENM_SVW_BV_01
/**
* @desc Verify complete complete Geo-broadcast message caching scenario
* <pre>
* Pics Selection:
* Config Id: CF-01with EUT4 off-link
* Initial conditions:
* with {
* itsGnNonAreaForwardingAlgorithm of EUT1 set to GREEDY
* itsGnNonAreaForwardingAlgorithm of EUT2 set to GREEDY
* itsGnNonAreaForwardingAlgorithm of EUT4 is SIMPLE
* }
* Expected behaviour:
* ensure that {
* when {
* EUT1 is requested to send DEN message
* encapsulated in a GBC packet
* containing Basic Header
* containing RHL field
* indicating a value > 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* }
* then {
* EUT1 sends a GBC packet
* containing Basic Header
* containing RHL field
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating the EUT2 address
* }
* when {
* EUT2 receives the GBC packet from EUT1
* }
* then {
* EUT2 buffers the GBC packet from EUT1
* }
* when {
* EUT2 and EUT4 become on-link
* }
* then {
* EUT2 sends a GBC packet
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating the EUT4 address
* and EUT3 does not receive the GBC packet from EUT1
* }
* when {
* EUT4 receives the GBC packet from EUT2
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* }
* then {
* EUT4 provides the DEN message to upper layers
* and EUT4 sends a GBC packet
* containing Basic Header
* containing RHL field
* indicating value decreased by 1
* containing DestinationArea
* indicating the TARGET_GEOAREA
* containing Payload
* containing the DEN message
* encapsulated in a LL packet
* containing a destination MAC address
* indicating broadcast address
* }
* when {
* EUT2 receives the GBC packet from EUT4
* }
* then {
* EUT2 discards the GBC packet
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_DENM_GMC_BV_01
* @reference ETSI EN 302 636-4-1 Clauses 9.3.11, D & E2 [2]
*/
testcase TC_AUTO_IOT_DENM_GMC_BV_01() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
var ItsAutoInteropGeonetworking v_eut3 := null;
var ItsAutoInteropGeonetworking v_eut4 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf01Up(v_eut1, v_eut2, v_eut3, v_eut4);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_DENM_GMC_BV_01_eut1(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_DENM_GMC_BV_01_eut2(v_eut2, PX_EUT2_ID));
// v_eut3 not used
v_eut4.start(f_TC_AUTO_IOT_DENM_GMC_BV_01_eut4(v_eut4, PX_EUT4_ID));
// Synchronization
f_serverSyncNClientsAndStop(4, {c_prDone, c_initDone, c_tbDone});
// Cleanup
f_mtcCf01Down(v_eut1, v_eut2, v_eut3, v_eut4);
} // End of TC_AUTO_IOT_DENM_GMC_BV_01
group g_TC_AUTO_IOT_DENM_GMC_BV_01 {
/**
* @desc Behavior function for EUT1 (TC_AUTO_IOT_DENM_GMC_BV_01)
*/
function f_TC_AUTO_IOT_DENM_GMC_BV_01_eut1(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
tc_ac.start;
alt {
[] geoNetworkingPort.receive( // Filter broadcasted DENM
mw_geoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[p_eut_id].stationId
)*/)),
PX_EUT_DESC[PX_EUT2_ID].ll_mac_address
)) -> value v_gnInd { // Receives the triggered DENM message
tc_ac.stop;
// Re-send DEN message to EUT2s
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
log("*** " & testcasename() & ": INFO: EUT1 sends a GBC packet ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: EUT1 does not send requested DEN message ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
f_selfOrClientSyncAndVerdict(c_initDone, e_success);
tc_wait.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
? // FIXME complement(PX_EUT_DESC[p_eut_id].stationId)
)*/)),
?
)) -> value v_gnInd {
tc_wait.stop;
log("*** " & testcasename() & ": FAIL: Unexpected DEN message received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": PASS: Geo-broadcast message caching scenario succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_GMC_BV_01_eut1
/**
* @desc Behavior function for EUT2 (TC_AUTO_IOT_DENM_GMC_BV_01)
*/
function f_TC_AUTO_IOT_DENM_GMC_BV_01_eut2(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] eutGeoNetworkingPort.receive( // EUT2 receives the GBC packet from EUT1
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[PX_EUT1_ID].stationId
)*/)))) -> value v_eutGeoNw {
// Here, GBC packet should be buffered
f_selfOrClientSyncAndVerdict(c_initDone, e_success);
// Now, we have to check for EUT4 to broadcast the DENM message
repeat;
}
[] eutGeoNetworkingPort.receive(
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[PX_EUT4_ID].stationId
)*/)),
c_llBroadcast
)) -> value v_eutGeoNw {
tc_wait.stop;
log("*** " & testcasename() & ": PASS: DEN message was broadcasted by EUT4 ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Geo-broadcast message caching scenario is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_GMC_BV_01_eut2
/**
* @desc Behavior function for EUT4 (TC_AUTO_IOT_DENM_GMC_BV_01)
*/
function f_TC_AUTO_IOT_DENM_GMC_BV_01_eut4(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var EutGeoNetworking v_eutGeoNw;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
f_selfOrClientSyncAndVerdict(c_initDone, e_success);
// EUT2 and EUT4 become on-link
if (PX_CAPTURE_MODE == "on-link") {
ItsAutoInterop_Functions.f_utTriggerEvent(UtAutoInteropTrigger:{utRadioOnOff := true});
}
tc_ac.start;
alt {
[] eutGeoNetworkingPort.receive(
mw_eutGeoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[PX_EUT1_ID].stationId
)*/)),
PX_EUT_DESC[p_eut_id].ll_mac_address
)) -> value v_eutGeoNw { // Receive a DEN message from EUT2
tc_ac.stop;
// Now check that EUT4 brodcasts the DENM message
tc_ac.start;
repeat;
}
[] geoNetworkingPort.receive(
mw_geoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_denm_stationId(
PX_EUT_DESC[p_eut_id].stationId
)*/)),
c_llBroadcast
)) -> value v_gnInd { // EUT4 has brodcasted the DENM message
tc_ac.stop;
// Re-send DEN message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
log("*** " & testcasename() & ": PASS: Geo-broadcast message caching scenario succeed ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": FAIL: Geo-broadcast message caching scenario is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
} // End of 'alt' statement
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_DENM_GMC_BV_01_eut4
} // End of group g_TC_AUTO_IOT_DENM_GMC_BV_01
/**
* @desc Verify complete neighbors detection scenario based on CA messages and/or beacons
* <pre>
* Pics Selection:
* Config Id: CF-03
* Initial conditions:
* with {
* EUT1, EUT2 and EUT3 being on-link
* }
* Expected behaviour:
* ensure that {
* when {
* EUT1 sends CA messages
* containing cam
* containing camParameters
* containing basicContainer
* containing referencePosition
* indicating POSITION_1
* }
* then {
* EUT2 indicates EUT1 as neighbour
* EUT3 indicates EUT1 as neighbour
* }
* when {
* EUT2 sends CA messages
* containing cam
* containing camParameters
* containing basicContainer
* containing referencePosition
* indicating POSITION_1
* }
* then {
* EUT1 indicates EUT1 as neighbour
* EUT3 indicates EUT1 as neighbour
* }
* when {
* EUT3 sends CA messages
* containing cam
* containing camParameters
* containing basicContainer
* containing referencePosition
* indicating POSITION_1
* }
* then {
* EUT1 indicates EUT1 as neighbour
* EUT2 indicates EUT1 as neighbour
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_CAM_NBD_BV_01
* @reference ETSI EN 302 636-2 ETSI EN 302 637-2 [4]
*/
testcase TC_AUTO_IOT_CAM_NBD_BV_01() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
var ItsAutoInteropGeonetworking v_eut3 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf03Up(v_eut1, v_eut2, v_eut3);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_CAM_NBD_BV_01_eut(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_CAM_NBD_BV_01_eut(v_eut2, PX_EUT2_ID));
v_eut3.start(f_TC_AUTO_IOT_CAM_NBD_BV_01_eut(v_eut3, PX_EUT3_ID));
// Synchronization
f_serverSyncNClientsAndStop(3, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf03Down(v_eut1, v_eut2, v_eut3);
} // End of TC_AUTO_IOT_CAM_NBD_BV_01
group g_TC_AUTO_IOT_CAM_NBD_BV_01 {
/**
* @desc Behavior function for EUT (TC_AUTO_IOT_CAM_NBD_BV_01)
*/
function f_TC_AUTO_IOT_CAM_NBD_BV_01_eut(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var HmiNeighborEventInds v_hmiNeighborEventInds;
var HmiNeighborEventInds v_expected_neighbors := {};
// Build the list of the expected neighbors
for (var integer i := 0; i < lengthof(PX_EUT_DESC); i := i + 1) {
if (i != p_eut_id) {
var octetstring v := int2oct(PX_EUT_DESC[i].stationId, 4); // FIXME How to improve type conversion
v_expected_neighbors[lengthof(v_expected_neighbors)].mid := PX_EUT_DESC[i].mid;
v_expected_neighbors[lengthof(v_expected_neighbors)].stationId := oct2int(v); // FIXME How to improve type conversion
}
} // End of 'for' statement
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] geoNetworkingPort.receive( // Filter broadcasted CAM
mw_geoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_cam_stationId(
-,
? // FIXME complement(PX_EUT_DESC[p_eut_id].stationId)
)*/)),
c_llBroadcast
)) -> value v_gnInd { // Receives a broadcast MAC address
// Broadcast CA message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
repeat;
}
[] geoNetworkingPort.receive( // Filter broadcasted beacon
mw_geoNwInd_withLinkLayerDestination(
mw_geoNwPdu(
mw_geoNwShbPacket(
mw_longPosVectorAny(
mw_gnAddressMid(
? // FIXME complement(PX_EUT_DESC[p_eut_id].mid)
)))),
c_llBroadcast
)) -> value v_gnInd { // Receives a broadcast MAC address
// Broadcast Beacon message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
repeat;
}
[] hmiPort.receive(
HmiNeighborEventInds:?
) -> value v_hmiNeighborEventInds {
for (var integer v_i := 0; v_i < lengthof(v_hmiNeighborEventInds); v_i := v_i + 1) {
if (match(v_expected_neighbors, superset(m_hmiNeighborEventInd(v_hmiNeighborEventInds[v_i].mid, v_hmiNeighborEventInds[v_i].stationId)))) {
// Remove item from the expected list
for (var integer v_j := 0; v_j < lengthof(v_expected_neighbors); v_j := v_j + 1) {
if (v_expected_neighbors[v_j].mid == v_hmiNeighborEventInds[v_i].mid) {
v_expected_neighbors[v_j] := {};
break;
}
} // End of 'for' statement
} // else nothing to do
} // End of 'for' statement
// Check if all neighbors were detected
if (lengthof(v_expected_neighbors) == 0) {
log("*** " & testcasename() & ": PASS: Neighbors were detected by EUT #", p_eut_id, " ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
} else {
repeat;
}
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": FAIL: Neighbors were not be detected by EUT #", p_eut_id, " ***");
}
} // End of 'alt' statement
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_CAM_NBD_BV_01_eut
} // End of group g_TC_AUTO_IOT_CAM_NBD_BV_01
/**
* @desc Verify complete longitudinal collision risk scenario based on CA messages
* <pre>
* Pics Selection:
* Config Id: CF-02
* Initial conditions:
* with {
* EUT1 having moved slowly between positions POS1 and POS2
* and EUT2 having moved from Start position to End position
* }
* Expected behaviour:
* ensure that {
* when {
* distance between EUT1 and EUT2 becomes less than the pre-defined security distance
* }
* then {
* EUT1 indicates the forward collision risk
* and EUT2 indicates the forward collision risk
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_CAM_CRW_BV_01
* @reference ETSI EN 302 637-2 [4]
*/
testcase TC_AUTO_IOT_CAM_CRW_BV_01() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf02Up(v_eut1, v_eut2);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_CAM_CRW_BV_01_eut(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_CAM_CRW_BV_01_eut(v_eut2, PX_EUT2_ID));
// Synchronization
f_serverSyncNClientsAndStop(2, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf02Down(v_eut1, v_eut2);
} // End of TC_AUTO_IOT_CAM_CRW_BV_01
group g_TC_AUTO_IOT_CAM_CRW_BV_01 {
/**
* @desc Behavior function for EUT1 (TC_AUTO_IOT_CAM_CRW_BV_01)
*/
function f_TC_AUTO_IOT_CAM_CRW_BV_01_eut(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var float v_distance;
var ThreeDLocation v_myPosition;
var ThreeDLocation v_position; // CAM reference position
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// Acquire my current position
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_cam_stationId(
-,
PX_EUT_DESC[p_eut_id].stationId
)*/)))) -> value v_gnInd { // Receive a DEN message
tc_ac.stop;
// Re-send DEN message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
// Store my current position
v_myPosition.latitude := v_gnInd.msgIn.gnPacket.packet.extendedHeader.shbHeader.srcPosVector.latitude;
v_myPosition.longitude := v_gnInd.msgIn.gnPacket.packet.extendedHeader.shbHeader.srcPosVector.longitude;
v_myPosition.elevation := 0; //v_gnInd.msgIn.gnPacket.packet.extendedHeader.shbHeader.srcPosVector.altitude;
}
[] geoNetworkingPort.receive( // TODO Move to default
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload
))) {
tc_ac.stop;
tc_ac.start;
repeat;
}
[] eutGeoNetworkingPort.receive( // TODO Move to default
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload
))) {
tc_ac.stop;
tc_ac.start;
repeat;
}
[] geoNetworkingPort.receive( // TODO Move to default
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?//mw_denm_stationId
)))) {
tc_ac.stop;
tc_ac.start;
repeat;
}
[] eutGeoNetworkingPort.receive( // TODO Move to default
mw_eutGeoNwInd(
mw_geoNwPdu(
mw_geoNwBroadcastPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?//mw_denm_stationId
)))) {
tc_ac.stop;
tc_ac.start;
repeat;
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: CAM messages for EUT ", PX_EUT_DESC[p_eut_id].stationId, " not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_cam_stationId(
-,
PX_EUT_DESC[p_eut_id].stationId
)*/)))) -> value v_gnInd { // Receive a DEN message
tc_ac.stop;
// Re-send DEN message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
// Store my current position
v_myPosition.latitude := v_gnInd.msgIn.gnPacket.packet.extendedHeader.shbHeader.srcPosVector.latitude;
v_myPosition.longitude := v_gnInd.msgIn.gnPacket.packet.extendedHeader.shbHeader.srcPosVector.longitude;
v_myPosition.elevation := 0; //v_gnInd.msgIn.gnPacket.packet.extendedHeader.shbHeader.srcPosVector.altitude;
}
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?//mw_cam_stationId
)))) -> value v_gnInd { // Receive a DEN message
tc_ac.stop;
if (f_check_payload_cam(
v_gnInd,
mw_camMsg_BC_refPos(?),
v_position) == true) {
// Re-send CA message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
// Store my current position
v_distance := f_distance(
v_position,
v_myPosition
);
if (v_distance >= PX_FORWARD_COLLISION_SECURITY_DISTANCE) { // TODO Check elevation
tc_ac.start;
repeat;
} // else, nothing to do
} else {
tc_ac.start;
repeat;
}
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: CAM messages for EUT ", PX_EUT_DESC[p_eut_id].stationId, " not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
tc_ac.start;
alt { // Check that Forward Collision Risk was received
[] hmiPort.receive(mw_hmiSignageEventInd_forwardCollisionRisk) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: The Forward Collision Risk signage was received on EUT ", PX_EUT_DESC[p_eut_id].stationId, "***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": FAIL: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_CAM_CRW_BV_01_eut
} // End of group g_TC_AUTO_IOT_CAM_CRW_BV_01
/**
* @desc Verify complete intersection collision risk scenario based on CA messages
* <pre>
* Pics Selection:
* Config Id: CF-04
* Initial conditions:
* with {
* EUT1 having moved from Start1 position to End1 position
* and EUT2 having moved from Start2 position to End2 position
* }
* Expected behaviour:
* ensure that {
* when {
* EUT1 and EUT2 approach simultaneously POS3
* }
* then {
* EUT1 indicates the lateral collision risk
* and EUT2 indicates the lateral collision risk
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_CAM_CRW_BV_02
* @reference ETSI EN 302 637-2 [4]
*/
testcase TC_AUTO_IOT_CAM_CRW_BV_02() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf02Up(v_eut1, v_eut2);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_CAM_CRW_BV_02_eut(v_eut1, PX_EUT1_ID));
v_eut2.start(f_TC_AUTO_IOT_CAM_CRW_BV_02_eut(v_eut2, PX_EUT2_ID));
// Synchronization
f_serverSyncNClientsAndStop(2, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf02Down(v_eut1, v_eut2);
} // End of TC_AUTO_IOT_CAM_CRW_BV_02
group g_TC_AUTO_IOT_CAM_CRW_BV_02 {
/**
* @desc Behavior function for EUT1 (TC_AUTO_IOT_CAM_CRW_BV_02)
*/
function f_TC_AUTO_IOT_CAM_CRW_BV_02_eut(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var float v_distance;
var ThreeDLocation v_position; // CAM reference position
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// Nothing to do
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_cam_stationId(
-,
PX_EUT_DESC[p_eut_id].stationId
)*/)))) -> value v_gnInd { // Receive a DEN message
tc_ac.stop;
if (f_check_payload_cam(
v_gnInd,
mw_camMsg_BC_refPos(?),
v_position) == true) {
// Re-send CA message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
// Compute distance from POS3
v_distance := f_distance(
v_position,
PICS_POS3
);
if (v_distance >= PX_LATERAL_COLLISION_SECURITY_DISTANCE) { // TODO Check elevation
// Continue
tc_ac.start;
repeat;
} // else, nothing to do
} else {
tc_ac.start;
repeat;
}
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: CAM messages for EUT ", PX_EUT_DESC[p_eut_id].stationId, " not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
} // End of 'alt' statement
tc_ac.start;
alt { // Check that Lateral Collision Risk was received
[] hmiPort.receive(mw_hmiSignageEventInd_lateralCollisionRisk) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: The Lateral Collision Risk signage was received on EUT ", PX_EUT_DESC[p_eut_id].stationId, "***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": FAIL: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_CAM_CRW_BV_02_eut
} // End of group g_TC_AUTO_IOT_CAM_CRW_BV_02
/**
* @desc Verify complete resolution of duplicate address conflict scenario based on GN messages
* <pre>
* Pics Selection:
* Config Id: CF-01
* Initial conditions:
* with {
* EUT1 and EUT2 being configured with the same GN address
* and EUT1 and EUT2 being off-link
* }
* Expected behaviour:
* ensure that {
* when {
* EUT1 and EUT2 become on-link
* }
* then {
* EUT1 changes its GN address
* and EUT2 changes its GN address
* }
* when {
* EUT1 sends CA messages
* containing cam
* containing camParameters
* containing basicContainer
* containing referencePosition
* }
* then {
* EUT2 indicates EUT1 as neighbour
* }
* when {
* EUT2 sends CA messages
* containing cam
* containing camParameters
* containing basicContainer
* containing referencePosition
* }
* then {
* EUT1 indicates EUT2 as neighbour
* }
* }
* </pre>
*
* @see Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) TD_AUTO_IOT_GN_DAD_BV_01
* @reference ETSI EN 302 636-4-1 [2] Clause 9.2.1.5
*/
testcase TC_AUTO_IOT_GN_DAD_BV_01() runs on ItsMtc system ItsAutoInteropGeoNetworkingSystem {
// Local variables
var ItsAutoInteropGeonetworking v_eut1 := null;
var ItsAutoInteropGeonetworking v_eut2 := null;
// Test control
/*if (not PICS_GN_LS_FWD) {
log("*** " & testcasename() & ": PICS_GN_LS_FWD required for executing the TC ***");
setverdict(inconc);
stop;
}*/
// Test component configuration
f_mtcCf02Up(v_eut1, v_eut2);
// Preamble
// Start components
v_eut1.start(f_TC_AUTO_IOT_GN_DAD_BV_01_eut(v_eut1, PX_EUT1_ID, PX_EUT2_ID));
v_eut2.start(f_TC_AUTO_IOT_GN_DAD_BV_01_eut(v_eut2, PX_EUT2_ID, PX_EUT1_ID));
// Synchronization
f_serverSyncNClientsAndStop(2, {c_prDone, c_tbDone});
// Cleanup
f_mtcCf02Down(v_eut1, v_eut2);
} // End of TC_AUTO_IOT_GN_DAD_BV_01
group g_TC_AUTO_IOT_GN_DAD_BV_01 {
/**
* @desc Behavior function for EUTs (TC_AUTO_IOT_GN_DAD_BV_01)
*/
function f_TC_AUTO_IOT_GN_DAD_BV_01_eut(
in ItsAutoInteropGeonetworking p_eut,
in integer p_eut_id,
in integer p_eut_id_neighbour
) runs on ItsAutoInteropGeonetworking {
// Local variables
var GeoNetworkingInd v_gnInd;
var GN_Address v_gnAddr;
var boolean v_getFirstCam := false;
var HmiNeighborEventInds v_hmiNeighborEventInds;
// Test component configuration
f_cfPtcUp(p_eut);
// Preamble
f_prDefault();
// EUT1 and EUT2 become on-link
if (PX_CAPTURE_MODE == "on-link") {
ItsAutoInterop_Functions.f_utTriggerEvent(UtAutoInteropTrigger:{utRadioOnOff := true});
}
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[v_getFirstCam == false] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
?,
?,
e_btpB,
?/*mw_cam_stationId(
-,
PX_EUT_DESC[p_eut_id].stationId
)*/)))) -> value v_gnInd { // Receive a CAM message
v_gnAddr := v_gnInd.msgIn.gnPacket.packet.extendedHeader.shbHeader.srcPosVector.gnAddr;
v_getFirstCam := true;
// Re-send CAM message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
repeat;
}
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeaderAndPayload(
mw_longPosVectorAny(
? /* FIXME complement(
v_gnAddr
)*/),
?,
e_btpB,
?/*mw_cam_stationId(
-,
PX_EUT_DESC[p_eut_id].stationId
)*/
)))) -> value v_gnInd { // Receive a CAM message
// Re-send CA message to the other EUTs
eutGeoNetworkingPort.send(
m_forward_geoNetworkingInd(
v_gnInd
));
tc_wait.stop;
log("*** " & testcasename() & ": INFO: GN duplicated address conflict resolved ***");
hmiPort.clear;
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": INCONC: GN duplicate address conflict scenario is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
tc_ac.start;
alt { // Check neighbours
[] hmiPort.receive(
HmiNeighborEventInds:?
) -> value v_hmiNeighborEventInds {
var boolean v_found := false;
tc_ac.stop;
for (var integer v_i := 0; v_i < lengthof(v_hmiNeighborEventInds); v_i := v_i + 1) {
if (
(PX_EUT_DESC[p_eut_id_neighbour].mid == v_hmiNeighborEventInds[v_i].mid) and
(PX_EUT_DESC[p_eut_id_neighbour].stationId == v_hmiNeighborEventInds[v_i].stationId)
) {
v_found := true;
break; // Got it, leave the loop
} // else, continue
} // End of 'for' statement
if (v_found) {
log("*** " & testcasename() & ": PASS: GN duplicate address conflict scenario compeleted for EUT ", PX_EUT_DESC[p_eut_id].stationId, "***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
} else {
log("*** " & testcasename() & ": FAIL: GN duplicate address conflict scenario is incomplete ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": FAIL: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
}
// Postamble
f_poDefault();
f_cfPtcDown(p_eut);
} // End of f_TC_AUTO_IOT_GN_DAD_BV_01_eut
} // End of group g_TC_AUTO_IOT_GN_DAD_BV_01
} // End of module AtsInterop_TestCases
module ItsAutoInterop_TestControl {
// ItsInterop
import from ItsAutoInterop_TestCases all;
control {
// Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) Clause 6.2.2 DEN message - Forwarding
execute(TC_AUTO_IOT_DENM_MFW_BV_01());
execute(TC_AUTO_IOT_DENM_MFW_BV_02());
execute(TC_AUTO_IOT_DENM_MFW_BV_03());
// Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) Clause 6.2.3 DEN message - Road Works Warning
execute(TC_AUTO_IOT_DENM_RWW_BV_01());
// Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) Clause 6.2.4 DEN message - Road Hazard Signals
execute(TC_AUTO_IOT_DENM_RHS_BV_01());
// Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) Clause 6.2.5 DEN message - Stationary Vehicle Warning
execute(TC_AUTO_IOT_DENM_SVW_BV_01());
// Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) Clause 6.2.6 DEN message - Geo-broadcast message caching
execute(TC_AUTO_IOT_DENM_GMC_BV_01());
// Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) Clause 6.2.7 CA message � Neighbors detection
execute(TC_AUTO_IOT_CAM_NBD_BV_01());
// Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) Clause 6.2.8 CA message � Collision Risk Warning
execute(TC_AUTO_IOT_CAM_CRW_BV_01());
execute(TC_AUTO_IOT_CAM_CRW_BV_02());
// Draft ETSI TS yyy xxx-2 V0.0.8 (2017-03) Clause 6.2.9 GN message � Duplicate address detection
execute(TC_AUTO_IOT_GN_DAD_BV_01());
} // End of 'control' statement
} // End of module ItsAutoInterop_TestControl
\ No newline at end of file
module ItsAutoInterop_TestSystem {
// Libcommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
// LibItsCommon
import from LibItsExternal_TypesAndValues all;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TypesAndValues all;
import from LibItsGeoNetworking_TestSystem all;
// ItsAutoInterop
import from ItsAutoInterop_TypesAndValues all;
group portDefinitions {
/**
* @desc EUT's HMI port
*/
type port HmiPort message {
in
HmiAutoInteropResults, HmiNeighborEventInds, HmiSignageEventInd;
out
HmiInitialize
}
} // End of group portDefinitions
group systemInterface {
/**
* @desc ITS System Adapter
*/
type component ItsAutoInteropGeoNetworkingSystem extends ItsGeoNetworkingSystem {
port HmiPort hmiPort;
} // End of component ItsAutoInteropGeoNetworkingSystem
} // End of group systemInterface
group componentDefinitions {
/**
* @desc Test component for ITS Network and Transport layer
*/
type component ItsAutoInteropGeonetworking extends ItsGeoNetworking {
port EutGeoNetworkingPort eutGeoNetworkingPort;
port HmiPort hmiPort;
// HMI indications
var HmiNeighborEventIndList vc_hmiNeighborEventIndsList := {};
var HmiSignageEventIndList vc_hmiSignageEventIndList := {};
var boolean vc_hmiDefaultActive := true;
} // End of component ItsAutoInteropGeonetworking
} // End of group componentDefinitions
type port EutGeoNetworkingPort message {
inout EutGeoNetworking
} with {
extension "internal"
}
/**
* @desc Inter EUT component communication
*/
type record EutGeoNetworking {
GeoNetworkingPdu msg,
MacAddress macDestinationAddress,
Bit256 ssp optional,
UInt32 its_aid optional
} with {
encode "RAW";
variant ""
} // End of type EutGeoNetworking
} // End of module ItsAutoInterop_TestSystem
\ No newline at end of file
module ItsAutoInterop_TypesAndValues {
// Libcommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
// LibIts
import from ITS_Container language "ASN.1:1997" all;
/**
* @desc Information required to uniquelly describe an EUT
* @member mid MID value of the device
* @member stationId Station ID value of the device
* @member ll_mac_address Link layer MAC address of the device
*/
type record EutDescription {
Oct6 mid,
StationID stationId,
Oct6 ll_mac_address
} // End of type EutDescription_
/**
* @desc Define a list of uniquelly described EUTs
*/
type record of EutDescription EutDescriptions;
group hmiPrimitives {
/**
* @desc HMI message to initialize HMI's IUT
* @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the HMI's IUT shall use
*/
type record HmiInitialize {
Oct8 hashedId8
} // End of type HmiInitialize
type union HmiAutoInteropResults {
boolean hmiInitializeResult
} // End of type HmiAutoInteropResults
type HmiAutoInteropResults.hmiInitializeResult HmiInitializeResult;
type record HmiNeighborEventInd { // TODO Simplify using EutDescription
Oct6 mid,
UInt32 stationId
} // End of type HmiNeighborEventInd
/**
* @desc Define a list of uniquelly described EUTs
* @remark 'set of' is used in order to use superset
*/
type set of HmiNeighborEventInd HmiNeighborEventInds;
/**
* @desc TODO
*/
type record of HmiNeighborEventInds HmiNeighborEventIndList;
/**
* @desc The list of Traffic Sign Information
* @see ISO/TS 14823 Clause 6.2 Information Elements
* @see ISO/TS 14823 Table 1 — Information Elements
*/
type enumerated TrafficSignPictogramClass { e_dangerWarning, e_regulatory, e_informative };
/**
* @desc The list of Ambient/Road Condition Information
* @see ISO/TS 14823 Clause 6.2 Information Elements
* @see ISO/TS 14823 Table 1 — Information Elements
*/
type enumerated AmbientOrRoadConditionPictogramClass { e_ambientCondition, e_roadCondition }
/**
* @see ISO/TS 14823 Clause 6.2 Information Elements
* @see ISO/TS 14823 Table 2 — Code Ordering (without attribute data)
*/
type record HmiSignageEventInd { // TODO To be refined
UInt16 countryCode,
TrafficSignPictogramClass trafficSignPictogramClass optional,
UInt8 trafficSignPictogramNature optional,
AmbientOrRoadConditionPictogramClass ambientOrRoadConditionPictogramClass optional,
UInt8 ambientOrRoadConditionPictogramNature optional
} // End of type HmiSignageEventInd
/**
* @desc TODO
*/
type record of HmiSignageEventInd HmiSignageEventIndList;
} // End of group hmiPrimitives
} with {
encode "RAW";
variant ""
} // End of module ItsAutoInterop_TypesAndValues