Commit 4fa811c1 authored by YannGarcia's avatar YannGarcia
Browse files

Validate first AtsMBR test case

parent ef121307
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -95,14 +95,17 @@ module ItsMbr_TestCases {
        
        function f_TC_MRS_ITSS_MESSAGES_CLASS1_CAM_001_itss() runs on ItsMbrItss system ItsMbrItssSystem {
          // Local variables
          var LongPosVector v_longPosVectorIut;
          
          // Test component configuration
          f_cfUp_itss();
          v_longPosVectorIut := f_getPosition(c_compIut);
          
          // Test adapter configuration
          
          // Preamble
          // Initial state: CAM shall be emitted
          f_prNeighbour();
          geoNetworkingPort.clear;
          tc_ac.start;
          alt {
@@ -130,18 +133,20 @@ module ItsMbr_TestCases {
          
          // Test Body
          // Send CAM message with incosistent speed value
          f_send_inconsistent_cam();
          //f_prepareSecuredCam();
          for (var integer i := 0; i < 1/*PX_REPEAT_INCONSISTENT_CAM*/; i := i + 1) {
            f_send_inconsistent_cam(true);
            f_sleepIgnoreDef(1.0);
          }
          log("*** " & testcasename() & ": PASS: MR triggered ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          
          // Postamble
          f_poNeighbour();
          f_cfDown_itss();
        } // End of function f_TC_MRS_ITSS_MESSAGES_CLASS1_CAM_001_itss
        
        function f_TC_MRS_ITSS_MESSAGES_CLASS1_CAM_001_ma() runs on ItsMbrHttp system ItsMbrItssSystem {
          // Local variable
          var Headers v_headers;
          var HttpMessage v_request;
          
          // Test component configuration
@@ -150,7 +155,6 @@ module ItsMbr_TestCases {
          // Test adapter configuration
          
          // Preamble
          f_init_default_headers_list(-, "mbr", v_headers);
          f_selfOrClientSyncAndVerdict(c_prDone, e_success);
          
          // Test Body
@@ -175,12 +179,12 @@ module ItsMbr_TestCases {
              tc_ac.stop;

              // Verify IUT response
              f_verify_http_mbr_request_from_iut_itss(v_request.request, v_headers, v_etsiTs103759_data, v_response, v_result);
              f_verify_http_mbr_request_from_iut_itss(v_request.request, v_request.request.header, v_etsiTs103759_data, v_response, v_result);
              // Send response
              if (isvalue(v_response)) {
                httpPort.send(v_response);
              } else { // Send HTTP error 500
                f_send_500_Internal_Error(v_headers);
                f_send_500_Internal_Error(v_request.request.header);
              }
              // Validate MR content
              log("Validate MR content :", match(v_etsiTs103759_data.report, (mw_cam_specific_report(mw_asr_cam_report_speed(m_mb_obs_cam_speed_change_too_large, {mw_v2x_pdu_stream}, {})))));
+24 −1
Original line number Diff line number Diff line
@@ -4,6 +4,29 @@ module LibItsMbr_Pics {

  modulepar boolean PICS_DETECTOR_CAM_SPEED := true;

  modulepar charstring PICS_HTTP_POST_URI_MBR := "/mbr/report";
  modulepar charstring PICS_HTTP_POST_URI_MBR := "/misbehavior-report";

  /**
   * @desc Certificate of the Misbehaviour Authority
   */
  modulepar charstring PICS_IUT_MA_CERTIFICATE_ID := "CERT_IUT_A_MA";

  /**
    * @desc Speed threshold value for unknown(0), pedestrian(1), cyclist(2), moped(3), specialVehicles(10) and tram(11)
    * @see ASN.1 Type definition for SetMbObsTgtsCam
    */
  modulepar integer PX_MBR_PEDESTRIAN_SPEED_THRESHOLD := 3000;

  /**
    * @desc Speed threshold value for passengerCar(5)
    * @see ASN.1 Type definition for SetMbObsTgtsCam
    */
  modulepar integer PX_MBR_PASSENGER_CAR_SPEED_THRESHOLD := 14000;

  /**
    * @desc Speed threshold value for roadSideUnit(15)
    * @see ASN.1 Type definition for SetMbObsTgtsCam
    */
  modulepar integer PX_MBR_RSU_SPEED_THRESHOLD := 0;

} // End of module LibItsMbr_Pics
 No newline at end of file
+11 −0
Original line number Diff line number Diff line
@@ -270,4 +270,15 @@ module LibItsMbr_Templates {

  } // End of group camObservation

  group security {

    template (omit) HeaderInfo m_headerInfo_mr_request(
                                                       in template (value) Psid p_psid := c_its_aid_MBR,
                                                       in template (value) Time64 p_generationTime
                                                       ) modifies m_ieee1609Dot2_headerInfo := {
        generationTime       := p_generationTime
    } // End of template m_headerInfo_mr_request
    
  } // End of group security

} // End of module LibItsMbr_Templates
+268 −44

File changed.

Preview size limit exceeded, changes collapsed.

+9 −4
Original line number Diff line number Diff line
@@ -63,9 +63,8 @@ module LibItsMbr_TestSystem language "TTCN-3:2010 Real Time and Performance Test
    type component ItsMbrHttpSystem extends HttpTestAdapter{
    } // End of component ItsMbrHttpSystem
    
    type component ItsMbrItssSystem extends ItsMbrHttpSystem {
    type component ItsMbrItssSystem extends ItsMbrHttpSystem, ItsGeoNetworkingSystem {
      port UpperTesterMbrPort utMbrPort;
      port GeoNetworkingPort geoNetworkingPort;
    } // End of component ItsMbrItssSystem
    
    /**
@@ -74,6 +73,14 @@ module LibItsMbr_TestSystem language "TTCN-3:2010 Real Time and Performance Test
    type component ItsMbrHttp extends ItsSecurityBaseComponent, HttpComponent {
      port InfoPort infoPort;

      // Setup AT certificate used to signed inner data
      //var Certificate vc_atCertificate;       /** Test Adapter AT certificate */
      var octetstring vc_atPrivateKey;        /** Test Adapter AT private key for signature */
      var octetstring vc_atPrivateEncKey;     /** Test Adapter AT private key for encryption */
      var octetstring vc_atWholeHash;         /** Test Adapter AT whole-hash for signature check */
      var octetstring vc_atWholeHash256;      /** Test Adapter AT whole-hash using SHA 256 for encryption because of encryption key size == 32 */
      var HashedId8   vc_atHashedId8;         /** Test Adapter AT HashedId8 for decryption of IUT's response */
      // Setup MA certificate used to encrypt signed inner data
      var Certificate vc_maCertificate;       /** Test Adapter MA certificate */
      var octetstring vc_maPrivateKey;        /** Test Adapter MA private key for signature */
      var octetstring vc_maPrivateEncKey;     /** Test Adapter MA private key for encryption */
@@ -92,10 +99,8 @@ module LibItsMbr_TestSystem language "TTCN-3:2010 Real Time and Performance Test
      //port GeoNetworkingPort geoNetworkingPort;

      // UT indications
      //var UtGnEventIndList vc_utInds := {};
      var UtMbrEventIndList vc_utInds_mbr := {};
      
      //var boolean vc_utDefaultActive := true;
    } // End of component ItsMbrItss
    
  } // End of group componentDefinitions