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

Bug fixed on ItsRSUsSimulator

parent 8f0acd8d
Loading
Loading
Loading
Loading
+29 −181
Original line number Original line Diff line number Diff line
@@ -120,8 +120,8 @@ module ItsPki_TestCases {
          setverdict(inconc);
          setverdict(inconc);
          stop;
          stop;
        }
        }
        v_itss.start(f_TC_SEC_PKI_ITSS_ENR_BV_01_itss(cc_taCert_A, v_private_key, v_publicKeyX, v_publicKeyY, v_publicKeyCompressed, v_compressedMode));
        v_itss.start(f_TC_SEC_PKI_ITSS_ENR_BV_01_itss(cc_taCert_A, v_private_key, v_publicKeyCompressed, v_compressedMode));
        v_ea.start(f_TC_SEC_PKI_ITSS_ENR_BV_01_pki(cc_taCert_A, v_private_key, v_publicKeyX, v_publicKeyY, v_publicKeyCompressed, v_compressedMode));
        v_ea.start(f_TC_SEC_PKI_ITSS_ENR_BV_01_pki(cc_taCert_A, v_private_key, v_publicKeyCompressed, v_compressedMode));
        
        
        // Synchronization
        // Synchronization
        f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
        f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
@@ -135,15 +135,10 @@ module ItsPki_TestCases {
        function f_TC_SEC_PKI_ITSS_ENR_BV_01_itss(
        function f_TC_SEC_PKI_ITSS_ENR_BV_01_itss(
                                                 in charstring p_certificate_id,
                                                 in charstring p_certificate_id,
                                                 in octetstring p_private_key,
                                                 in octetstring p_private_key,
                                                  in octetstring p_publicKeyX,
                                                  in octetstring p_publicKeyY,
                                                 in octetstring p_publicKeyCompressed,
                                                 in octetstring p_publicKeyCompressed,
                                                 in integer p_compressedMode
                                                 in integer p_compressedMode
                                                 ) runs on ItsPkiItss /*system ItsPkiItssSystem*/ {
                                                 ) runs on ItsPkiItss /*system ItsPkiItssSystem*/ {
          
          // Local variables
          // Local variables
          var GeoNetworkingInd        v_geoNwInd;
          var EtsiTs103097Certificate v_initial_certificate;
          
          
          // Test component configuration
          // Test component configuration
          f_cfUp_itss();
          f_cfUp_itss();
@@ -151,116 +146,19 @@ module ItsPki_TestCases {
          // Test adapter configuration
          // Test adapter configuration
          
          
          // Preamble
          // Preamble
          tc_ac.start; // Wait for current certificate
          f_sendUtTriggerPrimitive(PICS_ITS_S_CANONICAL_ID, '00'O, p_private_key, p_publicKeyCompressed, p_compressedMode);
          alt {
            [] geoNetworkingPort.receive(
                                         mw_geoNwInd(
                                                     mw_geoNwSecPdu(
                                                                    mw_etsiTs103097Data_signed(
                                                                                               mw_signedData(
                                                                                                             -, 
                                                                                                             mw_toBeSignedData(
                                                                                                                               mw_signedDataPayload,
                                                                                                                               mw_headerInfo_cam
                                                                                                                               ),
                                                                                                             mw_signerIdentifier_certificate(
                                                                                                                                             mw_etsiTs103097Certificate(
                                                                                                                                                                        -,
                                                                                                                                                                        mw_toBeSignedCertificate_at(
                                                                                                                                                                                                    { mw_appPermissions(c_its_aid_CAM) }
                                                                                                                                                                                                    )
                                                                                                                                                                        )
                                                                                                                                             )
                                                                                                             )
                                                                                               ), 
                                                                    mw_geoNwShbPacket
                                                                    ))) -> value v_geoNwInd {
              tc_ac.stop;
              
              log("*** " & testcasename() & ": INFO: Receieve initial certificate");
              // Extract the initial certificate
              v_initial_certificate := v_geoNwInd.msgIn.gnPacket.securedMsg.content.signedData.signer.certificate[0];
          f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
          f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            }
            [] geoNetworkingPort.receive(
                                         mw_geoNwInd(
                                                     mw_geoNwSecPdu(
                                                                    mw_etsiTs103097Data_signed
                                                                    ))) {
              log("*** " & testcasename() & ": DEBUG: Still waiting for certificate");
              repeat;
            }
            [] tc_ac.timeout {
              log("*** " & testcasename() & ": INCONC: Expected CA message not received ***");
              f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_timeout);
            }
          } // End of 'alt' statement
          
          
          // Test Body
          // Test Body
          tc_ac.start;
          alt {
            [] geoNetworkingPort.receive(
                                         mw_geoNwInd(
                                                     mw_geoNwSecPdu(
                                                                    mw_etsiTs103097Data_signed(
                                                                                               mw_signedData(
                                                                                                             -,
                                                                                                             mw_toBeSignedData(
                                                                                                                               mw_signedDataPayload,
                                                                                                                               mw_headerInfo_cam
                                                                                                                               ),
                                                                                                             mw_signerIdentifier_certificate(
                                                                                                                                             v_initial_certificate
                                                                                                                                             )
                                                                                                             )
                                                                                               ),
                                                                    mw_geoNwShbPacket
                                                                    ))) {
              log("*** " & testcasename() & ": INFO: IUT still using initial certificate ***");
              repeat;
            }
            [] geoNetworkingPort.receive(
                                         mw_geoNwInd(
                                                     mw_geoNwSecPdu(
                                                                    mw_etsiTs103097Data_signed(
                                                                                               mw_signedData(
                                                                                                             -,
                                                                                                             mw_toBeSignedData(
                                                                                                                               mw_signedDataPayload,
                                                                                                                               mw_headerInfo_gn
                                                                                                                               ),
                                                                                                             mw_signerIdentifier_certificate
                                                                                                             )
                                                                                               )
                                                                    ))) -> value v_geoNwInd {
              tc_ac.stop;
              log("*** " & testcasename() & ": PASS: IUT uses new certificate ***");
              // TODO Check that is the expected one
          f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
          f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
            }
            [] geoNetworkingPort.receive(
                                         mw_geoNwInd(
                                                     mw_geoNwSecPdu(
                                                                    mw_etsiTs103097Data_signed
                                                                    ))) {
              log("*** " & testcasename() & ": INFO: Unexpected message received, continue ***");
              repeat;
            }
            [] tc_ac.timeout {
              log("*** " & testcasename() & ": INCONC: Expected message not received ***");
              f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
            }
          } // End of 'alt' statement
          
          
          // Postamble
          // Postamble
          f_cfDown_itss();
          f_cfDown_itss();
        } // End of testcase f_TC_SEC_PKI_ITSS_ENR_BV_01_itss
        } // End of function f_TC_SEC_PKI_ITSS_ENR_BV_01_itss
        
        
        function f_TC_SEC_PKI_ITSS_ENR_BV_01_pki(
        function f_TC_SEC_PKI_ITSS_ENR_BV_01_pki(
                                                 in charstring p_certificate_id,
                                                 in charstring p_certificate_id,
                                                 in octetstring p_private_key,
                                                 in octetstring p_private_key,
                                                 in octetstring p_publicKeyX,
                                                 in octetstring p_publicKeyY,
                                                 in octetstring p_publicKeyCompressed,
                                                 in octetstring p_publicKeyCompressed,
                                                 in integer p_compressedMode
                                                 in integer p_compressedMode
                                                 ) runs on ItsPki /*system ItsPkiSystem*/ {
                                                 ) runs on ItsPki /*system ItsPkiSystem*/ {
@@ -272,20 +170,19 @@ module ItsPki_TestCases {
          // Test adapter configuration
          // Test adapter configuration
          
          
          // Preamble
          // Preamble
          f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
          
          // Test Body
          tc_ac.start;
          tc_ac.start;
          alt {
          alt {
            [] pkiPort.receive(
            [] pkiPort.receive(
                               mw_innerEcRequest
                               mw_innerEcRequest
                               ) {
                               ) {
              log("*** " & testcasename() & ": INFO: InnerEcRequest received ***");
              log("*** " & testcasename() & ": INFO: InnerEcRequest received ***");
              repeat;
              // TODO Check message content
            }
              // TODO Send InnerEcResponse;
            [] pkiPort.receive(
              log("*** " & testcasename() & ": PASS: Message triggered ***");
                               mw_innerEcResponse_ok
              f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                               ) {
              tc_ac.stop;
              log("*** " & testcasename() & ": INFO: InnerEcResponse received ***");
              f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            }
            }
            [] tc_ac.timeout {
            [] tc_ac.timeout {
              log("*** " & testcasename() & ": INCONC: Expected message not received ***");
              log("*** " & testcasename() & ": INCONC: Expected message not received ***");
@@ -293,15 +190,11 @@ module ItsPki_TestCases {
            }
            }
          } // End of 'alt' statement
          } // End of 'alt' statement
          
          
          // Test Body
          log("*** " & testcasename() & ": PASS: Message triggered ***");
          f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
          
          // Postamble
          // Postamble
          LibItsPki_Functions.f_cfDown();
          LibItsPki_Functions.f_cfDown();
        } // End of testcase f_TC_SEC_PKI_ITSS_ENR_BV_01_pki
        } // End of function f_TC_SEC_PKI_ITSS_ENR_BV_01_pki
        
        
      } // End of f_TC_SEC_PKI_ITSS_ENR_BV_01
      } // End of group f_TC_SEC_PKI_ITSS_ENR_BV_01
      
      
      /**
      /**
       * @desc If the enrolment request of the IUT is an initial enrolment request, the itsId 
       * @desc If the enrolment request of the IUT is an initial enrolment request, the itsId 
@@ -358,8 +251,8 @@ module ItsPki_TestCases {
          setverdict(inconc);
          setverdict(inconc);
          stop;
          stop;
        }
        }
        v_itss.start(f_TC_SEC_PKI_ITSS_ENR_BV_02_itss(cc_taCert_A, v_private_key, v_publicKeyX, v_publicKeyY, v_publicKeyCompressed, v_compressedMode));
        v_itss.start(f_TC_SEC_PKI_ITSS_ENR_BV_02_itss(cc_taCert_A, v_private_key, v_publicKeyCompressed, v_compressedMode));
        v_ea.start(f_TC_SEC_PKI_ITSS_ENR_BV_02_pki(cc_taCert_A, v_private_key, v_publicKeyX, v_publicKeyY, v_publicKeyCompressed, v_compressedMode));
        v_ea.start(f_TC_SEC_PKI_ITSS_ENR_BV_02_pki(cc_taCert_A, v_private_key, v_publicKeyCompressed, v_compressedMode));
        
        
        // Synchronization
        // Synchronization
        f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
        f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
@@ -373,12 +266,9 @@ module ItsPki_TestCases {
        function f_TC_SEC_PKI_ITSS_ENR_BV_02_itss(
        function f_TC_SEC_PKI_ITSS_ENR_BV_02_itss(
                                                  in charstring p_certificate_id,
                                                  in charstring p_certificate_id,
                                                  in octetstring p_private_key,
                                                  in octetstring p_private_key,
                                                  in octetstring p_publicKeyX,
                                                  in octetstring p_publicKeyY,
                                                  in octetstring p_publicKeyCompressed,
                                                  in octetstring p_publicKeyCompressed,
                                                  in integer p_compressedMode
                                                  in integer p_compressedMode
                                                  ) runs on ItsPkiItss /*system ItsPkiItssSystem*/ {
                                                  ) runs on ItsPkiItss /*system ItsPkiItssSystem*/ {
          
          // Local variables
          // Local variables
          
          
          // Test component configuration
          // Test component configuration
@@ -387,61 +277,19 @@ module ItsPki_TestCases {
          // Test adapter configuration
          // Test adapter configuration
          
          
          // Preamble
          // Preamble
          tc_ac.start; // Wait for current certificate
          f_sendUtTriggerPrimitive(PICS_ITS_S_CANONICAL_ID, '00'O, p_private_key, p_publicKeyCompressed, p_compressedMode);
          alt {
            [] geoNetworkingPort.receive(
                                         mw_geoNwInd(
                                                     mw_geoNwSecPdu(
                                                                    mw_etsiTs103097Data_signed(
                                                                                               mw_signedData(
                                                                                                             -, 
                                                                                                             mw_toBeSignedData(
                                                                                                                               mw_signedDataPayload,
                                                                                                                               mw_headerInfo_cam
                                                                                                                               ),
                                                                                                             mw_signerIdentifier_certificate(
                                                                                                                                             mw_etsiTs103097Certificate(
                                                                                                                                                                        -,
                                                                                                                                                                        mw_toBeSignedCertificate_at(
                                                                                                                                                                                                    { mw_appPermissions(c_its_aid_CAM) }
                                                                                                                                                                                                    )
                                                                                                                                                                        )
                                                                                                                                             )
                                                                                                             )
                                                                                               ), 
                                                                    mw_geoNwShbPacket
                                                                    ))) {
              tc_ac.stop;
              
              log("*** " & testcasename() & ": INFO: Receieve initial certificate");
          f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
          f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            }
            [] geoNetworkingPort.receive(
                                         mw_geoNwInd(
                                                     mw_geoNwSecPdu(
                                                                    mw_etsiTs103097Data_signed
                                                                    ))) {
              log("*** " & testcasename() & ": DEBUG: Still waiting for certificate");
              repeat;
            }
            [] tc_ac.timeout {
              log("*** " & testcasename() & ": INCONC: Expected CA message not received ***");
              f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_timeout);
            }
          } // End of 'alt' statement
          
          
          // Test Body
          // Test Body
          f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
          f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
          
          
          // Postamble
          // Postamble
          f_cfDown_itss();
          f_cfDown_itss();
        } // End of testcase f_TC_SEC_PKI_ITSS_ENR_BV_02_itss
        } // End of function f_TC_SEC_PKI_ITSS_ENR_BV_02_itss
        
        
        function f_TC_SEC_PKI_ITSS_ENR_BV_02_pki(
        function f_TC_SEC_PKI_ITSS_ENR_BV_02_pki(
                                                 in charstring p_certificate_id,
                                                 in charstring p_certificate_id,
                                                 in octetstring p_private_key,
                                                 in octetstring p_private_key,
                                                 in octetstring p_publicKeyX,
                                                 in octetstring p_publicKeyY,
                                                 in octetstring p_publicKeyCompressed,
                                                 in octetstring p_publicKeyCompressed,
                                                 in integer p_compressedMode
                                                 in integer p_compressedMode
                                                 ) runs on ItsPkiHttp /*system ItsPkiHttpSystem*/ {
                                                 ) runs on ItsPkiHttp /*system ItsPkiHttpSystem*/ {
@@ -497,7 +345,7 @@ module ItsPki_TestCases {
          
          
          // Postamble
          // Postamble
          f_cfHttpDown();
          f_cfHttpDown();
        } // End of testcase f_TC_SEC_PKI_ITSS_ENR_BV_02_pki
        } // End of function f_TC_SEC_PKI_ITSS_ENR_BV_02_pki
        
        
      } // End of f_TC_SEC_PKI_ITSS_ENR_BV_02
      } // End of f_TC_SEC_PKI_ITSS_ENR_BV_02
      
      
@@ -681,7 +529,7 @@ module ItsPki_TestCases {
            
            
          // Postamble
          // Postamble
          f_cfDown_itss();
          f_cfDown_itss();
        } // End of testcase f_TEST_itss
        } // End of function f_TEST_itss
        
        
        function f_TEST_pki(
        function f_TEST_pki(
                                                 in charstring p_certificate_id,
                                                 in charstring p_certificate_id,
@@ -726,7 +574,7 @@ module ItsPki_TestCases {
          
          
          // Postamble
          // Postamble
          LibItsPki_Functions.f_cfDown();
          LibItsPki_Functions.f_cfDown();
        } // End of testcase f_TEST_pki
        } // End of function f_TEST_pki
        
        
      } // End of f_TEST
      } // End of f_TEST
      
      
+0 −16
Original line number Original line Diff line number Diff line
@@ -42,20 +42,4 @@ module ItsRSUsSimulator_Pixits {
     */
     */
    modulepar integer PX_ETSI_ZONE_ID := 1;
    modulepar integer PX_ETSI_ZONE_ID := 1;
    
    
    modulepar boolean PICS_GENERATE_BEACON   := false;
    
    modulepar boolean PICS_GENERATE_CAM      := true;
    
    modulepar boolean PICS_GENERATE_DENM     := false;
    
    modulepar boolean PICS_GENERATE_IVIM     := false;
    
    modulepar boolean PICS_GENERATE_MAPEM    := false;
    
    modulepar boolean PICS_GENERATE_SPATEM   := false;
    
    modulepar boolean PICS_GENERATE_SSEM     := false;
    
    //modulepar boolean PICS_GENERATE_EVCSN    := false;
    
} // End of module ItsRSUsSimulator_Pixits
} // End of module ItsRSUsSimulator_Pixits
+13 −2
Original line number Original line Diff line number Diff line
@@ -16,6 +16,14 @@ module ItsRSUsSimulator_TestSystem {
  import from LibItsDenm_TestSystem all;
  import from LibItsDenm_TestSystem all;
  import from LibItsDenm_TypesAndValues all;
  import from LibItsDenm_TypesAndValues all;
    
    
  // LibItsHttp
  import from LibItsHttp_TestSystem all;
  import from LibItsHttp_TypesAndValues all;
  
  // LibItsPki
  import from LibItsHttp_TestSystem all;
  import from LibItsPki_TypesAndValues all;
  
  // AtsRSUsSimulator
  // AtsRSUsSimulator
  import from ItsRSUsSimulator_TypesAndValues all;
  import from ItsRSUsSimulator_TypesAndValues all;
  import from ItsRSUsSimulator_Pics all;
  import from ItsRSUsSimulator_Pics all;
@@ -25,6 +33,7 @@ module ItsRSUsSimulator_TestSystem {
   * @desc Test component for ITS Network and Transport layer
   * @desc Test component for ITS Network and Transport layer
   */
   */
  type component ItsRSUsSimulator extends ItsGeoNetworking {
  type component ItsRSUsSimulator extends ItsGeoNetworking {
    port HttpPort httpPort;
    /**
    /**
     * @desc RSUsimulator configuration port
     * @desc RSUsimulator configuration port
     */
     */
@@ -96,6 +105,7 @@ module ItsRSUsSimulator_TestSystem {
    var boolean vc_ivim   := PICS_GENERATE_IVIM;
    var boolean vc_ivim   := PICS_GENERATE_IVIM;
    var boolean vc_mapem  := PICS_GENERATE_MAPEM;
    var boolean vc_mapem  := PICS_GENERATE_MAPEM;
    var boolean vc_spatem := PICS_GENERATE_SPATEM;
    var boolean vc_spatem := PICS_GENERATE_SPATEM;
    var boolean vc_pki := PICS_PKI_SUPPORT;
    //var boolean vc_evcsn := PICS_GENERATE_EVCSN;
    //var boolean vc_evcsn := PICS_GENERATE_EVCSN;
    var float vc_cam_timer_value  := PICS_CAM_FREQUENCY;
    var float vc_cam_timer_value  := PICS_CAM_FREQUENCY;
    timer tc_beacon := PICS_BEACON_FREQUENCY;
    timer tc_beacon := PICS_BEACON_FREQUENCY;
@@ -113,6 +123,7 @@ module ItsRSUsSimulator_TestSystem {
     */
     */
  type component ItsRSUsSimulatorSystem extends ItsGeoNetworkingSystem {
  type component ItsRSUsSimulatorSystem extends ItsGeoNetworkingSystem {
    port ConfigRsuSimulatorPort cfPort; 
    port ConfigRsuSimulatorPort cfPort; 
    port HttpPort httPort;
  }
  }
    
    
  type record of record {
  type record of record {
@@ -149,9 +160,9 @@ module ItsRSUsSimulator_TestSystem {
     */
     */
    type port ConfigRsuSimulatorPort message {
    type port ConfigRsuSimulatorPort message {
      out 
      out 
      CfInitialize, CfResult, UtGnResults, UtCamResults, UtDenmResults, UtCamEventInd;
      CfInitialize, CfResult, UtGnResults, UtCamResults, UtDenmResults, UtCamEventInd, UtPkiResults;
      in 
      in 
      CfEvent, CfEventInd, UtGnInitialize, UtCamInitialize, UtDenmInitialize, UtGnTrigger, UtCamTrigger
      CfEvent, CfEventInd, UtGnInitialize, UtCamInitialize, UtDenmInitialize, UtGnTrigger, UtCamTrigger, UtPkiInitialize, UtPkiTrigger
      } // End of ConfigRsuSimulatorPort
      } // End of ConfigRsuSimulatorPort
        
        
  } // End of group configRsuSimulatorPort 
  } // End of group configRsuSimulatorPort