Commit cd1ad821 authored by YannGarcia's avatar YannGarcia
Browse files

Add support of getting time UTC, Start enhancement of RNIS

parent 65f0d13f
Loading
Loading
Loading
Loading
+38 −0
Original line number Original line Diff line number Diff line
#include "LibMec_Functions.hh"
#include <math.h>

#include "base_time.hh"
#include "loggers.hh"

#ifndef M_PI
#define M_PI	3.14159265358979323846
#endif
#define earthRadius 6378137.0L
#define rbis = ((double)(earthRadius * M_PI / 180))

namespace LibMec__Functions {

  /**
   * @desc    This external function gets the current time
   * @return  Timestamp - current time since 01/01/2004 in milliseconds
   * @see     fx_getCurrentTime() return TimestampIts
   */
  INTEGER fx__getCurrentTime(
) {
    INTEGER i;
    i.set_long_long_val(base_time::get_instance().get_its_current_time_ms());
    loggers::get_instance().log_msg("<<< fx__getCurrentTime: ", i);
    return i;
  }
  /**
   * @desc    This external function gets the current time since 01/01/1970 in UTC format
   * @return  The current time since 01/01/1970 in UTC format
   * @see     fx_getCurrentTimeUtc() return UInt64
   */
  INTEGER fx__get__current__time__utc() {
    INTEGER i;
    i.set_long_long_val(base_time::get_instance().get_current_time_ms());
    return i;
  }

} // end of Namespace
+2 −0
Original line number Original line Diff line number Diff line
@@ -13,6 +13,8 @@ LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0;
LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.1.34"
LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.1.34"


LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json"
LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json"
LibItsHttp_Pics.PICS_USE_TOKEN_HEADER    := true
#LibItsHttp_Pics.PICS_TOKEN_HEADER        := "Basic WrongToken"


LibMec_Pics.PICS_MEC_PLAT               := true
LibMec_Pics.PICS_MEC_PLAT               := true
LibMec_Pics.PICS_SERVICES               := true
LibMec_Pics.PICS_SERVICES               := true
+1004 −1001
Original line number Original line Diff line number Diff line
@@ -12,6 +12,7 @@
  module AtsMec_Ams_TestCases {
  module AtsMec_Ams_TestCases {
  
  
  // Libcommon
  // Libcommon
  import from LibCommon_BasicTypesAndValues all;
  import from LibCommon_Sync all;
  import from LibCommon_Sync all;
  
  
  // LibHttp
  // LibHttp
@@ -82,7 +83,7 @@ group appMobilityServices {
                              )))))) -> value v_response {
                              )))))) -> value v_response {
            tc_ac.stop;
            tc_ac.stop;
            
            
          if (f_check_headers(v_response.response.header) == true) {
            if (f_check_headers(valueof(v_response.response.header)) == true) {
              log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppTerminationNotificationSubscription ***");
              log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppTerminationNotificationSubscription ***");
              f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
              f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            } else {
            } else {
@@ -1136,6 +1137,7 @@ group ams_notifications {
    testcase TP_MEC_SRV_AMS_010_OK() runs on HttpComponent system HttpTestAdapter {
    testcase TP_MEC_SRV_AMS_010_OK() runs on HttpComponent system HttpTestAdapter {
          // Local variables
          // Local variables
          var HeaderLines v_headers;
          var HeaderLines v_headers;
          var UInt64 v_timestamp;
          
          
          // Test control
          // Test control
          if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) {
          if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) {
@@ -1152,6 +1154,7 @@ group ams_notifications {
          // Preamble
          // Preamble
          f_init_default_headers_list(-, -, v_headers);
          f_init_default_headers_list(-, -, v_headers);
          action("Trigger a expire notification event");
          action("Trigger a expire notification event");
          v_timestamp := f_get_current_timestamp_utc();
          f_selfOrClientSyncAndVerdict(c_prDone, e_success);
          f_selfOrClientSyncAndVerdict(c_prDone, e_success);
          
          
          // Test Body
          // Test Body
@@ -1167,7 +1170,7 @@ group ams_notifications {
                              	mw_expire_notification(
                              	mw_expire_notification(
                                  	-,
                                  	-,
                                  	-,
                                  	-,
                                	timeStamp // @TODO how can I express timestamp in TTNC?
                                  	{ seconds := v_timestamp / 1000, nanoSeconds := 1000 * v_timestamp mod 1000 }
                                  )
                                  )
                              )
                              )
                          )
                          )
+1 −1
Original line number Original line Diff line number Diff line
@@ -7,7 +7,7 @@
 *                 No part may be reproduced except as authorized by written permission.
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 *                 All rights reserved.
 *    @see      ETSI GS MEC 003, Draft ETSI GS MEC 013 V2.0.3 (2018-10)
 *    @see      ETSI GS MEC 003, Draft ETSI GS MEC 016 V2.0.3 (2018-10)
 */
 */
module AtsMec_BwManagementAPI_TestCases {
module AtsMec_BwManagementAPI_TestCases {
  
  
+58 −0
Original line number Original line Diff line number Diff line
@@ -1543,6 +1543,64 @@ module AtsMec_RnisAPI_TestCases {
        f_cf_01_http_notif_down();
        f_cf_01_http_notif_down();
    } // End of testcase TC_MEC_SRV_RNIS_008_OK
    } // End of testcase TC_MEC_SRV_RNIS_008_OK
    
    
    /**
     * @desc Check that the RNIS service sends an RNIS notification about 5G NR UE measurement report if the RNIS service has an associated subscription and the event is generated.
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisNotifications.tplan2
     */
    testcase TC_MEC_SRV_RNIS_009_OK() runs on HttpComponent system HttpTestAdapter {
        // Local variables
        var HeaderLines v_headers;
        
        // Test control
        if (not(PICS_RNIS) or not(PICS_RNIS_NOTIFICATIONS)) {
            log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_NOTIFICATIONS required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
        
        // Test component configuration
        f_cf_01_http_notif_up();
        
        // Test adapter configuration
        
        // Preamble
        f_init_default_headers_list(-, -, v_headers);
        action("Trigger a MeasRepUeNotification event");
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        
        // Test Body
        tc_wait.start;
        alt {
          [] httpPort_notif.receive(
                                    mw_http_request(
                                                    mw_http_request_post(
                                                                         PX_CALLBACK_URI,
                                                                         -,
                                                                         mw_http_message_body_json(
                                                                                                   mw_body_json_s1_bearer_subscription(
                                                                                                                                       mw_s1_bearer_subscription(
                                                                                                                                                                PX_CALLBACK_REFERENCE,
                                                                                                                                                                PX_LINKS_SELF,
                                                                                                                                                                -//mw_filter_criteria
                                                                                                                                                                )))))) {
            tc_wait.stop;
            
            // Send 204 No Content
            httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers)));
            
            log("*** " & testcasename() & ": PASS: IUT successfully sends RAB release notification ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
          [] tc_wait.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Postamble
        f_cf_01_http_notif_down();
    } // End of testcase TC_MEC_SRV_RNIS_009_OK
    
  } // End of group rnis_notifications 
  } // End of group rnis_notifications 
  
  
} // End of module AtsMec_RnisAPI_TestCases
} // End of module AtsMec_RnisAPI_TestCases
Loading