diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..138580e22cf460713699549ef1bf4957460a9807 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "lib/asn1"] + path = lib/asn1 + url = https://forge.etsi.org/rep/ITS/asn1/vam-ts103300_3.git + branch = TTF_T036 diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d7e34acc5723b9c92fa5f0e59908e29f88ab741 --- /dev/null +++ b/ItsVru_TestCases.ttcn @@ -0,0 +1,3229 @@ +module ItsVru_TestCases { + + // Libcommon + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibItsCommon + import from LibItsCommon_TestSystem all; + + // LibItsVru + import from LibItsVru_TestSystem all; + import from LibItsVru_Functions all; + import from LibItsVru_Pics all; + + // AtsVRU + import from ItsVru_TpFunctions all; + + group message_format { + + /** + * @desc Check that protocolVersion is set to 3 and messageID is set to 16 + *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * VAM is sent
+ * containing ITS PDU header
+ * containing protocolVersion
+ * indicating value 3
+ * and containing messageID
+ * indicating value 16
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-01
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.2
+ */
+ testcase TC_VBS_MSGF_BV_01() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_01();
+
+ } // End of TC_VBS_MSGF_BV_01
+
+ /**
+ * @desc Check that the generation time in the VAM is the time of reference position since ITS epoch modulo 2^16
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * VAM is sent
+ * containing generation time
+ * indicating reference position time in milliseconds since ITS epoch mod 2^16
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-02
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.2
+ */
+ testcase TC_VBS_MSGF_BV_02() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_02();
+
+ } // End of TC_VBS_MSGF_BV_02
+
+ /**
+ * @desc Check that stationType only takes supported values
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing BasicContainer
+ * containing stationType
+ * indicating pedestrian or
+ * indicating cyclist or
+ * indicating moped or
+ * indicating motorcycle or
+ * indicating lightVruVehicle or
+ * indicating animal
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-03
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.1
+ */
+ testcase TC_VBS_MSGF_BV_03() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_03();
+
+ } // End of TC_VBS_MSGF_BV_03
+
+ /**
+ * @desc Check that the reference point is the ground position of the center of the front side of the bounding box of the VRU
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing BasicContainer
+ * containing ReferencePosition
+ * indicating ground position of the center of the front side of the bounding box
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-04
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.1
+ */
+ testcase TC_VBS_MSGF_BV_04() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_04();
+
+ } // End of TC_VBS_MSGF_BV_04
+
+ /**
+ * @desc Check that the curvature includes the curvatureValue which is the inverse of the VRU curve radius and the turning direction of the curve
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU is following a curve with radius RADIUS and turning direction DIRECTION
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing VruHighFrequencyContainer
+ * containing curvature
+ * containing curvatureValue
+ * indicating DIRECTION * 1/(RADIUS*10000)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-05
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3
+ */
+ testcase TC_VBS_MSGF_BV_05() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_05();
+
+ } // End of TC_VBS_MSGF_BV_05
+
+ /**
+ * @desc Check that the yawRate includes the yawRateValue
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU has a yaw rate of YAW_RATE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing VruHighFrequencyContainer
+ * containing yawRate
+ * containing yawRateValue
+ * indicating YAW_RATE
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-06
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3
+ */
+ testcase TC_VBS_MSGF_BV_06() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_06();
+
+ } // End of TC_VBS_MSGF_BV_06
+
+ /**
+ * @desc Check that the lateralAcceleration indicates the lateral acceleration perpendicular to the heading direction
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU has a lateral acceleration of LAT_ACC
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing VruHighFrequencyContainer
+ * containing lateralAcceleration
+ * containing yawRateValue
+ * indicating LAT_ACC
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-07
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3
+ */
+ testcase TC_VBS_MSGF_BV_07() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_07();
+
+ } // End of TC_VBS_MSGF_BV_07
+
+ /**
+ * @desc Check that the vruLanePosition describes a lane on the road, a lane off the road or an island between two lanes
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU in lane LANE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing VruHighFrequencyContainer
+ * containing simpleLanePosition
+ * indicating lane LANE
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-08
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3
+ */
+ testcase TC_VBS_MSGF_BV_08() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_08();
+
+ } // End of TC_VBS_MSGF_BV_08
+
+ /**
+ * @desc Check that the orientation defines the angle between the longitudinal axis and WGS84 north
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU in lane LANE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing VruHighFrequencyContainer
+ * containing orientation
+ * indicating lane LANE
+ * containing headingValue
+ * indicating value HEADING
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-09
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3
+ */
+ testcase TC_VBS_MSGF_BV_09() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_09();
+
+ } // End of TC_VBS_MSGF_BV_09
+
+ /**
+ * @desc Check that the rollAngle includes the angle between the ground plane and the vehicle's y-axis as well as the angle accuracy and that no values between 500 and 3100 are used
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU has roll angle heading of ROLL_ANGLE with heading confidence of CONFIDENCE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing VruHighFrequencyContainer
+ * containing rollAnlge
+ * containing headingValue
+ * indicating value ROLL_ANGLE
+ * and containing headingConfidence
+ * indicating value CONFIDENCE < 500 and CONFIDENCE > 3100
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-10
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3
+ */
+ testcase TC_VBS_MSGF_BV_10() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_10();
+
+ } // End of TC_VBS_MSGF_BV_10
+
+ /**
+ * @desc Check that the deviceUsage uses values between 0 and 8
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_PROFILE_PEDESTRIAN
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU in profile pedestrian (1)
+ * and VRU has deviceUsage D
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing VruHighFrequencyContainer
+ * containing deviceUsage
+ * indicating value D
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-11
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3
+ */
+ testcase TC_VBS_MSGF_BV_11() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_11();
+
+ } // End of TC_VBS_MSGF_BV_11
+
+ /**
+ * @desc Check that the profileAndSubprofile contains the profile and sub-profile of the VRU if the VRU LF container is present
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU has profile PROFILE and sub-profile SUBPROFILE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * and VRU LF container is present
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruLowFrequencyContainer
+ * containing profileAndSubprofile
+ * indicating value included in PROFILE
+ * containing sub-profile
+ * indicating value included in SUBPROFILE
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-12
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.4
+ */
+ testcase TC_VBS_MSGF_BV_12() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_12();
+
+ } // End of TC_VBS_MSGF_BV_12
+
+ /**
+ * @desc Check that the sizeClass contains size information of the VRU
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU has sizeClass SC
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * and VRU LF container is present
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruLowFrequencyContainer
+ * containing sizeClass
+ * indicating value SC
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-13
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.4
+ */
+ testcase TC_VBS_MSGF_BV_13() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_13();
+
+ } // End of TC_VBS_MSGF_BV_13
+
+ /**
+ * @desc Check that exteriorLights is present for VRU profile 2
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU in profile bicyclist (2)
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * and VRU LF container is present
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruLowFrequencyContainer
+ * containing exteriorLights
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-14
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.4
+ */
+ testcase TC_VBS_MSGF_BV_14() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_MSGF_BV_14();
+
+ } // End of TC_VBS_MSGF_BV_14
+
+ /**
+ * @desc Check that clusterProfiles is not set to zeros if VRU has profile 1, 2 or 4
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING or PICS_PROFILE_PEDESTRIAN or PICS_PROFILE_BICYCLIST or PICS_PROFILE_ANIMAL
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU is part of cluster
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterInformationContainer
+ * containing clusterProfiles
+ * not indicating value 0000
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-15
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_15() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and PICS_PROFILE_PEDESTRIAN or PICS_PROFILE_BICYCLIST or PICS_PROFILE_ANIMAL and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and PICS_PROFILE_PEDESTRIAN or PICS_PROFILE_BICYCLIST or PICS_PROFILE_ANIMAL and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode
+ v_iut.start(f_TC_VBS_MSGF_BV_15_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_15
+
+ /**
+ * @desc Check that clusterLeaveReason indicates clusterLeaderLost when the cluster leader is lost
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-PASSIVE
+ * and VRU has last received a cluster VRU from cluster leader at time T1
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * timeClusterContinuity has passed since T1
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterLeaveInfo
+ * containing clusterLeaveReason
+ * indicating clusterLeaderLost (1)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-16
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_16() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_CLUSTERING or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_16_cluster_member()); // Set the IUT in VRU-PASSIVE mode
+ v_iut.start(f_TC_VBS_MSGF_BV_16_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_16
+
+ /**
+ * @desc Check that clusterLeaveReason indicates clusterDisbandedByLeader when the cluster leader breaks up the cluster
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-PASSIVE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * the IUT receives VAM
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterLeaveInfo
+ * containing clusterBreakupInfo
+ * from cluster leader
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterLeaveInfo
+ * containing clusterLeaveReason
+ * indicating clusterDisbandedByLeader (2)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-17
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_17() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_CLUSTERING or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_17_cluster_member()); // Set the IUT in VRU-PASSIVE mode and disband the cluster
+ v_iut.start(f_TC_VBS_MSGF_BV_17_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_17
+
+ /**
+ * @desc Check that clusterLeaveReason indicates outOfClusterBoundingBox when the VRU moves out of the cluster bounding box
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-PASSIVE and
+ * VRU has received a cluster VAM from cluster leader
+ * containing vruClusterInformationContainer
+ * containing clusterBoundingBoxShape
+ * indicating Shape S
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * the IUT is alerted about new reference position value P and
+ * P is not inside S
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterLeaveInfo
+ * containing clusterLeaveReason
+ * indicating outOfClusterBoundingBox (3)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-18
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_18() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_18_cluster_member()); // Set the IUT in VRU-PASSIVE mode and move the cluster to put IUT out of box
+ v_iut.start(f_TC_VBS_MSGF_BV_18_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_18
+
+ /**
+ * @desc Check that clusterLeaveReason indicates outOfClusterSpeedRange when the VRU is out of the cluster speed range
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-PASSIVE and
+ * VRU has received a cluster VAM from cluster leader
+ * containing vruHighFrequencyContainer
+ * containing speed
+ * containing speedValue
+ * indicating value SPEED_1
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * The IUT is alerted about new own speed value SPEED_2 and
+ * abs(SPEED_2 - SPEED_1) > maxClusterVelocityDifference
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterLeaveInfo
+ * containing clusterLeaveReason
+ * indicating outOfClusterSpeedRange (4)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-19
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_19() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_19_cluster_member()); // Set the IUT in VRU-PASSIVE mode and increase the speed of the cluster to put IUT out of speed
+ v_iut.start(f_TC_VBS_MSGF_BV_19_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_19
+
+ /**
+ * @desc Check that clusterLeaveReason indicates joiningAnotherCluster when the VRU is joining another cluster
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-PASSIVE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * The IUT has received a VAM from another cluster leader
+ * containing vruClusterInformationContainer
+ * containing clusterId
+ * indicating CId
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterLeaveInfo
+ * containing clusterLeaveReason
+ * indicating joiningAnotherCluster (5)
+ * and containing clusterJoinInfo
+ * containing clusterId
+ * indicating CId
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-20
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_20() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member_1;
+ var ItsVru v_vam_cluster_member_2;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut);
+
+ // Start components
+ v_vam_cluster_member_1.start(f_TC_VBS_MSGF_BV_20_cluster_member_1()); // Set the IUT in VRU-PASSIVE mode
+ v_vam_cluster_member_2.start(f_TC_VBS_MSGF_BV_20_cluster_member_1()); // Second cluster
+ v_iut.start(f_TC_VBS_MSGF_BV_20_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_20
+
+ /**
+ * @desc Check that clusterLeaveReason indicates CancelledJoin when the joining is cancelled
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * and VBS has started joining the cluster
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VBS has received a VAM from a cluster leader
+ * containing vruClusterInformationContainer
+ * containing clusterCardinalitySize
+ * indicating value > maxClusterSize
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterLeaveInfo
+ * containing clusterLeaveReason
+ * indicating CancelledJoin (6)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-21
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_21() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member_1;
+ var ItsVru v_vam_cluster_member_2;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut);
+
+ // Start components
+ v_vam_cluster_member_1.start(f_TC_VBS_MSGF_BV_21_cluster_member_1()); // Set the IUT in VRU-PASSIVE mode
+ v_vam_cluster_member_2.start(f_TC_VBS_MSGF_BV_21_cluster_member_1()); // Second cluster
+ v_iut.start(f_TC_VBS_MSGF_BV_21_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_21
+
+ /**
+ * @desc Check that clusterLeaveReason indicates FailedJoin when the joining is cancelled
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * and VBS has started joining the cluster
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VBS has received a VAM from a cluster leader
+ * containing vruClusterInformationContainer
+ * containing clusterCardinalitySize
+ * indicating value > maxClusterSize
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterLeaveInfo
+ * containing clusterLeaveReason
+ * indicating FailedJoin (7)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-22
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_22() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_22_cluster_member()); // Set the IUT in VRU-PASSIVE mode
+ v_iut.start(f_TC_VBS_MSGF_BV_22_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_22
+
+ /**
+ * @desc Check that clusterLeaveReason indicates SafetyCondition when another cluster VRU comes too close
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * another VRU in the cluster has come closer than MSLaD laterally
+ * and another VRU in the cluster has come closer than MSLoD longitudinally
+ * and another VRU in the cluster has come closer than MSVD vertically
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterLeaveInfo
+ * containing clusterLeaveReason
+ * indicating SafetyCondition (8)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-23
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_23() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader_1;
+ var ItsVru v_vam_cluster_leader_2; // To trigger SafetyCondition error
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+
+ // Start components
+ v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_23_cluster_leader()); // Set the IUT in VRU-VRU_ACTIVE_CLUSTER_LEADER mode & raise colliding cluster event
+ v_iut.start(f_TC_VBS_MSGF_BV_23_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_23
+
+ /**
+ * @desc Check that clusterBreakupReason indicates clusteringPurposeCompleted when the clustering purpose is completed
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * the clustering purpose is completed
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterInformationContainer
+ * containing clusterId
+ * containing vruClusterOperationContainer
+ * containing clusterBreakupInfo
+ * indicating clusteringPurposeCompleted (1)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-24
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_24() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_24_cluster_leader());
+ v_iut.start(f_TC_VBS_MSGF_BV_24_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_24
+
+ /**
+ * @desc Check that clusterBreakupReason indicates clusteringPurposeCompleted when the clustering purpose is completed
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER and
+ * VRU has sent a cluster VAM
+ * containing vruClusterInformationContainer
+ * containing clusterBoundingBoxShape
+ * indicating Shape S
+ * }
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * the IUT is alerted about new reference position value P
+ * and P is not inside S
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterInformationContainer
+ * containing clusterId
+ * containing vruClusterOperationContainer
+ * containing clusterBreakupInfo
+ * indicating leaderMovedOutOfClusterBoundingBox (2)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-25
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_25() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_25_cluster_leader());
+ v_iut.start(f_TC_VBS_MSGF_BV_25_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_25
+
+ /**
+ * @desc Check that clusterBreakupReason indicates joiningAnotherCluster when the cluster leader is joining another cluster
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * the clustering purpose is completed
+ * containing vruClusterInformationContainer
+ * containing clusterId
+ * indicating value CId
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterInformationContainer
+ * containing clusterId
+ * containing vruClusterOperationContainer
+ * containing clusterBreakupInfo
+ * indicating value joiningAnotherCluster (3)
+ * and containing clusterJoinInfo
+ * containing clusterId
+ * indicating value CId
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-26
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_26() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ /*TODO
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_26_cluster_leader());
+ v_iut.start(f_TC_VBS_MSGF_BV_26_iut());*/
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_26
+
+ /**
+ * @desc Check that clusterBreakupReason indicates enteringLowriskareaBasedonMAPs when the cluster leader is entering a low-risk area
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * a MAP is received indicating the current position is in a low risk area
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterInformationContainer
+ * containing clusterId
+ * containing vruClusterOperationContainer
+ * containing clusterBreakupInfo
+ * indicating value enteringLowriskareaBasedonMAPs (4)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-27
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_27() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ /*TODO
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_27_cluster_leader());
+ v_iut.start(f_TC_VBS_MSGF_BV_27_iut());*/
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_27
+
+ /**
+ * @desc Check that clusterBreakupReason indicates receptionOfCPMcontainingCluster when a CPM containing a cluster is received
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * a CPM is received that contains a cluster
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterInformationContainer
+ * containing clusterId
+ * containing vruClusterOperationContainer
+ * containing clusterBreakupInfo
+ * indicating value receptionOfCPMcontainingCluster (5)
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-28
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_28() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ /*TODO
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_28_cluster_leader());
+ v_iut.start(f_TC_VBS_MSGF_BV_28_iut());*/
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_28
+
+ /**
+ * @desc Check that clusterIdChangeTimeInfo indicates the time the cluster leader intents to change the cluster ID
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * and VRU is changing cluster ID
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterIdChangeTimeInfo
+ * indicating planned ID change time
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-29
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_29() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ /*TODO
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_29_cluster_leader());
+ v_iut.start(f_TC_VBS_MSGF_BV_29_iut());*/
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_29
+
+ /**
+ * @desc Check that the ClusterLeaveReason is systematically set to 0 if the reason for breaking up or leaving the cluster cannot be matched with the other reasons (1-8)
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * and VRU is leaving the cluster
+ * and no other reason applicable to the given 8
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruClusterOperationContainer
+ * containing clusterLeaveInfo
+ * containing clusterId
+ * and containing clusterLeaveReason
+ * indicating value 0
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-30
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5
+ */
+ testcase TC_VBS_MSGF_BV_30() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ /*TODO
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_30_cluster_leader());
+ v_iut.start(f_TC_VBS_MSGF_BV_30_iut());*/
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+
+ } // End of testcase TC_VBS_MSGF_BV_30
+
+ /**
+ * @desc Check that the VruMotionPredictionContainer includes the pathHistory of type PathHistory consisting of up to 40 past points
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU has n PathPoints
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing VruMotionPredictionContainer
+ * containing pathHistory
+ * containing n <= 40 PathPoints
+ * containing pathPosition
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-31
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6
+ */
+ testcase TC_VBS_MSGF_BV_31() runs on ItsBaseMtc system ItsVruSystem {
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader());
+ v_iut.start(f_TC_VBS_MSGF_BV_31_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+ } // End of TC_VBS_MSGF_BV_31
+
+ /**
+ * @desc Check that the VruMotionPredictionContainer includes the path prediction of type PathPredicted consisting of up to 15 future points, confidence values and time instances
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU has n VruPathPoints
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing VruMotionPredictionContainer
+ * containing pathPrediction
+ * containing n <= 15 times PathPointPredicted
+ * containing horizontalPositionConfidence
+ * and containing pathDeltaTime
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-32
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6
+ */
+ testcase TC_VBS_MSGF_BV_32() runs on ItsBaseMtc system ItsVruSystem {
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader());
+ v_iut.start(f_TC_VBS_MSGF_BV_32_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+ } // End of TC_VBS_MSGF_BV_32
+
+ /**
+ * @desc Check that the vruMotionPredictionContainer includes the safe distance indication that includes timeToCollision
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU has detected a possible collision
+ * and VRU has timeToCollision of TTC
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing VruMotionPredictionContainer
+ * containing safeDistance
+ * containing VruSafeDistanceIndication
+ * containing timeToCollision
+ * indicating value TTC
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-33
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6
+ */
+ testcase TC_VBS_MSGF_BV_33() runs on ItsBaseMtc system ItsVruSystem {
+ var ItsVru v_vam_cluster_leader_1;
+ var ItsVru v_vam_cluster_leader_2;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+
+ // Start components
+ v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode
+ v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_33_cluster_approching());
+ v_iut.start(f_TC_VBS_MSGF_BV_33_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+ } // End of TC_VBS_MSGF_BV_33
+
+ /**
+ * @desc Check that the vruMotionPredictionContainer includes the accelerationChangeIndication of type AccelerationChangeIndication containing accelOrDecel and actionDeltaTime
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU accelerates or decelerates for time period DELTA_TIME
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruMotionPredictionContainer
+ * containing accelerationChangeIndication
+ * containing accelOrDecel
+ * indicating accelerate / decelerate
+ * and containing actionDeltaTime
+ * indicating value DELTA_TIME
+
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-34
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6
+ */
+ testcase TC_VBS_MSGF_BV_34() runs on ItsBaseMtc system ItsVruSystem {
+ var ItsVru v_vam_cluster_leader_1;
+ var ItsVru v_vam_cluster_leader_2;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+
+ // Start components
+ v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode
+ /*TODO v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_34_cluster_approching());
+ v_iut.start(f_TC_VBS_MSGF_BV_34_iut());*/
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+ } // End of TC_VBS_MSGF_BV_34
+
+ /**
+ * @desc Check that the vruMotionPredictionContainer includes the headingChangeIndication of type HeadingChangeIndication containing the dircetion and actionDeltaTime
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU changes heading to direction d for a time period DELTA_TIME
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruMotionPredictionContainer
+ * containing headingChangeIndication
+ * containing direction
+ * indicating value d
+ * and containing actionDeltaTime
+ * indicating value DELTA_TIME
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-35
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6
+ */
+ testcase TC_VBS_MSGF_BV_35() runs on ItsBaseMtc system ItsVruSystem {
+ var ItsVru v_vam_cluster_leader_1;
+ var ItsVru v_vam_cluster_leader_2;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+
+ // Start components
+ v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode
+ /*TODO v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_35_cluster_approching());
+ v_iut.start(f_TC_VBS_MSGF_BV_35_iut());*/
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+ } // End of TC_VBS_MSGF_BV_35
+
+ /**
+ * @desc Check that the vruMotionPredictionContainer includes the stabilityChangeIndication of type StabilityChangeIndication containing the lossProbability and actionDeltaTime
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU changes stability by lossProbability PL for a time period DELTA_TIME
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM generation requested
+ * }
+ * then {
+ * VAM is sent
+ * containing VamAwarness
+ * containing vruMotionPredictionContainer
+ * containing stabilityChangeIndication
+ * containing lossProbability
+ * indicating value PL
+ * and containing actionDeltaTime
+ * indicating value DELTA_TIME
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-36
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6
+ */
+ testcase TC_VBS_MSGF_BV_36() runs on ItsBaseMtc system ItsVruSystem {
+ var ItsVru v_vam_cluster_leader_1;
+ var ItsVru v_vam_cluster_leader_2;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+
+ // Start components
+ v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode
+ /*TODO v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_36_cluster_approching());
+ v_iut.start(f_TC_VBS_MSGF_BV_36_iut());*/
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+ } // End of TC_VBS_MSGF_BV_36
+
+ /**
+ * @desc Check that profile 3 VRUs only transmit a VRU special vehicle container in the CAM instead of full VAM
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VRU in profile motorcyclist (3)
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * IUT is triggered to send awareness message
+ * }
+ * then {
+ * CAM is sent
+ * containing specialVehicleContainer
+ * containing vruSpecialVehicleContainer
+ * containing vruSubProfileMotorcyclist
+ * and containing sizeClass
+ * and no VAM is generated
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-37
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6
+ */
+ testcase TC_VBS_MSGF_BV_37() runs on ItsBaseMtc system ItsVruSystem {
+ var ItsVru v_vam_cluster_leader_1;
+ var ItsVru v_vam_cluster_leader_2;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+
+ // Start components
+ v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode
+ /*TODO v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_37_cluster_approching());
+ v_iut.start(f_TC_VBS_MSGF_BV_37_iut());*/
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut);
+ } // End of TC_VBS_MSGF_BV_37
+
+ } // End of group message_format
+
+ group vruLowerLayerParameters {
+
+ /**
+ * @desc Check that the BTP header type B and the destination port is passed if the value is not provided by the ITS-S configuration
+ *
+ * Pics Selection: PICS_VAM_GENERATION AND NOT PICS_IS_IUT_SECURED
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and data being passed from the VBS to GeoNetworking/BTP
+ * and BTP type is not privided by the ITS-S configuration
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * Message is sent
+ * Message is sent
+ * containing BTP header
+ * indicating type B
+ * and containing destination port
+ * indicating value 2018
+
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/IFGN/BV-01
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.3.3.2
+ */
+ testcase TC_VBS_IFGN_BV_01() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_IFGN_BV_01();
+
+ } // End of TC_VBS_IFGN_BV_01
+
+ /**
+ * @desc Check that the GN packet transport type is GeoNetworking SHB and passed if the value is not provided by the ITS-S configuration
+ *
+ * Pics Selection: PICS_VAM_GENERATION AND NOT PICS_IS_IUT_SECURED
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and data being passed from the VBS to GeoNetworking/BTP
+ * and BTP type is not privided by the ITS-S configuration
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * Message is sent
+ * containing GeoNetworking header
+ * containing Common Header
+ * containing Header Type
+ * indicating SHB
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/IFGN/BV-02
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.3.3.2
+ */
+ testcase TC_VBS_IFGN_BV_02() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_IFGN_BV_02();
+
+ } // End of TC_VBS_IFGN_BV_02
+
+ /**
+ * @desc Check that the GN Traffic class is the same value as for the CAM
+ *
+ * Pics Selection: PICS_VAM_GENERATION AND NOT PICS_IS_IUT_SECURED
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and data being passed from the VBS to GeoNetworking/BTP
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * Message is sent
+ * containing GeoNetworking header
+ * containing Common Header
+ * containing Traffic Class
+ * indicating value TC = 2
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/IFGN/BV-03
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.3.3.2
+ */
+ testcase TC_VBS_IFGN_BV_03() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_IFGN_BV_03();
+
+ } // End of TC_VBS_IFGN_BV_03
+
+ } // End of group vruLowerLayerParameters
+
+ group vruSecurityEntity {
+ // Not implemented
+ } // End of group vruSecurityEntity
+
+ group vruTransmittingVAMs {
+
+ /**
+ * @desc Check that a VRU in VRU-ACTIVE-STANDALONE sends individual VAMs
+ *
+ * Pics Selection: PICS_VAM_GENERATION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * VAM is sent
+ * not containing vruClusterInformationContainer
+ * and not containing vruClusterOperationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRANS/BV-01
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.3
+ */
+ testcase TC_VBS_TRANS_BV_01() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_TRANS_BV_01();
+
+ } // End of TC_VBS_TRANS_BV_01
+
+ /**
+ * @desc Check that a VRU in VRU-ACTIVE-CLUSTER-LEADER sends cluster VAMs
+ *
+ * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * VAM is sent
+ * containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRANS/BV-02
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.3
+ */
+ testcase TC_VBS_TRANS_BV_02() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader());
+ v_iut.start(f_TC_VBS_TRANS_BV_02_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+
+ } // End of TC_VBS_TRANS_BV_02
+
+ /**
+ * @desc Check that a VRU in VRU-PASSIVE sends individual VAMs containing VruClusterOperationContainer when leaving the VRU cluster
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION and PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * VAM is sent
+ * containing vruClusterOperationContainer
+ * and not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 038-2 V2.0.2 (2034-11) TP/VBS/TRANS/BV-03
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.3
+ */
+ testcase TC_VBS_TRANS_BV_03() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_17_cluster_member());
+ v_iut.start(f_TC_VBS_TRANS_BV_03_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of TC_VBS_TRANS_BV_03
+
+ /**
+ * @desc Check that a VRU in VRU-ACTIVE-STANDALONE sends individual VAMs containing VruClusterOperationContainer while joining a VRU cluster
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VRU determines to join cluster
+ * }
+ * then {
+ * VAM is sent
+ * containing vruClusterOperationContainer
+ * and not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 048-2 V2.0.2 (2044-11) TP/VBS/TRANS/BV-04
+ * @reference ETSI TS 104 300-3 (V2.2.1), clause 6.3
+ */
+ testcase TC_VBS_TRANS_BV_04() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_15_cluster_leader());
+ v_iut.start(f_TC_VBS_TRANS_BV_04_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of TC_VBS_TRANS_BV_04
+
+ } // End of group vruTransmittingVAMs
+
+ group vruTransitionTriggering {
+
+ /**
+ * @desc Check that a VBS starts sending VAMs when the state changes from VRU-IDLE to VRU-ACTIVE-STANDALONE
+ *
+ * Pics Selection: PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-IDLE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * state changes to VRU-ACTIVE-STANDALONE
+ * }
+ * then {
+ * VAM is sent
+ * not containing vruClusterOperationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-01
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2
+ */
+ testcase TC_VBS_CLTR_BV_01() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_CLTR_BV_01();
+
+ } // End of TC_VBS_CLTR_BV_01
+
+ /**
+ * @desc Check that the cluster size is set to minClusterSize and the VRU profile field is set to the VRU profile
+ *
+ * Pics Selection: PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-IDLE and
+ * VBS has VRU profile p
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VBS determining to form a cluster
+ * }
+ * then {
+ * VAM is sent
+ * containing vruClusterInformationContainer
+ * containing clusterProfiles
+ * indicating value p
+ * and containing clusterCardinalitySize
+ * indicating value minClusterSize
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-02
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2
+ */
+ testcase TC_VBS_CLTR_BV_02() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER
+ v_iut.start(f_TC_VBS_CLTR_BV_02_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of TC_VBS_CLTR_BV_02
+
+ /**
+ * @desc Check that a VBS in VRU-ACTIVE-STANDALONE stops the transmission of VAMs when changing to VRU-IDLE
+ *
+ * Pics Selection: PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * state changes to VRU-IDLE
+ * }
+ * then {
+ * VBS stops sending VAMs
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-03
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2
+ */
+ testcase TC_VBS_CLTR_BV_03() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_CLTR_BV_03();
+
+ } // End of TC_VBS_CLTR_BV_03
+
+ /**
+ * @desc Check that a cluster breaking VRU stops sending cluster VAMs
+ *
+ * Pics Selection: PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and breakup indication has been sent
+
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VBS breaking up cluster
+ * }
+ * then {
+ * VBS stops sending cluster VAMs
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-04
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2
+ */
+ testcase TC_VBS_CLTR_BV_04() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_CLTR_BV_04_cluster_leader()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER & VRU-ACTIVESTANDALONE
+ v_iut.start(f_TC_VBS_CLTR_BV_04_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of TC_VBS_CLTR_BV_04
+
+ /**
+ * @desc Check that a VRU sends an indication of joining a cluster for timeClusterJoinNotification including the identified cluster and time at which it stops sending individual VAMs
+ *
+ * Pics Selection: PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VBS has received a VAM from a cluster leader
+ * containing basicContainer
+ * containing referencePosition
+ * indicating Position
+ * and distance(Position, EgoPosition) < maxClusterDistance
+ * and containing vruHighFreuquencyContainer
+ * containing speed
+ * contaiing speedValue
+ * indicating value
+ * and abs(value – EgoSpeed) < maxClusterVelocityDifference
+ * and containing vruClusterInformationContainer
+ * containing clusterId
+ * indicating Cid
+ * and containing clusterCardinalitySize
+ * indicating value < maxClusterSize
+ * }
+ * then {
+ * VBS sends VAM
+ * for timeClusterJoinNotification
+ * not containing vruClusterInformationContainer
+ * and containing clusterOperationContainer
+ * containing clusterJoinInfo
+ * containing clusterId
+ * indicating CId
+ * and containing joinTime
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-05
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2
+ */
+ testcase TC_VBS_CLTR_BV_05() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_CLTR_BV_05_cluster_leader()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER & VRU-ACTIVESTANDALONE
+ v_iut.start(f_TC_VBS_CLTR_BV_04_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of TC_VBS_CLTR_BV_05
+
+ /**
+ * @desc Check that a VBS sends individual VAMs after a cancelled-join oder failed-join including the same station ID as before and the cluster leave notification for timeClusterLeaveNotification
+ *
+ * Pics Selection: PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * and cancelled-join has occured or failed-join has occured
+ * and stationID is value sID
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VBS generates VAM
+ * }
+ * then {
+ * VBS sends VAM
+ * not containing vruClusterInformationContainer
+ * and containing ITS PDU header
+ * containing stationID
+ * indicating sID
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-06
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2
+ */
+ testcase TC_VBS_CLTR_BV_06() runs on ItsBaseMtc system ItsVruSystem {
+
+ // TODO f_TC_VBS_CLTR_BV_06();
+
+ } // End of TC_VBS_CLTR_BV_06
+
+ /**
+ * @desc Check that a VRU leaving a cluster indicates the identified cluster and the reason for timeClusterLeaveNotification
+ *
+ * Pics Selection: PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-PASSIVE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VRU leaving cluster CL1
+ * }
+ * then {
+ * VBS sends VAM
+ * for timeClusterLeaveNotification
+ * containing vruClusterOperationContainer
+ * contianing vruClusterInformationContainer
+ * containing clusterId
+ * indicating CL1
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-07
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2
+ */
+ testcase TC_VBS_CLTR_BV_07() runs on ItsBaseMtc system ItsVruSystem {
+
+ // TODO f_TC_VBS_CLTR_BV_07();
+
+ } // End of TC_VBS_CLTR_BV_07
+
+ /**
+ * @desc Check that a cluster leader indicates a cluster ID change for timeClusterIdChangeNotification before the change
+ *
+ * Pics Selection: PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and is triggered to change cluster ID
+ * and VBS has sent VAM
+ * containing vruClusterInformationContainer
+ * containing clusterID
+ * indicating cID1
+ * and containing vruClusterOperationContainer
+ * containing clusterIdChangeTimeInfo
+ * indicating value x
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * IUT is sending
+ * }
+ * then {
+ * VBS sends multiple VAMs
+ * during timeClusterIdChangeNotification
+ * containing vruClusterInformationContainer
+ * and containing vruClusterOperationContainer
+ * containing clusterIdChangeTimeInfo
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-09
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.3
+ */
+ testcase TC_VBS_CLTR_BV_09() runs on ItsBaseMtc system ItsVruSystem {
+
+ // TODO f_TC_VBS_CLTR_BV_09();
+
+ } // End of TC_VBS_CLTR_BV_09
+
+ /**
+ * @desc Check that a cluster leader sends a cluster VAM with the new ID as soon as possible
+ *
+ * Pics Selection: PICS_CLUSTERING
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and change ID notification has been sent
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * IUT is changing cluster ID
+ * }
+ * then {
+ * VBS sends VAMs
+ * containing vruClusterInformationContainer
+ * containing clusterId
+ * indicating new cluster ID
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-10
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.3
+ */
+ testcase TC_VBS_CLTR_BV_10() runs on ItsBaseMtc system ItsVruSystem {
+
+ // TODO f_TC_VBS_CLTR_BV_10();
+
+ } // End of TC_VBS_CLTR_BV_10
+
+ } // End of group vruTransitionTriggering
+
+ group vruTriggeringCondition {
+
+ /**
+ * @desc Check that the first time individual VAM is generated immediately after VBS activation
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * and VBS activation has occured
+ * and VBS has sent no VAM yet
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * VAM is sent
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-01
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_01() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_TRCN_BV_01();
+
+ } // End of TC_VBS_TRCN_BV_01
+
+ /**
+ * @desc Check that a VAM is generated immediately if a VRU is in VRU-IDLE and enters VRU-ACTIVE-STANDALONE
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * VAM is sent
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-02
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_02() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_TRCN_BV_01();
+
+ } // End of TC_VBS_TRCN_BV_02
+
+ /**
+ * @desc Check that a VAM is generated immediately if a VRU is in VRU-PASSIVE, leaves the cluster and enters VRU-ACTIVE-STANDALONE
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-PASSIVE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VRU leaves cluster
+ * and state changes to VRU-ACTIVE-STANDALONE
+ * }
+ * then {
+ * VAM is sent
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-03
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_03() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_TRCN_BV_03_cluster_member()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER & VRU-ACTIVESTANDALONE
+ v_iut.start(f_TC_VBS_TRCN_BV_03_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of TC_VBS_TRCN_BV_03
+
+ /**
+ * @desc Check that a VAM is generated immediately if a VRU is in VRU-PASSIVE, determines the cluster leader is lost and enters VRU-ACTIVE-STANDALONE
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-PASSIVE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VRU leaves cluster
+ * and state changes to VRU-ACTIVE-STANDALONE
+ * }
+ * then {
+ * VAM is sent
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-04
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_04() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_member;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_member, v_iut);
+
+ // Start components
+ v_vam_cluster_member.start(f_TC_VBS_TRCN_BV_04_cluster_member()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER & VRU-ACTIVESTANDALONE
+ v_iut.start(f_TC_VBS_TRCN_BV_04_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_member, v_iut);
+
+ } // End of TC_VBS_TRCN_BV_04
+
+ /**
+ * @desc Check that a VAM is generated immediately if a VRU is in VRU-ACTIVE-CLUSTER-LEADER, breaks up the cluster and enters VRU-ACTIVE-STANDALONE
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-PASSIVE
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VRU leaves cluster
+ * and state changes to VRU-ACTIVE-STANDALONE
+ * }
+ * then {
+ * VAM is sent
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-05
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_05() runs on ItsBaseMtc system ItsVruSystem {
+ // Local variables
+ var ItsVru v_vam_cluster_leader;
+ var ItsVru v_iut;
+
+ // Test control
+ if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) {
+ log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfMtcUp01(v_vam_cluster_leader, v_iut);
+
+ // Start components
+ v_vam_cluster_leader.start(f_TC_VBS_TRCN_BV_05_cluster_leader()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER & VRU-ACTIVESTANDALONE
+ v_iut.start(f_TC_VBS_TRCN_BV_05_iut());
+
+ // Synchronization
+ f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone});
+
+ // Cleanup
+ f_cfMtcDown01(v_vam_cluster_leader, v_iut);
+
+ } // End of TC_VBS_TRCN_BV_05
+
+ /**
+ * @desc Check that the minimum time elapsed between the start of consecutive VAM generation events is equal or larger than T_Gen_Vam
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * and VAM has been transmitted at time T1
+ * not containing vruClusterInformationContainer
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is transmitted at time T2
+ * not containing vruClusterInformationContainer
+ * }
+ * then {
+ * T2 - T1 >= T_Gen_Vam
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-06
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_06() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_FRPE_TI_01();
+
+ } // End of TC_VBS_TRCN_BV_06
+
+ /**
+ * @desc Check that consecutive VAM transmissions occur when T_GenVamMax is exceeded
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VAM has been transmitted at time T1
+ * and no other VAM has been sent since then
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * T_GenVamMax is exceeded
+ * }
+ * then {
+ * VBS sends VAM
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-07
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_07() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_FRPE_TI_04();
+
+ } // End of TC_VBS_TRCN_BV_07
+
+ /**
+ * @desc Check that consecutive individual VAM transmissions occur when the euclidian absolute distance between the current estimated VRU reference point position and the last estimated VRU reference point position exceeds minReferencePointPositonChangeThreshold
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * and VAM has been transmitted at time T1
+ * not containing vruClusterInformationContainer
+ * and containing basicContainer
+ * containing referencePosition P1
+ * and the IUT not having sent any other VAM
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * T_GenVam is exceeded
+ * and the IUT is alerted about new position value P2
+ * and euclidian distance (P1, P2) > minReferencePointPositonChangeThreshold
+ * }
+ * then {
+ * VBS sends VAM
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-08
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_08() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_TRCN_BV_08();
+
+ } // End of TC_VBS_TRCN_BV_08
+
+ /**
+ * @desc Check that consecutive individual VAM transmissions occur when the euclidian absolute distance between the current estimated VRU reference point position and the last estimated VRU reference point position exceeds minReferencePointPositonChangeThreshold
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * and VAM has been transmitted at time T1
+ * not containing vruClusterInformationContainer
+ * and containing vruHighFrequencyContainer
+ * containing speed
+ * containing speedValue
+ * indcating V1
+ * and the IUT not having sent any other VAM
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * T_GenVam is exceeded
+ * and the IUT is alerted about new speed value V2
+ * and abs(V2 - V1) > minGroundSpeedChangeThreshold
+ * }
+ * then {
+ * VBS sends VAM
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-09
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_09() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_TRCN_BV_09();
+
+ } // End of TC_VBS_TRCN_BV_09
+
+ /**
+ * @desc Check that consecutive individual VAM transmissions occur when the difference between the orientation of the vector of the current estimated ground velocity of the reference point of the VRU and the estimated orientation of the vector of the ground velocity of the reference point of the VRU lastly included in an individual VAM exceeds minGroundVelocityOrientationChangeThreshold
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * and VAM has been transmitted at time T1
+ * not containing vruClusterInformationContainer
+ * and containing vruHighFrequencyContainer
+ * containing heading
+ * containing headingValue
+ * indcating H1
+ * and the IUT not having sent any other VAM
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * T_GenVam is exceeded
+ * and the IUT is alerted about new heading value H2
+ * and abs(H2 - H1) > minGroundVelocityOrientationChangeThreshold
+ * }
+ * then {
+ * VBS sends VAM
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-10
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_10() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_TRCN_BV_10();
+
+ } // End of TC_VBS_TRCN_BV_10
+
+ /**
+ * @desc Check that consecutive individual VAM transmissions occur when the difference between the orientation of the vector of the current estimated ground velocity of the reference point of the VRU and the estimated orientation of the vector of the ground velocity of the reference point of the VRU lastly included in an individual VAM exceeds minGroundVelocityOrientationChangeThreshold
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * and VAM has been transmitted at time T1
+ * not containing vruClusterInformationContainer
+ * and containing vruMotionPredictionContainer
+ * containing trajectoryInterceptionIndication
+ * containing trajectoryInterceptionProbability
+ * indicating P1
+ * and the IUT not having sent any other VAM
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * T_GenVam is exceeded
+ * and the IUT is alerted about new trajectory interception probability value P2
+ * and abs(P2 - P1) > minTrajectoryInterceptionProbChangeThreshold
+ * }
+ * then {
+ * VBS sends VAM
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-11
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_11() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_TRCN_BV_11();
+
+ } // End of TC_VBS_TRCN_BV_11
+
+ /**
+ * @desc Check that consecutive individual VAM transmissions occur when one or more other VRUs are simultanously coming closer than Minimum Safe Lateral Distance(MSLaD) laterally, closer than Minimum Safe Longitudinal Distance (MSLoD) longitudinally and closer than Minimum Safe Vertical Distance (MSVD) vertically
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * and VAM has been transmitted at time T1
+ * not containing vruClusterInformationContainer
+ * and VAM has been received from other VRU
+ * containing basicContainer
+ * containing referencePosition P1
+ * containing latitude
+ * indicating LAT1
+ * and containing longitude
+ * indicating LON1
+ * and the IUT not having sent any other VAM
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * T_GenVam is exceeded
+ * and the IUT is alerted about new reference position value P1
+ * containing latitude value LAT2
+ * and containing longitude value LON2
+ * and abs(LAT2 - LAT1) < MSLaD
+ * and abs(LON2 - LON1) < MSLoD
+ * and euclidian distance (P1, P2) < MSVD
+ * }
+ * then {
+ * VBS sends VAM
+ * not containing vruClusterInformationContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-12
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_TRCN_BV_12() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_TRCN_BV_12();
+
+ } // End of TC_VBS_TRCN_BV_12
+
+ } // End of group vruTriggeringCondition
+
+ group vruFrequencyPeriodicity {
+
+ /**
+ * @desc Check that the minimum time elapsed between the start of consecutive VAM generation events is equal or larger than T_Gen_Vam
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VBS has started generating a VAM at time T1
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VBS starts generating a VAM at time T2
+ * }
+ * then {
+ * T2 - T1 >= T_Gen_Vam
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/FRPE/TI-01
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.2
+ */
+ testcase TC_VBS_FRPE_TI_01() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_FRPE_TI_01();
+
+ } // End of TC_VBS_FRPE_TI_01
+
+ /**
+ * @desc Check that the LF container is included in the first VAM generation
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VBS activation has occured
+ * and no VAM has been sent yet
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * VAM is sent
+ * containing vruLowFrequencyContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/FRPE/BV-02
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1
+ */
+ testcase TC_VBS_FRPE_BV_02() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_FRPE_BV_02();
+
+ } // End of TC_VBS_FRPE_BV_02
+
+ /**
+ * @desc Check that the LF container is included periodically after 2000 ms
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and VBS activation has occured
+ * and no VAM has been sent yet
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * VAM is sent
+ * containing vruLowFrequencyContainer
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/FRPE/BV-03
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.2
+ */
+ testcase TC_VBS_FRPE_BV_03() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_FRPE_BV_03();
+
+ } // End of TC_VBS_FRPE_BV_03
+
+ /**
+ * @desc Check that the minimum time elapsed between the start of consecutive VAM generation events is equal or larger than T_Gen_Vam
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION and PICS_ITS_G5
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and T_GenVam >= T_GenVamMax
+ * and VAM has been sent at time T1
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * next VAM is generated at time T2
+ * }
+ * then {
+ * T2 - T1 = T_GenVamMax
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/FRPE/TI-04
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.2
+ */
+ testcase TC_VBS_FRPE_TI_04() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_FRPE_TI_04();
+
+ } // End of TC_VBS_FRPE_TI_04
+
+ /**
+ * @desc Check that T_GenVam is set to T_GenVamMin if the value for T_GenVam is not provided by the VBS management entity or smaller than T_GenVamMin in case of ITS-G5
+ *
+ * Pics Selection: PICS_VAM_TRANSMISSION and PICS_ITS_G5
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * and T_GenVam is not provided
+ * or T_GenVam <= T_GenVamMin
+ * and VAM has been sent at time T1
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * next VAM is generated at time T2
+ * }
+ * then {
+ * T2 - T1 = T_GenVamMin
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/FRPE/TI-05
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.2
+ */
+ testcase TC_VBS_FRPE_TI_05() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_FRPE_TI_05();
+
+ } // End of TC_VBS_FRPE_TI_05
+
+ } // End of group vruFrequencyPeriodicity
+
+ group securityConstraints {
+
+ /**
+ * @desc Check that the ITS-AID indicates the application for which permissions are being granted
+ *
+ * Pics Selection: PICS_VAM_GENERATION AND PICS_IS_IUT_SECURED
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * Message is sent
+ * containing GeoNetworking header
+ * containing Secure Header
+ * containing signedData
+ * containing certificate
+ * containing Certificate
+ * containing ToBeSigned
+ * containing AppPermissions
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/SECC/BV-02
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.5.1
+ */
+ testcase TC_VBS_SECC_BV_02() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_SECC_BV_02();
+
+ } // End of TC_VBS_SECC_BV_02
+
+ /**
+ * @desc Check that the SSP is a BitmapSsp
+ *
+ * Pics Selection: PICS_VAM_GENERATION AND PICS_IS_IUT_SECURED
+ * Initial conditions:
+ * with {
+ * VBS in state VRU-ACTIVE-STANDALONE
+ * or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+ * }
+ * Expected behaviour:
+ * ensure that {
+ * when {
+ * VAM is generated
+ * }
+ * then {
+ * Message is sent
+ * containing GeoNetworking header
+ * containing Secure Header
+ * containing signedData
+ * containing certificate
+ * containing Certificate
+ * containing ToBeSigned
+ * containing AppPermissions
+ * containing at least one item
+ * containing Bitmap SSP
+ * }
+ * }
+ *
+ *
+ * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/SECC/BV-02
+ * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.5.2
+ */
+ testcase TC_VBS_SECC_BV_04() runs on ItsVru system ItsVruSystem {
+
+ f_TC_VBS_SECC_BV_04();
+
+ } // End of TC_VBS_SECC_BV_04
+
+ } // End of group securityConstraints
+
+} // End of module ItsVru_TestCases
\ No newline at end of file
diff --git a/ItsVru_TestControl.ttcn b/ItsVru_TestControl.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..5795855f4559b343a448ee728f1229a1dddd8ef7
--- /dev/null
+++ b/ItsVru_TestControl.ttcn
@@ -0,0 +1,112 @@
+module ItsVru_TestControl {
+
+ // ATS VRU
+ import from ItsVru_TestCases all;
+
+ // LibIts
+ import from LibItsVru_Pics all;
+
+ // Test Execution
+ control {
+
+ if(PICS_VAM_GENERATION and PICS_IS_IUT_SECURED) {
+ execute(TC_VBS_MSGF_BV_01());
+ execute(TC_VBS_MSGF_BV_02());
+ execute(TC_VBS_MSGF_BV_03());
+ execute(TC_VBS_MSGF_BV_04());
+ execute(TC_VBS_MSGF_BV_05());
+ execute(TC_VBS_MSGF_BV_06());
+ execute(TC_VBS_MSGF_BV_07());
+ execute(TC_VBS_MSGF_BV_08());
+ execute(TC_VBS_MSGF_BV_10());
+ execute(TC_VBS_MSGF_BV_12());
+ execute(TC_VBS_MSGF_BV_13());
+ execute(TC_VBS_MSGF_BV_33());
+ execute(TC_VBS_MSGF_BV_34());
+ execute(TC_VBS_MSGF_BV_35());
+ execute(TC_VBS_MSGF_BV_36());
+ execute(TC_VBS_MSGF_BV_37());
+
+ if (PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST) {
+ execute(TC_VBS_MSGF_BV_09());
+ }
+
+ if (PICS_PROFILE_PEDESTRIAN) {
+ execute(TC_VBS_MSGF_BV_11());
+ }
+
+ if (PICS_PROFILE_BICYCLIST) {
+ execute(TC_VBS_MSGF_BV_14());
+ }
+
+ if (PICS_CLUSTERING) {
+ execute(TC_VBS_MSGF_BV_15());
+ execute(TC_VBS_MSGF_BV_16());
+ execute(TC_VBS_MSGF_BV_17());
+ execute(TC_VBS_MSGF_BV_18());
+ execute(TC_VBS_MSGF_BV_19());
+ execute(TC_VBS_MSGF_BV_20());
+ execute(TC_VBS_MSGF_BV_21());
+ execute(TC_VBS_MSGF_BV_22());
+ execute(TC_VBS_MSGF_BV_23());
+ execute(TC_VBS_MSGF_BV_24());
+ execute(TC_VBS_MSGF_BV_25());
+ execute(TC_VBS_MSGF_BV_26());
+ execute(TC_VBS_MSGF_BV_27());
+ execute(TC_VBS_MSGF_BV_28());
+ execute(TC_VBS_MSGF_BV_29());
+ execute(TC_VBS_MSGF_BV_30());
+ execute(TC_VBS_MSGF_BV_31());
+ execute(TC_VBS_MSGF_BV_32());
+ }
+
+ execute(TC_VBS_IFGN_BV_01());
+ execute(TC_VBS_IFGN_BV_02());
+ execute(TC_VBS_IFGN_BV_03());
+
+ execute(TC_VBS_SECC_BV_02());
+ execute(TC_VBS_SECC_BV_04());
+
+ }
+
+ if (PICS_CLUSTERING) {
+ execute(TC_VBS_CLTR_BV_01());
+ execute(TC_VBS_CLTR_BV_02());
+ execute(TC_VBS_CLTR_BV_03());
+ execute(TC_VBS_CLTR_BV_04());
+ execute(TC_VBS_CLTR_BV_05());
+ execute(TC_VBS_CLTR_BV_06());
+ execute(TC_VBS_CLTR_BV_07());
+ //execute(TC_VBS_CLTR_BV_08());
+ execute(TC_VBS_CLTR_BV_09());
+ execute(TC_VBS_CLTR_BV_10());
+ }
+ if (PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED) {
+ execute(TC_VBS_TRANS_BV_01());
+ if (PICS_CLUSTERING) {
+ execute(TC_VBS_TRANS_BV_02());
+ execute(TC_VBS_TRANS_BV_03());
+ }
+ execute(TC_VBS_TRANS_BV_04());
+
+ execute(TC_VBS_TRCN_BV_01());
+ execute(TC_VBS_TRCN_BV_02());
+ execute(TC_VBS_TRCN_BV_03());
+ execute(TC_VBS_TRCN_BV_04());
+ execute(TC_VBS_TRCN_BV_05());
+ execute(TC_VBS_TRCN_BV_06());
+ execute(TC_VBS_TRCN_BV_07());
+ execute(TC_VBS_TRCN_BV_08());
+ execute(TC_VBS_TRCN_BV_09());
+ execute(TC_VBS_TRCN_BV_10());
+ execute(TC_VBS_TRCN_BV_11());
+
+ execute(TC_VBS_FRPE_TI_01());
+ execute(TC_VBS_FRPE_BV_02());
+ execute(TC_VBS_FRPE_BV_03());
+ execute(TC_VBS_FRPE_TI_04());
+ execute(TC_VBS_FRPE_TI_05());
+ }
+ }
+
+} // End of module ItsVru_TestControl
\ No newline at end of file
diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..75ef8bbbf1b13f0dca7430dc00cac98aefe46866
--- /dev/null
+++ b/ItsVru_TpFunctions.ttcn
@@ -0,0 +1,5257 @@
+module ItsVru_TpFunctions {
+
+ // LibCommon
+ import from LibCommon_Sync all;
+ import from LibCommon_VerdictControl all;
+ import from LibCommon_Time all;
+ import from LibCommon_BasicTypesAndValues all;
+ import from LibCommon_DataStrings all;
+
+ // LibIts
+ import from ETSI_ITS_CDD language "ASN.1:1997" all;
+ import from VAM_PDU_Descriptions language "ASN.1:1997" all;
+
+ // LibItsCommon
+ import from LibItsCommon_TypesAndValues all;
+ import from LibItsCommon_Functions all;
+ import from LibItsCommon_Pixits all;
+ import from LibItsCommon_ASN1_NamedNumbers all;
+ import from LibItsCommon_CddTemplates all;
+
+ // LibItsVru
+ import from LibItsVru_TestSystem all;
+ import from LibItsVru_Functions all;
+ import from LibItsVru_Templates all;
+ import from LibItsVru_TypesAndValues all;
+ import from LibItsVru_Pics all;
+ import from LibItsVru_Pixits all;
+
+ // LibItsSecurity
+ import from LibItsSecurity_Functions all;
+
+ group LibHelpers_Functions {
+
+ type record of PathPointPredicted UnrestritedPathPointPredicted;
+ function f_generate_path_history(
+ in integer p_num_points,
+ in VAM p_first_iut_vam,
+ out PathHistory p_path_history,
+ out PathPredicted p_path_predicted
+ ) runs on ItsVru {
+ var VamParameters v_vam_parameters := p_first_iut_vam.vam.vamParameters;
+ var UnrestritedPathPointPredicted v_path_predicted;
+
+ // Initialize the path history
+ p_path_history := {};
+ v_path_predicted := {};
+ // Populate it with points based on IUT position
+ for (var integer i := 0; i < p_num_points; i := i + 1) { // From the most recent pint to the oldest one
+ p_path_history[i] := valueof(
+ m_path_point(
+ m_delta_reference_position(
+ PX_DELTA_LATITUDE_IN_BOX + i, // TODO To be refined
+ PX_DELTA_LONGITUDE_IN_BOX,
+ 0
+ ),
+ 1
+ ));
+ v_path_predicted[i] := valueof(
+ m_path_point_predicted(
+ PX_DELTA_LATITUDE_IN_BOX + i, // TODO To be refined
+ PX_DELTA_LONGITUDE_IN_BOX
+
+ ));
+ } // End of 'for'statement
+ p_path_predicted := v_path_predicted;
+
+ } // End of function f_generate_path_history
+
+ /**
+ * @desc Set the IUT in VRU-ACTIVE-CLUSTER-LEADER mode
+ */
+ function f_create_cluster_iut_as_leader(
+ out VAM p_first_iut_vam, // FIXME Seems to be useless
+ out VAM p_updated_cluster_vam,
+ in Identifier1B p_vru_cluster_create_id := PX_VRU_CLUSTER_CREATE_ID
+ ) runs on ItsVru return boolean {
+
+ // Local variables
+ var VamInd v_vam;
+ var VAM v_updated_cluster_vam;
+ var VamParameters v_vam_parameters;
+
+ // Wait for first VA message from the IUT
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters
+ )))) -> value v_vam {
+ tc_ac.stop;
+ p_first_iut_vam := v_vam.msgIn;
+ v_vam_parameters := v_vam.msgIn.vam.vamParameters;
+
+ log("*** " & testcasename() & ": INFO: VAM from IUT is received ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***");
+ return false;
+ }
+ } // End of 'alt' statement
+
+ // Send x VAM with conditions to create a cluster and wait for the cluster creation
+ v_updated_cluster_vam := valueof(
+ m_vamMsg(
+ 0, // Updated before to be sent
+ m_vru_awareness(
+ 0, // Updated before to be sent
+ m_vam_parameters(
+ m_basic_container(
+ StationType_bus_,
+ m_reference_position_with_confidence(
+ v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse,
+ v_vam_parameters.basicContainer.referencePosition.altitude
+ )),
+ m_vru_high_frequency_container(
+ v_vam_parameters.vruHighFrequencyContainer.heading,
+ m_speed(
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX,
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence
+ ),
+ v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.curvature,
+ v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode,
+ v_vam_parameters.vruHighFrequencyContainer.yawRate,
+ v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.vruLanePosition,
+ v_vam_parameters.vruHighFrequencyContainer.environment,
+ v_vam_parameters.vruHighFrequencyContainer.movementControl,
+ v_vam_parameters.vruHighFrequencyContainer.orientation,
+ v_vam_parameters.vruHighFrequencyContainer.rollAngle,
+ v_vam_parameters.vruHighFrequencyContainer.deviceUsage
+ ),
+ -/*,
+ m_vru_cluster_information_container(
+ m_vru_cluster_information(
+ PX_VRU_CLUSTER_CREATE_CARDINALITY,
+ p_vru_cluster_create_id,
+ m_shape_circular(
+ m_circular_shape(
+ PX_VRU_CLUSTER_CREATE_RADIUS,
+ m_cartesian_position3d(
+ v_vam_parameters.basicContainer.referencePosition.latitude,
+ v_vam_parameters.basicContainer.referencePosition.longitude
+ ))),
+ PX_VRU_CLUSTER_CREATE_PROFILE
+ ))*/))));
+ //log("------------------------- ", m_vru_motion_prediction_container);
+ //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container);
+ //log("========================= ", p_updated_cluster_vam);
+ //f_generate_path_history(
+ // 10,
+ // p_first_iut_vam,
+ // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory,
+ // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction
+ // );
+ //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam);
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ for (var integer i := 0; i < PX_VRU_CLUSTER_CREATE_CARDINALITY; i := i + 1) {
+ v_updated_cluster_vam.header.stationId := f_getTsStationId() + 1 + i;
+ v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ vamPort.send(m_vruReq(v_updated_cluster_vam));
+ f_sleep(0.1);
+ } // End of 'for' statement
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": INFO: VAM cluster initiated ***");
+ // Wait for the IUT to create the cluster
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ mw_vru_cluster_information_container(
+ mw_vru_cluster_information(
+ PX_VRU_CLUSTER_CREATE_CARDINALITY + 1,
+ -, -,
+ PX_VRU_CLUSTER_CREATE_PROFILE
+ ))))))) -> value v_vam {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": INFO: IUT created the cluster ***");
+ }
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId()
+ ))) {
+ log("*** " & testcasename() & ": INFO: Discard message ***");
+ repeat;
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***");
+ return false;
+ }
+ } // End of 'alt' statement
+
+ // Join the cluster
+ v_vam_parameters := v_vam.msgIn.vam.vamParameters;
+ v_updated_cluster_vam := valueof(
+ m_vamMsg(
+ 0, // Updated before to be sent
+ m_vru_awareness(
+ 0, // Updated before to be sent
+ m_vam_parameters(
+ m_basic_container(
+ StationType_bus_,
+ m_reference_position_with_confidence(
+ v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse,
+ v_vam_parameters.basicContainer.referencePosition.altitude
+ )),
+ m_vru_high_frequency_container(
+ v_vam_parameters.vruHighFrequencyContainer.heading,
+ m_speed(
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX,
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence
+ ),
+ v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.curvature,
+ v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode,
+ v_vam_parameters.vruHighFrequencyContainer.yawRate,
+ v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.vruLanePosition,
+ v_vam_parameters.vruHighFrequencyContainer.environment,
+ v_vam_parameters.vruHighFrequencyContainer.movementControl,
+ v_vam_parameters.vruHighFrequencyContainer.orientation,
+ v_vam_parameters.vruHighFrequencyContainer.rollAngle,
+ v_vam_parameters.vruHighFrequencyContainer.deviceUsage
+ ),
+ -,
+ v_vam_parameters.vruClusterInformationContainer,
+ m_vru_cluster_operation_container(
+ m_cluster_join_info(
+ v_vam_parameters.vruClusterInformationContainer.vruClusterInformation.clusterId,
+ PX_VRU_REPETITION
+ ))))));
+ //log("------------------------- ", m_vru_motion_prediction_container);
+ //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container);
+ //log("========================= ", v_updated_cluster_vam);
+ //f_generate_path_history(
+ // 10,
+ // p_first_iut_vam,
+ // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory,
+ // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction
+ // );
+ //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam);
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ for (var integer i :=0; i < PX_VRU_CLUSTER_CREATE_CARDINALITY; i := i + 1) {
+ v_updated_cluster_vam.header.stationId := f_getTsStationId() + 1 + i;
+ v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ vamPort.send(m_vruReq(v_updated_cluster_vam));
+ f_sleep(0.1);
+ } // End of 'for' statement
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": INFO: Simulated joined the IUT cluster, stop sending VAMs ***");
+
+ // // Cluster leader send a VA message to indicate the cluster presence
+ // //log("------------------------- ", m_vru_motion_prediction_container);
+ // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container);
+ // //log("========================= ", p_updated_cluster_vam);
+ // f_generate_path_history(
+ // 10,
+ // p_first_iut_vam,
+ // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory,
+ // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction
+ // );
+ // //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam);
+ // v_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer := valueof(
+ // m_vru_cluster_information_container(
+ // m_vru_cluster_information(
+ // PX_VRU_CLUSTER_CREATE_CARDINALITY + 1,
+ // p_vru_cluster_create_id,
+ // m_shape_circular(
+ // m_circular_shape(
+ // PX_VRU_CLUSTER_CREATE_RADIUS
+ // )),
+ // PX_VRU_CLUSTER_CREATE_PROFILE
+ // )));
+ // v_updated_cluster_vam.vam.vamParameters.vruClusterOperationContainer := omit;
+ // v_updated_cluster_vam.header.stationId := f_getTsStationId();
+ // v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ // vamPort.send(m_vruReq(v_updated_cluster_vam));
+ // log("*** " & testcasename() & ": INFO: VAM cluster created and existing ***");
+
+ p_updated_cluster_vam := v_vam.msgIn;
+
+ return true;
+ } // End of function f_create_cluster_iut_as_leader
+
+ /**
+ * @desc Set the IUT in VRU-PASSIVE mode
+ */
+ function f_create_cluster_iut_as_member(
+ out VAM p_first_iut_vam, // FIXME Seems to be useless
+ out VAM p_updated_cluster_vam,
+ in Identifier1B p_vru_cluster_create_id := PX_VRU_CLUSTER_CREATE_ID
+ ) runs on ItsVru return boolean {
+
+ // Local variables
+ var VamInd v_vam;
+ var VamParameters v_vam_parameters;
+
+ // Wait for first VA message from the IUT
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters
+ )))) -> value v_vam {
+ tc_ac.stop;
+ p_first_iut_vam := v_vam.msgIn;
+ v_vam_parameters := v_vam.msgIn.vam.vamParameters;
+
+ log("*** " & testcasename() & ": INFO: VAM from IUT is received ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***");
+ return false;
+ }
+ } // End of 'alt' statement
+ // Send VA message covering condition to join the cluster (similar speed, closed position, same direction)
+ p_updated_cluster_vam := valueof(
+ m_vamMsg(
+ f_getTsStationId(),
+ m_vru_awareness(
+ 0, // Updated before to be sent
+ m_vam_parameters(
+ m_basic_container(
+ StationType_bus_,
+ m_reference_position_with_confidence(
+ v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse,
+ v_vam_parameters.basicContainer.referencePosition.altitude
+ )),
+ m_vru_high_frequency_container(
+ v_vam_parameters.vruHighFrequencyContainer.heading,
+ m_speed(
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX,
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence
+ ),
+ v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.curvature,
+ v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode,
+ v_vam_parameters.vruHighFrequencyContainer.yawRate,
+ v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.vruLanePosition,
+ v_vam_parameters.vruHighFrequencyContainer.environment,
+ v_vam_parameters.vruHighFrequencyContainer.movementControl,
+ v_vam_parameters.vruHighFrequencyContainer.orientation,
+ v_vam_parameters.vruHighFrequencyContainer.rollAngle,
+ v_vam_parameters.vruHighFrequencyContainer.deviceUsage
+ ),
+ -,
+ m_vru_cluster_information_container(
+ m_vru_cluster_information(
+ PX_VRU_CLUSTER_CREATE_CARDINALITY,
+ p_vru_cluster_create_id,
+ m_shape_circular(
+ m_circular_shape(
+ PX_VRU_CLUSTER_CREATE_RADIUS
+ )),
+ PX_VRU_CLUSTER_CREATE_PROFILE
+ ))))));
+ //log("------------------------- ", m_vru_motion_prediction_container);
+ //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container);
+ //log("========================= ", v_updated_cluster_vam);
+ //f_generate_path_history(
+ // 10,
+ // p_first_iut_vam,
+ // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory,
+ // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction
+ // );
+ //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam);
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ vamPort.send(m_vruReq(p_updated_cluster_vam));
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": INFO: VAM cluster initiated ***");
+ // Wait for the IUT to join the cluster
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ mw_cluster_join_info(
+ p_vru_cluster_create_id
+ ))))))) -> value v_vam {
+ tc_ac.stop;
+
+ if (v_vam.msgIn.vam.vamParameters.vruClusterOperationContainer.clusterJoinInfo.joinTime > 0) {
+ log("*** " & testcasename() & ": INFO: IUT will join the cluster in ", v_vam.msgIn.vam.vamParameters.vruClusterOperationContainer.clusterJoinInfo.joinTime, "seconds ***");
+ if (not tc_noac.running) {
+ tc_noac.start(int2float(valueof(v_vam.msgIn.vam.vamParameters.vruClusterOperationContainer.clusterJoinInfo.joinTime)));
+ }
+ repeat;
+ } else {
+ log("*** " & testcasename() & ": INFO: IUT joined the cluster immediately ***");
+ }
+ }
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness
+ ))) {
+ log("*** " & testcasename() & ": INFO: Unexpected VAM received ***");
+ repeat;
+ }
+ [] tc_noac.timeout {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": INFO: IUT joined the cluster after timeout ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***");
+ return false;
+ }
+ } // End of 'alt' statement
+
+ // Cluster leader send a VA message to indicate the cluster presence
+ // f_generate_path_history(
+ // 12,
+ // p_first_iut_vam,
+ // p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory,
+ // p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction
+ // );
+ p_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer := valueof(
+ m_vru_cluster_information_container(
+ m_vru_cluster_information(
+ PX_VRU_CLUSTER_CREATE_CARDINALITY + 1,
+ p_vru_cluster_create_id,
+ m_shape_circular(
+ m_circular_shape(
+ PX_VRU_CLUSTER_CREATE_RADIUS
+ )),
+ PX_VRU_CLUSTER_CREATE_PROFILE
+ )));
+ //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam);
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ vamPort.send(m_vruReq(p_updated_cluster_vam));
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": INFO: VAM cluster alive ***");
+
+ return true;
+ } // End of function f_create_cluster_iut_as_member
+
+ /**
+ * @desc Initiate a cluster with error
+ */
+ function f_initiate_cluster_iut_as_member(
+ in template (value) VruClusterOperationContainer p_vru_cluster_operation_container,
+ in template (value) CardinalNumber1B p_cluster_cardinality := PX_VRU_CLUSTER_CREATE_CARDINALITY,
+ out VAM p_first_iut_vam, // FIXME Seems to be useless
+ out VAM p_updated_cluster_vam
+ ) runs on ItsVru return boolean {
+
+ // Local variables
+ var VamInd v_vam;
+ var VamParameters v_vam_parameters;
+
+ // Wait for first VA message from the IUT
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -
+ ))))) -> value v_vam {
+ tc_ac.stop;
+ p_first_iut_vam := v_vam.msgIn;
+ v_vam_parameters := v_vam.msgIn.vam.vamParameters;
+
+ log("*** " & testcasename() & ": INFO: VAM from IUT is received ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***");
+ return false;
+ }
+ } // End of 'alt' statement
+ // Send VA message covering condition to join the cluster (similar speed, closed position, same direction)
+ p_updated_cluster_vam := valueof(
+ m_vamMsg(
+ f_getTsStationId(),
+ m_vru_awareness(
+ f_getCurrentTime() mod 65536,
+ m_vam_parameters(
+ m_basic_container(
+ StationType_bus_,
+ m_reference_position_with_confidence(
+ v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse,
+ v_vam_parameters.basicContainer.referencePosition.altitude
+ )),
+ m_vru_high_frequency_container(
+ v_vam_parameters.vruHighFrequencyContainer.heading,
+ m_speed(
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX,
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence
+ ),
+ v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.curvature,
+ v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode,
+ v_vam_parameters.vruHighFrequencyContainer.yawRate,
+ v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.vruLanePosition,
+ v_vam_parameters.vruHighFrequencyContainer.environment,
+ v_vam_parameters.vruHighFrequencyContainer.movementControl,
+ v_vam_parameters.vruHighFrequencyContainer.orientation,
+ v_vam_parameters.vruHighFrequencyContainer.rollAngle,
+ v_vam_parameters.vruHighFrequencyContainer.deviceUsage
+ ),
+ -,
+ m_vru_cluster_information_container(
+ m_vru_cluster_information(
+ p_cluster_cardinality,
+ PX_VRU_CLUSTER_CREATE_ID,
+ m_shape_circular(
+ m_circular_shape(
+ PX_VRU_CLUSTER_CREATE_RADIUS
+ )),
+ PX_VRU_CLUSTER_CREATE_PROFILE
+ ))))));
+ //log("------------------------- ", m_vru_motion_prediction_container);
+ p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container);
+ //log("========================= ", p_updated_cluster_vam);
+ f_generate_path_history(
+ 10,
+ p_first_iut_vam,
+ p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory,
+ p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction
+ );
+ //log("+++++++++++++++++++++++++ ", p_updated_cluster_vam);
+ vamPort.send(m_vruReq(p_updated_cluster_vam));
+ log("*** " & testcasename() & ": INFO: VAM cluster initiated ***");
+ // Wait for the IUT to join the cluster
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ mw_vru_cluster_information_container,
+ mw_vru_cluster_operation_container(
+ mw_cluster_join_info(
+ PX_VRU_CLUSTER_CREATE_ID
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": INFO: IUT joined the cluster ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***");
+ return false;
+ }
+ } // End of 'alt' statement
+
+ f_sleep(PX_TNOAC);
+ // Cluster leader send a VA message to indicate the cluster presence
+ p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ f_generate_path_history(
+ 12,
+ p_first_iut_vam,
+ p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory,
+ p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction
+ );
+ p_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer := valueof(
+ m_vru_cluster_information_container(
+ m_vru_cluster_information(
+ PX_VRU_CLUSTER_CREATE_CARDINALITY + 1,
+ PX_VRU_CLUSTER_CREATE_ID,
+ m_shape_circular(
+ m_circular_shape(
+ PX_VRU_CLUSTER_CREATE_RADIUS
+ )),
+ PX_VRU_CLUSTER_CREATE_PROFILE
+ )));
+ p_updated_cluster_vam.vam.vamParameters.vruClusterOperationContainer := valueof(p_vru_cluster_operation_container);
+ vamPort.send(m_vruReq(p_updated_cluster_vam));
+ log("*** " & testcasename() & ": INFO: VAM cluster creation done ***");
+
+ return true;
+ } // End of function f_initiate_cluster_iut_as_member
+
+ /**
+ * @desc Terminate a cluster initiated by the IUT
+ */
+ function f_terminate_cluster(in VAM p_vam) runs on ItsVru {
+ var VAM v_updated_cluster_vam;
+ var VamParameters v_vam_parameters := p_vam.vam.vamParameters;
+
+ // Send x VAM with leaving VRU cluster indication
+ v_updated_cluster_vam := valueof(
+ m_vamMsg(
+ 0, // Updated before to be sent
+ m_vru_awareness(
+ 0, // Updated before to be sent
+ m_vam_parameters(
+ m_basic_container(
+ StationType_bus_,
+ m_reference_position_with_confidence(
+ v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse,
+ v_vam_parameters.basicContainer.referencePosition.altitude
+ )),
+ m_vru_high_frequency_container(
+ v_vam_parameters.vruHighFrequencyContainer.heading,
+ m_speed(
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX,
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence
+ ),
+ v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.curvature,
+ v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode,
+ v_vam_parameters.vruHighFrequencyContainer.yawRate,
+ v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.vruLanePosition,
+ v_vam_parameters.vruHighFrequencyContainer.environment,
+ v_vam_parameters.vruHighFrequencyContainer.movementControl,
+ v_vam_parameters.vruHighFrequencyContainer.orientation,
+ v_vam_parameters.vruHighFrequencyContainer.rollAngle,
+ v_vam_parameters.vruHighFrequencyContainer.deviceUsage
+ ),
+ -, -,
+ m_vru_cluster_operation_container(
+ -,
+ m_cluster_leave_info(
+ v_vam_parameters.vruClusterInformationContainer.vruClusterInformation.clusterId,
+ Vru_clusterLeaveReason_cancelledJoin
+ ))))));
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ for (var integer i :=0; i < PX_VRU_CLUSTER_CREATE_CARDINALITY; i := i + 1) {
+ v_updated_cluster_vam.header.stationId := f_getTsStationId() + 1 + i;
+ v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ vamPort.send(m_vruReq(v_updated_cluster_vam));
+ f_sleep(0.1);
+ } // End of 'for' statement
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": INFO: VRU cluster initiated by the IUT terminated ***");
+ } // End of function f_terminate_cluster
+
+ /**
+ * @desc Terminate a simulated cluster
+ */
+ function f_terminate_simulated_cluster(in VAM p_vam) runs on ItsVru {
+ p_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ p_vam.vam.vamParameters.vruClusterOperationContainer := valueof(
+ m_vru_cluster_operation_container(
+ -, -,
+ m_cluster_breakup_info(
+ PX_VRU_CLUSTER_BREAKUP_REASON
+ )));
+ vamPort.send(m_vruReq(p_vam));
+ log("*** " & testcasename() & ": INFO: VRU simulated cluster terminatted ***");
+ } // End of function f_terminate_simulated_cluster
+
+ /**
+ * @desc Verifiy 'euclidian distance (P1, P2) > minReferencePointPositonChangeThreshold'
+ * @param p_p1 Initial position
+ * @param p_p2 Next position
+ * @param p_threshold Threshold value for the comparison
+ * @param p_comparison Comparison operation: -1 is <, 0 is == and 1 is >
+ * @return true if comparison is verified, false otherwise
+ */
+ function f_verify_euclidian_distance(
+ in ReferencePositionWithConfidence p_p1,
+ in ReferencePositionWithConfidence p_p2,
+ in float p_threshold,
+ in integer p_comparison
+ ) return boolean {
+ return fx_verify_euclidian_distance(p_p1.latitude, p_p1.longitude, p_p2.latitude, p_p2.longitude, p_threshold, p_comparison);
+ }
+
+ /**
+ * @desc Verifiy 'abs(V2 - V1) > minGroundSpeedChangeThreshold'
+ * @param p_p1 Initial speed
+ * @param p_p2 Next speed
+ * @param p_threshold Threshold value for the comparison
+ * @param p_comparison Comparison operation: -1 is <, 0 is == and 1 is >
+ * @return true if comparison is verified, false otherwise
+ */
+ function f_verify_delta_speed(
+ in Speed p_speed1,
+ in Speed p_speed2,
+ in float p_threshold,
+ in integer p_comparison
+ ) return boolean {
+ return fx_verify_delta(p_speed1.speedValue, p_speed2.speedValue, p_threshold, p_comparison);
+ }
+
+ /**
+ * @desc Verifiy 'abs(H2 - H1) > minGroundVelocityOrientationChangeThreshold'
+ * @param p_p1 Initial heading
+ * @param p_p2 Next heading
+ * @param p_threshold Threshold value for the comparison
+ * @param p_comparison Comparison operation: -1 is <, 0 is == and 1 is >
+ * @return true if comparison is verified, false otherwise
+ */
+ function f_verify_delta_Wgs84Angle(
+ in Wgs84Angle p_angle1,
+ in Wgs84Angle p_angle2,
+ in float p_threshold,
+ in integer p_comparison
+ ) return boolean {
+ return fx_verify_delta(p_angle1.value_, p_angle2.value_, p_threshold, p_comparison);
+ }
+
+ } // End of group LibHelpers_Functions
+
+ group message_format {
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_01
+ */
+ function f_TC_VBS_MSGF_BV_01() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg_any
+ )) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM messageID is set to 16 ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_01
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_02
+ */
+ function f_TC_VBS_MSGF_BV_02() runs on ItsVru {
+ // Local variables
+ var integer v_lower_bound; // Time unit is millisecond
+ var integer v_upper_bound; // Time unit is millisecond
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ v_lower_bound := (f_getCurrentTime() - 5000) mod 65536;
+ v_upper_bound := (f_getCurrentTime() + 5000) mod 65536;
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ (v_lower_bound .. v_upper_bound)
+ )))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing a generation time modulo 2^16 ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness
+ ))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": ERROR: VAM containing an invalid generation time ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_02
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_03
+ */
+ function f_TC_VBS_MSGF_BV_03() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Set VRU profile
+ f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE));
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ mw_basic_container(
+ (StationType_pedestrian_ .. StationType_motorcycle_)
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing valid StationType received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ mw_basic_container(
+ (StationType_lightVruVehicle .. StationType_animal)
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing a valid StationType received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ mw_basic_container
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": FAIL: VAM containing an invalid StationType received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_03
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_04
+ */
+ function f_TC_VBS_MSGF_BV_04() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ mw_basic_container(
+ -,
+ LibItsVru_Templates.mw_reference_position
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing reference position ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_04
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_05
+ */
+ function f_TC_VBS_MSGF_BV_05() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -,
+ mw_vru_high_frequency_container(
+ -, -, -,
+ mw_curvature
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing curvature value ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_05
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_06
+ */
+ function f_TC_VBS_MSGF_BV_06() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -,
+ mw_vru_high_frequency_container(
+ -, -, -, -, -, -,
+ mw_lateral_acceleration
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing yaw-rate value ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_06
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_07
+ */
+ function f_TC_VBS_MSGF_BV_07() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -,
+ mw_vru_high_frequency_container(
+ -, -, -, -, -,
+ mw_yaw_rate
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing yaw-rate value ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_07
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_08
+ */
+ function f_TC_VBS_MSGF_BV_08() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -,
+ mw_vru_high_frequency_container(
+ -, -, -, -, -, -, -, -,
+ mw_generalized_lane_position
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing VRU lane position value ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_08
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_09
+ */
+ function f_TC_VBS_MSGF_BV_09() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not(PICS_VAM_GENERATION and PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST)) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Set VRU profile
+ f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE));
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -,
+ mw_vru_high_frequency_container(
+ -, -, -, -, -, -, -, -, -, -, -, -,
+ mw_cartesian_angle(
+ complement((500 .. 3100))
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing RollAngle angle value (500 .. 3100 range excluded) ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_09
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_10
+ */
+ function f_TC_VBS_MSGF_BV_10() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -,
+ mw_vru_high_frequency_container(
+ -, -, -, -, -, -, -, -, -, -, -, -, -,
+ (0 .. 8)
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing VRU lane position value ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_10
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_11
+ */
+ function f_TC_VBS_MSGF_BV_11() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_PROFILE_PEDESTRIAN or PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_PROFILE_PEDESTRIAN and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Set VRU profile
+ f_utTriggerEvent(m_setVruProfile(Vru_profile_pedestrian));
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -,
+ mw_vru_high_frequency_container(
+ mw_wgs84_angle
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing VRU lane position value ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_11
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_12
+ */
+ function f_TC_VBS_MSGF_BV_12() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -,
+ -,
+ mw_vru_low_frequency_container(
+ mw_vru_profile_and_subprofile_pedestrian
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing profile and sub-profile of the VRU ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_12
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_13
+ */
+ function f_TC_VBS_MSGF_BV_13() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -,
+ -,
+ mw_vru_low_frequency_container(
+ -,
+ ?
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing class zize ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_13
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_14
+ */
+ function f_TC_VBS_MSGF_BV_14() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_PROFILE_BICYCLIST or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Set VRU profile
+ f_utTriggerEvent(m_setVruProfile(Vru_profile_bicyclistAndLightVruVehicle));
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -,
+ -,
+ mw_vru_low_frequency_container(
+ -, -,
+ ?
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing class zize ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_14
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_15
+ */
+ group f_TC_VBS_MSGF_BV_15 {
+
+ function f_TC_VBS_MSGF_BV_15_cluster_leader() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Set the IUT in VRU_ACTIVE_CLUSTER_LEADER mode
+ if (f_create_cluster_iut_as_leader(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ // f_sleep(PX_TNOAC);
+ // // Cluster leader send a VA message to indicate the cluster presence
+ // vamPort.send(m_vruReq(v_cluster_vam));
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ // Delete the cluster
+ f_terminate_cluster(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: VAM cluster deleted ***");
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_15_cluster_leader
+
+ function f_TC_VBS_MSGF_BV_15_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE));
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Wait for the IUT to create the cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ vamPort.clear;
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ mw_vru_cluster_information_container(
+ mw_vru_cluster_information(
+ -, -, -,
+ complement('0000'B)
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_MSGF_BV_15_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_15
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_16
+ */
+ group f_TC_VBS_MSGF_BV_16 {
+
+ function f_TC_VBS_MSGF_BV_16_cluster_member() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Set the IUT in VRU_PASSIVE mode
+ if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ // Do not sent VAM cluster anymore to trigger clusterLeaveReason with clusterLeaderLost
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and no more VAM cluster sent ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_16_cluster_member
+
+ function f_TC_VBS_MSGF_BV_16_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE));
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Wait for the IUT to join the cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ -,
+ mw_cluster_leave_info(
+ -,
+ Vru_clusterLeaveReason_clusterLeaderLost
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_clusterLeaderLost ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_MSGF_BV_16_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_16
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_17
+ */
+ group f_TC_VBS_MSGF_BV_17 {
+
+ function f_TC_VBS_MSGF_BV_17_cluster_member() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Set the IUT in VRU_PASSIVE mode
+ if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ // Sent VAM cluster anymore to trigger clusterLeaveReason with clusterDisbandedByLeader
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ f_sleep(1.0);
+ // TODO Update pathHistory
+ v_cluster_vam.vam.vamParameters.vruClusterOperationContainer := valueof(
+ m_vru_cluster_operation_container(
+ -,
+ m_cluster_leave_info(
+ v_cluster_vam.vam.vamParameters.vruClusterInformationContainer.vruClusterInformation.clusterId,
+ Vru_clusterLeaveReason_clusterDisbandedByLeader
+ )));
+ v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ log(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: Disband the cluster ***");
+ vamPort.send(m_vruReq(v_cluster_vam));
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the VAM cluster was disbanded ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_17_cluster_member
+
+ function f_TC_VBS_MSGF_BV_17_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE));
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Wait for the IUT to join the cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ -,
+ mw_cluster_leave_info(
+ -,
+ Vru_clusterLeaveReason_clusterDisbandedByLeader
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_clusterDisbandedByLeader ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_MSGF_BV_17_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_17
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_18
+ */
+ group f_TC_VBS_MSGF_BV_18 {
+
+ function f_TC_VBS_MSGF_BV_18_cluster_member() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ // Set the IUT in VRU_PASSIVE mode
+ if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ // Sent VAM cluster anymore to trigger clusterLeaveReason with outOfClusterBoundingBox
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ f_sleep(1.0);
+ // TODO Update pathHistory
+ v_cluster_vam.vam.vamParameters.basicContainer.referencePosition.latitude := v_cluster_vam.vam.vamParameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_OUT_OF_BOX;
+ v_cluster_vam.vam.vamParameters.basicContainer.referencePosition.longitude := v_cluster_vam.vam.vamParameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_OUT_OF_BOX;
+ v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ log(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: Disband the cluster ***");
+ vamPort.send(m_vruReq(v_cluster_vam));
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the IUT is out of box ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_18_cluster_member
+
+ function f_TC_VBS_MSGF_BV_18_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ // Join the cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ -,
+ mw_cluster_leave_info(
+ -,
+ Vru_clusterLeaveReason_outOfClusterBoundingBox
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterBoundingBox ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_MSGF_BV_18_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_18
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_19
+ */
+ group f_TC_VBS_MSGF_BV_19 {
+
+ function f_TC_VBS_MSGF_BV_19_cluster_member() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ // Set the IUT in VRU_PASSIVE mode
+ if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ // Sent VAM cluster anymore to trigger clusterLeaveReason with outOfClusterSpeedRange
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ f_sleep(1.0);
+ // TODO Update pathHistory
+ v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue := v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX;
+ v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ log(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: Leave the cluster ***");
+ vamPort.send(m_vruReq(v_cluster_vam));
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the IUT is out of speed range ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_19_cluster_member
+
+ function f_TC_VBS_MSGF_BV_19_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ // Join the cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ -,
+ mw_cluster_leave_info(
+ -,
+ Vru_clusterLeaveReason_outOfClusterSpeedRange
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterSpeedRange ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_MSGF_BV_19_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_19
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_20
+ */
+ group f_TC_VBS_MSGF_BV_20 {
+
+ function f_TC_VBS_MSGF_BV_20_cluster_member_1() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ // Set the IUT in VRU_PASSIVE mode
+ if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ }
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ // Sent VAM cluster anymore to trigger clusterLeaveReason with joiningAnotherCluster
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ f_sleep(1.0);
+ // TODO Update pathHistory
+ v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue := v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX;
+ v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ log(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: Disband the cluster ***");
+ vamPort.send(m_vruReq(v_cluster_vam));
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the IUT is out of box ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_20_cluster_member_1
+
+ function f_TC_VBS_MSGF_BV_20_cluster_member_2() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Set the IUT in VRU_PASSIVE mode
+ if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ // Sent VAM cluster to trigger clusterLeaveReason with joiningAnotherCluster
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ f_sleep(1.0);
+ // TODO Update pathHistory
+ v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ log(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: joiningAnotherCluster the cluster ***");
+ vamPort.send(m_vruReq(v_cluster_vam));
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_20_cluster_member_2
+
+ function f_TC_VBS_MSGF_BV_20_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ // Join the first cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Join the 2nd cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ mw_cluster_join_info(
+ ? // FIXME FSCOM Set the correct cluster id
+ ),
+ mw_cluster_leave_info(
+ -,
+ Vru_clusterLeaveReason_joiningAnotherCluster
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_joiningAnotherCluster ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_MSGF_BV_20_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_20
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_21
+ */
+ group f_TC_VBS_MSGF_BV_21 {
+
+ function f_TC_VBS_MSGF_BV_21_cluster_member_1() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ // Set the IUT in VRU_PASSIVE mode
+ if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ }
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ // Sent VAM cluster anymore to trigger clusterLeaveReason with joiningAnotherCluster
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ f_sleep(1.0);
+ // TODO Update pathHistory
+ v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue := v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX;
+ v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ log(v_cluster_vam);
+ vamPort.send(m_vruReq(v_cluster_vam));
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the IUT is out of box ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_21_cluster_member_1
+
+ function f_TC_VBS_MSGF_BV_21_cluster_member_2() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Set the IUT in VRU_PASSIVE mode
+ if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ // Sent VAM cluster to trigger clusterLeaveReason with joiningAnotherCluster
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ f_sleep(1.0);
+ // TODO Update pathHistory
+ v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ log(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: joiningAnotherCluster the cluster ***");
+ vamPort.send(m_vruReq(v_cluster_vam));
+ } // End of 'for' statement
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_201_cluster_member_2
+
+ function f_TC_VBS_MSGF_BV_21_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ // Join the first cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Join the 2nd cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ -,
+ mw_cluster_leave_info(
+ -,
+ Vru_clusterLeaveReason_cancelledJoin
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_cancelledJoin ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_MSGF_BV_21_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_21
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_22
+ */
+ group f_TC_VBS_MSGF_BV_22 {
+
+ function f_TC_VBS_MSGF_BV_22_cluster_member() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ // Set the IUT in VRU_PASSIVE mode
+ if (f_initiate_cluster_iut_as_member(m_vru_cluster_operation_container(
+ m_cluster_join_info(
+ PX_VRU_CLUSTER_CREATE_ID,
+ PX_VRU_REPETITION
+ )),
+ PX_VRU_MAX_CLUSTER_SIZE + 1,
+ v_fisrt_vam,
+ v_cluster_vam
+ ) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ log("*** " & testcasename() & ": PASS: Initiating cluster creation with invalid cardinality ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_22_cluster_member
+
+ function f_TC_VBS_MSGF_BV_22_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ // Joinning cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ -,
+ mw_cluster_leave_info(
+ -,
+ Vru_clusterLeaveReason_failedJoin
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_failedJoin ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_MSGF_BV_22_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_22
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_23
+ */
+ group f_TC_VBS_MSGF_BV_23 {
+
+ function f_TC_VBS_MSGF_BV_23_cluster_leader() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ // Set the IUT in VRU_ACTIVE_CLUSTER_LEADER mode
+ if (f_create_cluster_iut_as_leader(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ log("*** " & testcasename() & ": INFO: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ // f_sleep(PX_TNOAC);
+ for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) {
+ v_cluster_vam.header.stationId := f_getTsStationId() + 10;
+ v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536;
+ v_cluster_vam.vam.vamParameters.vruClusterInformationContainer.vruClusterInformation.clusterId := v_cluster_vam.vam.vamParameters.vruClusterInformationContainer.vruClusterInformation.clusterId + 1 // Same Cluster info with different cluster ID
+ vamPort.send(m_vruReq(v_cluster_vam));
+ f_sleep(0.1);
+ } // End of 'for' statement
+
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ // Delete the cluster
+ f_terminate_cluster(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: VAM cluster deleted ***");
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_23_cluster_leader
+
+ function f_TC_VBS_MSGF_BV_23_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ // Join the cluster and wait for colliding cluster event raised
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ -,
+ mw_cluster_leave_info(
+ -,
+ Vru_clusterLeaveReason_safetyCondition
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_safetyCondition ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ }
+
+ } // End of group f_TC_VBS_MSGF_BV_23
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_24
+ */
+ group f_TC_VBS_MSGF_BV_24 {
+
+ function f_TC_VBS_MSGF_BV_24_cluster_leader() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+ var VamParameters v_vam_parameters;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_create_cluster_iut_as_leader(
+ v_fisrt_vam,
+ v_cluster_vam
+ );
+ v_vam_parameters := v_cluster_vam.vam.vamParameters;
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ f_sleep(PX_TNOAC);
+ // Bus cluster leader send a VA message to indicate the cluster presence and to indicate cluster completed to the IUT
+ vamPort.send(
+ m_vruReq(
+ m_vamMsg(
+ f_getTsStationId(),
+ m_vru_awareness(
+ f_getCurrentTime() mod 65536,
+ m_vam_parameters(
+ m_basic_container(
+ StationType_bus_,
+ m_reference_position_with_confidence(
+ v_vam_parameters.basicContainer.referencePosition.latitude,
+ v_vam_parameters.basicContainer.referencePosition.longitude,
+ v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse,
+ v_vam_parameters.basicContainer.referencePosition.altitude
+ )),
+ m_vru_high_frequency_container(
+ v_vam_parameters.vruHighFrequencyContainer.heading,
+ m_speed(
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX,
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence
+ ),
+ v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration
+ ),
+ -,
+ m_vru_cluster_information_container(
+ m_vru_cluster_information(
+ PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL,
+ PX_VRU_CLUSTER_CREATE_ID,
+ m_shape_circular(
+ m_circular_shape(
+ PX_VRU_CLUSTER_CREATE_RADIUS
+ )),
+ PX_VRU_CLUSTER_CREATE_PROFILE
+
+ )))))));
+ f_sleep(PX_TNOAC);
+ vamPort.send(
+ m_vruReq(
+ m_vamMsg(
+ f_getTsStationId(),
+ m_vru_awareness(
+ f_getCurrentTime() mod 65536,
+ m_vam_parameters(
+ m_basic_container(
+ StationType_bus_,
+ m_reference_position_with_confidence(
+ v_vam_parameters.basicContainer.referencePosition.latitude,
+ v_vam_parameters.basicContainer.referencePosition.longitude,
+ v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse,
+ v_vam_parameters.basicContainer.referencePosition.altitude
+ )),
+ m_vru_high_frequency_container(
+ v_vam_parameters.vruHighFrequencyContainer.heading,
+ m_speed(
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX,
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence
+ ),
+ v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration
+ ),
+ -,
+ m_vru_cluster_information_container(
+ m_vru_cluster_information(
+ PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL,
+ PX_VRU_CLUSTER_CREATE_ID,
+ m_shape_circular(
+ m_circular_shape(
+ PX_VRU_CLUSTER_CREATE_RADIUS
+ )),
+ PX_VRU_CLUSTER_CREATE_PROFILE
+ )),
+ m_vru_cluster_operation_container(
+ -, -,
+ m_cluster_breakup_info(
+ Vru_ClusterBreakupReason_clusteringPurposeCompleted
+
+ )))))));
+ log("*** " & testcasename() & ": PASS: VAM cluster created and terminated ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+ }
+
+ function f_TC_VBS_MSGF_BV_24_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ // Join the cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ -, -,
+ m_cluster_breakup_info(
+ Vru_ClusterBreakupReason_clusteringPurposeCompleted
+
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_ClusterBreakupReason_clusteringPurposeCompleted ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_MSGF_BV_24_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_24
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_25
+ */
+ group f_TC_VBS_MSGF_BV_25 {
+
+ function f_TC_VBS_MSGF_BV_25_cluster_leader() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VamInd v_fisrt_vam;
+ var VamParameters v_vam_parameters;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ // Wait for first VA message from the IUT
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -,
+ mw_vru_low_frequency_container
+ ))))) -> value v_fisrt_vam {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": INFO: VAM from IUT is received ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+ // Send VA message covering condition to join the cluster (similar speed, closed position, same direction)
+ v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters;
+ vamPort.send(
+ m_vruReq(
+ m_vamMsg(
+ f_getTsStationId(),
+ m_vru_awareness(
+ f_getCurrentTime() mod 65536,
+ m_vam_parameters(
+ m_basic_container(
+ StationType_bus_,
+ m_reference_position_with_confidence(
+ v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX,
+ v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse,
+ v_vam_parameters.basicContainer.referencePosition.altitude
+ )),
+ m_vru_high_frequency_container(
+ v_vam_parameters.vruHighFrequencyContainer.heading,
+ m_speed(
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX,
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence
+ ),
+ v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.curvature,
+ v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode,
+ v_vam_parameters.vruHighFrequencyContainer.yawRate,
+ v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration,
+ v_vam_parameters.vruHighFrequencyContainer.vruLanePosition,
+ v_vam_parameters.vruHighFrequencyContainer.environment,
+ v_vam_parameters.vruHighFrequencyContainer.movementControl,
+ v_vam_parameters.vruHighFrequencyContainer.orientation,
+ v_vam_parameters.vruHighFrequencyContainer.rollAngle,
+ v_vam_parameters.vruHighFrequencyContainer.deviceUsage
+ ),
+ -,
+ m_vru_cluster_information_container(
+ m_vru_cluster_information(
+ PX_VRU_CLUSTER_CREATE_CARDINALITY,
+ PX_VRU_CLUSTER_CREATE_ID,
+ m_shape_circular(
+ m_circular_shape(
+ PX_VRU_CLUSTER_CREATE_RADIUS
+ )),
+ PX_VRU_CLUSTER_CREATE_PROFILE
+ )),
+ m_vru_cluster_operation_container(
+ m_cluster_join_info(
+ PX_VRU_CLUSTER_CREATE_ID
+ )))))));
+ log("*** " & testcasename() & ": INFO: VAM cluster initiated ***");
+ // Wait for the IUT to join the cluster
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ mw_vru_cluster_information_container,
+ m_vru_cluster_operation_container(
+ mw_cluster_join_info(
+ PX_VRU_CLUSTER_CREATE_ID
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": INFO: IUT joined the cluster ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ f_sleep(PX_TNOAC);
+ // Cluster leader send a VA message to indicate the cluster presence and cluster completed
+ vamPort.send(
+ m_vruReq(
+ m_vamMsg(
+ f_getTsStationId(),
+ m_vru_awareness(
+ f_getCurrentTime() mod 65536,
+ m_vam_parameters(
+ m_basic_container(
+ StationType_bus_,
+ m_reference_position_with_confidence(
+ v_vam_parameters.basicContainer.referencePosition.latitude,
+ v_vam_parameters.basicContainer.referencePosition.longitude,
+ v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse,
+ v_vam_parameters.basicContainer.referencePosition.altitude
+ )),
+ m_vru_high_frequency_container(
+ v_vam_parameters.vruHighFrequencyContainer.heading,
+ m_speed(
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX,
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence
+ ),
+ v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration
+ ),
+ -,
+ m_vru_cluster_information_container(
+ m_vru_cluster_information(
+ PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL,
+ PX_VRU_CLUSTER_CREATE_ID,
+ m_shape_circular(
+ m_circular_shape(
+ PX_VRU_CLUSTER_CREATE_RADIUS
+ )),
+ PX_VRU_CLUSTER_CREATE_PROFILE
+
+ )))))));
+ f_sleep(PX_TNOAC);
+ vamPort.send(
+ m_vruReq(
+ m_vamMsg(
+ f_getTsStationId(),
+ m_vru_awareness(
+ f_getCurrentTime() mod 65536,
+ m_vam_parameters(
+ m_basic_container(
+ StationType_bus_,
+ m_reference_position_with_confidence(
+ v_vam_parameters.basicContainer.referencePosition.latitude,
+ v_vam_parameters.basicContainer.referencePosition.longitude,
+ v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse,
+ v_vam_parameters.basicContainer.referencePosition.altitude
+ )),
+ m_vru_high_frequency_container(
+ v_vam_parameters.vruHighFrequencyContainer.heading,
+ m_speed(
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX,
+ v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence
+ ),
+ v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration
+ ),
+ -,
+ m_vru_cluster_information_container(
+ m_vru_cluster_information(
+ PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL,
+ PX_VRU_CLUSTER_CREATE_ID,
+ m_shape_circular(
+ m_circular_shape(
+ PX_VRU_CLUSTER_CREATE_RADIUS
+ )),
+ PX_VRU_CLUSTER_CREATE_PROFILE
+ )),
+ m_vru_cluster_operation_container(
+ -, -,
+ m_cluster_breakup_info(
+ PX_VRU_CLUSTER_BREAKUP_REASON
+
+ )))))));
+ log("*** " & testcasename() & ": PASS: VAM cluster created and terminated ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+ }
+
+ function f_TC_VBS_MSGF_BV_25_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ // Join the cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ -, -,
+ m_cluster_breakup_info(
+ Vru_ClusterBreakupReason_leaderMovedOutOfClusterBoundingBox
+
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_ClusterBreakupReason_leaderMovedOutOfClusterBoundingBox ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_MSGF_BV_25_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_25
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ group f_TC_VBS_MSGF_BV_31 {
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_31
+ */
+ function f_TC_VBS_MSGF_BV_31_iut() runs on ItsVru {
+ // Local variables
+ var VamInd v_fisrt_vam, v_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ mw_vru_motion_prediction_container(?)
+ ))))) -> value v_fisrt_vam{
+ tc_ac.stop;
+
+ log("*** " & testcasename() & ": INFO: First VAM containing VruMotionPredictionContainer value received ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ mw_vru_motion_prediction_container(?)
+ ))))) -> value v_vam {
+ tc_ac.stop;
+
+ if (lengthof(v_fisrt_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory) < lengthof(v_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory)) {
+ log("*** " & testcasename() & ": PASS: VAM containing VruMotionPredictionContainer value received with increased number of PathHistory ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ } else {
+ log("*** " & testcasename() & ": FAIL: Invalid number of PathPoint in PathHistory ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ }
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_31_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_31
+
+ group f_TC_VBS_MSGF_BV_32 {
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_32
+ */
+ function f_TC_VBS_MSGF_BV_32_iut() runs on ItsVru {
+ // Local variables
+ var VamInd v_fisrt_vam, v_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ mw_vru_motion_prediction_container(
+ -,
+ ?
+ )))))) -> value v_fisrt_vam{
+ tc_ac.stop;
+
+ log("*** " & testcasename() & ": INFO: First VAM containing VruMotionPredictionContainer value received ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ mw_vru_motion_prediction_container(?)
+ ))))) -> value v_vam {
+ tc_ac.stop;
+
+ if (lengthof(v_fisrt_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory) < lengthof(v_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory)) {
+ log("*** " & testcasename() & ": PASS: VAM containing VruMotionPredictionContainer value received with increased number of PathHistory ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ } else {
+ log("*** " & testcasename() & ": FAIL: Invalid number of PathPoint in PathHistory ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ }
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_32_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_32
+
+ group f_TC_VBS_MSGF_BV_33 {
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_33
+ */
+ function f_TC_VBS_MSGF_BV_33_cluster_approching() runs on ItsVru {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ // Set the IUT in VRU-PASSIVE mode
+ if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam, PX_VRU_CLUSTER_CREATE_ID + 1) == false) { // Use a different cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ f_sleep(PX_TNOAC);
+ // Cluster leader send a VA message to indicate the cluster presence
+ vamPort.send(m_vruReq(v_cluster_vam));
+ log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ // Delete the cluster
+ f_terminate_cluster(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: VAM cluster deleted ***");
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_MSGF_BV_33_cluster_approching
+
+ /**
+ * @desc TP Function for TC_VBS_MSGF_BV_33
+ */
+ function f_TC_VBS_MSGF_BV_33_iut() runs on ItsVru {
+ // Local variables
+ var VamInd v_fisrt_vam, v_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ mw_vru_motion_prediction_container(
+ -,
+ ?
+ )))))) -> value v_fisrt_vam{
+ tc_ac.stop;
+
+ log("*** " & testcasename() & ": INFO: First VAM containing VruMotionPredictionContainer value received ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ mw_vru_motion_prediction_container(
+ -, -,
+ {
+ *,
+ mw_safe_distance_indication(-, -, ?),
+ *
+ }
+ )))))) -> value v_vam {
+ tc_ac.stop;
+
+ log("*** " & testcasename() & ": PASS: VAM containing VruMotionPredictionContainer value received with increased number of PathHistory ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_MSGF_BV_33_iut
+
+ } // End of group f_TC_VBS_MSGF_BV_33
+
+
+
+
+
+
+
+ } // End of group message_format
+
+ group vruLowerLayerParameters {
+
+ /**
+ * @desc TP Function for TC_VBS_IFGN_BV_01
+ */
+ function f_TC_VBS_IFGN_BV_01() runs on ItsVru {
+
+ // Local variables
+ const UInt8 c_gnNhBtpB := 2;
+ const UInt16 c_btp_port := 2018;
+ var boolean v_cond_1 := false, v_cond_2 := false;
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [v_cond_1 == false] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, c_gnNhBtpB)) {
+ log("*** " & testcasename() & ": INFO: Expected VRU message encapsultated in BTP-B packet received ***");
+ v_cond_1 := true;
+ repeat;
+ }
+ [v_cond_2 == false] vamPort.receive(mw_vamIndWithBtpParameters(mw_vamMsg_any, c_btp_port)) {
+ log("*** " & testcasename() & ": INFO: Expected VRU message encapsultated in BTP-B packet received ***");
+ v_cond_2 := true;
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [v_cond_1 == true and v_cond_2 == true] vamPort.receive(mw_vamIndWithBtpParameters(mw_vamMsg_any)) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: Expected VRU message encapsultated in BTP-B packet with the correct BTP port received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, omit)) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": INCONC: no GN NH information in CpmInd ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ [] vamPort.receive(mw_vamInd(mw_vamMsg_any)) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": FAIL: Expected VRU message received, but not encapsulated in BTP-B packet ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ }
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_IFGN_BV_01
+
+ /**
+ * @desc TP Function for TC_VBS_IFGN_BV_02
+ */
+ function f_TC_VBS_IFGN_BV_02() runs on ItsVru {
+
+ // Local variables
+ const UInt8 c_gnHtTsb := 5;
+ const UInt8 c_GnHstSingleHop := 0;
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, c_gnHtTsb, c_GnHstSingleHop)) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: Expected VRU message encapsulated in SHB packet received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, omit, omit)) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": INCONC: no GN HT/HST information in CpmInd ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ [] vamPort.receive(mw_vamInd(mw_vamMsg_any)) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": FAIL: Expected VRU message received, but not encapsulated in SHB packet ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ }
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_IFGN_BV_02
+
+ /**
+ * @desc TP Function for TC_VBS_IFGN_BV_03
+ */
+ function f_TC_VBS_IFGN_BV_03() runs on ItsVru {
+
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, -, -, -, 2)) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: Expected VRU message received encapsulted in GN packet with correct TC value ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ }
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_IFGN_BV_03
+
+ } // End of group vruLowerLayerParameters
+
+ group vruSecurityEntity {
+ // Not implemented
+ } // End of group vruSecurityEntity
+
+ group vruTransmittingVAMs {
+
+ /**
+ * @desc TP Function for TC_VBS_TRANS_BV_01
+ */
+ function f_TC_VBS_TRANS_BV_01() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ omit,
+ omit
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM not containing vruClusterInformationContainer and not containing vruClusterOperationContainer ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_TRANS_BV_01
+
+ group f_TC_VBS_TRANS_BV_02 {
+
+ function f_TC_VBS_TRANS_BV_02_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ // Join the cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ mw_vru_cluster_information_container
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing vruClusterInformationContainer ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_TRANS_BV_02_iut
+
+ } // End of group f_TC_VBS_TRANS_BV_02
+
+ group f_TC_VBS_TRANS_BV_03 {
+
+ function f_TC_VBS_TRANS_BV_03_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ f_utTriggerEvent(m_leaveClusterWithCause(Vru_clusterLeaveReason_notProvided));
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ omit,
+ mw_vru_cluster_operation_container
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing vruClusterOperationContainer ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness
+ ))) {
+ log("*** " & testcasename() & ": INFO: Unexpected VAM, skip it ***");
+ repeat;
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_TRANS_BV_03_iut
+
+ } // End of group f_TC_VBS_TRANS_BV_03
+
+ group f_TC_VBS_TRANS_BV_04 {
+
+ function f_TC_VBS_TRANS_BV_04_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ omit,
+ omit
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing vruClusterOperationContainer ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness
+ ))) {
+ log("*** " & testcasename() & ": INFO: Unexpected VAM, skip it ***");
+ repeat;
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_TRANS_BV_04_iut
+
+ } // End of group f_TC_VBS_TRANS_BV_04
+
+ } // End of group vruTransmittingVAMs
+
+ group vruTransitionTriggering {
+
+ /**
+ * @desc TP Function for TC_VBS_CLTR_BV_01
+ */
+ function f_TC_VBS_CLTR_BV_01() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_CLUSTERING or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VA message sent ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_CLTR_BV_01
+
+ group f_TC_VBS_CLTR_BV_02 {
+
+ function f_TC_VBS_CLTR_BV_02_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Wait for the cluster creation
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ mw_vru_cluster_information_container(
+ mw_vru_cluster_information(
+ PX_VRU_MIN_CLUSTER_SIZE,
+ -, -,
+ PX_VRU_CLUSTER_CREATE_PROFILE
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterBoundingBox ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_CLTR_BV_02_iut
+
+ } // End of group f_TC_VBS_CLTR_BV_02
+
+ /**
+ * @desc TP Function for TC_VBS_CLTR_BV_01
+ */
+ function f_TC_VBS_CLTR_BV_03() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_CLUSTERING or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": INFO: VA message received ***");
+ // Change state to idle
+ f_utTriggerEvent(m_setVbsState(0));
+ // Wait for stable state
+ f_sleep(1.0);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VA message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ vamPort.clear;
+ tc_noac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId()
+ ))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": FAIL: VA message shall not be sent ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ }
+ [] tc_noac.timeout {
+ log("*** " & testcasename() & ": PASS: No VA message received anymore ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_CLTR_BV_03
+
+ group f_TC_VBS_CLTR_BV_04 {
+
+ function f_TC_VBS_CLTR_BV_04_cluster_leader() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ if (f_create_cluster_iut_as_leader(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ }
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***");
+
+ // Set the IUT in VRU_ACTIVE_CLUSTER_LEADER mode
+ // Delete the cluster
+ f_terminate_cluster(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: VAM cluster deleted ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_STANDALONE ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_CLTR_BV_04_cluster_leader
+
+ function f_TC_VBS_CLTR_BV_04_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Wait for the cluster deletion
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ f_sleep(1.0); // Wait for stable state
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ omit,
+ omit
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: IUT stops sending VAM cluster ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_CLTR_BV_04_iut
+
+ } // End of group f_TC_VBS_CLTR_BV_04
+
+ group f_TC_VBS_CLTR_BV_05 {
+
+ function f_TC_VBS_CLTR_BV_05_cluster_leader() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ if (f_initiate_cluster_iut_as_member(m_vru_cluster_operation_container(
+ m_cluster_join_info(
+ PX_VRU_CLUSTER_CREATE_ID,
+ PX_VRU_REPETITION
+ )),
+ PX_VRU_MAX_CLUSTER_SIZE + 1,
+ v_fisrt_vam,
+ v_cluster_vam
+ ) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***");
+
+ // Test Body
+ log("*** " & testcasename() & ": PASS: VAM cluster is initiated ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ // Delete the cluster
+ f_terminate_cluster(v_cluster_vam);
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_CLTR_BV_05_cluster_leader
+
+ function f_TC_VBS_CLTR_BV_05_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Wait for the cluster deletion
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ f_sleep(1.0); // Wait for stable state
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ omit,
+ mw_vru_cluster_operation_container(
+ mw_cluster_join_info
+ )))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: IUT sends indication of joining a cluster for timeClusterJoinNotification ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_CLTR_BV_05_iut
+
+ } // End of group f_TC_VBS_CLTR_BV_05
+
+ group f_TC_VBS_CLTR_BV_06 {
+
+
+ } // End of group f_TC_VBS_CLTR_BV_06
+
+ group f_TC_VBS_CLTR_BV_07 {
+
+
+ } // End of group f_TC_VBS_CLTR_BV_07
+
+ group f_TC_VBS_CLTR_BV_08 {
+
+
+ } // End of group f_TC_VBS_CLTR_BV_08
+
+ group f_TC_VBS_CLTR_BV_09 {
+
+
+ } // End of group f_TC_VBS_CLTR_BV_09
+
+ group f_TC_VBS_CLTR_BV_10 {
+
+
+ } // End of group f_TC_VBS_CLTR_BV_10
+
+ } // End of group vruTransitionTriggering
+
+ group vruTriggeringCondition {
+
+ /**
+ * @desc TP Function for TC_VBS_TRCN_BV_01
+ */
+ function f_TC_VBS_TRCN_BV_01() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: First VAM was sent ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_TRCN_BV_01
+
+ group f_TC_VBS_TRCN_BV_03 {
+
+ function f_TC_VBS_TRCN_BV_03_cluster_member() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ if (f_create_cluster_iut_as_leader(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ }
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***");
+
+ // Set the IUT in VRU_ACTIVE_CLUSTER_LEADER mode
+ // Delete the cluster
+ f_terminate_cluster(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: VAM cluster deleted ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_STANDALONE ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_TRCN_BV_03_cluster_member
+
+ function f_TC_VBS_TRCN_BV_03_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Wait for the cluster deletion
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ f_sleep(1.0); // Wait for stable state
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ omit,
+ omit
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: IUT stops sending VAM cluster ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId()
+ ))) {
+ log("*** " & testcasename() & ": INFO: Skip intermediate VA messages ***");
+ repeat;
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_TRCN_BV_03_iut
+
+ } // End of group f_TC_VBS_TRCN_BV_03
+
+ group f_TC_VBS_TRCN_BV_04 {
+
+ function f_TC_VBS_TRCN_BV_04_cluster_member() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Set the IUT in VRU_PASSIVE mode
+ if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+
+ // Test Body
+ // Do not sent VAM cluster anymore to trigger clusterLeaveReason with clusterLeaderLost
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and no more VAM cluster sent ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_TRCN_BV_04_cluster_member
+
+ function f_TC_VBS_TRCN_BV_04_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE));
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Wait for the IUT to join the cluster
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -,
+ mw_vru_cluster_operation_container(
+ -,
+ mw_cluster_leave_info(
+ -,
+ Vru_clusterLeaveReason_clusterLeaderLost
+ ))))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_clusterLeaderLost ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_TRCN_BV_04_iut
+
+ } // End of group f_TC_VBS_TRCN_BV_04
+
+ group f_TC_VBS_TRCN_BV_05 {
+
+ function f_TC_VBS_TRCN_BV_05_cluster_leader() runs on ItsVru system ItsVruSystem {
+ // Local variables
+ var VAM v_fisrt_vam;
+ var VAM v_cluster_vam;
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_cluster();
+
+ // Test adapter configuration
+
+ // Preamble
+ if (f_create_cluster_iut_as_leader(v_fisrt_vam, v_cluster_vam) == false) {
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout);
+ } else {
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ }
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***");
+
+ // Set the IUT in VRU_ACTIVE_CLUSTER_LEADER mode
+ // Delete the cluster
+ f_terminate_cluster(v_cluster_vam);
+ log("*** " & testcasename() & ": INFO: VAM cluster deleted ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_STANDALONE ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+
+ // Postamble
+ f_poDefault();
+ f_cfDown_cluster_leader();
+
+ } // End of function f_TC_VBS_TRCN_BV_05_cluster_leader
+
+ function f_TC_VBS_TRCN_BV_05_iut() runs on ItsVru system ItsVruSystem {
+ // Local variables
+
+ // Test control
+
+ // Test component configuration
+ f_cfUp_iut();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for the cluster creation
+ f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success);
+ // Wait for the cluster deletion
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ f_sleep(1.0); // Wait for stable state
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -,
+ omit,
+ omit
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: IUT stops sending VAM cluster ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId()
+ ))) {
+ log("*** " & testcasename() & ": INFO: Skip intermediate VA messages ***");
+ repeat;
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ // Leave the cluster
+ f_poDefault();
+ f_cfDown_iut();
+
+ } // End of function f_TC_VBS_TRCN_BV_05_iut
+
+ } // End of group f_TC_VBS_TRCN_BV_05
+
+ /**
+ * @desc TP Function for TC_VBS_TRCN_BV_08
+ */
+ function f_TC_VBS_TRCN_BV_08() runs on ItsVru {
+ // Local variables
+ var VamInd v_vam;
+ var VAM v_first_vam;
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for first VA message from the IUT
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters
+ )))) -> value v_vam {
+ tc_ac.stop;
+ v_first_vam := v_vam.msgIn;
+ log("*** " & testcasename() & ": INFO: VAM from IUT is received ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) -> value v_vam {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": INFO: Next VAM was sent ***");
+ if (f_verify_euclidian_distance(v_first_vam.vam.vamParameters.basicContainer.referencePosition, v_vam.msgIn.vam.vamParameters.basicContainer.referencePosition, PICS_MIN_REFERENCE_POINT_POSITON_CHANGE_THRESHOLD, 1) == false) {
+ log("*** " & testcasename() & ": FAIL: euclidian distance (P1, P2) not verified ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ } else {
+ log("*** " & testcasename() & ": PASS: euclidian distance (P1, P2) verified ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_TRCN_BV_08
+
+ /**
+ * @desc TP Function for TC_VBS_TRCN_BV_09
+ */
+ function f_TC_VBS_TRCN_BV_09() runs on ItsVru {
+ // Local variables
+ var VamInd v_vam;
+ var VAM v_first_vam;
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for first VA message from the IUT
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters
+ )))) -> value v_vam {
+ tc_ac.stop;
+ v_first_vam := v_vam.msgIn;
+ log("*** " & testcasename() & ": INFO: VAM from IUT is received ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) -> value v_vam {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: Next VAM was sent ***");
+ // Verifiy 'abs(V2 - V1) > minGroundSpeedChangeThreshold'
+ if (f_verify_delta_speed(v_first_vam.vam.vamParameters.vruHighFrequencyContainer.speed, v_vam.msgIn.vam.vamParameters.vruHighFrequencyContainer.speed, PICS_MIN_GROUND_SPEED_CHANGE_THRESHOLD, 1) == false) {
+ log("*** " & testcasename() & ": FAIL: abs(V2 - V1) not verified ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ } else {
+ log("*** " & testcasename() & ": PASS: abs(V2 - V1) verified ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_TRCN_BV_09
+
+ /**
+ * @desc TP Function for TC_VBS_TRCN_BV_10
+ */
+ function f_TC_VBS_TRCN_BV_10() runs on ItsVru {
+ // Local variables
+ var VamInd v_vam;
+ var VAM v_first_vam;
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for first VA message from the IUT
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters
+ )))) -> value v_vam {
+ tc_ac.stop;
+ v_first_vam := v_vam.msgIn;
+ log("*** " & testcasename() & ": INFO: VAM from IUT is received ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) -> value v_vam {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: Next VAM was sent ***");
+ // Verifiy Verifiy 'abs(H2 - H1) > minGroundVelocityOrientationChangeThreshold'
+ if (f_verify_delta_Wgs84Angle(v_first_vam.vam.vamParameters.vruHighFrequencyContainer.heading, v_vam.msgIn.vam.vamParameters.vruHighFrequencyContainer.heading, PICS_MIN_GROUND_VELOCITY_ORIENTATION_CHANGE_THRESHOLD, 1) == false) {
+ log("*** " & testcasename() & ": FAIL: abs(H2 - H1) not verified ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ } else {
+ log("*** " & testcasename() & ": PASS: abs(H2 - H1) verified ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_TRCN_BV_10
+
+ /**
+ * @desc TP Function for TC_VBS_TRCN_BV_11
+ */
+ function f_TC_VBS_TRCN_BV_11() runs on ItsVru {
+ // Local variables
+ var VamInd v_vam;
+ var VAM v_first_vam;
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for first VA message from the IUT
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters
+ )))) -> value v_vam {
+ tc_ac.stop;
+ v_first_vam := v_vam.msgIn;
+ log("*** " & testcasename() & ": INFO: VAM from IUT is received ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) -> value v_vam {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: Next VAM was sent ***");
+ // TODO Verifiy 'abs(P2 - P1) > minTrajectoryInterceptionProbChangeThreshold'
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_TRCN_BV_11
+
+ /**
+ * @desc TP Function for TC_VBS_TRCN_BV_12
+ */
+ function f_TC_VBS_TRCN_BV_12() runs on ItsVru {
+ // Local variables
+ var VamInd v_vam;
+ var VAM v_first_vam;
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ // Wait for first VA message from the IUT
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters
+ )))) -> value v_vam {
+ tc_ac.stop;
+ v_first_vam := v_vam.msgIn;
+ log("*** " & testcasename() & ": INFO: VAM from IUT is received ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***");
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) -> value v_vam {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: Next VAM was sent ***");
+ // TODO Verifiy 'abs(LAT2 - LAT1) < MSLaD'
+ // TODO Verifiy 'abs(LON2 - LON1) < MSLoD'
+ // TODO Verifiy 'euclidian distance (P1, P2) < MSVD'
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_TRCN_BV_12
+
+ } // End of group vruTriggeringCondition
+
+ group vruFrequencyPeriodicity {
+
+ /**
+ * @desc TP Function for TC_VBS_FRPE_TI_01
+ */
+ function f_TC_VBS_FRPE_TI_01() runs on ItsVru {
+ // Local variables
+ timer t_minTransInterval := PICS_T_GEN_VAM * PX_DEC_TIMER_CONTROL_FACTOR;
+ timer t_maxTransInterval := PICS_T_GEN_VAM * PX_INC_TIMER_CONTROL_FACTOR;
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ vamPort.clear;
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ t_minTransInterval.start;
+ t_maxTransInterval.start;
+ log("*** " & testcasename() & ": INFO: Initial conditions: First VA message received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: Initial conditions: VA message not received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ if (t_minTransInterval.running) {
+ t_minTransInterval.stop;
+ t_maxTransInterval.stop;
+ log("*** " & testcasename() & ": FAIL: VAM received too early ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ } else {
+ t_maxTransInterval.stop;
+ log("*** " & testcasename() & ": PASS: VAM received within T_Gen_Vam ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ }
+ [] t_minTransInterval.timeout {
+ repeat;
+ }
+ [] t_maxTransInterval.timeout {
+ tc_ac.stop;
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ log("*** " & testcasename() & ": FAIL: VAM not received within T_Gen_Vam ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_FRPE_TI_01
+
+ /**
+ * @desc TP Function for TC_VBS_FRPE_BV_02
+ */
+ function f_TC_VBS_FRPE_BV_02() runs on ItsVru {
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -,
+ mw_vru_low_frequency_container,
+ -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: First VAM was sent, including vruLowFrequencyContainer ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_FRPE_BV_02
+
+ /**
+ * @desc TP Function for TC_VBS_FRPE_BV_03
+ */
+ function f_TC_VBS_FRPE_BV_03() runs on ItsVru {
+ // Local variables
+ timer t_minTransInterval := PICS_T_GEN_VAM_LF_MIN * PX_DEC_TIMER_CONTROL_FACTOR;
+ timer t_maxTransInterval := PICS_T_GEN_VAM_LF_MIN * PX_INC_TIMER_CONTROL_FACTOR;
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ vamPort.clear;
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -,
+ ?,
+ -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ t_minTransInterval.start;
+ t_maxTransInterval.start;
+ log("*** " & testcasename() & ": INFO: Initial conditions: First VA message with vruLowFrequencyContainer received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: Initial conditions: VA message with vruLowFrequencyContainer not received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -,
+ ?,
+ -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ if (t_minTransInterval.running) {
+ t_minTransInterval.stop;
+ t_maxTransInterval.stop;
+ log("*** " & testcasename() & ": FAIL: VAM with vruLowFrequencyContainer received too early ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ } else {
+ t_maxTransInterval.stop;
+ log("*** " & testcasename() & ": PASS: VAM with vruLowFrequencyContainer received within PICS_T_GEN_VAM_LF_MIN ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ }
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness
+ ))) {
+ log("*** " & testcasename() & ": INFO: VAM w/o vruLowFrequencyContainer received, skip it ***");
+ repeat;
+ }
+ [] t_minTransInterval.timeout {
+ repeat;
+ }
+ [] t_maxTransInterval.timeout {
+ tc_ac.stop;
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ log("*** " & testcasename() & ": FAIL: VAM not received within PICS_T_GEN_VAM_LF_MIN ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_FRPE_BV_03
+
+ /**
+ * @desc TP Function for TC_VBS_FRPE_TI_04
+ */
+ function f_TC_VBS_FRPE_TI_04() runs on ItsVru {
+ // Local variables
+ timer t_minTransInterval := PICS_T_GEN_VAM_MAX * PX_DEC_TIMER_CONTROL_FACTOR;
+ timer t_maxTransInterval := PICS_T_GEN_VAM_MAX * PX_INC_TIMER_CONTROL_FACTOR;
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_ITS_G5 or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_ITS_G5 and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ vamPort.clear;
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ t_minTransInterval.start;
+ t_maxTransInterval.start;
+ log("*** " & testcasename() & ": INFO: Initial conditions: First VA message received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: Initial conditions: VA message not received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ if (t_minTransInterval.running) {
+ t_minTransInterval.stop;
+ t_maxTransInterval.stop;
+ log("*** " & testcasename() & ": FAIL: VAM received too early ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ } else {
+ t_maxTransInterval.stop;
+ log("*** " & testcasename() & ": PASS: VAM received within T_Gen_VamMax ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ }
+ [] t_minTransInterval.timeout {
+ repeat;
+ }
+ [] t_maxTransInterval.timeout {
+ tc_ac.stop;
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ log("*** " & testcasename() & ": FAIL: VAM not received within T_Gen_VamMax ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_FRPE_TI_04
+
+ /**
+ * @desc TP Function for TC_VBS_FRPE_TI_05
+ */
+ function f_TC_VBS_FRPE_TI_05() runs on ItsVru {
+ // Local variables
+ timer t_minTransInterval := PICS_T_GEN_VAM_MIN * PX_DEC_TIMER_CONTROL_FACTOR;
+ timer t_maxTransInterval := PICS_T_GEN_VAM_MIN * PX_INC_TIMER_CONTROL_FACTOR;
+
+ // Test control
+ if (not PICS_VAM_TRANSMISSION or not PICS_ITS_G5 or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_ITS_G5 and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ vamPort.clear;
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ t_minTransInterval.start;
+ t_maxTransInterval.start;
+ log("*** " & testcasename() & ": INFO: Initial conditions: First VA message received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: Initial conditions: VA message not received ***");
+ f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(
+ mw_vamInd(
+ mw_vamMsg(
+ f_getIutStationId(),
+ mw_vru_awareness(
+ -,
+ mw_vam_parameters(
+ -, -, -, -, -,
+ omit
+ ))))) {
+ tc_ac.stop;
+ if (t_minTransInterval.running) {
+ t_minTransInterval.stop;
+ t_maxTransInterval.stop;
+ log("*** " & testcasename() & ": FAIL: VAM received too early ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ } else {
+ t_maxTransInterval.stop;
+ log("*** " & testcasename() & ": PASS: VAM received within T_Gen_VamMin ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ }
+ [] t_minTransInterval.timeout {
+ repeat;
+ }
+ [] t_maxTransInterval.timeout {
+ tc_ac.stop;
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
+ log("*** " & testcasename() & ": FAIL: VAM not received within T_Gen_VamMin ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ } // End of 'alt' statement
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_FRPE_TI_05
+
+ } // End of group vruFrequencyPeriodicity
+
+ group securityConstraints {
+
+ /**
+ * @desc TP Function for TC_VBS_SECC_BV_02
+ */
+ function f_TC_VBS_SECC_BV_02() runs on ItsVru {
+
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(mw_vamIndWithSecurityParameters(mw_vamMsg_any)) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: Expected secured VRU message received with correct ITS-AID value ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ }
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_SECC_BV_02
+
+ /**
+ * @desc TP Function for TC_VBS_SECC_BV_04
+ */
+ function f_TC_VBS_SECC_BV_04() runs on ItsVru {
+
+ // Local variables
+
+ // Test control
+ if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) {
+ log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
+ setverdict(inconc);
+ stop;
+ }
+
+ // Test component configuration
+ f_cfUp();
+
+ // Test adapter configuration
+
+ // Preamble
+ f_prInitialState();
+ f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
+
+ // Test Body
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(mw_vamIndWithSecurityParameters(mw_vamMsg_any, ?)) {
+ tc_ac.stop;
+ log("*** " & testcasename() & ": PASS: Expected secured VRU message received with SSP value ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: VRU message not received ***");
+ f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
+ }
+ }
+
+ // Postamble
+ f_poDefault();
+ f_cfDown();
+
+ } // End of function f_TC_VBS_SECC_BV_04
+
+ } // End of group securityConstraints
+
+} // End of module ItsVru_TpFunctions
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..950683d5a87a8fed1a434b8ec477df6c4f33c4ea
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2019-2024 ETSI
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its contributors
+ may be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/README.md b/README.md
index 487448c6ca4ce45201a76e91f45d265254dc552b..e9caba2faa0699651672b26dee6902983c6f8d3a 100644
--- a/README.md
+++ b/README.md
@@ -1,92 +1,7 @@
-# VRU TS 104 018-3
+# Vulnerable Road Users awareness Message TTCN-3 test suite
+Vulnerable Road Users awarenes Message abstract test suite (ATS) as defined in [ETSI TS 104 018-3 V2.0.5](https://www.etsi.org/deliver/etsi_ts/102800_102899/10286803/01.05.01_60/ts_10286803v010501p.pdf)
-
-## Getting started
-
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
-
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
-
-## Add your files
-
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-
-```
-cd existing_repo
-git remote add origin https://forge.etsi.org/rep/ITS/ttcn/vru-ts-104-018-3.git
-git branch -M main
-git push -uf origin main
-```
-
-## Integrate with your tools
-
-- [ ] [Set up project integrations](https://forge.etsi.org/rep/ITS/ttcn/vru-ts-104-018-3/-/settings/integrations)
-
-## Collaborate with your team
-
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
-
-## Test and Deploy
-
-Use the built-in continuous integration in GitLab.
-
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
-
-***
-
-# Editing this README
-
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
-
-## Name
-Choose a self-explaining name for your project.
-
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
-
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
-
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
-
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
-
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
-
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
-
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
-
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
-
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
-
-## License
-For open source projects, say how it is licensed.
-
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+This code is a part of the ETSI ITS test suite, available on https://forge.etsi.org/rep/ITS/TS.ITS and cannot be run independently.
+Please clone the main ETSI ITS test suite repository and compile and follow the compilation instructions.
+To run this code, the test suite shall be compiled using `make ATS=AtsVRU`
diff --git a/lib/LibItsVru_EncdecDeclarations.ttcn b/lib/LibItsVru_EncdecDeclarations.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..4ec2a36986fef5896b04e8a0e65d830be3c13377
--- /dev/null
+++ b/lib/LibItsVru_EncdecDeclarations.ttcn
@@ -0,0 +1,30 @@
+module LibItsVru_EncdecDeclarations {
+
+ // LibIts
+ import from VAM_PDU_Descriptions language "ASN.1:1997" all;
+
+ // LibItsVru
+ import from LibItsVru_TypesAndValues all;
+
+ external function fx_enc_VruReq (VamReq p) return bitstring
+ with {extension "prototype(convert) encode(LibIts_Interface)"}
+
+ external function fx_dec_VruReq (inout bitstring b, out VamReq p) return integer
+ with {extension "prototype(sliding) decode(LibIts_Interface)"}
+
+ external function fx_dec_VruInd (inout bitstring b, out VamInd p) return integer
+ with {extension "prototype(sliding) decode(LibIts_Interface)"}
+
+ external function fx_enc_VAM (VAM p) return bitstring
+ with {extension "prototype(convert) encode(PER)"}
+
+ external function fx_dec_VAM (inout bitstring b, out VAM p) return integer
+ with {extension "prototype(sliding) decode(PER)"}
+
+ external function fx_enc_UtVamInitialize (UtVamInitialize p) return bitstring
+ with {extension "prototype(convert) encode(UpperTester)"}
+
+ external function fx_dec_UtVamEventInd (inout bitstring b, out UtVamEventInd p) return integer
+ with {extension "prototype(sliding) decode(UpperTester)"}
+
+} // End of module LibItsVru_EncdecDeclarations
\ No newline at end of file
diff --git a/lib/LibItsVru_Pics.ttcn b/lib/LibItsVru_Pics.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..44b954b9d58e0180da8b24c832a22dd3aba8c9e3
--- /dev/null
+++ b/lib/LibItsVru_Pics.ttcn
@@ -0,0 +1,90 @@
+module LibItsVru_Pics {
+
+ // LibCommon
+ import from LibCommon_BasicTypesAndValues all;
+
+ /**
+ * @desc Support for VRU generation
+ * @see ETSI TS 104 019-1 Table A.1/1
+ */
+ modulepar boolean PICS_VAM_GENERATION := true;
+
+ /**
+ * @desc Support for VRU generation
+ * @see ETSI TS 104 019-1 Table A.1/1
+ */
+ modulepar boolean PICS_VAM_TRANSMISSION := true;
+
+ /**
+ * @desc Is the IUT vehicle profile Pedestrain?
+ * @see ETSI TS 104 019-1 Table A.3/1
+ */
+ modulepar boolean PICS_PROFILE_PEDESTRIAN := false;
+
+ /**
+ * @desc Is the IUT vehicle profile Bycycle or Light vehicle?
+ * @see ETSI TS 104 019-1 Table A.3/2
+ */
+ modulepar boolean PICS_PROFILE_BICYCLIST := true;
+
+ /**
+ * @desc Is the IUT vehicle profile Motorcyclist?
+ * @see ETSI TS 104 019-1 Table A.3/3
+ */
+ modulepar boolean PICS_PROFILE_MOTORCYCLIST := false;
+
+ /**
+ * @desc Is the IUT vehicle profile Animal?
+ * @see ETSI TS 104 019-1 Table A.3/3
+ */
+ modulepar boolean PICS_PROFILE_ANIMAL := false;
+
+ /**
+ * @desc Is the IUT support clustering?
+ * @see ETSI TS 104 019-1 Table A.4/1
+ */
+ modulepar boolean PICS_CLUSTERING := true;
+
+ /**
+ * @desc Support for VRU reception
+ * @see ETSI TS 104 019-1 Table A.3
+ */
+ modulepar boolean PICS_VRU_RECEPTION := true;
+
+ /**
+ * @desc Is the IUT running in secured mode?
+ * @see ETSI TS 104 019-1 Table A.5/1
+ */
+ modulepar boolean PICS_IS_IUT_SECURED := false;
+
+ modulepar float PICS_T_GEN_VAM := 1000.0;
+
+ modulepar float PICS_T_GEN_VAM_MIN := 100.0;
+
+ modulepar float PICS_T_GEN_VAM_MAX := 5000.0;
+
+ modulepar float PICS_T_GEN_VAM_LF_MIN := 2000.0;
+
+ modulepar boolean PICS_ITS_G5 := true;
+
+
+
+
+
+ modulepar float PICS_MIN_REFERENCE_POINT_POSITON_CHANGE_THRESHOLD := 100.0;
+
+ modulepar float PICS_MIN_GROUND_SPEED_CHANGE_THRESHOLD := 100.0;
+
+ modulepar float PICS_MIN_GROUND_VELOCITY_ORIENTATION_CHANGE_THRESHOLD := 100.0;
+
+ modulepar float PICS_MIN_TRAJECTORY_INTERCEPTION_PROB_CHANGE_THRESHOLD := 100.0;
+
+ modulepar float PICS_MSLAD := 100.0;
+
+ modulepar float PICS_MSLOD := 100.0;
+
+ modulepar float PICS_MSVD := 100.0;
+
+
+
+} // End of module LibItsVru_Pics
\ No newline at end of file
diff --git a/lib/LibItsVru_Pixits.ttcn b/lib/LibItsVru_Pixits.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..a04b7fd7a48f445c100570cbc1b4f1a9902483ae
--- /dev/null
+++ b/lib/LibItsVru_Pixits.ttcn
@@ -0,0 +1,84 @@
+module LibItsVru_Pixits {
+
+ // LibCommon
+ import from LibCommon_BasicTypesAndValues all;
+ import from LibCommon_DataStrings all;
+
+ // LibIts
+ import from ETSI_ITS_CDD language "ASN.1:1997" all;
+ import from VAM_PDU_Descriptions language "ASN.1:1997" all;
+
+ // LibItsCommon
+ import from LibItsCommon_ASN1_NamedNumbers all;
+
+ /**
+ * @desc To trigger to the IUT which profile to apply
+ * @see PX_VRU_CLUSTER_CREATE_PROFILE
+ */
+ modulepar UInt8 PX_IUT_VRU_PROFILE_TYPE := Vru_profile_bicyclistAndLightVruVehicle;
+
+ /**
+ * @desc To trigger to the IUT which cluster profile to apply
+ */
+ modulepar VruClusterProfiles PX_VRU_CLUSTER_CREATE_PROFILE := '0001'B; // bicyclist
+
+ /**
+ * @desc To indicates how many time a message shall be sent
+ */
+ modulepar integer PX_VRU_REPETITION := 1;
+
+ /**
+ * @desc Value of minClusterSize
+ */
+ modulepar integer PX_VRU_MIN_CLUSTER_SIZE := 4;
+
+ /**
+ * @desc To indicates the cardinality of a cluster initiated by the IUT (>= 3, 3 + the IUT as leader)
+ */
+ modulepar CardinalNumber1B PX_VRU_CLUSTER_CREATE_CARDINALITY := 4;
+
+ /**
+ * @desc To indicates the cardinality of a cluster initiated by the IUT (>= 3, 3 + the IUT as leader)
+ */
+ modulepar CardinalNumber1B PX_VRU_MAX_CLUSTER_SIZE := 5;
+
+ /**
+ * @desc To indicates the cluster ID when initiated by the TS
+ */
+ modulepar Identifier1B PX_VRU_CLUSTER_CREATE_ID := 78; // Random number
+
+ /**
+ * @desc To indicates the size of the clusterBoundingBoxShape
+ */
+ modulepar StandardLength12b PX_VRU_CLUSTER_CREATE_RADIUS := 30; // 3 meters
+
+ /**
+ * @desc To indicates the reason of breaking the cluster
+ */
+ modulepar ClusterBreakupReason PX_VRU_CLUSTER_BREAKUP_REASON := Vru_ClusterBreakupReason_clusteringPurposeCompleted;
+
+ modulepar UInt32 PX_DELTA_LATITUDE_IN_BOX := 10;
+
+ modulepar UInt32 PX_DELTA_LONGITUDE_IN_BOX := 10;
+
+ modulepar UInt32 PX_DELTA_LATITUDE_OUT_OF_BOX := 100;
+
+ modulepar UInt32 PX_DELTA_LONGITUDE_OUT_OF_BOX := 100;
+
+ modulepar UInt32 PX_DELTA_SPEED_IN_BOX := 2;
+
+ modulepar UInt32 PX_DELTA_SPEED_OUT_OF_BOX := 20;
+
+ modulepar UInt32 PX_DELTA_CARDINALITY_CANCEL := 100;
+
+ /**
+ * @desc Multiply timer value by this control factor to increase it
+ */
+ modulepar float PX_INC_TIMER_CONTROL_FACTOR := 1.10;
+
+ /**
+ * @desc Multiply timer value by this control factor to decrease it
+ */
+ modulepar float PX_DEC_TIMER_CONTROL_FACTOR := 0.9;
+
+} // End of module LibItsVru_Pixits
\ No newline at end of file
diff --git a/lib/LibItsVru_Templates.ttcn b/lib/LibItsVru_Templates.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..ce3af2ce02940eaaac27e2b80d782cb9221dd66e
--- /dev/null
+++ b/lib/LibItsVru_Templates.ttcn
@@ -0,0 +1,420 @@
+module LibItsVru_Templates {
+
+ // LibCommon
+ import from LibCommon_BasicTypesAndValues all;
+ import from LibCommon_DataStrings all;
+
+ // LibHelpers
+ import from LibHelpers_Functions all;
+
+ // LibIts
+ import from ETSI_ITS_CDD language "ASN.1:1997" all;
+ import from VAM_PDU_Descriptions language "ASN.1:1997" all;
+
+ // LibItsCommon
+ import from LibItsCommon_Functions all;
+ import from LibItsCommon_TypesAndValues all;
+ import from LibItsCommon_ASN1_NamedNumbers all;
+ import from LibItsCommon_CddTemplates all;
+
+ // LibItsVru
+ import from LibItsVru_TypesAndValues all;
+
+ group vruPrimitives {
+
+ /**
+ * @desc Receive template for VRU Message (VamPort Primitive)
+ * @param p_vamMsg Expected VRU Message
+ */
+ template VamInd mw_vamInd (
+ in template (present) VAM p_vamMsg
+ ) := {
+ msgIn := p_vamMsg,
+ recvTime := ?,
+ gnNextHeader := *,
+ gnHeaderType := *,
+ gnHeaderSubtype := *,
+ gnLifetime := *,
+ gnTrafficClass := *,
+ btpDestinationPort := *,
+ btpInfo := *,
+ ssp := *,
+ its_aid := *
+ } // End of template mw_vamInd
+
+ /**
+ * @desc Receive template for VRU Message (VamPort Primitive)
+ * @param p_vamMsg Expected VRU Message
+ * @param p_gnNextHeader GN next header value
+ * @param p_gnHeaderType GN header type value
+ * @param p_gnHeaderSubtype GN header subtype value
+ * @param p_gnLifetime GN packet lifetime value (ms)
+ * @param p_gnTrafficClass GN traffic class value
+ */
+ template VamInd mw_vamIndWithGnParameters (
+ in template (present) VAM p_vamMsg,
+ in template UInt8 p_gnNextHeader := *,
+ in template UInt8 p_gnHeaderType := *,
+ in template UInt8 p_gnHeaderSubtype := *,
+ in template UInt32 p_gnLifetime := *,
+ in template UInt8 p_gnTrafficClass := *
+ ) modifies mw_vamInd := {
+ gnNextHeader := p_gnNextHeader,
+ gnHeaderType := p_gnHeaderType,
+ gnHeaderSubtype := p_gnHeaderSubtype,
+ gnLifetime := p_gnLifetime,
+ gnTrafficClass := p_gnTrafficClass
+ } // End of template mw_vamIndWithGnParameters
+
+ /**
+ * @desc Receive template for VRU Message (VamPort Primitive)
+ * @param p_caMsg The expected CA Message
+ * @param p_ssp SSP security parameter
+ * @param p_its_aid ITS-AID value
+ */
+ template VamInd mw_vamIndWithSecurityParameters(
+ template (present) VAM p_vamMsg,
+ template Bit256 p_ssp := *,
+ template UInt32 p_its_aid := c_its_aid_VAM
+ ) modifies mw_vamInd := {
+ ssp := p_ssp,
+ its_aid := p_its_aid
+ } // End of template mw_vamIndWithSecurityParameters
+
+ /**
+ * @desc Receive template for VRU Message (VamPort Primitive)
+ * @param p_vamMsg Expected VRU Message
+ * @param p_btpDestinationPort BTP destination port value
+ * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A)
+ */
+ template VamInd mw_vamIndWithBtpParameters(
+ in template (present) VAM p_vamMsg,
+ in template UInt16 p_btpDestinationPort := *,
+ in template UInt16 p_btpInfo := *
+ ) modifies mw_vamInd := {
+ btpDestinationPort := p_btpDestinationPort,
+ btpInfo := p_btpInfo
+ } // End of template mw_vamIndWithBtpParameters
+
+ /**
+ * @desc Send template for VRU Message (VamPort Primitive)
+ * @param p_vamMsg VRU Message to be received
+ */
+ template (value) VamReq m_vruReq(
+ in template (value) VAM p_vamMsg
+ ) := {
+ msgOut := p_vamMsg
+ } // End of template m_vruReq
+
+ group vruUtPrimitives {
+
+ /**
+ * @desc Initializes the VRU IUT.
+ */
+ template (value) UtVamInitialize m_vruInitialize := {
+ hashedId8 := '0000000000000000'O
+ }
+
+ /**
+ * @desc Set the VRU profile
+ * @param p_vru_profile The VRU profile
+ */
+ template (value) UtVamTrigger m_setVruProfile(in UInt8 p_vru_profile) := {
+ setVruProfile := p_vru_profile
+ }
+
+ /**
+ * @desc Set the VRU profile
+ * @param p_leave_cluster_with_cause The cause of the leave cluster request
+ */
+ template (value) UtVamTrigger m_leaveClusterWithCause(in UInt8 p_leave_cluster_with_cause) := {
+ leaveClusterWithCause := p_leave_cluster_with_cause
+ }
+
+ /**
+ * @desc Set the VRU profile
+ * @param p_set_vbs_state The VBS state
+ */
+ template (value) UtVamTrigger m_setVbsState(in UInt8 p_set_vbs_state) := {
+ setVbsState := p_set_vbs_state
+ }
+
+ } // End of group utPrimitives
+
+ } // End of group Primitives
+
+ /**
+ * @desc Default Receive template for VAM PDU
+ */
+ template (present) VAM mw_vamMsg_any := {
+ header := {
+ protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_,
+ messageId := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageId_vru_,
+ stationId := ?
+ },
+ vam := {
+ generationDeltaTime := ?,
+ vamParameters := ?
+ }
+ }
+
+ /**
+ * @desc Send template for VAM PDU
+ */
+ template (value) VAM m_vamMsg(
+ in StationId p_stationId,
+ in template (value) VruAwareness p_vam
+ ) := {
+ header := {
+ protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_,
+ messageId := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageId_vru_,
+ stationId := p_stationId
+ },
+ vam := p_vam
+ }
+
+ /**
+ * @desc Default Receive template for VAM PDU
+ */
+ template (present) VAM mw_vamMsg(
+ template (present) StationId p_stationId,
+ template (present) VruAwareness p_vam := ?
+ ) modifies mw_vamMsg_any := {
+ header := {
+ stationId := p_stationId
+ },
+ vam := p_vam
+ }
+
+ template (value) VruAwareness m_vru_awareness(
+ in template (value) GenerationDeltaTime p_generation_delta_time,
+ in template (value) VamParameters p_vam_parameters
+ ) := {
+ generationDeltaTime := p_generation_delta_time,
+ vamParameters := p_vam_parameters
+ }
+
+ template (present) VruAwareness mw_vru_awareness(
+ template (present) GenerationDeltaTime p_generation_delta_time := ?,
+ template (present) VamParameters p_vam_parameters := ?
+ ) := {
+ generationDeltaTime := p_generation_delta_time,
+ vamParameters := p_vam_parameters
+ }
+
+ template (omit) VamParameters m_vam_parameters(
+ in template (value) BasicContainer p_basic_container,
+ in template (value) VruHighFrequencyContainer p_vru_high_frequency_container,
+ in template (omit) VruLowFrequencyContainer p_vru_low_frequency_container := omit,
+ in template (omit) VruClusterInformationContainer p_vru_cluster_information_container := omit,
+ in template (omit) VruClusterOperationContainer p_vru_cluster_operation_container := omit,
+ in template (omit) VruMotionPredictionContainer p_vru_motion_prediction_container := omit
+ ) := {
+ basicContainer := p_basic_container,
+ vruHighFrequencyContainer := p_vru_high_frequency_container,
+ vruLowFrequencyContainer := p_vru_low_frequency_container,
+ vruClusterInformationContainer := p_vru_cluster_information_container,
+ vruClusterOperationContainer := p_vru_cluster_operation_container,
+ vruMotionPredictionContainer := p_vru_motion_prediction_container
+ }
+
+ template (present) VamParameters mw_vam_parameters(
+ template (present) BasicContainer p_basic_container := ?,
+ template (present) VruHighFrequencyContainer p_vru_high_frequency_container := ?,
+ template VruLowFrequencyContainer p_vru_low_frequency_container := *,
+ template VruClusterInformationContainer p_vru_cluster_information_container := *,
+ template VruClusterOperationContainer p_vru_cluster_operation_container := *,
+ template VruMotionPredictionContainer p_vru_motion_prediction_container := *
+ ) := {
+ basicContainer := p_basic_container,
+ vruHighFrequencyContainer := p_vru_high_frequency_container,
+ vruLowFrequencyContainer := p_vru_low_frequency_container,
+ vruClusterInformationContainer := p_vru_cluster_information_container,
+ vruClusterOperationContainer := p_vru_cluster_operation_container,
+ vruMotionPredictionContainer := p_vru_motion_prediction_container
+ }
+
+ template (omit) VruHighFrequencyContainer m_vru_high_frequency_container(
+ in template (value) Wgs84Angle p_heading,
+ in template (value) Speed p_speed,
+ in template (value) LongitudinalAcceleration p_longitudinal_acceleration,
+ in template (omit) Curvature p_curvature := omit,
+ in template (omit) CurvatureCalculationMode p_curvature_calculation_mode := omit,
+ in template (omit) YawRate p_yaw_rate := omit,
+ in template (omit) LateralAcceleration p_lateral_acceleration := omit,
+ in template (omit) VerticalAcceleration p_vertical_acceleration := omit,
+ in template (omit) GeneralizedLanePosition p_vru_lane_position := omit,
+ in template (omit) VruEnvironment p_environment := omit,
+ in template (omit) VruMovementControl p_movement_control := omit,
+ in template (omit) Wgs84Angle p_orientation := omit,
+ in template (omit) CartesianAngle p_roll_angle := omit,
+ in template (omit) VruDeviceUsage p_device_usage := omit
+ ) := {
+ heading := p_heading,
+ speed := p_speed,
+ longitudinalAcceleration := p_longitudinal_acceleration,
+ curvature := p_curvature,
+ curvatureCalculationMode := p_curvature_calculation_mode,
+ yawRate := p_yaw_rate,
+ lateralAcceleration := p_lateral_acceleration,
+ verticalAcceleration := p_vertical_acceleration,
+ vruLanePosition := p_vru_lane_position,
+ environment := p_environment,
+ movementControl := p_movement_control,
+ orientation := p_orientation,
+ rollAngle := p_roll_angle,
+ deviceUsage := p_device_usage
+ }
+
+ template (present) VruHighFrequencyContainer mw_vru_high_frequency_container(
+ template (present) Wgs84Angle p_heading := ?,
+ template (present) Speed p_speed := ?,
+ template (present) LongitudinalAcceleration p_longitudinal_acceleration := ?,
+ template Curvature p_curvature := *,
+ template CurvatureCalculationMode p_curvature_calculation_mode := *,
+ template YawRate p_yaw_rate := *,
+ template LateralAcceleration p_lateral_acceleration := *,
+ template VerticalAcceleration p_vertical_acceleration := *,
+ template GeneralizedLanePosition p_vru_lane_position := *,
+ template VruEnvironment p_environment := *,
+ template VruMovementControl p_movement_control := *,
+ template Wgs84Angle p_orientation := *,
+ template CartesianAngle p_roll_angle := *,
+ template VruDeviceUsage p_device_usage := *
+ ) := {
+ heading := p_heading,
+ speed := p_speed,
+ longitudinalAcceleration := p_longitudinal_acceleration,
+ curvature := p_curvature,
+ curvatureCalculationMode := p_curvature_calculation_mode,
+ yawRate := p_yaw_rate,
+ lateralAcceleration := p_lateral_acceleration,
+ verticalAcceleration := p_vertical_acceleration,
+ vruLanePosition := p_vru_lane_position,
+ environment := p_environment,
+ movementControl := p_movement_control,
+ orientation := p_orientation,
+ rollAngle := p_roll_angle,
+ deviceUsage := p_device_usage
+ }
+
+ template (omit) VruLowFrequencyContainer m_vru_low_frequency_container(
+ in template (value) VruProfileAndSubprofile p_profile_and_subprofile,
+ in template (omit) VruSizeClass p_size_class := omit,
+ in template (omit) VruExteriorLights p_exterior_lights := omit
+ ) := {
+ profileAndSubprofile := p_profile_and_subprofile,
+ sizeClass := p_size_class,
+ exteriorLights := p_exterior_lights
+ }
+
+ template (present) VruLowFrequencyContainer mw_vru_low_frequency_container(
+ template (present) VruProfileAndSubprofile p_profile_and_subprofile := ?,
+ template VruSizeClass p_size_class := *,
+ template VruExteriorLights p_exterior_lights := *
+ ) := {
+ profileAndSubprofile := p_profile_and_subprofile,
+ sizeClass := p_size_class,
+ exteriorLights := p_exterior_lights
+ }
+
+ template (value) VruClusterInformationContainer m_vru_cluster_information_container(
+ in template (value) VruClusterInformation p_vru_cluster_information
+ ) := {
+ vruClusterInformation := p_vru_cluster_information
+ }
+
+ template (present) VruClusterInformationContainer mw_vru_cluster_information_container(
+ template (present) VruClusterInformation p_vru_cluster_information := ?
+ ) := {
+ vruClusterInformation := p_vru_cluster_information
+ }
+
+ template (omit) VruClusterOperationContainer m_vru_cluster_operation_container(
+ in template (omit) ClusterJoinInfo p_cluster_join_info := omit,
+ in template (omit) ClusterLeaveInfo p_cluster_leave_info := omit,
+ in template (omit) ClusterBreakupInfo p_cluster_breakup_info := omit,
+ in template (omit) DeltaTimeQuarterSecond p_cluster_id_change_time_info := omit
+ ) := {
+ clusterJoinInfo := p_cluster_join_info,
+ clusterLeaveInfo := p_cluster_leave_info,
+ clusterBreakupInfo := p_cluster_breakup_info,
+ clusterIdChangeTimeInfo := p_cluster_id_change_time_info
+ }
+
+ template VruClusterOperationContainer mw_vru_cluster_operation_container(
+ template ClusterJoinInfo p_cluster_join_info := *,
+ template ClusterLeaveInfo p_cluster_leave_info := *,
+ template ClusterBreakupInfo p_cluster_breakup_info := *,
+ template DeltaTimeQuarterSecond p_cluster_id_change_time_info := *
+ ) := {
+ clusterJoinInfo := p_cluster_join_info,
+ clusterLeaveInfo := p_cluster_leave_info,
+ clusterBreakupInfo := p_cluster_breakup_info,
+ clusterIdChangeTimeInfo := p_cluster_id_change_time_info
+ }
+
+ template (omit) VruMotionPredictionContainer m_vru_motion_prediction_container(
+ in template (omit) PathHistory p_path_history := omit,
+ in template (omit) PathPredicted p_path_prediction := omit,
+ in template (omit) SequenceOfSafeDistanceIndication p_safe_distance := omit,
+ in template (omit) SequenceOfTrajectoryInterceptionIndication p_trajectory_interception_indication := omit,
+ in template (omit) AccelerationChangeIndication p_acceleration_change_indication := omit,
+ in template (omit) HeadingChangeIndication p_heading_change_indication := omit,
+ in template (omit) StabilityChangeIndication p_stability_change_indication := omit
+ ) := {
+ pathHistory := p_path_history,
+ pathPrediction := p_path_prediction,
+ safeDistance := p_safe_distance,
+ trajectoryInterceptionIndication := p_trajectory_interception_indication,
+ accelerationChangeIndication := p_acceleration_change_indication,
+ headingChangeIndication := p_heading_change_indication,
+ stabilityChangeIndication := p_stability_change_indication
+ }
+
+ template VruMotionPredictionContainer mw_vru_motion_prediction_container(
+ template PathHistory p_path_history := *,
+ template PathPredicted p_path_prediction := *,
+ template SequenceOfSafeDistanceIndication p_safe_distance := *,
+ template SequenceOfTrajectoryInterceptionIndication p_trajectory_interception_indication := *,
+ template AccelerationChangeIndication p_acceleration_change_indication := *,
+ template HeadingChangeIndication p_heading_change_indication := *,
+ template StabilityChangeIndication p_stability_change_indication := *
+ ) := {
+ pathHistory := p_path_history,
+ pathPrediction := p_path_prediction,
+ safeDistance := p_safe_distance,
+ trajectoryInterceptionIndication := p_trajectory_interception_indication,
+ accelerationChangeIndication := p_acceleration_change_indication,
+ headingChangeIndication := p_heading_change_indication,
+ stabilityChangeIndication := p_stability_change_indication
+ }
+
+ template (value) ReferencePositionWithConfidence m_reference_position(
+ in UInt32 p_latitude,
+ in UInt32 p_longitude
+ ) := {
+ latitude := p_latitude,
+ longitude := p_longitude,
+ positionConfidenceEllipse := {
+ semiMajorAxisLength := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_,
+ semiMinorAxisLength := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_,
+ semiMajorAxisOrientation := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_
+ },
+ altitude := {
+ altitudeValue := LibItsCommon_ASN1_NamedNumbers.AltitudeValue_referenceEllipsoidSurface_,
+ altitudeConfidence := unavailable
+ }
+ }
+
+ template (present) ReferencePositionWithConfidence mw_reference_position(
+ template (present) UInt32 p_latitude := ?,
+ template (present) UInt32 p_longitude := ?
+ ) := {
+ latitude := p_latitude,
+ longitude := p_longitude,
+ positionConfidenceEllipse := ?,
+ altitude := ?
+ }
+
+} // End of module LibItsVru_Templates
\ No newline at end of file
diff --git a/lib/LibItsVru_TypesAndValues.ttcn b/lib/LibItsVru_TypesAndValues.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..63d9c77802c7ebe7232fbf850dfe8dec172b6c14
--- /dev/null
+++ b/lib/LibItsVru_TypesAndValues.ttcn
@@ -0,0 +1,109 @@
+module LibItsVru_TypesAndValues {
+
+ // LibCommon
+ import from LibCommon_BasicTypesAndValues all;
+ import from LibCommon_DataStrings all;
+
+ // LibIts
+ import from ETSI_ITS_CDD language "ASN.1:1997" all;
+ import from VAM_PDU_Descriptions language "ASN.1:1997" all;
+
+ group utPrimitives {
+
+ /**
+ * @desc Upper Tester message to initialize IUT
+ * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use
+ */
+ type record UtVamInitialize {
+ Oct8 hashedId8
+ } with {
+ variant "FIELDORDER(msb)"
+ }
+
+ /**
+ * @desc Upper Tester events
+ * @member setVruProfile Set VRU profile
+ * @member leaveClusterWithCause Set VRU profile
+ * @member setVbsState (0: idle, 1: VRU-ACTIVE-STANDALONE, 2: VRU-ACTIVECLUSTERLEADER, 3: VRU-PASSIVE) See ETSI TS 103 300-3 V2.2.1 Table 5: Possible states of the VRU basic service related to cluster operation
+ */
+ type union UtVamTrigger {
+ UInt8 setVruProfile,
+ UInt8 leaveClusterWithCause,
+ UInt8 setVbsState
+ } with {
+ variant ""
+ }
+
+ /**
+ * @desc Upper Tester results message of the VRU IUT
+ */
+ type union UtVamResults {
+ boolean utVamInitializeResult,
+ boolean utVamTriggerResult
+ } with {
+ variant ""
+ } // End of type UtVamResults
+
+ /**
+ * @desc Upper Tester message to check event/status on VRU IUT
+ */
+ type record UtVamEventInd {
+ VAM vamMsg // TODO Rename into caMsg to be compliant with UtDenmEventInd
+ } with {
+ encode (vamMsg) "LibItsVru_asn1"
+ }
+
+ /**
+ * @desc List of Upper Tester messages to check event/status on VRU IUT
+ */
+ type record of UtVamEventInd UtVamEventIndList;
+
+ } with {
+ encode "UpperTester"
+ variant ""
+ } // End of group utPrimitives
+
+ group facilityPrimitives {
+
+ group fa1Primitives {
+
+ /**
+ * @desc FA1 VRU Indication Primitive
+ */
+ type record VamInd {
+ VAM msgIn,
+ UInt64 recvTime,
+ UInt8 gnNextHeader optional,
+ UInt8 gnHeaderType optional,
+ UInt8 gnHeaderSubtype optional,
+ UInt32 gnLifetime optional,
+ UInt8 gnTrafficClass optional,
+ UInt16 btpDestinationPort optional,
+ UInt16 btpInfo optional,
+ Bit256 ssp optional,
+ UInt32 its_aid optional
+ } with {
+ encode (msgIn) "PER"
+ }
+
+ /**
+ * @desc FA1 VRU Request Primitive
+ */
+ type record VamReq {
+ VAM msgOut
+ } with {
+ encode (msgOut) "PER"
+ }
+
+ } // End of group fa1Primitives
+
+ } // End of group facilityPrimitives
+ with {
+ variant ""
+ encode "LibIts_Interface"
+ } // End of group interfacePrimitives
+
+} with {
+ encode "LibItsVru"
+ }
+ // End of module LibItsVru_TypesAndValues
\ No newline at end of file
diff --git a/lib/asn1 b/lib/asn1
new file mode 160000
index 0000000000000000000000000000000000000000..360191dc8314cb71d146218821cf3a2b889ecf76
--- /dev/null
+++ b/lib/asn1
@@ -0,0 +1 @@
+Subproject commit 360191dc8314cb71d146218821cf3a2b889ecf76
diff --git a/lib/module.mk b/lib/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..3f7abad04a59e497c2d43c23fab2136f9041bc39
--- /dev/null
+++ b/lib/module.mk
@@ -0,0 +1,9 @@
+sources := \
+ LibItsVru_EncdecDeclarations.ttcn \
+ LibItsVru_Pics.ttcn \
+ LibItsVru_Pixits.ttcn \
+ LibItsVru_Templates.ttcn \
+ LibItsVru_TypesAndValues.ttcn \
+
+
+modules := asn1
diff --git a/lib_system/LibItsVru_Functions.ttcn b/lib_system/LibItsVru_Functions.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..3a43c1cb138e12d8f829390d108a1739250e680d
--- /dev/null
+++ b/lib_system/LibItsVru_Functions.ttcn
@@ -0,0 +1,549 @@
+module LibItsVru_Functions {
+
+ // LibCommon
+ import from LibCommon_Time all;
+ import from LibCommon_VerdictControl all;
+ import from LibCommon_Sync all;
+
+ // LibIts
+ import from ETSI_ITS_CDD language "ASN.1:1997" all;
+
+ // LibItsCommon
+ import from LibItsCommon_Pixits all;
+ import from LibItsCommon_Templates all;
+ import from LibItsCommon_Functions all;
+ import from LibItsCommon_TypesAndValues all;
+ import from LibItsCommon_TestSystem all;
+
+ // LibItsGeoNetworking
+ import from LibItsGeoNetworking_TypesAndValues all;
+
+ // LibItsVru
+ import from LibItsVru_TestSystem all;
+ import from LibItsVru_Templates all;
+ import from LibItsVru_TypesAndValues all;
+ import from LibItsVru_Pics all;
+ import from LibItsVru_Pixits all;
+
+ group utFuntions {
+
+ /**
+ * @desc Requests to bring the IUT in an initial state
+ * @param p_init The initialisation to trigger.
+ */
+ function f_utInitializeIut(template (value) UtVamInitialize p_init) runs on ItsVru {
+
+ //deactivate vamPort default alts
+ vc_vruDefaultActive := false;
+
+ utPort.send(p_init);
+ tc_wait.start;
+ alt {
+ [] utPort.receive(UtVamResults: { utVamInitializeResult := true }) {
+ tc_wait.stop;
+ log("*** f_utInitializeIut: INFO: IUT initialized ***");
+ }
+ [] utPort.receive {
+ tc_wait.stop;
+ log("*** f_utInitializeIut: INFO: IUT could not be initialized ***");
+ f_selfOrClientSyncAndVerdict("error", e_error);
+ }
+ [] tc_wait.timeout {
+ log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***");
+ f_selfOrClientSyncAndVerdict("error", e_timeout);
+ }
+ }
+
+ //activate vamPort default alts
+ vc_vruDefaultActive := true;
+
+ }
+
+ /**
+ * @desc Triggers event from the application layer
+ * @param p_event The event to trigger.
+ */
+ function f_utTriggerEvent(template (value) UtVamTrigger p_event) runs on ItsVru {
+
+ // deactivate vamPort default alts
+ vc_vruDefaultActive := false;
+
+ utPort.send(p_event);
+ tc_wait.start;
+ alt {
+ [] utPort.receive(UtVamResults: { utVamTriggerResult := true }) {
+ tc_wait.stop;
+ }
+ [] utPort.receive {
+ tc_wait.stop;
+ }
+ [] tc_wait.timeout {
+ }
+ }
+
+ //activate vamPort default alts
+ vc_vruDefaultActive := true;
+
+ }
+
+ } // End of group utFunctions
+
+ group adapterControl {
+
+ /**
+ * @desc Initialise secure mode if required
+ */
+ function f_initialiseSecuredMode(
+ in charstring p_certificateId := PX_CERT_FOR_TS
+ ) runs on ItsVru {
+
+ if (PICS_IS_IUT_SECURED == true) {
+
+ if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) {
+ log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***");
+ stop;
+ }
+ }
+
+ } // End of function f_initialiseSecuredMode()
+
+ function f_uninitialiseSecuredMode() runs on ItsVru {
+
+ if (PICS_IS_IUT_SECURED == true) {
+ f_acTriggerSecEvent(m_acDisableSecurity);
+ }
+
+ } // End of function f_initialiseSecuredMode()
+
+ /**
+ * @desc Triggers event in the test system adaptation.
+ * @param p_event The event to trigger
+ * @return FncRetCode
+ */
+ function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsVru return FncRetCode {
+ var FncRetCode v_ret := e_success;
+
+ acPort.send(p_event);
+ tc_ac.start;
+ alt {
+ [] acPort.receive(m_acSecResponseSuccess) {
+ tc_ac.stop;
+ }
+ [] acPort.receive {
+ tc_ac.stop;
+ log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***");
+ f_selfOrClientSyncAndVerdict("error", e_error);
+ }
+ [] tc_ac.timeout {
+ log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***");
+ f_selfOrClientSyncAndVerdict("error", e_timeout);
+ }
+ }
+
+ return v_ret;
+ }
+
+ /**
+ * @desc Triggers event in the test system adaptation.
+ * @param p_event The event to trigger
+ * @return FncRetCode
+ */
+ function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsVru return FncRetCode {
+ var FncRetCode v_ret := e_success;
+
+ acPort.send(p_event);
+ tc_ac.start;
+ alt {
+ [] acPort.receive(m_acGnssResponseSuccess) {
+ tc_ac.stop;
+ }
+ [] acPort.receive(m_acGnssResponseError) {
+ tc_ac.stop;
+ log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***");
+ f_selfOrClientSyncAndVerdict("error", e_error);
+ }
+ [] tc_ac.timeout {
+ log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***");
+ f_selfOrClientSyncAndVerdict("error", e_timeout);
+ }
+ }
+
+ return v_ret;
+ }
+
+ /**
+ * @desc Loads the given scenario
+ *
+ * @param p_scenario The scenario to load.
+ */
+ function f_acLoadScenario(in Scenario p_scenario) runs on ItsVru {
+
+ if (PX_GNSS_SCENARIO_SUPPORT==true) {
+ f_acTriggerGnssEvent(m_loadScenario(p_scenario));
+ }
+ } // End of function f_acLoadScenario
+
+ /**
+ * @desc Starts a loaded scenario
+ */
+ function f_acStartScenario() runs on ItsVru {
+
+ if (PX_GNSS_SCENARIO_SUPPORT==true) {
+ f_acTriggerGnssEvent(m_startScenario);
+ vc_scenarioStarted := true;
+ }
+ } // End of function f_acStartScenario
+
+ /**
+ * @desc Stops a loaded scenario
+ */
+ function f_acStopScenario() runs on ItsVru {
+
+ if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) {
+ f_acTriggerGnssEvent(m_stopScenario);
+ vc_scenarioStarted := false;
+ }
+ } // End of function f_acStopScenario
+
+ function f_acAwaitTimeInRunningScenario(
+ integer p_time,
+ boolean p_stopOnVamMessage := true
+ ) runs on ItsVru return FncRetCode {
+ var FncRetCode v_ret := e_success;
+
+ if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) {
+
+ f_acTriggerGnssEvent(m_timeInRunningScenario(p_time));
+
+ tc_ac.start(int2float(p_time)*1.1);
+ alt {
+ [p_stopOnVamMessage] vamPort.check(receive(mw_vamInd ( mw_vamMsg_any ))) {
+ tc_ac.stop;
+ }
+ [] acPort.receive(m_acGnssTimeReachedSuccess) {
+ tc_ac.stop;
+ }
+ [] acPort.receive(m_acGnssTimeReachedError) {
+ tc_ac.stop;
+ log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***");
+ f_selfOrClientSyncAndVerdict("error", e_error);
+ }
+ [] tc_ac.timeout {
+ log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***");
+ f_selfOrClientSyncAndVerdict("error", e_timeout);
+ }
+ }
+
+ }
+ return v_ret;
+ } // End of function f_acAwaitTimeInRunningScenario
+
+ } // End of group adapterControl
+
+ group vruConfigurationFunctions {
+
+ function f_cfMtcUp01(
+ out ItsVru p_vam_cluster_leader,
+ out ItsVru p_iut
+ ) runs on ItsBaseMtc {
+ p_vam_cluster_leader := ItsVru.create("VRU_CLUSTER_LEADER") alive;
+ p_iut := ItsVru.create("VRU_IUT") alive;
+
+ connect(self:syncPort, mtc:syncPort);
+ connect(p_vam_cluster_leader:syncPort, self:syncPort);
+ connect(p_iut:syncPort, self:syncPort);
+
+ //connect(p_vam_cluster_leader:infoPort, p_iut:infoPort);
+
+ } // End of function f_cfMtcUp01
+
+ function f_cfMtcUp02(
+ out ItsVru p_vam_cluster_1,
+ out ItsVru p_vam_cluster_2,
+ out ItsVru p_iut
+ ) runs on ItsBaseMtc {
+ p_vam_cluster_1 := ItsVru.create("VRU-CLUSTER_LEADER") alive;
+ p_vam_cluster_2 := ItsVru.create("VRU-CLUSTER_LEADER") alive;
+ p_iut := ItsVru.create("VRU-IUT") alive;
+
+ connect(self:syncPort, mtc:syncPort);
+ connect(p_vam_cluster_1:syncPort, self:syncPort);
+ connect(p_vam_cluster_2:syncPort, self:syncPort);
+ connect(p_iut:syncPort, self:syncPort);
+
+ //connect(p_vam_cluster_leader:infoPort, p_iut:infoPort);
+
+ } // End of function f_cfMtcUp02
+
+ function f_cfMtcDown01(
+ inout ItsVru p_vam_cluster_leader,
+ inout ItsVru p_iut
+ ) runs on ItsBaseMtc {
+
+ deactivate;
+
+ disconnect(self:syncPort, mtc:syncPort);
+ disconnect(p_vam_cluster_leader:syncPort, self:syncPort);
+ disconnect(p_iut:syncPort, self:syncPort);
+
+ //disconnect(p_vam_cluster_leader:infoPort, p_iut:infoPort);
+
+ p_vam_cluster_leader.done;
+ p_iut.done;
+ }
+
+ function f_cfMtcDown02(
+ out ItsVru p_vam_cluster_1,
+ out ItsVru p_vam_cluster_2,
+ inout ItsVru p_iut
+ ) runs on ItsBaseMtc {
+
+ deactivate;
+
+ disconnect(self:syncPort, mtc:syncPort);
+ disconnect(p_vam_cluster_1:syncPort, self:syncPort);
+ disconnect(p_vam_cluster_2:syncPort, self:syncPort);
+ disconnect(p_iut:syncPort, self:syncPort);
+
+ //disconnect(p_vam_cluster_leader:infoPort, p_iut:infoPort);
+
+ p_vam_cluster_1.done;
+ p_vam_cluster_2.done;
+ p_iut.done;
+ }
+
+ /**
+ * @desc Setups default configuration
+ * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT
+ */
+ function f_cfUp(
+ in charstring p_certificateId := PX_CERT_FOR_TS
+ ) runs on ItsVru system ItsVruSystem {
+
+ map(self:utPort, system:utPort);
+ map(self:acPort, system:acPort);
+ map(self:vamPort, system:vamPort);
+ f_connect4SelfOrClientSync();
+
+ // Initialise secured mode
+ f_initialiseSecuredMode(p_certificateId);
+
+ } // End of function f_cfUp
+
+ /**
+ * @desc Deletes default configuration
+ */
+ function f_cfDown() runs on ItsVru system ItsVruSystem {
+
+ // Initialise secured mode
+ f_uninitialiseSecuredMode();
+
+ unmap(self:vamPort, system:vamPort);
+
+ f_acStopScenario();
+ unmap(self:utPort, system:utPort);
+ unmap(self:acPort, system:acPort);
+ f_disconnect4SelfOrClientSync();
+
+ } // End of function f_cfDown
+
+ /**
+ * @desc Setups default configuration
+ * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT
+ */
+ function f_cfUp_cluster() runs on ItsVru system ItsVruSystem {
+
+ //map(self:utPort, system:utPort);
+ map(self:acPort, system:acPort);
+ map(self:vamPort, system:vamPort);
+ f_connect4SelfOrClientSync();
+
+ // Initialise secured mode
+ f_initialiseSecuredMode();
+
+ } // End of function f_cfUp_cluster
+
+ /**
+ * @desc Deletes default configuration
+ */
+ function f_cfDown_cluster_leader() runs on ItsVru system ItsVruSystem {
+ deactivate;
+
+ // Initialise secured mode
+ f_uninitialiseSecuredMode();
+
+ unmap(self:vamPort, system:vamPort);
+
+ f_acStopScenario();
+ //unmap(self:utPort, system:utPort);
+ unmap(self:acPort, system:acPort);
+ f_disconnect4SelfOrClientSync();
+
+ } // End of function f_cfDown_cluster_leader
+
+ /**
+ * @desc Setups default configuration
+ */
+ function f_cfUp_iut() runs on ItsVru system ItsVruSystem {
+
+ map(self:utPort, system:utPort);
+ map(self:acPort, system:acPort);
+ map(self:vamPort, system:vamPort);
+ f_connect4SelfOrClientSync();
+
+ // Initialise secured mode
+ f_initialiseSecuredMode();
+
+ f_prInitialState();
+
+ } // End of function f_cfUp_iut
+
+ /**
+ * @desc Deletes default configuration
+ */
+ function f_cfDown_iut() runs on ItsVru system ItsVruSystem {
+ deactivate;
+
+ // Initialise secured mode
+ f_uninitialiseSecuredMode();
+
+ unmap(self:vamPort, system:vamPort);
+
+ f_acStopScenario();
+ unmap(self:utPort, system:utPort);
+ unmap(self:acPort, system:acPort);
+ f_disconnect4SelfOrClientSync();
+
+ } // End of function f_cfDown_iut
+
+ } // End of vruConfigurationFunctions
+
+ group defaults {
+
+ /**
+ * @desc basic default behaviour handling
+ */
+ altstep a_default() runs on ItsVru {
+
+ [vc_vruDefaultActive] vamPort.receive(mw_vamInd ( mw_vamMsg_any )){
+ log("*** a_default: INFO: VAM message received in default ***");
+ vc_vruReceived := true;
+ repeat;
+ }
+ [vc_vruDefaultActive] vamPort.receive {
+ log("*** a_default: ERROR: event received on VAM port in default ***");
+ f_selfOrClientSyncAndVerdict("error", e_error);
+ }
+ [] acPort.receive(AdapterControlResults: { acGnssTimeReached := ? }) {
+ log("*** a_default: INFO: TimeReached event received on AC port in default ***");
+ repeat;
+ }
+ [] acPort.receive(AdapterControlResults: { acGnssSpeedReached := ? }) {
+ log("*** a_default: INFO: SpeedReached event received on AC port in default ***");
+ repeat;
+ }
+ [] acPort.receive(AdapterControlResults: { acGnssDistanceCovered := ? }) {
+ log("*** a_default: INFO: DistanceCovered event received on AC port in default ***");
+ repeat;
+ }
+ [] acPort.receive {
+ tc_ac.stop;
+ log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***");
+ f_selfOrClientSyncAndVerdict("error", e_error);
+ }
+ [] any timer.timeout {
+ log("*** a_default: INCONC: a timer expired in default ***");
+ f_selfOrClientSyncAndVerdict("error", e_timeout);
+ }
+ [] a_shutdown() {
+ f_poDefault();
+ f_cfDown();
+ log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
+ stop;
+ }
+ }//end altstep a_basicDefault
+
+ /**
+ * @desc The default for handling upper tester messages.
+ */
+ altstep a_utDefault() runs on ItsVru {
+ var UtVamEventInd v_event;
+ [] utPort.receive(UtVamEventInd:?) -> value v_event {
+ //store every upper tester indication received
+ vc_utEvents[lengthof(vc_utEvents)] := v_event;
+ repeat;
+ }
+ [] utPort.receive {
+ log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***");
+ repeat;
+ }
+ }
+
+ } // End of defaults
+
+ group preambles {
+
+ /**
+ * @desc The default preamble.
+ */
+ function f_prDefault() runs on ItsVru {
+ vc_default := activate(a_default());
+ activate(a_utDefault());
+ }
+
+ /**
+ * @desc Initialize the IUT
+ * @remark No specific actions specified in the base standard
+ */
+ function f_prInitialState(
+ in Scenario p_scenario := e_staticPosition,
+ in boolean p_awaitInitialVAM := true,
+ in template (value) UtVamInitialize p_vruInitialize := m_vruInitialize,
+ in boolean p_awaitTimeInRunningScenario := true
+ ) runs on ItsVru {
+
+ f_utInitializeIut(p_vruInitialize);
+
+ f_prDefault();
+
+ f_acLoadScenario(p_scenario);
+
+ //Allow burst mode at the beginning
+ f_sleep(1.0);
+
+ vamPort.clear;
+
+ f_acStartScenario();
+ if (p_awaitTimeInRunningScenario) {
+ f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix());
+ }
+
+ if (p_awaitInitialVAM) {
+ tc_ac.start;
+ alt {
+ [] vamPort.receive(mw_vamInd ( mw_vamMsg_any )){
+ tc_ac.stop;
+ log("*** " & testcasename() & ": INFO: Received initial VAM ***");
+ }
+ [] tc_ac.timeout {
+ log("*** " & testcasename() & ": INCONC: Initial VAM not received ***");
+ f_selfOrClientSyncAndVerdictPreamble("error", e_timeout);
+ }
+ } // End of 'alt' statement
+ }
+
+ } // End of function f_prInitialState
+
+ } // End of preambles
+
+ group postambles {
+
+ /**
+ * @desc The default postamble.
+ */
+ function f_poDefault() runs on ItsVru {
+ }
+
+ } // End of group postambles
+
+} // End of module LibItsVru_Functions
\ No newline at end of file
diff --git a/lib_system/LibItsVru_TestSystem.ttcn b/lib_system/LibItsVru_TestSystem.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..2eaecf012945bec5a2e8be90ca88d70c8ff715eb
--- /dev/null
+++ b/lib_system/LibItsVru_TestSystem.ttcn
@@ -0,0 +1,101 @@
+module LibItsVru_TestSystem language "TTCN-3:2010 Real Time and Performance Testing" {
+
+ // LibCommon
+ import from LibCommon_BasicTypesAndValues all;
+ import from LibCommon_DataStrings all;
+
+ // LibIts
+ import from VAM_PDU_Descriptions language "ASN.1:1997" all;
+
+ // LibItsCommon
+ import from LibItsCommon_TestSystem all;
+ import from LibItsCommon_TypesAndValues all;
+
+ // LibItsVru
+ import from LibItsVru_TypesAndValues all;
+
+ group portDefinitions {
+
+ /**
+ * @desc Adapter control port
+ */
+ type port AdapterControlPort message {
+ out
+ AcGnssPrimitive, AcSecPrimitive;
+ in
+ AdapterControlResults;
+ } // end AdapterControlPort
+
+ /**
+ * @desc Upper Tester port
+ */
+ type port UpperTesterPort message {
+ out
+ UtVamInitialize, UtVamTrigger;
+ in
+ UtVamResults, UtVamEventInd;
+ } // end UpperTesterPort
+
+ } // end portDefinitions
+ group interfacePorts {
+
+ group facilityPorts {
+
+ group fa1Ports {
+
+ /**
+ * @desc FA1 CPS Port (CPS/BTP/GeoNet/RadioNetwork)
+ */
+ type port VruPort message {
+ in VamInd;
+ out VamReq;
+ } // End of port VruPort
+
+ } // end fa1Ports
+
+ } // End of group facilityPorts
+
+ } // End of group interfacePorts
+
+ group componentDefinitions {
+ /**
+ * @desc ITS System Adapter
+ */
+ type component ItsVruSystem {
+
+ port UpperTesterPort utPort;
+ port AdapterControlPort acPort;
+
+ // FA1 ports
+ port VruPort vamPort;
+ } // end component ItsAdapter
+
+ } // End of group componentDefinitions
+
+ /**
+ * @desc Test component for ITS Facility layer
+ */
+ type component ItsVru extends ItsBaseComponent {
+ port UpperTesterPort utPort;
+ port AdapterControlPort acPort;
+
+ // FA1 ports
+ port VruPort vamPort;
+ //timers
+
+ //component variables
+ var VamInd vc_vamMsg;
+
+ //default
+ var default vc_default := null;
+
+ //global variables
+ var boolean vc_vruReceived := false;
+ var UtVamEventIndList vc_utEvents := {};
+
+ var boolean vc_utDefaultActive := true;
+ var boolean vc_vruDefaultActive := true;
+
+ } // End of component ItsVru
+
+} // End of module LibItsVru_TestSystem
\ No newline at end of file
diff --git a/lib_system/module.mk b/lib_system/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..04732d31abc7432bf9ff0d26c9dc26e5363a668d
--- /dev/null
+++ b/lib_system/module.mk
@@ -0,0 +1 @@
+sources := LibItsVru_Functions.ttcn LibItsVru_TestSystem.ttcn
diff --git a/module.mk b/module.mk
new file mode 100644
index 0000000000000000000000000000000000000000..e94440b50308ed4d26025f03bcece6b8bbb1cc66
--- /dev/null
+++ b/module.mk
@@ -0,0 +1,51 @@
+suite := AtsVRU
+pdu := VAM
+
+sources := ItsVru_TestCases.ttcn \
+ ItsVru_TestControl.ttcn \
+ ItsVru_TpFunctions.ttcn \
+
+modules := lib \
+ lib_system \
+ ../../titan-test-system-framework/ttcn/LibHelpers \
+ ../../titan-test-system-framework/ttcn/LibSecurity \
+ ../../titan-test-system-framework/ttcn/LibXsd \
+ ../LibCommon \
+ ../LibIts \
+ ../AtsGeoNetworking/lib \
+ ../AtsGeoNetworking/lib_system \
+ ../AtsIPv6OverGeoNetworking/lib \
+ ../AtsIPv6OverGeoNetworking/lib_system \
+ ../AtsSecurity/lib \
+ ../AtsSecurity/lib_system \
+ ../AtsBTP/lib \
+ ../AtsBTP/lib_system \
+ /ccsrc/Ports/LibIts_ports \
+ /ccsrc/Ports/LibIts_ports/VRU_ports \
+ /ccsrc/Ports/LibIts_ports/GN_ports \
+ /ccsrc/Ports/LibIts_ports/IPv6oGN_ports \
+ /ccsrc/Ports/LibIts_ports/BTP_ports \
+ /ccsrc/EncDec \
+ /titan-test-system-framework/ccsrc/Framework \
+ /titan-test-system-framework/ccsrc/loggers \
+ /titan-test-system-framework/ccsrc/Protocols/ETH \
+ /titan-test-system-framework/ccsrc/Protocols/Tcp \
+ /titan-test-system-framework/ccsrc/Protocols/Pcap \
+ /titan-test-system-framework/ccsrc/Protocols/Xml \
+ /titan-test-system-framework/ccsrc/Helpers \
+ /titan-test-system-framework/ccsrc/security \
+ /ccsrc/Externals \
+ /ccsrc/geospacial \
+ /ccsrc/Asn1c \
+ /ccsrc/framework \
+ /ccsrc/Protocols/VRU \
+ /ccsrc/Protocols/VRU_layers \
+ /ccsrc/Protocols/GeoNetworking \
+ /ccsrc/Protocols/BTP \
+ /ccsrc/Protocols/BTP_layers \
+ /ccsrc/Protocols/LTE \
+ /ccsrc/Protocols/Qualcomm \
+ /ccsrc/Protocols/UpperTester \
+ /ccsrc/Protocols/Security \
+ ../modules/titan.TestPorts.Common_Components.Abstract_Socket \
+