Commit 7be148b9 authored by YannGarcia's avatar YannGarcia
Browse files

Review TC_MEC_SRV_UEINFSUB_001_OK TC_MEC_SRV_UEINFSUB_001_BR...

Review TC_MEC_SRV_UEINFSUB_001_OK TC_MEC_SRV_UEINFSUB_001_BR TC_MEC_SRV_UEINFSUB_002_OK TC_MEC_SRV_UEINFSUB_002_NF
parent 5614aed4
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -37,6 +37,13 @@ This file provides the list of the TODOs related to the STF 569.

### UEDISTSUB

Draft ETSI GS MEC 013 V2.0.3 (2018-10)

https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/remove-401s/Test%20Purposes/SRV/UEDISTSUB/PlatUeDistanceSubscription.tplan2

TODO DistanceNotificationSubscription data structure not found


### UEINFLOOK

Draft ETSI GS MEC 013 V2.0.3 (2018-10)
@@ -51,6 +58,18 @@ https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/remove-401s/Test%20

### UEINFSUB

Draft ETSI GS MEC 013 V2.0.3 (2018-10)

https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/remove-401s/Test%20Purposes/SRV/UEINFSUB/PlatUeInformationSubscription.tplan2

- TC_MEC_SRV_UEINFSUB_001_OK   <font color="color:yellow">To be tested</font>

- TC_MEC_SRV_UEINFSUB_001_BR   <font color="color:yellow">To be tested</font>

- TC_MEC_SRV_UEINFSUB_002_OK   <font color="color:yellow">To be tested</font>

- TC_MEC_SRV_UEINFSUB_002_NF   <font color="color:yellow">To be tested</font>

### UELOC

Draft ETSI GS MEC 013 V2.0.3 (2018-10)
+250 −1
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ module AtsMec_LocationAPI_TestCases {
                                                                                                                                                                                     PX_CALLBACK_REF_URL,
                                                                                                                                                                                     PX_USER
                                                                                                                                              )))))) {
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a ressourceURL ***");
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a callbackURL ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
          [] tc_ac.timeout {
@@ -828,4 +828,253 @@ module AtsMec_LocationAPI_TestCases {
    
  } // End of group ueInfLook 
  
  group ueInfSub {
    
    /**
     * @desc Check that the IUT acknowledges the UE information change subscription request when commanded by a MEC Application and notifies it when the location changes
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/remove-401s/Test%20Purposes/SRV/UEINFSUB/PlatUeInformationSubscription.tplan2
     */
    testcase TC_MEC_SRV_UEINFSUB_001_OK() runs on HttpComponent system HttpTestAdapter {
        // Local variables
        var HeaderLines v_headers;
        
        // Test control
        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;
        }
        
        // 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_post(
                                                         "/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI,
                                                         v_headers,
                                                         m_http_message_body_json(
                                                                                  m_body_json_zonal_traffic_subscription(
                                                                                                                         m_zonal_traffic_subscription(
                                                                                                                                                      PX_CLIENT_ID,
                                                                                                                                                      PX_CALLBACK_REF_URL,
                                                                                                                                                      PX_ZONE_ID
                                                                                                                                                      )
                                                                                                                           )
                                                                                  )
                                                         )
                                      )
                      );
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        
        // Test Body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_201_created(
                                                                            mw_http_message_body_json(
                                                                                                      mw_body_json_zonal_traffic_subscription(
                                                                                                                                              mw_zonal_traffic_subscription(
                                                                                                                                                                            PX_CLIENT_ID,
                                                                                                                                                                            PX_CALLBACK_REF_URL,
                                                                                                                                                                            PX_ZONE_ID
                                                                                                                                              )))))) {
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a callbackURL ***");
            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_SRV_UEINFSUB_001_OK
    
    /**
     * @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/gs032p2-test-purposes/blob/remove-401s/Test%20Purposes/SRV/UEINFSUB/PlatUeInformationSubscription.tplan2
     */
    testcase TC_MEC_SRV_UEINFSUB_001_BR() runs on HttpComponent system HttpTestAdapter {
        // Local variables
        var HeaderLines v_headers;
        
        // Test control
        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;
        }
        
        // 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_post(
                                                         "/" & PICS_ROOT_API & "invilad/" & PX_ME_APP_Q_USERS_INF_SUB_URI,
                                                         v_headers,
                                                         m_http_message_body_json(
                                                                                  m_body_json_zonal_traffic_subscription(
                                                                                                                         m_zonal_traffic_subscription(
                                                                                                                                                      PX_CLIENT_ID,
                                                                                                                                                      PX_CALLBACK_REF_URL,
                                                                                                                                                      PX_ZONE_ID
                                                                                                                                                      )
                                                                                                                           )
                                                                                  )
                                                         )
                                      )
                      );
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        
        // Test Body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_400_bad_request
                                             )) {
            log("*** " & testcasename() & ": PASS: IUT successfully responds 400 Bad Request ***");
              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_SRV_UEINFSUB_001_BR
    
    /**
     * @desc Check that the IUT acknowledges the cancellation of UE information change notifications  when commanded by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/remove-401s/Test%20Purposes/SRV/UEINFSUB/PlatUeInformationSubscription.tplan2
     */
    testcase TC_MEC_SRV_UEINFSUB_002_OK() runs on HttpComponent system HttpTestAdapter {
        // Local variables
        var HeaderLines v_headers;
        
        // Test control
        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;
        }
        
        // 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_delete(
                                                           "/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI,
                                                           v_headers,
                                                           m_http_message_body_json(
                                                                                    m_body_json_zonal_traffic_subscription(
                                                                                                                           m_zonal_traffic_subscription(
                                                                                                                                                        PX_CLIENT_ID,
                                                                                                                                                        PX_CALLBACK_REF_URL,
                                                                                                                                                        PX_ZONE_ID
                                                                                                                                                        )
                                                                                                                           )
                                                                                  )
                                                         )
                                      )
                      );
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        
        // Test Body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_204_no_content
                                               )) {
            log("*** " & testcasename() & ": PASS: IUT successfully responds with 204 No Content ***");
            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_SRV_UEINFSUB_002_OK
    
    /**
     * @desc Check that the IUT acknowledges the cancellation of UE information change notifications  when commanded by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/remove-401s/Test%20Purposes/SRV/UEINFSUB/PlatUeInformationSubscription.tplan2
     */
    testcase TC_MEC_SRV_UEINFSUB_002_NF() runs on HttpComponent system HttpTestAdapter {
        // Local variables
        var HeaderLines v_headers;
        
        // Test control
        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;
        }
        
        // 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_delete(
                                                           "/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI & "/" & oct2char(unichar2oct(PX_USER_UNKNOWN, "UTF-8")),
                                                           v_headers
                                                         )
                                      )
                      );
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        
        // Test Body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_404_not_found
                                             )) {
            log("*** " & testcasename() & ": PASS: IUT successfully responds 404 Not Found ***");
            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_SRV_UEINFSUB_002_NF
    
  } // End of group ueInfSub
  
  group ueDistSub {
    
  } // End of group ueDistSub
  
} // End of module AtsMec_LocationAPI_TestCases 
+5 −0
Original line number Diff line number Diff line
@@ -48,6 +48,11 @@ module AtsMec_TestControl {
        execute(TC_MEC_SRV_UEINFLOOK_001_BR());
        execute(TC_MEC_SRV_UEINFLOOK_001_NF());
        
        execute(TC_MEC_SRV_UEINFSUB_001_OK());
        execute(TC_MEC_SRV_UEINFSUB_001_BR());
        execute(TC_MEC_SRV_UEINFSUB_002_OK());
        execute(TC_MEC_SRV_UEINFSUB_002_NF());
        
        execute(TC_MEC_PLAT_RLOC_001_OK());
      }
    }
+0 −97
Original line number Diff line number Diff line
/**
 *    @author   ETSI / STF569
 *    @version  $URL:$
 *              $ID:$
 *    @desc     This module provides the MEC test cases.
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 *    @see      ETSI GS MEC 003, Draft ETSI GS MEC 013 V2.0.3 (2018-10)
 */
module AtsMec_UEdistance_TestCases {
  
  // Libcommon
  import from LibCommon_Time all;
  import from LibCommon_VerdictControl all;
  import from LibCommon_Sync all;
  
  // LibHttp
  import from LibItsHttp_TypesAndValues all;
  import from LibItsHttp_Functions all;
  import from LibItsHttp_Templates all;
  import from LibItsHttp_JsonTemplates all;
  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;
  
  // LibMec
  import from LibMec_Functions all;
  import from LibMec_Pics all;
  import from LibMec_Pixits all;
  
  group me_app_role {
    
    /**
     * @desc Check that the IUT acknowledges the subscription by a MEC Application to the notifications on UE distance
     * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeDistance/PlatUeDistance.tplan2
     */
    testcase TC_MEC_PLAT_MP1_DIST_BV_001() 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 ***");
            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_post(
                                                         PX_ME_APP_Q_DIST_URI,
                                                         v_headers
                                                         )
                                     )
                      );
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        
        // Test Body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_ok(
                                                                   mw_http_message_body_json(
                                                                                             mw_body_json_user_info(
                                                                                                                    mw_user_info(-, -, PX_ZONE_ID)
                                                                                                                    ))))) -> value v_response {
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a ZoneId ***");
            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_MP1_DIST_BV_001
    
  } // End of group me_app_role 
  
} // End of module AtsMec_UEdistance_TestCases
+28 −0
Original line number Diff line number Diff line
@@ -153,4 +153,32 @@ module LocationAPI_Templates {
    resourceURL       := p_resourceURL
  } // End of template mw_user_tracking_subscription
  
  template (value) ZonalTrafficSubscription m_zonal_traffic_subscription(
                                                                         in ClientCorrelator p_client_correlator,
                                                                         in CallbackReference p_callback_reference,
                                                                         in ZoneId p_zone_id
  ) := {
    clientCorrelator  := p_client_correlator,
    callbackReference := p_callback_reference,
    zoneId            := p_zone_id,
    interestRealm     := omit,
    userEventCriteria := omit,
    duration          := omit,
    resourceURL       := omit
  } // End of template m_zonal_traffic_subscription
  
  template (present) ZonalTrafficSubscription mw_zonal_traffic_subscription(
                                                                            template (present) ClientCorrelator p_client_correlator := ?,
                                                                            template (present) CallbackReference p_callback_reference := ?,
                                                                            template (present) ZoneId p_zone_id := ?
  ) := {
    clientCorrelator  := p_client_correlator,
    callbackReference := p_callback_reference,
    zoneId            := p_zone_id,
    interestRealm     := *,
    userEventCriteria := *,
    duration          := *,
    resourceURL       := *
  } // End of template mw_zonal_traffic_subscription
  
} // End of module LocationAPI_Templates
Loading