Commit 4688594a authored by Yann Garcia's avatar Yann Garcia
Browse files

Big fixed on MEC-011 ATS

parent b0ed782c
......@@ -35,10 +35,11 @@ module AtsMec_AppEnablementAPI_TestCases {
import from LibMec_Pics all;
import from LibMec_Pixits all;
const charstring c_etag_http_header := "etag";
/*
* Application Service Availability Query (APPSAQ)
*/
/*
* Application Service Availability Query (APPSAQ)
*/
group app_saq {
/**
......@@ -499,7 +500,8 @@ module AtsMec_AppEnablementAPI_TestCases {
*/
function f_create_service(
out universal charstring p_service_name,
out ServiceInfo p_service_info
out ServiceInfo p_service_info,
out Headers p_headers
) runs on HttpComponent return integer {
var universal charstring v_service_name;
var Headers v_headers;
......@@ -546,6 +548,7 @@ module AtsMec_AppEnablementAPI_TestCases {
tc_ac.stop;
p_service_name := v_service_name;
p_service_info := v_response.response.body.json_body.serviceInfo;
p_headers := v_response.response.header;
v_result := 0;
}
[] tc_ac.timeout {
......@@ -603,6 +606,7 @@ module AtsMec_AppEnablementAPI_TestCases {
testcase TC_MEC_SRV_APPSAQ_004_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var Headers v_headers;
var charstring_list v_etag;
var universal charstring v_service_name;
var ServiceInfo v_service_info;
......@@ -619,13 +623,19 @@ module AtsMec_AppEnablementAPI_TestCases {
// Test adapter configuration
// Preamble
if(f_create_service(v_service_name, v_service_info) == -1) {
if(f_create_service(v_service_name, v_service_info, v_headers) == -1) {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
log("*** " & testcasename() & ": INFO: New servie created: ", v_service_name, ", transportID=", v_service_info.transportInfo.id);
// TODO If-Match header needs to have a PROPER_ETAG
if (f_check_headers(v_headers, c_etag_http_header) == false) {
log("*** " & testcasename() & ": INCONC: 'ETag' HTTP header not set ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
f_get_header(v_headers, c_etag_http_header, v_etag); // TODO Check headers
log("*** " & testcasename() & ": INFO: New servie created: ", v_service_name, ", transportID=", v_service_info.transportInfo.id, ", ETag=", v_etag[0]);
// If-Match header needs to have a PROPER_ETAG
f_init_default_headers_list(-, -, v_headers);
f_set_headers_list({ "If-Match" }, v_etag, v_headers);
httpPort.send(
m_http_request(
m_http_request_put(
......@@ -670,7 +680,7 @@ module AtsMec_AppEnablementAPI_TestCases {
} // End of 'alt' statement
// Postamble
// TODO Delete service created
f_delete_service(v_service_name);
f_cf_01_http_down();
} // End of testcase TC_MEC_SRV_APPSAQ_004_OK
......@@ -681,6 +691,7 @@ module AtsMec_AppEnablementAPI_TestCases {
testcase TC_MEC_SRV_APPSAQ_004_BR() runs on HttpComponent system HttpTestAdapter {
// Local variables
var Headers v_headers;
var charstring_list v_etag;
var universal charstring v_service_name := "";
var ServiceInfo v_service_info;
......@@ -697,14 +708,19 @@ module AtsMec_AppEnablementAPI_TestCases {
// Test adapter configuration
// Preamble
if(f_create_service(v_service_name, v_service_info) == -1) {
if(f_create_service(v_service_name, v_service_info, v_headers) == -1) {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
log("*** " & testcasename() & ": INFO: New servie created: ", v_service_name, ", transportID=", v_service_info.transportInfo.id);
// TODO If-Match header needs to have a PROPER_ETAG
if (f_check_headers(v_headers, c_etag_http_header) == false) {
log("*** " & testcasename() & ": INCONC: 'ETag' HTTP header not set ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
f_get_header(v_headers, c_etag_http_header, v_etag); // TODO Check headers
log("*** " & testcasename() & ": INFO: New servie created: ", v_service_name, ", transportID=", v_service_info.transportInfo.id, ", ETag=", v_etag[0]);
// If-Match header needs to have a PROPER_ETAG
f_init_default_headers_list(-, -, v_headers);
f_set_headers_list({ "If-Match" }, v_etag, v_headers);
httpPort.send(
m_http_request(
m_http_request_put(
......@@ -742,6 +758,7 @@ module AtsMec_AppEnablementAPI_TestCases {
} // End of 'alt' statement
// Postamble
f_delete_service(v_service_name);
f_cf_01_http_down();
} // End of testcase TC_MEC_SRV_APPSAQ_004_BR
......@@ -815,6 +832,7 @@ module AtsMec_AppEnablementAPI_TestCases {
testcase TC_MEC_SRV_APPSAQ_004_PF() runs on HttpComponent system HttpTestAdapter {
// Local variables
var Headers v_headers;
var charstring_list v_etag;
var universal charstring v_service_name;
var ServiceInfo v_service_info;
......@@ -831,14 +849,19 @@ module AtsMec_AppEnablementAPI_TestCases {
// Test adapter configuration
// Preamble
if(f_create_service(v_service_name, v_service_info) == -1) {
if(f_create_service(v_service_name, v_service_info, v_headers) == -1) {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
log("*** " & testcasename() & ": INFO: New servie created: ", v_service_name, ", transportID=", v_service_info.transportInfo.id);
// TODO If-Match header needs to have an INVALID_ETAG
if (f_check_headers(v_headers, c_etag_http_header) == false) {
log("*** " & testcasename() & ": INCONC: 'ETag' HTTP header not set ***");
f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
}
f_get_header(v_headers, c_etag_http_header, v_etag);
log("*** " & testcasename() & ": INFO: New servie created: ", v_service_name, ", transportID=", v_service_info.transportInfo.id, ", ETag=", v_etag[0]);
// If-Match header needs to have an INVALID_ETAG
f_init_default_headers_list(-, -, v_headers);
f_set_headers_list({ "ETag" }, { int2str(f_get_current_timestamp_utc()) }, v_headers);
f_set_headers_list({ "If-Match" }, { int2str(f_get_current_timestamp_utc()) }, v_headers);
httpPort.send(
m_http_request(
m_http_request_put(
......@@ -878,6 +901,7 @@ module AtsMec_AppEnablementAPI_TestCases {
} // End of 'alt' statement
// Postamble
f_delete_service(v_service_name);
f_cf_01_http_down();
} // End of testcase TC_MEC_SRV_APPSAQ_004_PF
......@@ -1007,8 +1031,6 @@ module AtsMec_AppEnablementAPI_TestCases {
// Local variables
var Headers v_headers;
var HttpMessage v_response;
var universal charstring v_service_name;
var ServiceInfo v_service_info;
// Test control
if (not(PICS_MEC_PLAT) or not (PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
......@@ -1024,40 +1046,21 @@ module AtsMec_AppEnablementAPI_TestCases {
// Preamble
f_init_default_headers_list(-, -, v_headers);
f_create_service(v_service_name, v_service_info);
//v_service_name := oct2unichar(char2oct("service_" & int2str(f_get_current_timestamp_utc())));
//TODO Create a subsciption (see TC_MEC_SRV_APPSUB_001_OK);
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_ME_APP_SUPPORT_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions",
v_headers,
m_http_message_body_json(
m_body_json_srv_avail_notif_subscription/*m_body_json_app_termination_notif_subscription*/(
m_srv_avail_notif_subscription(
PX_APP_TERM_NOTIF_CALLBACK_URI,
m_self(
{ href := PX_HREF }
),
m_service_info(
v_service_name,
-, -, -, -, -, //-,
m_transport_info(
"transportId1",
"TC_MEC_SRV_APPSUB_002_OK",
REST_HTTP,
"HTTP",
"2.0",
m_end_point_uris({"/meMp1/service/MyEntryPoint"}),
m_security_info
)
) )
/*m_app_termination_notif_subscription(
m_body_json_app_termination_notif_subscription(
m_app_termination_notif_subscription(
PX_APP_TERM_NOTIF_CALLBACK_URI,
m_self(
-/*m_self(
{ href := PX_HREF }
),
PX_APP_INSTANCE_ID
)*/
)*/,
"ID1"/*PX_APP_INSTANCE_ID*/
)
)
)
)
......@@ -1775,8 +1778,9 @@ module AtsMec_AppEnablementAPI_TestCases {
// Test adapter configuration
// Preamble
// TODO If-Match header needs to have an INVALID_ETAG
f_init_default_headers_list(-, -, v_headers);
// If-Match header needs to have an INVALID_ETAG
f_set_headers_list({ "If-Match" }, { int2str(f_get_current_timestamp_utc()) }, v_headers);
httpPort.send(
m_http_request(
m_http_request_put(
......@@ -2019,7 +2023,7 @@ module AtsMec_AppEnablementAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_MEC_SVC_MGMT_SVC_URI & oct2char(unichar2oct(PX_NON_EXISTENT_SERVICE_ID, "UTF-8")),
"/" & PICS_ROOT_API & PX_MEC_SVC_MGMT_SVC_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SERVICE_ID, "UTF-8")),
v_headers
)
)
......@@ -3037,8 +3041,9 @@ module AtsMec_AppEnablementAPI_TestCases {
// Test adapter configuration
// Preamble
// TODO If-Match header needs to have an INVALID_ETAG
f_init_default_headers_list(-, -, v_headers);
// If-Match header needs to have an INVALID_ETAG
f_set_headers_list({ "If-Match" }, { int2str(f_get_current_timestamp_utc()) }, v_headers);
httpPort.send(
m_http_request(
m_http_request_put(
......
......@@ -19,7 +19,7 @@ module AppEnablementAPI_Pixits {
modulepar ServiceInfo_Version PX_NEW_SERVICE_INFO_VERSION := "2.0.0";
modulepar ServiceInfo_State PX_SERVICE_INFO_STATE := ACTIVE;
modulepar ServiceState PX_SERVICE_INFO_STATE := ACTIVE;
modulepar SerializerTypes PX_SERIALIZER := JSON;
......
......@@ -49,7 +49,7 @@ module AppEnablementAPI_Templates {
template (omit) ServiceInfo m_service_info(
in SerName p_serName,
in ServiceInfo_Version p_version := PX_SERVICE_INFO_VERSION,
in ServiceInfo_State p_state := PX_SERVICE_INFO_STATE,
in ServiceState p_state := PX_SERVICE_INFO_STATE,
in SerializerTypes p_serializer := PX_SERIALIZER,
//in ServiceInfo_Link p_links := PX_LINKS_SERVICE_INFO,
in template (omit) SerInstanceId p_serInstanceId := omit,
......@@ -75,7 +75,7 @@ module AppEnablementAPI_Templates {
template ServiceInfo mw_service_info(
template (present) SerName p_serName := ?,
template (present) ServiceInfo_Version p_version := ?,
template (present) ServiceInfo_State p_state := ?,
template (present) ServiceState p_state := ?,
template (present) SerializerTypes p_serializer := ?,
//template (present) ServiceInfo_Link p_links := ?,
template SerInstanceId p_serInstanceId := *,
......@@ -111,17 +111,15 @@ module AppEnablementAPI_Templates {
} // End of template mw_subscription_link_list
template (value) Self m_self(
in template (value) LinkType p_self_,
in template (value) JSON.Bool p_readOnly := false
in template (value) LinkType p_self_
) := {
self_ := p_self_,
readOnly := p_readOnly
self_ := p_self_
} // End of template m_self
template (value) AppTerminationNotificationSubscription m_app_termination_notif_subscription(
in template (value) AppTerminationNotificationSubscription_CallbackReference p_callbackReference,
in template (value) Self p_links,
in template (value) AppInstanceId p_appInstanceId
template (omit) AppTerminationNotificationSubscription m_app_termination_notif_subscription(
in template (value) AppTerminationNotificationSubscription_CallbackReference p_callbackReference,
in template (omit) Self p_links := omit,
in template (value) AppInstanceId p_appInstanceId
) := {
subscriptionType := "AppTerminationNotificationSubscription",
callbackReference := p_callbackReference,
......@@ -129,18 +127,18 @@ module AppEnablementAPI_Templates {
appInstanceId := p_appInstanceId
} // End of template m_app_termination_notif_subscription
template (value) AppTerminationNotificationSubscription m_app_termination_notif_subscription_invalid(
in template (value) AppTerminationNotificationSubscription_CallbackReference p_callbackReference,
in template (value) Self p_links,
in template (value) AppInstanceId p_appInstanceId
) modifies m_app_termination_notif_subscription := {
template (omit) AppTerminationNotificationSubscription m_app_termination_notif_subscription_invalid(
in template (value) AppTerminationNotificationSubscription_CallbackReference p_callbackReference,
in template (omit) Self p_links := omit,
in template (value) AppInstanceId p_appInstanceId
) modifies m_app_termination_notif_subscription := {
subscriptionType := "InvalidAppTerminationNotificationSubscription"
} // End of template m_app_termination_notif_subscription_invalid
template (present) AppTerminationNotificationSubscription mw_app_termination_notif_subscription(
template (present) AppTerminationNotificationSubscription_CallbackReference p_callbackReference := ?,
template (present) Self p_links := ?,
template (present) AppInstanceId p_appInstanceId := ?
template AppTerminationNotificationSubscription mw_app_termination_notif_subscription(
template (present) AppTerminationNotificationSubscription_CallbackReference p_callbackReference := ?,
template Self p_links := *,
template (present) AppInstanceId p_appInstanceId := ?
) := {
subscriptionType := "AppTerminationNotificationSubscription",
callbackReference := p_callbackReference,
......@@ -223,7 +221,7 @@ module AppEnablementAPI_Templates {
template (omit) SerAvailabilityNotificationSubscription m_srv_avail_notif_subscription(
in template (value) SerAvailabilityNotificationSubscription_CallbackReference p_callbackReference,
in template (omit) Self p_links := omit,
in template (omit) ServiceInfo p_filteringCriteria := omit
in template (omit) FilteringCriteria p_filteringCriteria := omit
) := {
subscriptionType := "SerAvailabilityNotificationSubscription",
callbackReference := p_callbackReference,
......@@ -234,7 +232,7 @@ module AppEnablementAPI_Templates {
template (omit) SerAvailabilityNotificationSubscription m_srv_avail_notif_subscription_invalid(
in template (value) SerAvailabilityNotificationSubscription_CallbackReference p_callbackReference,
in template (omit) Self p_links := omit,
in template (omit) ServiceInfo p_filteringCriteria := omit
in template (omit) FilteringCriteria p_filteringCriteria := omit
) modifies m_srv_avail_notif_subscription := {
subscriptionType := "InvalidSerAvailabilityNotificationSubscription"
} // End of template m_srv_avail_notif_subscription_invalid
......@@ -242,7 +240,7 @@ module AppEnablementAPI_Templates {
template SerAvailabilityNotificationSubscription mw_srv_avail_notif_subscription(
template (present) SerAvailabilityNotificationSubscription_CallbackReference p_callbackReference := ?,
template Self p_links := *,
template ServiceInfo p_filteringCriteria := *
template FilteringCriteria p_filteringCriteria := *
) := {
subscriptionType := "SerAvailabilityNotificationSubscription",
callbackReference := p_callbackReference,
......
......@@ -48,7 +48,7 @@ module AppEnablementAPI_TypesAndValues {
type record AppTerminationNotificationSubscription {
SubscriptionType subscriptionType,
AppTerminationNotificationSubscription_CallbackReference callbackReference,
Self links,
Self links optional,
AppInstanceId appInstanceId
} with {
variant (links) "name as '_links'";
......@@ -88,6 +88,7 @@ module AppEnablementAPI_TypesAndValues {
Name name,
CategoryRef_Version version
}
type record length(0..infinity) of CategoryRef CategoryRefList;
/**
* @desc The seconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.
......@@ -352,8 +353,7 @@ module AppEnablementAPI_TypesAndValues {
* @desc Self-referring URI.
*/
type record Self {
LinkType self_,
JSON.Bool readOnly optional
LinkType self_
} with {
variant (self_) "name as 'self'";
}
......@@ -370,7 +370,7 @@ module AppEnablementAPI_TypesAndValues {
SerAvailabilityNotificationSubscription_SubscriptionType subscriptionType,
SerAvailabilityNotificationSubscription_CallbackReference callbackReference,
Self links optional,
ServiceInfo filteringCriteria optional
FilteringCriteria filteringCriteria optional
} with {
variant (links) "name as '_links'";
}
......@@ -380,6 +380,17 @@ module AppEnablementAPI_TypesAndValues {
*/
type JSON.String SerAvailabilityNotificationSubscription_SubscriptionType;
/**
* @desc Filtering criteria to match services for which events are requested to be reported
*/
type record FilteringCriteria {
SerInstanceIdList serInstanceIds optional,
SerNameList serNames optional,
CategoryRefList serCategories optional,
ServiceStateList states,
JSON.Bool isLocal optional
}
/**
* @desc This type represents the service availability information.
*/
......@@ -403,20 +414,23 @@ module AppEnablementAPI_TypesAndValues {
* @desc Identifier of the service instance assigned by the MEPM / mobile edge platform.
*/
type JSON.String SerInstanceId;
type record length(0..infinity) of SerInstanceId SerInstanceIdList;
/**
* @desc The name of the service. This is how the service producing mobile edge application identifies the service instance it produces.
*/
type JSON.String SerName;
type record length(0..infinity) of SerName SerNameList;
/**
* @desc Contains the state.
*/
type enumerated ServiceInfo_State {
type enumerated ServiceState {
ACTIVE,
INACTIVE,
UNKNOWN // Used for invalid behavior tests
}
type record length(0..infinity) of ServiceState ServiceStateList;
/**
* @desc Link to the "Individual mecServiceLiveness" resource where the MEC platform expects the service instance to send the liveness information.
......@@ -458,7 +472,7 @@ module AppEnablementAPI_TypesAndValues {
SerName serName,
CategoryRef serCategory optional,
ServiceInfo_Version version,
ServiceInfo_State state,
ServiceState state,
TransportId transportId optional,
TransportInfo transportInfo optional,
SerializerTypes serializer,
......
Supports Markdown
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