/** * @author ETSI STF517 / TTF002 * @version $Url: https://oldforge.etsi.org/svn/ITS/tags/20170222_STF527_Final/ttcn/AtsMapemSpatem/ItsMapem_TpFunctions.ttcn $ * $Id: ItsMapem_TpFunctions.ttcn,v 1.2 2018/05/31 15:57:07 dte Exp $ * @desc MAPEM TP functions * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. * The copyright and the foregoing restriction extend to reproduction in all media. * All rights reserved. * */ module ItsMapem_TpFunctions { // LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_Sync all; import from LibCommon_VerdictControl all; import from LibCommon_Time all; // LibItsCommon import from LibItsCommon_Functions all; import from LibItsCommon_TypesAndValues all; // LibIts import from ITS_Container language "ASN.1:1997" all; import from MAPEM_PDU_Descriptions language "ASN.1:1997" all; import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all; import from DSRC_REGION_noCircular language "ASN.1:1997" all; // LibItsMapemSpatem import from LibItsMapemSpatem_TestSystem all; import from LibItsMapemSpatem_Functions all; import from LibItsMapemSpatem_Templates all; import from LibItsMapemSpatem_TypesAndValues all; import from LibItsMapemSpatem_Pics all; import from LibItsMapemSpatem_Pixits all; group mapeMessageDissemination { group mapeMessageFormat { /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_01 */ function f_IS_RLT_GEN_MSGF_BV_01 () runs on ItsMapemSpatem { // Local variables // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Successfully received MAPEM PDU header. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_01 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_02 */ function f_IS_RLT_GEN_MSGF_BV_02 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, v_mapem.msgIn.map_.intersections[0].id.id, m_speedLimits(maxSpeedInConstructionZone, 30))); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( { mw_intersectionGeometry(v_mapem.msgIn.map_.intersections[0].id, v_mapem.msgIn.map_.intersections[0].revision + 1) } )))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Successfully received MAPEM PDU header. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_02 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_03 */ function f_IS_RLT_GEN_MSGF_BV_03 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, v_mapem.msgIn.map_.intersections[0].id.id, v_mapem.msgIn.map_.intersections[0].speedLimits[0])); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( { mw_intersectionGeometry(v_mapem.msgIn.map_.intersections[0].id, v_mapem.msgIn.map_.intersections[0].revision) } )))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Successfully received MAPEM PDU header. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_03 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_04 */ function f_IS_RLT_GEN_MSGF_BV_04 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( -, { mw_roadSegment( -, -, -, { mw_roadLane(-, -, ?), mw_roadLane(-, -, -, ?) } ) } )))) -> value v_mapem { tc_ac.stop; log("*** " & testcasename() & ": PASS: Successfully received MAPEM PDU header. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_04 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_05 */ function f_IS_RLT_GEN_MSGF_BV_05 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, -, -, PX_3D_REF_POINT_LATITUDE)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( { mw_intersectionGeometry(v_mapem.msgIn.map_.intersections[0].id, -, mw_position3D(-, -, ?)) } )))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Successfully received MAPEM PDU header. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_05 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_06 */ function f_IS_RLT_GEN_MSGF_BV_06 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, 7)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { tc_ac.stop; if (f_check_uniqueless_lanes_id(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: Duplicated lanes identifier. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_06 group checks_IS_RLT_GEN_MSGF_BV_06 { function f_check_uniqueless_lanes_id( in IntersectionGeometryList p_intersections ) return boolean { var charstring v_lane_ids_found; // Used to build the list of the laneID already processed var charstring v_lane_id; // laneID currently processed var template charstring v_found_pattern; // Used in regex to verify that ''v_usageStatememtId' was not found before' for (var integer v_intersections_idx := 0; v_intersections_idx < lengthof(p_intersections); v_intersections_idx := v_intersections_idx + 1) { v_lane_ids_found := ";"; for (var integer v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(p_intersections[v_intersections_idx].laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { v_lane_id := int2str(p_intersections[v_intersections_idx].laneSet[v_lane_ids_idx].laneID); v_found_pattern := pattern "*({v_lane_id})*"; if (regexp(v_lane_ids_found, v_found_pattern, 0) == v_lane_id) { return false; // v_lane_id exist at least 2 times, uniqueness is not verified } // v_lane_id non found, add current laneID into the built list v_lane_ids_found := v_lane_ids_found & v_lane_id & ";"; } // End of 'for' statement } // End of 'for' statement return true; } // End of function f_check_uniqueless_lanes_id } // End of group checks_IS_RLT_GEN_MSGF_BV_06 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_07 */ function f_IS_RLT_GEN_MSGF_BV_07 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { tc_ac.stop; if (f_check_lanes_nodes_length(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: Duplicated lanes identifier. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_07 group checks_IS_RLT_GEN_MSGF_BV_07 { function f_check_lanes_nodes_length( in IntersectionGeometryList p_intersections ) return boolean { for (var integer v_intersections_idx := 0; v_intersections_idx < lengthof(p_intersections); v_intersections_idx := v_intersections_idx + 1) { for (var integer v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(p_intersections[v_intersections_idx].laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { var NodeListXY v_nodes_list := p_intersections[v_intersections_idx].laneSet[v_lane_ids_idx].nodeList; if (ischosen(v_nodes_list.nodes)) { for (var integer v_idx := 0; v_idx < lengthof(v_nodes_list.nodes); v_idx := v_idx + 1) { var NodeXY v_node := v_nodes_list.nodes[v_idx]; // TODO Which fields should be tested? //if (v_node.delta.) } // End of 'for' statement } // else, ignore ComputedLane field } // End of 'for' statement } // End of 'for' statement return true; } // End of function f_check_lanes_nodes_length } // End of group checks_IS_RLT_GEN_MSGF_BV_07 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_08 */ function f_IS_RLT_GEN_MSGF_BV_08 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { tc_ac.stop; if (f_check_generic_lanes_content(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: Duplicated lanes identifier. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_08 group checks_IS_RLT_GEN_MSGF_BV_08 { function f_check_generic_lanes_content( in IntersectionGeometryList p_intersections ) return boolean { for (var integer v_intersections_idx := 0; v_intersections_idx < lengthof(p_intersections); v_intersections_idx := v_intersections_idx + 1) { for (var integer v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(p_intersections[v_intersections_idx].laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { var GenericLane v_lane := p_intersections[v_intersections_idx].laneSet[v_lane_ids_idx]; if (match(v_lane, mw_roadLane) == false) { return false; } } // End of 'for' statement } // End of 'for' statement return true; } // End of function f_check_generic_lanes_content } // End of group checks_IS_RLT_GEN_MSGF_BV_08 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_09 */ function f_IS_RLT_GEN_MSGF_BV_09 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_PEDESTRIAN_MANOEUVRES) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_PEDESTRIAN_MANOEUVRES required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { tc_ac.stop; if (f_check_generic_pedestrian_lanes_content(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: Duplicated lanes identifier. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_09 group checks_IS_RLT_GEN_MSGF_BV_09 { function f_check_generic_pedestrian_lanes_content( in IntersectionGeometryList p_intersections ) return boolean { for (var integer v_intersections_idx := 0; v_intersections_idx < lengthof(p_intersections); v_intersections_idx := v_intersections_idx + 1) { for (var integer v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(p_intersections[v_intersections_idx].laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { var GenericLane v_lane := p_intersections[v_intersections_idx].laneSet[v_lane_ids_idx]; if (match(v_lane, mw_roadLane) == false) { return false; } // TODO Which fields should be tested? } // End of 'for' statement } // End of 'for' statement return true; } // End of function f_check_generic_pedestrian_lanes_content } // End of group checks_IS_RLT_GEN_MSGF_BV_09 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_10 */ function f_IS_RLT_GEN_MSGF_BV_10 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_SPECIALIZED_CARS_MANOEUVRES) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_SPECIALIZED_CARS_MANOEUVRES required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { tc_ac.stop; if (f_check_generic_special_lanes_content(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: Duplicated lanes identifier. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_10 group checks_IS_RLT_GEN_MSGF_BV_10 { function f_check_generic_special_lanes_content( in IntersectionGeometryList p_intersections ) return boolean { for (var integer v_intersections_idx := 0; v_intersections_idx < lengthof(p_intersections); v_intersections_idx := v_intersections_idx + 1) { for (var integer v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(p_intersections[v_intersections_idx].laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { var GenericLane v_lane := p_intersections[v_intersections_idx].laneSet[v_lane_ids_idx]; if (match(v_lane, mw_roadLane) == false) { return false; } // TODO Which fields should be tested? } // End of 'for' statement } // End of 'for' statement return true; } // End of function f_check_generic_special_lanes_content } // End of group checks_IS_RLT_GEN_MSGF_BV_10 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_11 */ function f_IS_RLT_GEN_MSGF_BV_11 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { tc_ac.stop; if (f_check_generic_crosswalk_lanes_content(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: Duplicated lanes identifier. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_11 group checks_IS_RLT_GEN_MSGF_BV_11 { function f_check_generic_crosswalk_lanes_content( in IntersectionGeometryList p_intersections ) return boolean { for (var integer v_intersections_idx := 0; v_intersections_idx < lengthof(p_intersections); v_intersections_idx := v_intersections_idx + 1) { for (var integer v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(p_intersections[v_intersections_idx].laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { var GenericLane v_lane := p_intersections[v_intersections_idx].laneSet[v_lane_ids_idx]; if (match(v_lane, mw_roadLane) == false) { return false; } // TODO Which fields should be tested? } // End of 'for' statement } // End of 'for' statement return true; } // End of function f_check_generic_crosswalk_lanes_content } // End of group checks_IS_RLT_GEN_MSGF_BV_11 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_12 */ function f_IS_RLT_GEN_MSGF_BV_12 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_MAPEM_HAS_LANE_WIDTH) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_MAPEM_HAS_LANE_WIDTH required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { var integer v_intersections_idx; tc_ac.stop; for (v_intersections_idx := 0; v_intersections_idx < lengthof(v_mapem.msgIn.map_.intersections); v_intersections_idx := v_intersections_idx + 1) { var integer v_lane_ids_idx; for (v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(v_mapem.msgIn.map_.intersections[v_intersections_idx].laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { if (f_check_node_list_content(v_mapem.msgIn.map_.intersections[v_intersections_idx].laneSet[v_lane_ids_idx].nodeList)) { log("*** " & testcasename() & ": FAIL: Wrong NodeList content for intersection #", v_intersections_idx , ". ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); break; } } // End of 'for' statement if (v_lane_ids_idx < lengthof(v_mapem.msgIn.map_.intersections[v_intersections_idx].laneSet)) { break; } } // End of 'for' statement if (v_intersections_idx == lengthof(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_12 group checks_IS_RLT_GEN_MSGF_BV_12 { function f_check_node_list_content( in NodeListXY p_node_list ) return boolean { if (ischosen(p_node_list.nodes) == false) { return false; } for (var integer v_nodes_idx := 0; v_nodes_idx < lengthof(p_node_list.nodes); v_nodes_idx := v_nodes_idx + 1) { var NodeXY v_node_xy := p_node_list.nodes[v_nodes_idx]; if (match(v_node_xy, mw_nodeXY(-, mw_nodeAttributeSetXY_default)) == false) { return false; } // TODO Which fields should be tested? } // End of 'for' statement return true; } // End of function f_check_node_list_content } // End of group checks_IS_RLT_GEN_MSGF_BV_12 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_13 */ function f_IS_RLT_GEN_MSGF_BV_13 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_MAPEM_HAS_LANE_WIDTH) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_MAPEM_HAS_LANE_WIDTH required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { var integer v_intersections_idx; tc_ac.stop; for (v_intersections_idx := 0; v_intersections_idx < lengthof(v_mapem.msgIn.map_.intersections); v_intersections_idx := v_intersections_idx + 1) { if (f_check_node_list_width_attribut(v_mapem.msgIn.map_.intersections[v_intersections_idx])) { log("*** " & testcasename() & ": FAIL: Wrong NodeList content for intersection #", v_intersections_idx , ". ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); break; } } // End of 'for' statement if (v_intersections_idx == lengthof(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_13 group checks_IS_RLT_GEN_MSGF_BV_13 { function f_check_node_list_width_attribut( in IntersectionGeometry p_intersections_geometry ) return boolean { if (ispresent(p_intersections_geometry)) { return false; } for (var integer v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(p_intersections_geometry.laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { var NodeListXY v_node_list := p_intersections_geometry.laneSet[v_lane_ids_idx].nodeList; if (ischosen(v_node_list.nodes) == false) { return false; } for (var integer v_nodes_idx := 0; v_nodes_idx < lengthof(v_node_list.nodes); v_nodes_idx := v_nodes_idx + 1) { var NodeXY v_node_xy := v_node_list.nodes[v_nodes_idx]; if (match(v_node_xy, mw_nodeXY(-, mw_nodeAttributeSetXY_default)) == false) { return false; } // TODO Which fields should be tested? } // End of 'for' statement } // End of 'for' statement return true; } // End of function f_check_node_list_width_attribut } // End of group checks_IS_RLT_GEN_MSGF_BV_13 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_14 */ function f_IS_RLT_GEN_MSGF_BV_14 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { tc_ac.stop; if (f_check_generic_connection_content(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: Duplicated lanes identifier. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_14 group checks_IS_RLT_GEN_MSGF_BV_14 { function f_check_generic_connection_content( in IntersectionGeometryList p_intersections ) return boolean { for (var integer v_intersections_idx := 0; v_intersections_idx < lengthof(p_intersections); v_intersections_idx := v_intersections_idx + 1) { for (var integer v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(p_intersections[v_intersections_idx].laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { var GenericLane v_lane := p_intersections[v_intersections_idx].laneSet[v_lane_ids_idx]; if (match(v_lane, mw_roadLane(-, -, -, -, ?)) == false) { // TODO Which fields should be tested? return false; } } // End of 'for' statement } // End of 'for' statement return true; } // End of function f_check_generic_connection_content } // End of group checks_IS_RLT_GEN_MSGF_BV_14 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_15 */ function f_IS_RLT_GEN_MSGF_BV_15 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { tc_ac.stop; if (f_check_generic_lane_content(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: Duplicated lanes identifier. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_15 group checks_IS_RLT_GEN_MSGF_BV_15 { function f_check_generic_lane_content( in IntersectionGeometryList p_intersections ) return boolean { for (var integer v_intersections_idx := 0; v_intersections_idx < lengthof(p_intersections); v_intersections_idx := v_intersections_idx + 1) { for (var integer v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(p_intersections[v_intersections_idx].laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { var GenericLane v_lane := p_intersections[v_intersections_idx].laneSet[v_lane_ids_idx]; if (match(v_lane, mw_roadLane(-, -, -, -, ?)) == false) { // TODO Which fields should be tested? return false; } } // End of 'for' statement } // End of 'for' statement return true; } // End of function f_check_generic_lane_content } // End of group checks_IS_RLT_GEN_MSGF_BV_15 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_16 */ function f_IS_RLT_GEN_MSGF_BV_16 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { tc_ac.stop; if (f_check_generic_lane_approach(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: Duplicated lanes identifier. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_16 group checks_IS_RLT_GEN_MSGF_BV_16 { function f_check_generic_lane_approach( in IntersectionGeometryList p_intersections ) return boolean { for (var integer v_intersections_idx := 0; v_intersections_idx < lengthof(p_intersections); v_intersections_idx := v_intersections_idx + 1) { for (var integer v_lane_ids_idx := 0; v_lane_ids_idx < lengthof(p_intersections[v_intersections_idx].laneSet); v_lane_ids_idx := v_lane_ids_idx + 1) { var GenericLane v_lane := p_intersections[v_intersections_idx].laneSet[v_lane_ids_idx]; if (match(v_lane, mw_roadLane(-, -, 4, 5, ?)) == false) { // TODO Use PIXIT? return false; } } // End of 'for' statement } // End of 'for' statement return true; } // End of function f_check_generic_lane_approach } // End of group checks_IS_RLT_GEN_MSGF_BV_16 /** * @desc TP Function for TC_IS_RLT_GEN_MSGF_BV_17 */ function f_IS_RLT_GEN_MSGF_BV_17 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent, PX_INTERSECTION_ID)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem( ? )))) -> value v_mapem { tc_ac.stop; if (f_check_generic_lane_approach(v_mapem.msgIn.map_.intersections)) { log("*** " & testcasename() & ": PASS: The lanes identifier are unique. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: Duplicated lanes identifier. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_MSGF_BV_17 } // End of group mapeMessageFormat group mapeEventGeneration { //TODO Toggle comment following 2 tests /** * @desc TP Function for TC_IS_RLT_EVGN_BV_01 */ function f_IS_RLT_EVGN_BV_01 () runs on ItsMapemSpatem { // Local variables // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem ))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Successfully received MAPEM. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_defaultMapem ))) { tc_ac.stop; log("*** " & testcasename() & ": FAIL: Received a MAPEM with incorrect information. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_EVGN_BV_01 /** * @desc TP Function for TC_IS_RLT_EVGN_BV_02 */ function f_IS_RLT_EVGN_BV_02 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent)); tc_ac.start; alt { [] mapemSpatemPort.receive(v_mapem) { tc_ac.stop; log("*** " & testcasename() & ": FAIL: The same MAPEM was received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem ))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Successfully received a new MAPEM. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_defaultMapem ))) { tc_ac.stop; log("*** " & testcasename() & ": FAIL: Received a MAPEM with incorrect information. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_EVGN_BV_02 /** * @desc TP Function for TC_IS_RLT_GEN_FRAG_BV_01 */ function f_IS_RLT_GEN_FRAG_BV_01 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_mapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem ))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Successfully received MAPEM without the Layer ID. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_FRAG_BV_01 /** * @desc TP Function for TC_IS_RLT_GEN_FRAG_BV_02 */ function f_IS_RLT_GEN_FRAG_BV_02 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; var boolean v_firstFragmentReceived := false; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContentWithFragmentation)); tc_ac.start; alt { [not v_firstFragmentReceived] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapemLayerType ))) -> value v_mapem { log("*** " & testcasename() & ": INFO: Successfully received the first fragment of MAPEM. ***"); v_firstFragmentReceived := true; repeat; } [v_firstFragmentReceived] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapemLayerType( -, -, v_mapem.msgIn.map_.layerID + 1 ) ))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Successfully received the last fragment of MAPEM. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_defaultMapem ))) { tc_ac.stop; log("*** " & testcasename() & ": FAIL: Received a MAPEM with incorrect information. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_FRAG_BV_02 } // End of group mapeEventGeneration group mapeCommunication { /** * @desc TP Function for TC_IS_RLT_GEN_COM_BV_01 */ function f_IS_RLT_GEN_COM_BV_01 () runs on ItsMapemSpatem { // Local variables var boolean v_tlmServiceStarted := false; // Test control if (not PICS_SPATEM_GENERATION or not PICS_SPATEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_SPATEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body tc_ac.start; alt { [v_tlmServiceStarted == false] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu( mw_mapem ))) { tc_ac.stop; log("*** " & testcasename() & ": INFO: Successfully received well-formed MAPEM. ***"); f_utTriggerEvent(m_utTriggerEvent(startTLMService)); v_tlmServiceStarted := true; tc_ac.start; repeat; } [] mapemSpatemPort.receive( mw_spatemInd( mw_spatemPdu( mw_spatemWellFormatted ))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Successfully received well-formed MAPEM & SPATEM. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_utTriggerEvent(m_utTriggerEvent(stopTLMService)); f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_COM_BV_01 /** * @desc TP Function for TC_IS_RLT_GEN_COM_BV_02 */ // function f_IS_RLT_GEN_COM_BV_02 () runs on ItsMapemSpatem { // // // TODO // // } // End of function f_IS_RLT_GEN_COM_BV_02 /** * @desc TP Function for TC_IS_RLT_GEN_COM_BV_03 */ function f_IS_RLT_GEN_COM_BV_03 () runs on ItsMapemSpatem { // TODO } // End of function f_IS_RLT_GEN_COM_BV_03 /** * @desc TP Function for TC_IS_RLT_GEN_COM_BV_04 */ function f_IS_RLT_GEN_COM_BV_04 () runs on ItsMapemSpatem { // Local variables const UInt16 c_gnNhBtpBPort := 2003; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemIndWithBtpParameters( mw_mapemPdu, c_gnNhBtpBPort, 0 )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected MAPEM encapsultated in BTP packet with port value 2003 received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] mapemSpatemPort.receive(mw_mapemInd(mw_mapemPdu(mw_defaultMapem))) { tc_ac.stop; log("*** " & testcasename() & ": FAIL: Expected MAPEM received, but not addressed to the correct destination port. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_COM_BV_04 /** * @desc TP Function for TC_IS_RLT_GEN_COM_BV_05 */ function f_IS_RLT_GEN_COM_BV_05 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; const UInt8 c_gnHtGbc := 4; // Test control if (not PICS_MAPEM_GENERATION) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemIndWithGnParameters( mw_mapemPdu( mw_defaultMapem ), -, c_gnHtGbc )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected MAPEM encapsulated in GBC packet received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_COM_BV_05 } // End of group mapeCommunication } // End of group mapeMessageDissemination group mapeMessageProcessing { /** * @desc TP Function for TC_IS_RLT_GEN_SEC_BV_01 */ function f_IS_RLT_GEN_SEC_BV_01 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemIndWithSecurityParameters( mw_mapemPdu( mw_mapem ), -, c_its_aid_MAP )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected secured MAPEM received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_SEC_BV_01 /** * @desc TP Function for TC_IS_RLT_GEN_SEC_BV_02 */ function f_IS_RLT_GEN_SEC_BV_02 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemIndWithSecurityParameters( mw_mapemPdu( mw_mapem ), -, c_its_aid_MAP )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected secured MAPEM received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_SEC_BV_02 /** * @desc TP Function for TC_IS_RLT_GEN_SSP_BV_01 */ function f_IS_RLT_GEN_SSP_BV_01 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState("CERT_SPAT_SSP_NONE"); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemIndWithSecurityParameters( mw_mapemPdu( mw_defaultMapem ), oct2bit('010000'O), c_its_aid_MAP )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected secured MAPEM received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_SSP_BV_01 /** * @desc TP Function for TC_IS_RLT_GEN_SSP_BV_02 */ function f_IS_RLT_GEN_SSP_BV_02 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState("CERT_MAP_SSP_1"); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemIndWithSecurityParameters( mw_mapemPdu( mw_defaultMapem ), oct2bit('010000'O), c_its_aid_MAP )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected secured MAPEM received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_SSP_BV_02 /** * @desc TP Function for TC_IS_RLT_GEN_SSP_BO_03 */ function f_IS_RLT_GEN_SSP_BO_03 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState("CERT_MAP_SSP_NONE"); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent)); tc_noac.start; alt { [] mapemSpatemPort.receive( mw_mapemIndWithSecurityParameters( mw_mapemPdu( mw_defaultMapem ), oct2bit('010000'O), c_its_aid_MAP )) { tc_noac.stop; log("*** " & testcasename() & ": FAIL: Unexpected secured MAPEM received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } [] tc_noac.timeout { log("*** " & testcasename() & ": PASS: No MAP message received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_SSP_BO_03 /** * @desc TP Function for TC_IS_RLT_GEN_SSP_BV_04 */ function f_IS_RLT_GEN_SSP_BV_04 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState("CERT_MAP_SSP_2"); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent)); tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemIndWithSecurityParameters( mw_mapemPdu( mw_defaultMapem ), oct2bit('018000'O), c_its_aid_MAP )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected secured MAPEM received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_SSP_BV_04 /** * @desc TP Function for TC_IS_RLT_GEN_SSP_BO_05 */ function f_IS_RLT_GEN_SSP_BO_05 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; // Test control if (not PICS_MAPEM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState("CERT_MAP_SSP_NONE"); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body f_utTriggerEvent(m_utTriggerEvent(mapemNewContent)); tc_noac.start; alt { [] mapemSpatemPort.receive( mw_mapemIndWithSecurityParameters( mw_mapemPdu( mw_defaultMapem ), oct2bit('010000'O), c_its_aid_MAP )) { tc_noac.stop; log("*** " & testcasename() & ": FAIL: Unexpected secured MAPEM received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } [] tc_noac.timeout { log("*** " & testcasename() & ": PASS: No MAP message received. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_SSP_BO_05 /** * @desc TP Function for TC_IS_RLT_GEN_RATE_BV_01 */ function f_IS_RLT_GEN_RATE_BV_01 () runs on ItsMapemSpatem { // Local variables var MapemInd v_mapem; timer t_minTransInterval := PICS_T_GENMAPEMMIN * 0.90; timer t_maxTransInterval := PICS_T_GENMAPEMMAX * 1.10; // Test control if (not PICS_MAPEM_GENERATION or not PICS_MAPEM_TRANSMISSION_RATE) { log("*** " & testcasename() & ": PICS_MAPEM_GENERATION and PICS_MAPEM_TRANSMISSION_RATE required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_awaitMapeMessage( mw_mapemInd( mw_mapemPdu( mw_defaultMapem )), v_mapem ); t_minTransInterval.start; t_maxTransInterval.start; f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body tc_ac.start; alt { [] mapemSpatemPort.receive( mw_mapemInd( mw_mapemPdu )) { tc_ac.stop; if (t_minTransInterval.running) { log("*** " & testcasename() & ": PASS: Successfully received MAPEM PDU header. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: MAPE message was received before t_minTransInterval expiry. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } } [] t_minTransInterval.timeout { repeat; } [] t_maxTransInterval.timeout { log("*** " & testcasename() & ": FAIL: MAPE message was not received within the t_minTransInterval/t_maxTransInterval expiration ***"); f_selfOrClientSyncAndVerdictPreamble(c_tbDone, e_error); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_RATE_BV_01 /** * @desc TP Function for TC_IS_RLT_GEN_RCV_BV_03 */ function f_IS_RLT_GEN_RCV_BV_03 () runs on ItsMapemSpatem { // Local variables var MapemReq v_mapemReq; var integer i; if (not PICS_MAPEM_RECEPTION) { log("*** " & testcasename() & ": PICS_MAPEM_RECEPTION required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body v_mapemReq := valueof( m_mapemReq( m_mapemPdu( m_mapem( 5, { m_intersectionGeometry( m_intersectionReferenceID(9), 1, m_position3D( 367485365, -45560691 ), { m_laneList( 1, { directionalUse := '10'B, sharedWith := '0000000000'B, laneType := { vehicle := '00000000'B }, regional := omit }, { nodes := { { delta := { node_XY6 := { x := 83, y := -124 } }, attributes := omit }, { delta := { node_XY6 := { x := 93, y := -122 } }, attributes := omit } } }, -, 1 ) } ) } )))); mapemSpatemPort.send(v_mapemReq) ; f_sleep(PX_TAC); for (i := 0; i < lengthof(vc_utMapemEvents) and not match (v_mapemReq.msgOut , vc_utMapemEvents[i].mapeMsg); i := i + 1) { // empty on purpose } if (i < lengthof(vc_utMapemEvents) ) { log("*** " & testcasename() & ": PASS: MAPEM was transmitted to upper layer***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: MAPEM was not transmitted to upper layer***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_GEN_RCV_BV_03 /** * @desc TP Function for TC_IS_RLT_RCV_SEC_BV_01 */ function f_IS_RLT_RCV_SEC_BV_01 () runs on ItsMapemSpatem { // Local variables var MapemReq v_mapemReq; var integer i; if (not PICS_MAPEM_RECEPTION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_RECEPTION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp(); // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body v_mapemReq := valueof( m_mapemReq( m_mapemPdu( m_mapem( 5 )))); mapemSpatemPort.send(v_mapemReq) ; f_sleep(PX_TAC); for (i := 0; i < lengthof(vc_utMapemEvents) and not match (v_mapemReq.msgOut , vc_utMapemEvents[i].mapeMsg); i := i + 1) { // empty on purpose } if (i < lengthof(vc_utMapemEvents) ) { log("*** " & testcasename() & ": PASS: MAPEM was transmitted to upper layer***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: MAPEM was not transmitted to upper layer***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_RCV_SEC_BV_01 /** * @desc TP Function for TC_IS_RLT_RCV_SEC_BO_02 */ function f_IS_RLT_RCV_SEC_BO_02 () runs on ItsMapemSpatem { // Local variables var MapemReq v_mapemReq; var integer i; if (not PICS_MAPEM_RECEPTION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_RECEPTION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp("RLT_RCV_SEC_BO_02"); // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body v_mapemReq := valueof( m_mapemReq( m_mapemPdu( m_mapem( 5 )))); mapemSpatemPort.send(v_mapemReq) ; f_sleep(PX_TAC); if (0 == lengthof(vc_utMapemEvents) ) { log("*** " & testcasename() & ": PASS: MAPEM was not transmitted to upper layer***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: MAPEM was transmitted to upper layer***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_RCV_SEC_BO_02 /** * @desc TP Function for TC_IS_RLT_RCV_SEC_BO_03 */ function f_IS_RLT_RCV_SEC_BO_03 () runs on ItsMapemSpatem { // Local variables var MapemReq v_mapemReq; var integer i; if (not PICS_MAPEM_RECEPTION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_RECEPTION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp("RLT_RCV_SEC_BO_03"); // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body v_mapemReq := valueof( m_mapemReq( m_mapemPdu( m_mapem( 5 )))); mapemSpatemPort.send(v_mapemReq) ; f_sleep(PX_TAC); if (0 == lengthof(vc_utMapemEvents) ) { log("*** " & testcasename() & ": PASS: MAPEM was not transmitted to upper layer***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: MAPEM was transmitted to upper layer***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_RCV_SEC_BO_03 /** * @desc TP Function for TC_IS_RLT_RCV_SEC_BO_04 */ function f_IS_RLT_RCV_SEC_BO_04 () runs on ItsMapemSpatem { // Local variables var MapemReq v_mapemReq; var integer i; if (not PICS_MAPEM_RECEPTION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_MAPEM_RECEPTION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cfUp("RLT_RCV_SEC_BO_04"); // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body v_mapemReq := valueof( m_mapemReq( m_mapemPdu( m_mapem( 5 )))); mapemSpatemPort.send(v_mapemReq) ; f_sleep(PX_TAC); if (0 == lengthof(vc_utMapemEvents) ) { log("*** " & testcasename() & ": PASS: MAPEM was not transmitted to upper layer***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { log("*** " & testcasename() & ": FAIL: MAPEM was transmitted to upper layer***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } // Postamble f_poDefault(); f_cfDown(); } // End of function f_IS_RLT_RCV_SEC_BO_04 } // End of group mapeMessageProcessing } // End of module ItsMapem_TpFunctions