Commit 091299e5 authored by Yann Garcia's avatar Yann Garcia
Browse files

Add functions to initiate and create a cluster

parent 5f69d1fa
Loading
Loading
Loading
Loading
+403 −6
Original line number Diff line number Diff line
@@ -553,7 +553,7 @@ module ItsVru_TestCases {
      f_cfMtcUp01(v_vam_cluster_leader, v_iut);

      // Start components
      v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader());
      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
@@ -608,7 +608,7 @@ module ItsVru_TestCases {
      f_cfMtcUp01(v_vam_cluster_leader, v_iut);

      // Start components
      v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_16_cluster_leader());
      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_16_iut());

      // Synchronization
@@ -667,7 +667,7 @@ module ItsVru_TestCases {
      f_cfMtcUp01(v_vam_cluster_leader, v_iut);

      // Start components
      v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_17_cluster_leader());
      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_17_iut());

      // Synchronization
@@ -726,7 +726,7 @@ module ItsVru_TestCases {
      f_cfMtcUp01(v_vam_cluster_leader, v_iut);

      // Start components
      v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_18_cluster_leader());
      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_18_iut());

      // Synchronization
@@ -786,7 +786,7 @@ module ItsVru_TestCases {
      f_cfMtcUp01(v_vam_cluster_leader, v_iut);

      // Start components
      v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_19_cluster_leader());
      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_19_iut());

      // Synchronization
@@ -847,7 +847,7 @@ module ItsVru_TestCases {
      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_20_cluster_leader_1());
      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_20_cluster_leader_2());
      v_iut.start(f_TC_VBS_MSGF_BV_20_iut());

@@ -859,6 +859,247 @@ module ItsVru_TestCases {

    } // End of testcase TC_VBS_MSGF_BV_20

    /**
     * @desc Check that clusterLeaveReason indicates CancelledJoin when the joining is cancelled
     * <pre>
     * 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)
     *      }
     *  } 
     * </pre>
     * 
     * @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_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_21_cluster_leader()); // Initiate the cluster
      v_iut.start(f_TC_VBS_MSGF_BV_21_iut());

      // Synchronization
      f_serverSync2ClientsAndStop({c_prDone, c_tbDone});

      // Cleanup
      f_cfMtcDown01(v_vam_cluster_leader, v_iut);

    } // End of testcase TC_VBS_MSGF_BV_21

    /**
     * @desc Check that clusterLeaveReason indicates FailedJoin when the joining is cancelled
     * <pre>
     * 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)
     *      }
     *  } 
     * </pre>
     * 
     * @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_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_21_cluster_leader()); // FIXME Seems to be identical to TP/VBS/MSGF/BV-21
      v_iut.start(f_TC_VBS_MSGF_BV_21_iut());

      // Synchronization
      f_serverSync2ClientsAndStop({c_prDone, c_tbDone});

      // Cleanup
      f_cfMtcDown01(v_vam_cluster_leader, v_iut);

    } // End of testcase TC_VBS_MSGF_BV_22

    /**
     * @desc Check that clusterLeaveReason indicates SafetyCondition when another cluster VRU comes too close
     * <pre>
     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
     * Initial conditions: 
     *     with {
     *         VBS in state VRU-PASSIVE
     *     }
     * 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)
     *      }
     *  } 
     * </pre>
     * 
     * @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
      // TODO
      /*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_23_cluster_approching());
      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
     * <pre>
     * 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)
     *      }
     *  } 
     * </pre>
     * 
     * @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















@@ -906,16 +1147,172 @@ module ItsVru_TestCases {



    /**
     * @desc Check that the VruMotionPredictionContainer includes the pathHistory of type PathHistory consisting of up to 40 past points
     * <pre>
     * 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
     *      }
     *  } 
     * </pre>
     * 
     * @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
     * <pre>
     * 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
     *      }
     *  } 
     * </pre>
     * 
     * @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
     * <pre>
     * 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
     *      }
     *  } 
     * </pre>
     * 
     * @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



+794 −806

File changed.

Preview size limit exceeded, changes collapsed.

+3 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ module LibItsVru_Pixits {

  modulepar StandardLength12b PX_VRU_CLUSTER_CREATE_RADIUS     := 30; // 3 meters

  modulepar VruClusterProfiles PX_VRU_CLUSTER_CREATE_PROFILE   := '0000'B; // At least on pedestrian
  modulepar VruClusterProfiles PX_VRU_CLUSTER_CREATE_PROFILE   := '0000'B; // At least one pedestrian

  modulepar ClusterBreakupReason PX_VRU_CLUSTER_BREAKUP_REASON := Vru_ClusterBreakupReason_clusteringPurposeCompleted;

@@ -35,4 +35,6 @@ module LibItsVru_Pixits {

  modulepar UInt32 PX_DELTA_SPEED_OUT_OF_BOX     := 20;

  modulepar UInt32 PX_DELTA_CARDINALITY_CANCEL   := 100;

} // End of module LibItsVru_Pixits
 No newline at end of file