Commit 651d6feb authored by YannGarcia's avatar YannGarcia
Browse files

Review UEidentityAPI tests

parent 79d00f6f
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -27,13 +27,13 @@ module AtsMec_TestControl {
        execute(TC_MEC_PLAT_MP1_LOC_BV_001());
      }
      if (PICS_UE_IDENTITY_API_SUPPORTED) {
        execute(TC_MEC_PLAT_MP1_UETAG_BV_001());
        execute(TC_MEC_PLAT_MP1_UETAG_BV_002());
        execute(TC_MEC_PLAT_MP1_UETAG_BV_003());
        execute(TC_MEC_PLAT_MP1_UETAG_BI_001());
        execute(TC_MEC_PLAT_MP1_UETAG_BI_002());
        execute(TC_MEC_PLAT_MP1_UETAG_BI_003());
        execute(TC_MEC_PLAT_MP1_UETAG_BI_004());
        execute(TC_MEC_PLAT_UETAG_001_OK());
        execute(TC_MEC_PLAT_UETAG_002_OK());
        execute(TC_MEC_PLAT_UETAG_003_OK());
        execute(TC_MEC_PLAT_UETAG_001_BI());
        execute(TC_MEC_PLAT_UETAG_002_BI());
        execute(TP_MEC_PLAT_UETAG_003_BI());
        execute(TP_MEC_PLAT_UETAG_004_BI());
      }
      if (PICS_LOCATION_API_SUPPORTED) {
        execute(TC_MEC_PLAT_MP1_INF_BV_001());
+105 −36
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ module AtsMec_UEidentityAPI_TestCases {
     * @desc Check that the IUT responds with a list for the location of User Equipments when queried by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
     */
    testcase TC_MEC_PLAT_MP1_UETAG_BV_001() runs on HttpComponent system HttpTestAdapter {
    testcase TC_MEC_PLAT_UETAG_001_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
@@ -92,13 +92,13 @@ module AtsMec_UEidentityAPI_TestCases {
        
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_PLAT_MP1_UETAG_BV_001
    } // End of testcase TC_MEC_PLAT_UETAG_001_OK
    
    /**
     * @desc Check that the IUT registers a tag (representing a UE) or a list of tags when commanded by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
     */
    testcase TC_MEC_PLAT_MP1_UETAG_BV_002() runs on HttpComponent system HttpTestAdapter {
    testcase TC_MEC_PLAT_UETAG_002_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
@@ -161,13 +161,13 @@ module AtsMec_UEidentityAPI_TestCases {
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_PLAT_MP1_UETAG_BV_002
    } // End of testcase TC_MEC_PLAT_UETAG_002_OK
    
    /**
     * @desc Check that the IUT deregisters a tag (representing a UE) or a list of tags when commanded by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
     */
    testcase TC_MEC_PLAT_MP1_UETAG_BV_003() runs on HttpComponent system HttpTestAdapter {
    testcase TC_MEC_PLAT_UETAG_003_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
@@ -230,13 +230,13 @@ module AtsMec_UEidentityAPI_TestCases {
      
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_PLAT_MP1_UETAG_BV_003
    } // End of testcase TC_MEC_PLAT_UETAG_003_OK
    
    /**
     * @desc Check that the IUT responds with ProblemDetails on information on an unknown UE Identity tag when queried by a MEC Application
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
     */
    testcase TC_MEC_PLAT_MP1_UETAG_BI_001() runs on HttpComponent system HttpTestAdapter {
    testcase TC_MEC_PLAT_UETAG_001_BI() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
@@ -270,11 +270,11 @@ module AtsMec_UEidentityAPI_TestCases {
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_404_not_found(
                                             mw_http_response_400_bad_request(
                                                                              mw_http_message_body_json(
                                                                                                        mw_body_json_ue_identity_problem_details(
                                                                                                                                                 mw_problem_details(
                                                                                                                                                                  -, -, 404
                                                                                                                                                                    -, -, 400
                                                                                                                                                                    )))))) -> value v_response {
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
@@ -287,13 +287,13 @@ module AtsMec_UEidentityAPI_TestCases {
        
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_001
    } // End of testcase TC_MEC_PLAT_UETAG_001_BI
    
    /**
     * @desc Check that the IUT responds with ProblemDetails on information an unknown Application Instance Identifier when queried by a MEC Application
     * @desc Check that the IUT responds with an error when an unauthorised request is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
     */
    testcase TC_MEC_PLAT_MP1_UETAG_BI_002() runs on HttpComponent system HttpTestAdapter {
    testcase TC_MEC_PLAT_UETAG_002_BI() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
@@ -315,7 +315,64 @@ module AtsMec_UEidentityAPI_TestCases {
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
                                                      PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID_UNKNOWN, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")),
                                                      PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID_UNAUTHORIZED, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")),
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_403_forbidden(
                                                                            mw_http_message_body_json(
                                                                                                      mw_body_json_ue_identity_problem_details(
                                                                                                                                               mw_problem_details(
                                                                                                                                                                  -, -, 403
                                                                                                                                                                  )))))) -> value v_response {
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 403 Forbidden ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
        
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_PLAT_UETAG_002_BI
    
    /**
     * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
     */
    testcase TC_MEC_PLAT_UETAG_003_BI() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
        
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
        
      // Test component configuration
      f_cf_01_http_up();
        
      // Test adapter configuration
        
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
                                                      PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")),
                                                      v_headers
                                                      )
                                   )
@@ -344,13 +401,13 @@ module AtsMec_UEidentityAPI_TestCases {
        
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_002
    } // End of testcase TC_MEC_PLAT_UETAG_003_BI
    
    /**
     * @desc Check that the IUT responds with ProblemDetails on information an invalid URI
     * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
     */
    testcase TC_MEC_PLAT_MP1_UETAG_BI_003() runs on HttpComponent system HttpTestAdapter {
    testcase TP_MEC_PLAT_UETAG_003_BI() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
@@ -401,13 +458,13 @@ module AtsMec_UEidentityAPI_TestCases {
        
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_003
    } // End of testcase TP_MEC_PLAT_UETAG_003_BI
    
    /**
     * @desc Check that the IUT responds with ProblemDetails on information on not allowed request
     * @desc Check that the IUT responds with an error when an unauthorised request is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2
     */
    testcase TC_MEC_PLAT_MP1_UETAG_BI_004() runs on HttpComponent system HttpTestAdapter {
    testcase TP_MEC_PLAT_UETAG_004_BI() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
@@ -428,9 +485,21 @@ module AtsMec_UEidentityAPI_TestCases {
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
                                                      PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(APP_INSTANCE_ID_WITH_RESTRICTED_ACCESS, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")),
                                                      v_headers
                                   m_http_request_post(
                                                       PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info",
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_ue_identity_tag_info(
                                                                                                                 m_ue_identity_tag_info(
                                                                                                                                        {
                                                                                                                                          m_ue_identity_tag_item(
                                                                                                                                                                 PX_UE_IDENTITY_TAG,
                                                                                                                                                                 INVALID_STATE
                                                                                                                                                                 )
                                                                                                                                          }
                                                                                                                                        )
                                                                                                                 )
                                                                                )
                                                       )
                                   )
                    );
@@ -441,13 +510,13 @@ module AtsMec_UEidentityAPI_TestCases {
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_403_forbidden(
                                             mw_http_response_400_bad_request(
                                                                              mw_http_message_body_json(
                                                                                                        mw_body_json_ue_identity_problem_details(
                                                                                                                                                 mw_problem_details(
                                                                                                                                                                  -, -, 403
                                                                                                                                                                    -, -, 400
                                                                                                                                                                    )))))) -> value v_response {
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***");
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
@@ -458,7 +527,7 @@ module AtsMec_UEidentityAPI_TestCases {
        
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_004
    } // End of testcase TP_MEC_PLAT_UETAG_004_BI
    
  } // End of group me_app_role 
  
+2 −2
Original line number Diff line number Diff line
@@ -8,9 +8,9 @@ module UEidentityAPI_Pixits {
  
  modulepar universal charstring PX_APP_INSTANCE_ID := "appInst01";
  
  modulepar universal charstring PX_APP_INSTANCE_ID_UNKNOWN := "appInst99";
  modulepar universal charstring PX_NON_EXISTENT_APP_INSTANCE_ID := "appInst99";
  
  modulepar universal charstring APP_INSTANCE_ID_WITH_RESTRICTED_ACCESS := "appInst98";
  modulepar universal charstring PX_APP_INSTANCE_ID_UNAUTHORIZED := "appInst98";
  
  modulepar universal charstring PX_UE_IDENTITY_TAG := "UeTagA";
  
+2 −1
Original line number Diff line number Diff line
@@ -56,7 +56,8 @@ module UEidentityAPI_TypesAndValues {
   */
  type enumerated State {
    UNREGISTERED,
    REGISTERED
    REGISTERED,
    INVALID_STATE // Used for BI tests
  }

  /**