Commit 64d90b2f authored by YannGarcia's avatar YannGarcia
Browse files

Create virtualization folder; Create EdgePlatformApplicationEnablementAPI for...

 Create virtualization folder; Create EdgePlatformApplicationEnablementAPI for MEC-10-2 v2.2.1; Remove useless folders
parent e3a8892a
......@@ -10,6 +10,6 @@ cd $(dirname $0)
run_dir=`pwd`
# Docker version 2
cd docker
cd virtualization/docker
./build.sh #--force-stfubuntu
#./run.sh
......@@ -560,6 +560,8 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
loggers::get_instance().warning("http_codec::decode_body: Missing data and chunked mode");
_params->insert(std::pair<std::string, std::string>("missing_data", "1"));
_params->log();
OCTETSTRING raw_trunk(len, idx + static_cast<const unsigned char*>(body));
loggers::get_instance().log_msg("http_codec::decode_body: raw_trunk: ", raw_trunk);
return -1;
}
while (counter < body.lengthof() && ((body[counter].get_octet() == '\r') || (body[counter].get_octet() == '\n'))) { // Skip additional \n
......
......@@ -83,10 +83,11 @@ void http_layer::send_data(OCTETSTRING& data, params& params) {
void http_layer::receive_data(OCTETSTRING& data, params& params)
{
loggers::get_instance().log_msg(">>> http_layer::receive_data: ", data);
loggers::get_instance().log_msg(">>> http_layer::receive_data: _stream_buffer= ", _stream_buffer);
// Decode HTTP message
LibItsHttp__TypesAndValues::HttpMessage http_message;
if (!_stream_buffer.is_bound()) {
if (!_stream_buffer.is_bound() || (_stream_buffer.lengthof() == 0)) {
if (data.lengthof() < 6) { // 'HTTP/' or 'GET /'
loggers::get_instance().warning("http_layer::receive_data: Inconsistant buffer length");
return;
......@@ -95,7 +96,8 @@ void http_layer::receive_data(OCTETSTRING& data, params& params)
loggers::get_instance().warning("http_layer::receive_data (0): Failed to decode data");
return;
}
} else {
} else { // First chunk is received
loggers::get_instance().warning("http_layer::receive_data: #######################################");
_stream_buffer += data;
if (_codec.decode(_stream_buffer, http_message, &params) == -1) {
loggers::get_instance().warning("http_layer::receive_data (1): Failed to decode data");
......@@ -103,7 +105,7 @@ void http_layer::receive_data(OCTETSTRING& data, params& params)
}
}
params::const_iterator it = params.find("missing_data");
if (it != params.cend()) {
if (it != params.cend()) { // Transport layer didn't reassemble chunks, keep current state and wait for the next chunk
// Store data and wait for the next stream
loggers::get_instance().warning("http_layer::receive_data: Missing data, save current stream");
_stream_buffer += data;
......
......@@ -14,16 +14,16 @@ 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_ROOT_API := "/sbx1y8q0x9/mep1" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application'
LibMec_Pics.PICS_ROOT_API := "/sbxdflb1km/mep1" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application'
# LibMec_Pixits
LibMec_Pixits.PX_RNIS_SUBSCRITIONS_URI := "/rni/v2/subscriptions"
LibMec_Pixits.PX_RNIS_QUERIES_URI := "/rni/v2/queries"
LibMec_Pixits.PX_MEC_SVC_MGMT_APPS_URI := "/mec_service_mgmt/v2/applications"
LibMec_Pixits.PX_ME_APP_SUPPORT_URI := "/mec_app_support/v2/applications"
LibMec_Pixits.PX_SVC_MGMT_TRANS_URI := "/mec_service_mgmt/v2/transports"
LibMec_Pixits.PX_ME_APP_SUPPORT_TIMING_CAPS_URI := "/mec_app_support/v2/timing/timing_caps"
LibMec_Pixits.PX_ME_APP_SUPPORT_TIMING_CURRENT_URI := "/mec_app_support/v2/timing/current_time"
LibMec_Pixits.PX_MEC_SVC_MGMT_APPS_URI := "/mec_service_mgmt/v1/applications"
LibMec_Pixits.PX_ME_APP_SUPPORT_URI := "/mec_app_support/v1/applications"
LibMec_Pixits.PX_SVC_MGMT_TRANS_URI := "/mec_service_mgmt/v1/transports"
LibMec_Pixits.PX_ME_APP_SUPPORT_TIMING_CAPS_URI := "/mec_app_support/v1/timing/timing_caps"
LibMec_Pixits.PX_ME_APP_SUPPORT_TIMING_CURRENT_URI := "/mec_app_support/v1/timing/current_time"
LibMec_Pics.PICS_MEC_PLAT := true
......@@ -134,7 +134,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server
# ETSI GS MEC 011
# Check that the IUT responds with a list of available MEC services for a given application instance when queried by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_OK
AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_BR
# Check that the IUT notifies the authorised relevant (subscribed) application instances when a new service for a given application instance is registered
......@@ -150,7 +150,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server
# Check that the IUT updates a service information for a given application instance when commanded by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_004_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_004_BR
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_004_BR
# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_004_NF
# Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition
......
......@@ -9,36 +9,36 @@
* All rights reserved.
* @see ETSI GS MEC 003, Draft ETSI GS MEC 010-2 V2.1.1
*/
module AtsMec_AppLCM_TestCases {
module AtsMec_AppLifecycleManagement_TestCases {
// Libcommon
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;
// Libcommon
import from LibCommon_Sync all;
import from AppLCM_Templates all;
import from AppLCM_Pics all;
import from AppLCM_Pixits all;
// LibMec
import from LibMec_Functions all;
import from LibMec_Pics all;
import from LibMec_Pixits 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_ApplicationPackageLifecycleAndOperationGrantingAPI
import from ApplicationPackageLifecycleAndOperationGrantingAPI_Templates all;
import from ApplicationPackageLifecycleAndOperationGrantingAPI_Pics all;
import from ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits all;
// LibMec
import from LibMec_Functions all;
import from LibMec_Pics all;
import from LibMec_Pixits all;
group App_lifecycle_management {
group App_lifecycle_management {
/**
* @desc: Check that MEC API provider creates a new App Package when requested
* ETSI GS MEC 010-2 2.0.10, clause 7.5.1.3.1
* ETSI GS MEC 010-2 2.0.10, Table 6.2.2.3.2-1 //CreateAppInstanceRequest
* ETSI GS MEC 010-2 2.0.10, Table 6.2.2.4.2-1 //AppInstanceInfo
*/
* @desc: Check that MEC API provider creates a new App Package when requested
* ETSI GS MEC 010-2 2.0.10, clause 7.5.1.3.1
* ETSI GS MEC 010-2 2.0.10, Table 6.2.2.3.2-1 //CreateAppInstanceRequest
* ETSI GS MEC 010-2 2.0.10, Table 6.2.2.4.2-1 //AppInstanceInfo
*/
testcase TC_MEC_MEC010p2_MEX_LCM_001_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var Headers v_headers;
......
/**
* @author ETSI / STF569
* @Author ETSI / STF569
* @version $URL:$
* $ID:$
* @desc This module provides the MEC test cases.
......@@ -9,29 +9,29 @@
* All rights reserved.
* @see ETSI GS MEC 003, Draft ETSI GS MEC 010-2 V2.1.1
*/
module AtsMec_Grant_TestCases {
module AtsMec_Granting_TestCases {
// Libcommon
import from LibCommon_Sync all;
// Libcommon
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 Grant_Templates all;
import from Grant_Pics all;
import from Grant_Pixits all;
// LibMec_ApplicationPackageLifecycleAndOperationGrantingAPI
import from ApplicationPackageLifecycleAndOperationGrantingAPI_Templates all;
import from ApplicationPackageLifecycleAndOperationGrantingAPI_Pics all;
import from ApplicationPackageLifecycleAndOperationGrantingAPI_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 grant {
group grant {
/**
* @desc: Check that MEO sends a synchronous grant response when a grant request is requested
......@@ -59,7 +59,7 @@ group grant {
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_MEO_GRANT_URI,
PICS_ROOT_API & PX_MEO_GRANT_URI,
v_headers,
m_http_message_body_json(
m_body_json_grant_request(
......@@ -124,7 +124,7 @@ group grant {
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_MEO_GRANT_URI,
PICS_ROOT_API & PX_MEO_GRANT_URI,
v_headers,
m_http_message_body_json(
m_body_json_grant_request_with_error(
......@@ -185,7 +185,7 @@ group grant {
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_MEO_GRANT_URI,
PICS_ROOT_API & PX_MEO_GRANT_URI,
v_headers,
m_http_message_body_json(
m_body_json_grant_request(
......@@ -246,7 +246,7 @@ group grant {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_MEO_GRANT_URI & oct2char(unichar2oct(PX_GRANTING_ID, "UTF-8")),
PICS_ROOT_API & PX_MEO_GRANT_URI & oct2char(unichar2oct(PX_GRANTING_ID, "UTF-8")),
v_headers
)));
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
......@@ -298,7 +298,7 @@ group grant {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_MEO_GRANT_URI & oct2char(unichar2oct(PX_NON_EXISTANT_GRANTING_ID, "UTF-8")),
PICS_ROOT_API & PX_MEO_GRANT_URI & oct2char(unichar2oct(PX_NON_EXISTANT_GRANTING_ID, "UTF-8")),
v_headers,
m_http_message_body_json(
m_body_json_grant_request(
......@@ -359,7 +359,7 @@ group grant {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_MEO_GRANT_URI & oct2char(unichar2oct(PX_GRANTING_ID, "UTF-8")),
PICS_ROOT_API & PX_MEO_GRANT_URI & oct2char(unichar2oct(PX_GRANTING_ID, "UTF-8")),
v_headers
)));
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
......
suite := AtsMEC
sources := \
AtsMec_Ams_TestCases.ttcn \
AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn \
AtsMec_AppLCM_TestCases.ttcn \
AtsMec_TrafficManagementAPI_TestCases.ttcn \
AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn \
AtsMec_Grant_TestCases.ttcn \
AtsMec_LocationAPI_TestCases.ttcn \
AtsMec_RnisAPI_TestCases.ttcn \
AtsMec_TestControl.ttcn \
......@@ -15,6 +12,9 @@ sources := \
AtsMec_V2XInformationServiceAPI_TestCases.ttcn \
AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn \
AtsMec_WlanInformationAPI_TestCases.ttcn \
# AtsMec_AppLifecycleManagement_TestCases.ttcn \
# AtsMec_Granting_TestCases.ttcn \
# AtsMec_Ams_TestCases.ttcn \
# AtsMec_MeoPkgm_TestCases.ttcn \
# AtsMec_MepmPkgm_TestCases.ttcn \
# AtsMec_FixedAccessInfoAPI_TestCases.ttcn \
......@@ -25,20 +25,17 @@ modules := ../LibCommon \
../LibIts \
../LibIts/ttcn/Http \
../LibMec \
../LibMec/Ams \
../LibMec/EdgePlatformApplicationEnablementAPI \
../LibMec/AppLCM \
../LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI \
../LibMec/TrafficManagementAPI \
../LibMec/Grant \
../LibMec/LocationAPI \
../LibMec/MeoPkgm \
../LibMec/MepmPkgm \
../LibMec/RnisAPI \
../LibMec/UEAppInterfaceAPI \
../LibMec/UEidentityAPI \
../LibMec/V2XInformationServiceAPI \
../LibMec/DeviceApplicationInterfaceAPI \
../LibMec/WlanInformationAPI \
../LibMec/ApplicationMobilityServiceAPI \
../../ccsrc/Ports/LibHttp \
../../ccsrc/EncDec/LibHttp \
../../ccsrc/EncDec/LibMec \
......
sources := \
ttcn/AppLCM_Pics.ttcn \
ttcn/AppLCM_Pixits.ttcn \
ttcn/AppLCM_Templates.ttcn \
ttcn/AppLCM_TypesAndValues.ttcn
module AppLCM_Pics {
/**
* @desc Does the IUT support LocationAPI?
*/
modulepar boolean PICS_LCM_API_SUPPORTED := true;
} // End of module LocationAPI_Pics
module AppLCM_Pixits {
// JSON
import from JSON all;
import from AppLCM_TypesAndValues all;
modulepar JSON.String PX_APP_D_ID := "5lkj4782-2c70-4e47-9a4e-0ee3a1a0fd1f"
modulepar InstantiationState PX_INSTANTIATION_STATE := NOT_INSTANTIATED
modulepar JSON.String PX_APP_INSTANCE_ID := "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f"
modulepar JSON.String PX_NON_EXISTENT_APP_INSTANCE_ID := "PX_NON_EXISTENT_APP_INSTANCE_ID"
modulepar TerminationType PX_APP_TERMINATION_TYPE := GRACEFUL
modulepar TerminationTypeWithError PX_APP_TERMINATION_TYPE_WITH_ERROR := GRACE
modulepar OperationType PX_CHANGE_STATE_TO := STARTED
modulepar OperationTypeWithError PX_CHANGE_STATE_TO_WITH_ERROR := START
modulepar JSON.String PX_APP_LCM_OP_OCC_ID := "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f"
modulepar JSON.String PX_NON_EXISTENT_APP_LCM_OP_OCC_ID := "PX_NON_EXISTENT_APP_LCM_OP_OCC_ID"
modulepar JSON.AnyURI PX_CALLBACK_URI := "http://127.0.0.1/callback"
modulepar SubscriptionType PX_SUBSCRIPTION_TYPE := AppInstanceStateChangeSubscription
modulepar JSON.String PX_SUBSCRIPTION_ID := "e0deee2b-6e50-4f33-ab09-8bf0585025d3"
modulepar JSON.String PX_NON_ESISTENT_SUBSCRIPTION_ID := "PX_NON_ESISTENT_SUBSCRIPTION_ID"
modulepar JSON.String PX_NOTIFICATION_ID := "208c95ec-121f-4bc2-b896-be3fe000d3ea"
modulepar NotificationType PX_NOTIFICATION_TYPE := AppInstNotification
} // End of module
\ No newline at end of file
module AppLCM_Templates {
// JSON
import from JSON all;
// LibCommon
import from LibCommon_BasicTypesAndValues all;
import from AppLCM_TypesAndValues all;
import from AppLCM_Pixits all;
template (present) CreateAppInstanceRequest m_lifecycle_management_create (
in template (present) String p_appDId := ?
) := {
appDId := p_appDId
}
template (present) CreateAppInstanceRequestWithError m_lifecycle_management_create_with_error (
in template (present) String p_appDIdWithError := ?
) := {
appDIdWithError := p_appDIdWithError
}
template (present) AppInstanceInfo mw_lcm_instance_info (
in template (present) String p_app_instance_id := ?,
in template (present) String p_app_d_id := ?,
in template (present) InstantiationState p_instantiation_state := ?
) := {
appInstanceId := p_app_instance_id,
appDId := p_app_d_id,
instantiationState := p_instantiation_state
}
template (present) InstantiateAppRequest m_lifecycle_management_instantiate (
in template (present) String p_app_instance_id
) := {
appInstanceId := p_app_instance_id
}
template (present) InstantiateAppRequestWithError m_lifecycle_management_instantiate_with_error (
in template (present) String p_app_instance_id
) := {
appId := p_app_instance_id
}
template (present) TerminateAppRequest m_lifecycle_management_terminate (
in template (present) TerminationType p_termination_type
) := {
terminationType := p_termination_type
}
template (present) TerminateAppRequestWithError m_lifecycle_management_terminate_with_error (
in template (present) TerminationTypeWithError p_termination_type_with_error
) := {
terminationTypeWithError := p_termination_type_with_error
}
template (present) OperateAppRequest m_lifecycle_management_operate (
in template (present) OperationType p_change_state_to_type
) := {
changeStateTo := p_change_state_to_type
}
template (present) OperateAppRequestWithError m_lifecycle_management_operate_with_error (
in template (present) OperationTypeWithError p_change_state_to_type_with_error
) := {
changeStateToWithError := p_change_state_to_type_with_error
}
template (present) AppInstanceLcmOpOcc mw_lifecycle_management_op_occ (
in template (present) JSON.String p_app_lcm_op_occ_id := ?
) := {
appLcmOpOccId := p_app_lcm_op_occ_id
}
template (present) SubscriptionRequest m_app_lcm_subscribe_request (
in template (present) SubscriptionType p_subscription_type,
in template (present) AnyURI p_callback_uri
) := {
subscriptionType := p_subscription_type,
callbackUri := p_callback_uri
}
template (present) SubscriptionRequestWithError m_app_lcm_subscribe_request_with_error (
in template (present) SubscriptionType p_subscription_type,
in template (present) AnyURI p_callback_uri_with_error
) := {
subscriptionType := p_subscription_type,
callbackUriWithError := p_callback_uri_with_error
}
template (present) SubscriptionInfo mw_app_lcm_subscription_info (
in template (present) String p_subscription_id := ?,
in template (present) SubscriptionType p_subscription_type := ?,
in template (present) AnyURI p_callback_uri := ?
) := {
subscriptionId := p_subscription_id,
subscriptionType := p_subscription_type,
callbackUri := p_callback_uri
}
template (present) Notification mw_app_lcm_notification (
in template (present) String p_notification_id := ?,
in template (present) NotificationType p_notification_type := ?,
in template (present) String p_subscription_id := ?
) := {
notificationId := p_notification_id,
notificationType := p_notification_type
}
}
\ No newline at end of file
module AppLCM_TypesAndValues {
// JSON
import from JSON all;
// LibCommon
import from LibCommon_BasicTypesAndValues all;
type enumerated InstantiationState {
NOT_INSTANTIATED,
INSTANTIATED
}
type enumerated TerminationType {
FORCEFUL,
GRACEFUL
}
type enumerated TerminationTypeWithError {
FORCE,
GRACE
}
type enumerated OperationType {
STARTED,
STOPPED
}
type enumerated OperationTypeWithError {
START,
STOP
}
type enumerated SubscriptionType {
AppInstanceStateChangeSubscription,
AppLcmOpOccStateChangeSubscription
}
type enumerated NotificationType {
AppInstNotification,
AppLcmOpOccNotification
}
type record CreateAppInstanceRequest {
String appDId
}
type record CreateAppInstanceRequestWithError {
String appDIdWithError
}
type record of AppInstanceInfo AppInstanceInfoList;
type record AppInstanceInfo {
String appInstanceId,
String appDId,
InstantiationState instantiationState
}
type record of SelectedMECHostInfo SelectedMECHostInfoList
type record SelectedMECHostInfo {
}
type record InstantiateAppRequest {
String appInstanceId,
SelectedMECHostInfoList selectedMECHostInfo
}
type record InstantiateAppRequestWithError {
String appId,
SelectedMECHostInfoList selectedMECHostInfo
}
type record TerminateAppRequest {
TerminationType terminationType
}
type record TerminateAppRequestWithError {
TerminationTypeWithError terminationTypeWithError
}
type record OperateAppRequest {
OperationType changeStateTo
}
type record OperateAppRequestWithError {
OperationTypeWithError changeStateToWithError
}
type record of AppInstanceLcmOpOcc AppInstanceLcmOpOccList;
type record AppInstanceLcmOpOcc {
String appLcmOpOccId
}
type record SubscriptionRequest {
SubscriptionType subscriptionType,
AnyURI callbackUri
}
type record SubscriptionRequestWithError {
SubscriptionType subscriptionType,
AnyURI callbackUriWithError
}
type record of SubscriptionInfo SubscriptionInfoList;
type record SubscriptionInfo {
String subscriptionId,
SubscriptionType subscriptionType,
AnyURI callbackUri
}
type record Notification {
String notificationId,
NotificationType notificationType,
String subscriptionId
}