Commit fbcf1cfa authored by Yann Garcia's avatar Yann Garcia
Browse files

Validate VRU Test System

parent 612f5a9b
Loading
Loading
Loading
Loading
+88 −0
Original line number Diff line number Diff line
@@ -2135,6 +2135,94 @@ module ItsVru_TestCases {

  } // 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
     * <pre>
     * 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
     *      }
     *  } 
     * </pre>
     * 
     * @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
     * <pre>
     * 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
     *      }
     *  } 
     * </pre>
     * 
     * @see       ETSI TS 104 028-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_initiate_cluster_leader;
      var ItsVru v_iut;

      // Test control
      if (not(PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) {
        log("*** " & testcasename() & ": PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }

      // Test component configuration
      f_cfMtcUp01(v_vam_initiate_cluster_leader, v_iut);

      // Start components
      /* TODO v_vam_clustev_vam_initiate_cluster_leaderr_leader.start(f_TC_VBS_CLTR_BV_02_initiate_cluster_leader());
      v_iut.start(f_TC_VBS_CLTR_BV_02_iut());*/

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

      // Cleanup
      f_cfMtcDown01(v_vam_initiate_cluster_leader, v_iut);

    } // End of TC_VBS_CLTR_BV_02

  } // End of group vruTransitionTriggering

  group securityConstraints {

    /**
+4 −6
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ module ItsVru_TestControl {
  // Test Execution
  control {
    
    if(PICS_VAM_GENERATION) {
    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());
@@ -64,14 +64,12 @@ module ItsVru_TestControl {
      execute(TC_VBS_IFGN_BV_02());
      execute(TC_VBS_IFGN_BV_03());

      if (PICS_IS_IUT_SECURED) {
        execute(TC_VBS_SECC_BV_02());
        execute(TC_VBS_SECC_BV_04());
      }

    }

    if (PICS_VAM_TRANSMISSION) {
    if (PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED) {
      execute(TC_VBS_TRANS_BV_01());
      if (PICS_CLUSTERING) {
        execute(TC_VBS_TRANS_BV_02());
+123 −40
Original line number Diff line number Diff line
@@ -577,8 +577,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -620,12 +620,12 @@ module ItsVru_TpFunctions {
     */
    function f_TC_VBS_MSGF_BV_02() runs on ItsVru {
      // Local variables
      var integer v_lower_bound := (f_getCurrentTime() - 5000) mod 65536; // Time unit is millisecond
      var integer v_upper_bound := (f_getCurrentTime() + 5000) mod 65536; // Time unit is millisecond
      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 PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -640,6 +640,8 @@ module ItsVru_TpFunctions {
      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(
@@ -653,6 +655,16 @@ module ItsVru_TpFunctions {
          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);
@@ -672,8 +684,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -685,6 +697,8 @@ module ItsVru_TpFunctions {
      
      // Preamble
      f_prInitialState();
      // Set VRU profile
      f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE));
      f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
      
      // Test Body
@@ -699,7 +713,6 @@ module ItsVru_TpFunctions {
                                                                mw_vam_parameters(
                                                                                  mw_basic_container(
                                                                                                     (StationType_pedestrian_ .. StationType_motorcycle_)
                                                                                                     //pedestrian, cyclist, moped, motorcycle, lightVruVehicle, animal
                           )))))) { 
          tc_ac.stop;
          log("*** " & testcasename() & ": PASS: VAM containing valid StationType received ***");
@@ -713,13 +726,25 @@ module ItsVru_TpFunctions {
                                                                -,
                                                                mw_vam_parameters(
                                                                                  mw_basic_container(
                                                                                                     (12..13)
                                                                                                     //pedestrian, cyclist, moped, motorcycle, lightVruVehicle, animal
                                                                                                     (StationType_lightVruVehicle .. StationType_animal)
                           )))))) { 
          tc_ac.stop;
          log("*** " & testcasename() & ": PASS: VAM containing valid StationType received ***");
          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);
@@ -739,8 +764,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -791,8 +816,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -844,8 +869,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -897,8 +922,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -950,8 +975,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -1003,8 +1028,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not(PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST)) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST required for executing the TC ***");
      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;
      }
@@ -1016,10 +1041,9 @@ module ItsVru_TpFunctions {

      // Preamble
      f_prInitialState();
      f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
      
      // Set VRU profile
      f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE));
      f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
@@ -1060,8 +1084,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -1168,8 +1192,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -1221,8 +1245,8 @@ module ItsVru_TpFunctions {
      // Local variables
      
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -2777,8 +2801,8 @@ module ItsVru_TpFunctions {
      var boolean v_cond_1 := false, v_cond_2 := false;
     
      // Test control
      if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
      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;
      }
@@ -2842,8 +2866,8 @@ module ItsVru_TpFunctions {
    const UInt8 c_GnHstSingleHop := 0;
    
    // Test control
    if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
      log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
    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;
    }    
@@ -2895,8 +2919,8 @@ module ItsVru_TpFunctions {
    // Local variables
    
    // Test control
    if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) {
      log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***");
    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;
    }    
@@ -3252,6 +3276,65 @@ module ItsVru_TpFunctions {

  } // 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 PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_CLUSTERING and not 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: VAM 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_CLTR_BV_01

    group f_TC_VBS_CLTR_BV_02 {


    } // End of group f_TC_VBS_CLTR_BV_02

  } // End of group vruTransitionTriggering

  group securityConstraints {

+6 −6
Original line number Diff line number Diff line
@@ -426,12 +426,12 @@ module LibItsVru_Functions {
    altstep a_default() runs on ItsVru {
      
      [vc_vruDefaultActive] vamPort.receive(mw_vamInd ( mw_vamMsg_any )){ 
        log("*** a_default: INFO: CPM message received in default ***");
        log("*** a_default: INFO: VAM message received in default ***");
        vc_vruReceived := true;
        repeat;
      }
      [vc_vruDefaultActive] vamPort.receive {
        log("*** a_default: ERROR: event received on CPM port in default ***");
        log("*** a_default: ERROR: event received on VAM port in default ***");
        f_selfOrClientSyncAndVerdict("error", e_error);
      }
      [] acPort.receive(AdapterControlResults: { acGnssTimeReached := ? }) {
@@ -497,7 +497,7 @@ module LibItsVru_Functions {
     */  
    function f_prInitialState(
                  in Scenario p_scenario := e_staticPosition,
                  in boolean p_awaitInitialCPM := true,
                  in boolean p_awaitInitialVAM := true,
                  in template (value) UtVamInitialize p_vruInitialize := m_vruInitialize,
                  in boolean p_awaitTimeInRunningScenario := true 
    ) runs on ItsVru {
@@ -518,15 +518,15 @@ module LibItsVru_Functions {
        f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix());
      }
      
      if (p_awaitInitialCPM) {
      if (p_awaitInitialVAM) {
        tc_ac.start;
        alt {
          [] vamPort.receive(mw_vamInd ( mw_vamMsg_any )){
            tc_ac.stop;            
            log("*** " & testcasename() & ": INFO: Received initial CPM ***");
            log("*** " & testcasename() & ": INFO: Received initial VAM ***");
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Initial CPM not received ***");
            log("*** " & testcasename() & ": INCONC: Initial VAM not received ***");
            f_selfOrClientSyncAndVerdictPreamble("error", e_timeout);
          }
        } // End of 'alt' statement