Commit cd1ad821 authored by YannGarcia's avatar YannGarcia

Add support of getting time UTC, Start enhancement of RNIS

parent 65f0d13f
#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
......@@ -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_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_SERVICES := true
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
* 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)
* @see ETSI GS MEC 003, Draft ETSI GS MEC 016 V2.0.3 (2018-10)
*/
module AtsMec_BwManagementAPI_TestCases {
......
......@@ -84,7 +84,7 @@ module AtsMec_PkgMgmt_mm1_TestCases {
mw_http_response_ok(
mw_http_message_body_json(
mw_body_json_pkg_mgmt_response(
mw_package_management_list(
mw_package_management_list(
-,
PX_APP_PKG_NAME,
PX_APP_PKG_VERSION,
......
......@@ -1543,6 +1543,64 @@ module AtsMec_RnisAPI_TestCases {
f_cf_01_http_notif_down();
} // 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 module AtsMec_RnisAPI_TestCases
......
LibIts @ 25c8a9e7
Subproject commit 8b156c8b0781f511dc4444742ee2eed9818aa865
Subproject commit 25c8a9e788ccd0fb17ef38dbf12b1a7e9a6c0085
......@@ -13,7 +13,7 @@ module AppLCM_Templates {
template (present) CreateAppInstanceRequest m_lifecycle_management_create (
in template (present) String p_appDId := ?
) := {
appDId := p_appDId
appDId := p_appDId
}
template (present) CreateAppInstanceRequestWithError m_lifecycle_management_create_with_error (
......
......@@ -100,13 +100,13 @@ type record AppInstanceLcmOpOcc {
type record SubscriptionRequest {
AnyURI callbackUri,
SubscriptionType subscriptionType
SubscriptionType subscriptionType,
AnyURI callbackUri
}
type record SubscriptionRequestWithError {
AnyURI callbackUriWithError,
SubscriptionType subscriptionType
SubscriptionType subscriptionType,
AnyURI callbackUriWithError
}
type record of SubscriptionInfo SubscriptionInfoList;
......
......@@ -66,7 +66,7 @@ module MeoPkgm_Templates {
in template (present) SubscriptionType p_subscription_type := ?,
in template (present) AnyURI p_callbackUri := ?
) := {
subscriptionId := p_subscriptionId ifpresent,
subscriptionId := p_subscriptionId /* FIXME Error??? ifpresent*/,
subscriptionType := p_subscription_type,
callbackUri := p_callbackUri
}
......
......@@ -42,13 +42,12 @@ module MepmPkgm_Templates {
in template (present) UsageState p_usageState := ?
) := {
appPkgId := p_appPkgId ,
appName := p_appName,
appDId := p_appDId ,
appName := p_appName,
appDVersion := p_appDVersion,
checksum := p_checksum ,
operationalState := p_operationalState,
usageState := p_usageState
usageState := p_usageState
}
......@@ -74,7 +73,7 @@ module MepmPkgm_Templates {
in template (present) SubscriptionType p_subscription_type := ?,
in template (present) AnyURI p_callbackUri := ?
) := {
subscriptionId := p_subscriptionId ifpresent,
subscriptionId := p_subscriptionId /*FIXME Error???ifpresent*/,
subscriptionType := p_subscription_type,
callbackUri := p_callbackUri
}
......
......@@ -305,6 +305,26 @@ module RnisAPI_Templates {
s1UeInfo := p_s1UeInfo
} // End of temlate mw_s1_bearer_info
template (omit) L2Meas m_l2_measa(
in template (omit )TimeStamp p_timestamp := omit,
in template (value) CellInfo p_cellInfo,
in template (value) CellUEInfo p_cellUEInfo
) := {
timestamp := p_timestamp,
cellInfo := p_cellInfo,
cellUEInfo := p_cellUEInfo
} // End of template m_l2_measa
template L2Meas mw_l2_measa(
template TimeStamp p_timestamp := *,
template CellInfo p_cellInfo := *,
template CellUEInfo p_cellUEInfo := *
) := {
timestamp := p_timestamp,
cellInfo := p_cellInfo,
cellUEInfo := p_cellUEInfo
} // End of template mw_l2_measa
} // End of group info_request
group sub_types {
......
module LibMec_Functions {
// Libcommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_Sync all;
// LibMec
......@@ -19,6 +20,7 @@ module LibMec_Functions {
import from LibItsHttp_TestSystem all;
import from LibItsHttp_Templates all;
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_Pics all;
group preambles {
......@@ -112,6 +114,16 @@ module LibMec_Functions {
} // End of group postambles
group external_functions {
/**
* @desc Gets the current time since 01/01/1970 in UTC format
* @return The current time since 01/01/1970 in UTC format
*/
external function fx_get_current_time_utc() return UInt64;
} // End of group external_functions
group helpers {
/**
......@@ -198,6 +210,10 @@ module LibMec_Functions {
return v_result;
} // End of function f_check_user_register_state
function f_get_current_timestamp_utc() return UInt64 {
return fx_get_current_time_utc();
} // End of function f_get_current_timestamp
} // End of group helpers
group registration {
......@@ -324,13 +340,22 @@ module LibMec_Functions {
log("*** " & testcasename() & ": FAIL: Unexpected binary response ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
[PICS_USE_TOKEN_HEADER == false] httpPort.receive(
mw_http_response(
mw_http_response_401_unauthorized
)) -> value v_response {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Received HTTP error message in case of non authenticated HTTP request ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
[] httpPort.receive(
mw_http_response(
mw_http_response_ko
)) -> value v_response {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Server error: " & int2str(v_response.response.statuscode) & "/" & v_response.response.statustext & " ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
// Do not repeat!
}
[] httpPort.receive(mw_http_response) -> value v_response {
tc_ac.stop;
......
......@@ -12,13 +12,13 @@ module LibItsHttp_JsonMessageBodyTypes {
import from Ams_TypesAndValues all;
// LibMec/AppEnablementAPI
import from AppEnablementAPI_TypesAndValues all;
// LibMec/GrantAPI
import from Grant_TypesAndValues all;
// LibMec/AppPkgAPI
import from MeoPkgm_TypesAndValues all;
// LibMec/AppEnablementAPI
import from MepmPkgm_TypesAndValues all;
// LibMec/AppLCMAPI
import from AppLCM_TypesAndValues all;
// LibMec/UEAppInterfaceAPI
......@@ -54,6 +54,7 @@ module LibItsHttp_JsonMessageBodyTypes {
MeasTaSubscription measTaSubscription,
CaReConfSubscription caReConfSubscription,
S1BearerSubscription s1BearerSubscription,
L2Meas l2Meas,
RnisAPI_TypesAndValues.ProblemDetails problemDetails_rnis,
BwInfo bwInfo,
BwManagementAPI_TypesAndValues.ProblemDetails problemDetails_bw_management,
......
......@@ -698,6 +698,18 @@ group ams_api {
s1BearerSubscription := p_s1BearerSubscription
} // End of template mw_body_json_s1_bearer_subscription
template (value) JsonBody m_body_json_l2_meas_subscription(
in template (value) L2Meas p_l2Meas
) := {
l2Meas := p_l2Meas
} // End of template m_body_json_l2_meas_subscription
template (present) JsonBody mw_body_json_l2_meas_subscription(
template (present) L2Meas p_l2Meas := ?
) := {
l2Meas := p_l2Meas
} // End of template mw_body_json_l2_meas_subscription
template (value) JsonBody m_body_json_rni_problem_details(
in template (value) RnisAPI_TypesAndValues.ProblemDetails p_problemDetails
) := {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment