Commit 97c12f07 authored by YannGarcia's avatar YannGarcia
Browse files

Review TP_MEC_SRV_UELOC_001_OK, TC_MEC_SRV_UELOC_001_BR, TC_MEC_SRV_UELOC_001_NF

parent 46b8a6fe
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -60,4 +60,21 @@ https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/SRV/UELO

### UeIdentity

ETSI GS MEC 014 V1.1.1 (2018-02)

https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/SRV/UeIdentity/PlatUeIdentity.tplan2

- TC_MEC_PLAT_UETAG_001_OK   <span style="color:green">To be tested</span>

- TC_MEC_PLAT_UETAG_002_OK   <span style="color:green">To be tested</span>

- TC_MEC_PLAT_UETAG_003_OK   <span style="color:green">To be tested</span>

- TC_MEC_PLAT_UETAG_001_BI   <span style="color:green">To be tested</span>

- TC_MEC_PLAT_UETAG_002_BI   <span style="color:green">To be tested</span>

- TP_MEC_PLAT_UETAG_003_BI   <span style="color:green">Done</span>

- TP_MEC_PLAT_UETAG_004_BI   <span style="color:green">Done</span>
+15 −23
Original line number Diff line number Diff line
@@ -12,8 +12,6 @@
module AtsMec_LocationAPI_TestCases {
  
  // Libcommon
  import from LibCommon_Time all;
  import from LibCommon_VerdictControl all;
  import from LibCommon_Sync all;
  
  // LibHttp
@@ -24,7 +22,6 @@ module AtsMec_LocationAPI_TestCases {
  import from LibItsHttp_TestSystem all;
  
  // LibMec_LocationAPI
  import from LocationAPI_TypesAndValues all;
  import from LocationAPI_Templates all;
  import from LocationAPI_Pics all;
  import from LocationAPI_Pixits all;
@@ -44,11 +41,10 @@ module AtsMec_LocationAPI_TestCases {
    testcase TC_MEC_SRV_UELOC_001_OK() 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_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
@@ -84,7 +80,7 @@ module AtsMec_LocationAPI_TestCases {
                                                                                                                                   mw_user_info(PX_USER, PX_ACCESS_POINT_ID, PX_ZONE_ID, PX_RESOURCE_URL),
                                                                                                                                   *
                                                                                                                                   }
                                                                                                                                 )))))) -> value v_response {
                                                                                                                                 )))))) {
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a ZoneId ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
@@ -106,11 +102,10 @@ module AtsMec_LocationAPI_TestCases {
    testcase TC_MEC_SRV_UELOC_001_BR() 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_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
@@ -138,7 +133,7 @@ module AtsMec_LocationAPI_TestCases {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_400_bad_request
                                               )) -> value v_response {
                                               )) {
            log("*** " & testcasename() & ": PASS: IUT successfully responds with 400 Bad Request ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
@@ -160,11 +155,10 @@ module AtsMec_LocationAPI_TestCases {
    testcase TC_MEC_SRV_UELOC_001_NF() 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_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
@@ -192,7 +186,7 @@ module AtsMec_LocationAPI_TestCases {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_404_not_found
                                               )) -> value v_response {
                                               )) {
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
@@ -218,11 +212,10 @@ module AtsMec_LocationAPI_TestCases {
    testcase TC_MEC_PLAT_LOCSUB_001_OK() 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_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
@@ -265,7 +258,7 @@ module AtsMec_LocationAPI_TestCases {
                                                                                                                                                                                     PX_CLIENT_ID,
                                                                                                                                                                                     PX_CALLBACK_REF_URL,
                                                                                                                                                                                     PX_USER
                                                                                                                                              )))))) -> value v_response {
                                                                                                                                              )))))) {
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a ressourceURL ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
@@ -286,11 +279,10 @@ module AtsMec_LocationAPI_TestCases {
    testcase TC_MEC_PLAT_LOCSUB_002_OK() 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_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
@@ -318,7 +310,7 @@ module AtsMec_LocationAPI_TestCases {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_ok
                                               )) -> value v_response {
                                               )) {
            log("*** " & testcasename() & ": PASS: IUT successfully cancel subscription ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
+3 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ module AtsMec_TestControl {
  
  control {
    
    if (PICS_MEC_PLAT) {
    if (PICS_MEC_PLAT and PICS_SERVICES) {
      if (PICS_LOCATION_API_SUPPORTED) {
        execute(TC_MEC_SRV_UELOC_001_OK());
        execute(TC_MEC_SRV_UELOC_001_BR());
@@ -38,8 +38,9 @@ module AtsMec_TestControl {
        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(TC_MEC_PLAT_UETAG_003_BI());
        execute(TP_MEC_PLAT_UETAG_004_BI());
        execute(TP_MEC_PLAT_UETAG_005_BI());
      }
    }

+87 −56

File changed.

Preview size limit exceeded, changes collapsed.

+64 −2
Original line number Diff line number Diff line
module LibMec_Functions {
  
  // Libcommon
  import from LibCommon_Time all;
  import from LibCommon_VerdictControl all;
  import from LibCommon_Sync all;
  
  // LibMec
  import from LibMec_Pixits all;
  
   // LibMec_UEidentityAPI
  import from UEidentityAPI_TypesAndValues all;
  import from UEidentityAPI_Templates all;
  import from UEidentityAPI_Pixits all;
  
  // LibHttp
  import from LibItsHttp_TypesAndValues all;
  import from LibItsHttp_Templates all;
  import from LibItsHttp_TestSystem all;
  import from LibItsHttp_Templates all;
  import from LibItsHttp_JsonTemplates all;
  
  group preambles {
    
@@ -60,6 +68,60 @@ module LibMec_Functions {
    
  } // End of group postambles
  
  group helpers {
    
    /**
     * @desc Check if the user is registered or not
     * @param 
     * @return 0 if unregistered, 1 if registered, -1 otherwise
     */
    function f_check_user_register_state(
                                         in UeIdentityTag p_ue_identity_tag := PX_UE_IDENTITY_TAG,
                                         in HeaderLines p_headers
    ) runs on HttpComponent return integer {
      var HttpMessage v_response;
      var integer v_result := -1;
      
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
                                                      PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(p_ue_identity_tag, "UTF-8")),
                                                      p_headers
                                                      )
                                   )
                    );
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_ok(
                                                                 mw_http_message_body_json(
                                                                                           mw_body_json_ue_identity_tag_info(
                                                                                                                             mw_ue_identity_tag_info(
                                                                                                                                                     { *, mw_ue_identity_tag_item(PX_UE_IDENTITY_TAG), * }
                                                                                                                                                     )))))) -> value v_response {
          for (var integer v_i := 0; v_i < lengthof(v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags); v_i := v_i + 1) {
            if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].ueIdentityTag == p_ue_identity_tag) {
              if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state == UNREGISTERED) {
                v_result := 0;
              } else {
                v_result := 1;
              }
              break;
            }
          }
        }
        [] tc_ac.timeout {
        }
      } // End of 'alt' statement
      
      return v_result;
    } // End of function f_check_user_register_state
    
  } // End of group helpers 
  
  group altsteps {

    altstep a_default_requests() runs on HttpComponent {