Commit cd1ad821 authored by YannGarcia's avatar YannGarcia
Browse files

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
......
......@@ -9,29 +9,30 @@
* All rights reserved.
* @see ETSI GS MEC 003, Draft ETSI GS MEC 013 V2.0.3 (2018-10)
*/
module AtsMec_Ams_TestCases {
module AtsMec_Ams_TestCases {
// Libcommon
import from LibCommon_Sync all;
// Libcommon
import from LibCommon_BasicTypesAndValues 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;
// 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 Ams_Templates all;
import from Ams_Pics all;
import from Ams_Pixits all;
// LibMec_LocationAPI
import from Ams_Templates all;
import from Ams_Pics all;
import from Ams_Pixits all;
// LibMec
import from LibMec_Functions all;
import from LibMec_Pics all;
import from LibMec_Pixits all;
// LibMec
import from LibMec_Functions all;
import from LibMec_Pics all;
import from LibMec_Pixits all;
group appMobilityServices {
group appMobilityServices {
/**
* @desc Check that the AMS service returns information about the registered application mobility services when requested
......@@ -82,7 +83,7 @@ group appMobilityServices {
)))))) -> value v_response {
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 ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
} else {
......@@ -297,9 +298,9 @@ group appMobilityServices {
} // End of 'alt' statement
} // End of testcase TP_MEC_SRV_AMS_002_BR
} // End of group appMobilityServices
} // End of group appMobilityServices
group appMobilityServicesSubscriptions {
group appMobilityServicesSubscriptions {
/**
* @desc Check that the AMS service returns information about the available subscriptions when requested.
......@@ -992,9 +993,9 @@ group appMobilityServicesSubscriptions {
} // End of TP_MEC_SRV_AMS_007_NF
} // End of group appMobilityServicesSubscriptions
} // End of group appMobilityServicesSubscriptions
group ams_notifications {
group ams_notifications {
/**
* @desc Check that the AMS service sends an AMS notification about a mobility procedure if the AMS service has an associated subscription and the event is generated
......@@ -1136,6 +1137,7 @@ group ams_notifications {
testcase TP_MEC_SRV_AMS_010_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
var UInt64 v_timestamp;
// Test control
if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) {
......@@ -1152,6 +1154,7 @@ group ams_notifications {
// Preamble
f_init_default_headers_list(-, -, v_headers);
action("Trigger a expire notification event");
v_timestamp := f_get_current_timestamp_utc();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
......@@ -1167,7 +1170,7 @@ group ams_notifications {
mw_expire_notification(
-,
-,
timeStamp // @TODO how can I express timestamp in TTNC?
{ seconds := v_timestamp / 1000, nanoSeconds := 1000 * v_timestamp mod 1000 }
)
)
)
......
......@@ -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 {
......
......@@ -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
......@@ -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
}
......@@ -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 {
......
......@@ -30,7 +30,7 @@ module RnisAPI_TypesAndValues {
}
/**
* @desc
* @desc This type represents the information on Mobile Network(s), which a MEC application instance is associated to.
* @member timeStamp
* @member appInsId
* @member ecgi
......@@ -42,7 +42,7 @@ module RnisAPI_TypesAndValues {
}
/**
* @desc
* @desc This type represents the information on existing E-RABs that are associated with a specific MEC application instance.
* @member timeStamp
* @member appInsId
* @member requestId
......@@ -56,7 +56,7 @@ module RnisAPI_TypesAndValues {
}
/**
* @desc
* @desc This type represents the information on S1-U bearer.
* @member timeStamp
* @member appInsId
* @member ecgi
......@@ -66,6 +66,18 @@ module RnisAPI_TypesAndValues {
S1UeInfo s1UeInfo
}
/**
* @desc This type represents the information on the Layer 2 measurements information from one or more eNBs that are associated with the requested MEC application instance.
* @member timestamp Time stamp
* @member cellInfo The per cell measurement information
* @member cellUEInfo The per cell per UE layer 2 measurements information
*/
type record L2Meas {
TimeStamp timestamp optional,
CellInfo cellInfo optional,
CellUEInfo cellUEInfo optional
}
/**
* @desc The information on users per cell
* @member tempUeId
......@@ -262,6 +274,94 @@ module RnisAPI_TypesAndValues {
}
type record of QosInformation_ QosInformation;
type integer UInt100 (0 .. 100) with {variant "unsigned 100 bit"};
/**
* @desc The per cell measurement information
* @member ecgi E-UTRAN CelI Global Identifier
* @member dl_gbr_prb_usage_cell indicates the PRB usage for downlink GBR traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12].
* @member ul_gbr_prb_usage_cell indicates (in percentage) the PRB usage for uplink GBR traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12].
* @member dl_nongbr_prb_usage_cell indicates (in percentage) the PRB usage for downlink non-GBR traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12].
* @member ul_nongbr_prb_usage_cell indicates (in percentage) the PRB usage for uplink non-GBR traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12].
* @member dl_total_prb_usage_cell indicates (in percentage) the PRB usage for total downlink traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12].
* @member ul_total_prb_usage_cell indicates (in percentage) the PRB usage for total uplink traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12].
* @member received_dedicated_preambles_cell indicates (in percentage) the received dedicated preamples, as defined in ETSI TS 136 314 [i.11].
* @member received_randomly_selected_preambles_low_range_cellIt indicates (in percentage) the received randomly selected preambles in the low range, as defined in ETSI TS 136 314 [i.11].
* @member received_randomly_selected_preambles_high_range_cell It indicates (in percentage) the received randomly selected preambles in the high range, as defined in ETSI TS 136 314 [i.11].
* @member number_of_active_ue_dl_gbr_cell It indicates the number of active UEs with downlink GBR traffic, as defined in ETSI TS 136 314 [i.11].
* @member number_of_active_ue_ul_gbr_cell It indicates the number of active UEs with uplink GBR traffic, as defined in ETSI TS 136 314 [i.x].
* @member number_of_active_ue_dl_nongbr_cell It indicates the number of active UEs with downlink non-GBR traffic, as defined in ETSI TS 136 314 [i.11].
* @member number_of_active_ue_ul_nongbr_cell It indicates the number of active UEs with uplink non-GBR traffic, as defined in ETSI TS 136 314 [i.11].
* @member dl_gbr_pdr_cell It indicates the packet discard rate in percentage of the downlink GBR traffic in a cell, as defined in ETSI TS 136 314 [i.x].
* @member ul_gbr_pdr_cell It indicates the packet discard rate in percentage of the uplink GBR traffic in a cell, as defined in ETSI TS 136 314 [i.11].
* @member dl_nongbr_pdr_cell It indicates the packet discard rate in percentage of the downlink non-GBR traffic in a cell, as defined in ETSI TS 136 314 [i.x].
* @member ul_nongbr_pdr_cell It indicates the packet discard rate in percentage of the uplink non-GBR traffic in a cell, as defined in ETSI TS 136 314 [i.11].
*/
type record CellInfo_ {
Ecgi ecgi optional,
UInt100 dl_gbr_prb_usage_cell optional,
UInt100 ul_gbr_prb_usage_cell optional,
UInt100 dl_nongbr_prb_usage_cell optional,
UInt100 ul_nongbr_prb_usage_cell optional,
UInt100 dl_total_prb_usage_cell optional,
UInt100 ul_total_prb_usage_cell optional,
UInt100 received_dedicated_preambles_cell optional,
UInt100 received_randomly_selected_preambles_low_range_cell optional,
UInt100 received_randomly_selected_preambles_high_range_cell optional,
integer number_of_active_ue_dl_gbr_cell optional,
integer number_of_active_ue_ul_gbr_cell optional,
integer number_of_active_ue_dl_nongbr_cell optional,
integer number_of_active_ue_ul_nongbr_cell optional,
UInt100 dl_gbr_pdr_cell optional,
UInt100 ul_gbr_pdr_cell optional,
UInt100 dl_nongbr_pdr_cell optional,
UInt100 ul_nongbr_pdr_cell optional
}
type record of CellInfo_ CellInfo;
/**
* @desc The per cell measurement information
* @member ecgi E-UTRAN CelI Global Identifier
* @member associateId Identifier to associate the information for a specific UE or flow.
* @member dl_gbr_delay_ue It indicates the packet delay of the downlink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member ul_gbr_delay_ue It indicates the packet delay of the uplink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member dl_nongbr_delay_ue It indicates the packet delay of the downlink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member ul_nongbr_delay_ue It indicates the packet delay of the uplink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member dl_gbr_pdr_ue It indicates the packet discard rate in percentage of the downlink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member ul_gbr_pdr_ue It indicates the packet discard rate in percentage of the uplink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member dl_nongbr_pdr_ue It indicates the packet discard rate in percentage of the downlink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member ul_nongbr_pdr_ue It indicates the packet discard rate in percentage of the uplink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member dl_gbr_throughput_ue It indicates the scheduled throughput of the downlink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member ul_gbr_throughput_ue It indicates the scheduled throughput of the uplink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member dl_nongbr_throughput_ue It indicates the scheduled throughput of the downlink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member ul_nongbr_throughput_ue It indicates the scheduled throughput of the uplink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member dl_gbr_data_volume_ue It indicates the data volume of the downlink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member ul_gbr_data_volume_ue It indicates the data volume of the uplink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member dl_nongbr_data_volume_ue It indicates the data volume of the downlink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
* @member ul_nongbr_data_volume_ue It indicates the data volume of the uplink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11].
*/
type record CellUEInfo_ {
Ecgi ecgi optional,
AssociateId associateId,
integer dl_gbr_delay_ue optional,
integer ul_gbr_delay_ue optional,
integer dl_nongbr_delay_ue optional,
integer ul_nongbr_delay_ue optional,
UInt100 dl_gbr_pdr_ue optional,
UInt100 ul_gbr_pdr_ue optional,
UInt100 dl_nongbr_pdr_ue optional,
UInt100 ul_nongbr_pdr_ue optional,
integer dl_gbr_throughput_ue optional,
integer ul_gbr_throughput_ue optional,
integer dl_nongbr_throughput_ue optional,
integer ul_nongbr_throughput_ue optional,
integer dl_gbr_data_volume_ue optional,
integer ul_gbr_data_volume_ue optional,
integer dl_nongbr_data_volume_ue optional,
integer ul_nongbr_data_volume_ue optional
}
type record of CellUEInfo_ CellUEInfo;
/**
* @desc
* @member links
......@@ -274,18 +374,6 @@ module RnisAPI_TypesAndValues {
variant (links) "name as '_links'";
}
/**
* @desc
* @member callbackReference
* @member filterCriteria
* @member expiryDeadline
*/
type record MeasRepUeSubscriptionPost {
CallbackReference callbackReference,
FilterCriteriaAssocTri filterCriteria,
TimeStamp expiryDeadline optional
}
/**
* @desc
* @member callbackReference
......@@ -303,20 +391,6 @@ module RnisAPI_TypesAndValues {
variant (links) "name as '_links'";
}
/**
* @desc
* @member callbackReference
* @member eventType
* @member s1BearerSubscriptionCriteria
* @member expiryDeadline
*/
type record S1BearerSubscriptionPost {
CallbackReference callbackReference,
EventType eventType,
S1BearerSubscriptionCriteria s1BearerSubscriptionCriteria,
TimeStamp expiryDeadline optional
}
/**
* @desc
* @member callbackReference
......@@ -350,22 +424,6 @@ module RnisAPI_TypesAndValues {
variant (links) "name as '_links'";
}
/**
* @desc
* @member callbackReference
* @member links
* @member filterCriteria
* @member expiryDeadline
*/
type record RabEstSubscriptionPost {
CallbackReference callbackReference,
Link links,
FilterCriteriaAssocQci filterCriteria,
TimeStamp expiryDeadline optional
} with {
variant (links) "name as '_links'";
}
/**
* @desc
* @member callbackReference
......@@ -383,18 +441,6 @@ module RnisAPI_TypesAndValues {
variant (links) "name as '_links'";
}
/**
* @desc
* @member callbackReference
* @member filterCriteria
* @member expiryDeadline
*/
type record RabModSubscriptionPost {
CallbackReference callbackReference,
FilterCriteriaAssocQci filterCriteria,
TimeStamp expiryDeadline optional
}
/**
* @desc
* @member callbackReference
......@@ -412,18 +458,6 @@ module RnisAPI_TypesAndValues {
variant (links) "name as '_links'";
}
/**
* @desc
* @member callbackReference
* @member filterCriteria
* @member expiryDeadline
*/
type record RabRelSubscriptionPost {
CallbackReference callbackReference,
FilterCriteriaAssocQci filterCriteria,
TimeStamp expiryDeadline optional
}
/**
* @desc
* @member callbackReference
......@@ -441,30 +475,6 @@ module RnisAPI_TypesAndValues {
variant (links) "name as '_links'";
}
/**
* @desc
* @member callbackReference
* @member filterCriteria
* @member expiryDeadline
*/
type record CaReConfSubscriptionPost {
CallbackReference callbackReference,
FilterCriteriaAssoc filterCriteria,
TimeStamp expiryDeadline optional
}
/**
* @desc
* @member callbackReference
* @member filterCriteria
* @member expiryDeadline
*/
type record CellChangeSubscriptionPost {
CallbackReference callbackReference,
FilterCriteriaAssocHo filterCriteria,
TimeStamp expiryDeadline optional
}
/**
* @desc
* @member callbackReference
......@@ -482,19 +492,6 @@ module RnisAPI_TypesAndValues {
variant (links) "name as '_links'";
}
/**
* @desc
* @member callbackReference
* @member filterCriteria
* @member expiryDeadline
*/
type record MeasTaSubscriptionPost {
SubscriptionType subscriptionType,
CallbackReference callbackReference,
FilterCriteriaAssoc filterCriteria,
TimeStamp expiryDeadline optional
}
/**
* @desc
* @member callbackReference
......