Commit 74eac227 authored by Yann Garcia's avatar Yann Garcia
Browse files

Finalyze TC_CPS_MSGF_BV_01

parent ce6120ec
Loading
Loading
Loading
Loading
+53 −2
Original line number Diff line number Diff line
module ItsCps_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;
  
  // LibItsCps
  import from LibItsCps_TestSystem all;
  import from LibItsCps_Functions all;
  import from LibItsCps_Pics all;

  // Ats Its
  // AtsCPS
  import from ItsCps_TpFunctions all;

  group message_format {

    /**
     * @desc Check that protocolVersion is set to 3 and messageID is set to 14
     * <pre>
     * Pics Selection: PICS_CPM_GENERATION
     * Initial conditions: 
     *     with {
     *         the IUT being in the "initial state"
     *     }
     * Expected behaviour:
     *  ensure that {
     *      when {
     *          a CPM is generated
     *      }
     *      then {
     *          CPM is sent
     *              containing ITS PDU header
     *                  containing protocolVersion
     *                      indicating value 3
     *              and containing messageID
     *                  indicating value 14
     *      }
     *  } 
     * </pre>
     * 
     * @see       ETSI TS 104 018-2 V2.0.2 (2024-11) TP/CPS/MSGF/BV-01
     * @reference ETSI TS 103 324 (V2.2.1), clause 7.1.2
     */
    testcase TC_CPS_MSGF_BV_01() runs on ItsCps system ItsCpsSystem {

      f_TC_CPS_MSGF_BV_01();

    } // End of TC_CPS_MSGF_BV_01

  } // End of group message_format



  group cpsLowerLayerParameters {

    /**
+5 −3
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ module ItsCps_TestControl {
  control {
    
    if(PICS_CPS_GENERATION) {
      execute(TC_CPS_MSGF_BV_01());

      execute(TC_CPS_MSD_PAR_BV_01());
      execute(TC_CPS_MSD_PAR_BV_02());
      execute(TC_CPS_MSD_PAR_BV_03());
+63 −7
Original line number Diff line number Diff line
@@ -25,7 +25,63 @@ module ItsCps_TpFunctions {
  import from LibItsCps_TypesAndValues all;
  import from LibItsCps_Pics all;

  // LibItsSecurity
  import from LibItsSecurity_Functions all;

  group message_format {

    /**
     * @desc  TP Function for TC_CPS_MSGF_BV_01
     */
    function f_TC_CPS_MSGF_BV_01() runs on ItsCps {
      // Local variables
      
      // Test control
      if (not PICS_CPS_GENERATION or not PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_CPS_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 {
        [] cpmPort.receive(
                           mw_cpmInd(
                                     mw_cpmMsg_any
                           )) { 
          tc_ac.stop;
          log("*** " & testcasename() & ": PASS: CPM messageID is set to 16 ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);  
        }    
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: CPS message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_poDefault();
      f_cfDown();

    } // End of function f_TC_CPS_MSGF_BV_01

  } // End of group message_format






  group cpsLowerLayerParameters {
    
    /**
@@ -55,17 +111,17 @@ module ItsCps_TpFunctions {
      // Test Body
      tc_ac.start;
      alt {
        [] cpmPort.receive(mw_cpsIndWithGnParameters(mw_cpmMsg_any, c_gnNhBtpB)) { 
        [] cpmPort.receive(mw_cpmIndWithGnParameters(mw_cpmMsg_any, c_gnNhBtpB)) { 
        tc_ac.stop;
        log("*** " & testcasename() & ": PASS: Expected CPS message encapsultated in BTP-B packet received ***");
        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);  
        }
        [] cpmPort.receive(mw_cpsIndWithGnParameters(mw_cpmMsg_any, omit)) { 
        [] cpmPort.receive(mw_cpmIndWithGnParameters(mw_cpmMsg_any, omit)) { 
        tc_ac.stop;
        log("*** " & testcasename() & ": INCONC: no GN NH information in CpmInd ***");
        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);  
        }      
        [] cpmPort.receive(mw_cpsInd(mw_cpmMsg_any)) { 
        [] cpmPort.receive(mw_cpmInd(mw_cpmMsg_any)) { 
        tc_ac.stop;
        log("*** " & testcasename() & ": FAIL: Expected CPS message received, but not encapsulated in BTP-B packet ***");
        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);  
@@ -110,17 +166,17 @@ module ItsCps_TpFunctions {
    // Test Body
    tc_ac.start;
    alt {
      [] cpmPort.receive(mw_cpsIndWithGnParameters(mw_cpmMsg_any, -, c_gnHtTsb, c_GnHstSingleHop)) { 
      [] cpmPort.receive(mw_cpmIndWithGnParameters(mw_cpmMsg_any, -, c_gnHtTsb, c_GnHstSingleHop)) { 
      tc_ac.stop;
      log("*** " & testcasename() & ": PASS: Expected CPS message encapsulated in SHB packet received ***");
      f_selfOrClientSyncAndVerdict(c_tbDone, e_success);  
      }
      [] cpmPort.receive(mw_cpsIndWithGnParameters(mw_cpmMsg_any, -, omit, omit)) { 
      [] cpmPort.receive(mw_cpmIndWithGnParameters(mw_cpmMsg_any, -, omit, omit)) { 
      tc_ac.stop;
      log("*** " & testcasename() & ": INCONC: no GN HT/HST information in CpmInd ***");
      f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);  
      }      
      [] cpmPort.receive(mw_cpsInd(mw_cpmMsg_any)) { 
      [] cpmPort.receive(mw_cpmInd(mw_cpmMsg_any)) { 
      tc_ac.stop;
      log("*** " & testcasename() & ": FAIL: Expected CPS message received, but not encapsulated in SHB packet ***");
      f_selfOrClientSyncAndVerdict(c_tbDone, e_error);  
@@ -164,7 +220,7 @@ module ItsCps_TpFunctions {
    // Test Body
    tc_ac.start;
    alt {
      [] cpmPort.receive(mw_cpsIndWithGnParameters(mw_cpmMsg_any)) -> value v_cpmInd { 
      [] cpmPort.receive(mw_cpmIndWithGnParameters(mw_cpmMsg_any)) -> value v_cpmInd { 
      tc_ac.stop;
      if(not ispresent(v_cpmInd.gnLifetime)) {
        log("*** " & testcasename() & ": INCONC: no GN lifetime information in CpmInd ***");
+28 −20
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ module LibItsCps_Templates {
      * @desc    Receive template for CPS Message (CpmPort Primitive)
      * @param   p_cpmMsg    Expected CPS Message
      */
    template CpmInd mw_cpsInd (
    template CpmInd mw_cpmInd (
                               in template (present) CollectivePerceptionMessage p_cpmMsg
                               ) := {
      msgIn               := p_cpmMsg,
@@ -44,7 +44,7 @@ module LibItsCps_Templates {
      btpInfo             := *,
      ssp                 := *,
      its_aid             := *
    } // End of template mw_cpsInd
    } // End of template mw_cpmInd

    /**
      * @desc    Receive template for CPS Message (CpmPort Primitive)
@@ -55,20 +55,20 @@ module LibItsCps_Templates {
      * @param   p_gnLifetime        GN packet lifetime value (ms)
      * @param   p_gnTrafficClass    GN traffic class value
      */
    template CpmInd mw_cpsIndWithGnParameters (
    template CpmInd mw_cpmIndWithGnParameters (
                                               in template (present) CollectivePerceptionMessage p_cpmMsg,
                                               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_cpsInd := {
                                               ) modifies mw_cpmInd := {
      gnNextHeader := p_gnNextHeader,
      gnHeaderType := p_gnHeaderType,
      gnHeaderSubtype := p_gnHeaderSubtype,
      gnLifetime := p_gnLifetime,
      gnTrafficClass := p_gnTrafficClass
    } // End of template mw_cpsIndWithGnParameters
    } // End of template mw_cpmIndWithGnParameters

    /**
      * @desc    Receive template for CA Message (DenmPort Primitive)
@@ -76,14 +76,14 @@ module LibItsCps_Templates {
      * @param   p_ssp       SSP security parameter
      * @param   p_its_aid   ITS-AID value
      */
    template CpmInd mw_cpsIndWithSecurityParameters(
    template CpmInd mw_cpmIndWithSecurityParameters(
                                                    template (present) CollectivePerceptionMessage p_cpmMsg,
                                                    template Bit256 p_ssp := *,
                                                    template UInt32 p_its_aid := c_its_aid_CAM
                                                    ) modifies mw_cpsInd := {
                                                    ) modifies mw_cpmInd := {
      ssp             := p_ssp,
      its_aid         := p_its_aid
    } // End of template mw_cpsIndWithSecurityParameters
    } // End of template mw_cpmIndWithSecurityParameters

    /**
      * @desc    Receive template for CPS Message (CpmPort Primitive)
@@ -91,34 +91,42 @@ module LibItsCps_Templates {
      * @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 CpmInd mw_cpsIndWithBtpParameters(
    template CpmInd mw_cpmIndWithBtpParameters(
                                               in template (present) CollectivePerceptionMessage p_cpmMsg,
                                               in template UInt16 p_btpDestinationPort := *,
                                               in template UInt16 p_btpInfo := *
                                               ) modifies mw_cpsInd := {
                                               ) modifies mw_cpmInd := {
      btpDestinationPort := p_btpDestinationPort,
      btpInfo := p_btpInfo
    } // End of template mw_cpsIndWithBtpParameters
    } // End of template mw_cpmIndWithBtpParameters

    /**
      * @desc    Send template for CPS Message (CpmPort Primitive)
      * @param   p_cpmMsg CPS Message to be received
      */
    template (value) CpmReq m_cpsReq(
    template (value) CpmReq m_cpmReq(
                                     in template (value) CollectivePerceptionMessage p_cpmMsg
                                     ) := {
      msgOut := p_cpmMsg
    } // End of template m_cpsReq
    } // End of template m_cpmReq

    group cpsUtPrimitives {

        /**
          * @desc Initializes the CPS IUT.
          */
        template (value) UtCpmInitialize m_cpsInitialize := {
        template (value) UtCpmInitialize m_cpmInitialize := {
          hashedId8 := '0000000000000000'O
        }

        /**
         * @desc Set the IUT role
         * @param p_vehicle_role The IUT role
         */
        template (value) UtCpmTrigger m_setVruRole(in UInt8 p_vehicle_role) := {
            setVehicleRole := p_vehicle_role
        }

    } // End of group utPrimitives

  } // End of group Primitives
@@ -303,13 +311,13 @@ module LibItsCps_Templates {
      trailerDataSet   := p_trailer_data_set
    }

    template (omit) OriginatingRsuContainer m_OriginatingRsuContainer(
    template (omit) OriginatingRsuContainer m_originatingnating_rsu_container(
                                                                              in template (omit) MapReference p_map_reference := omit
                                                                              ) := {
      mapReference := p_map_reference
    }

    template OriginatingRsuContainer mw_OriginatingRsuContainer(
    template OriginatingRsuContainer mw_originating_rsu_container(
                                                                  template MapReference p_map_reference := *
                                                                  ) := {
      mapReference := p_map_reference
+11 −1
Original line number Diff line number Diff line
@@ -27,11 +27,21 @@ module LibItsCps_TypesAndValues {
      variant "FIELDORDER(msb)"
      }

    /**
     * @desc Upper Tester results message of the CPS IUT
     */
    type union UtCpmTrigger {
      UInt8 setVehicleRole
    } with {
      variant ""
    } // End of type UtCpmTrigger

    /**
     * @desc Upper Tester results message of the CPS IUT
     */
    type union UtCpmResults {
      boolean utCpmInitializeResult
      boolean utCpmInitializeResult,
      boolean utCpmTriggerResult
    } with {
      variant ""
    } // End of type UtCpmResults
Loading