Commit 2a7dc956 authored by Yann Garcia's avatar Yann Garcia
Browse files

Start validation of MEC profile for CAPIF

parent 24537cef
Loading
Loading
Loading
Loading
+12
Changes for ccsrc/Protocols/Json/json_codec_mec011.cc: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -52,6 +52,10 @@ int json_codec_mec011::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule& traffic_rule = msg.trafficRule();
    traffic_rule.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_service__api__description)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription& service_api_description = msg.service__api__description();
    service_api_description.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else {
    return json_codec::encode(msg, data);
  }
@@ -185,6 +189,14 @@ int json_codec_mec011::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo
    EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo appInfo;
    appInfo.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.appInfo__regapps() = appInfo;
  } else if (it->second.find("\"serviceAPIDescriptions\"") != std::string::npos) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::DiscoveredAPIs discovered_apis;
    discovered_apis.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::DiscoveredAPIs_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.discovered__apis() = discovered_apis;
  } else if (it->second.find("\"apiName\"") != std::string::npos) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription service_api_description;
    service_api_description.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.service__api__description() = service_api_description;
  } else {
    return json_codec::decode(p_data, msg, p_params);
  }
+19
Changes for ccsrc/Protocols/Json/json_codec_mec021.cc: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -20,6 +20,10 @@ int json_codec_mec021::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms
    const ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfo& registration_info = msg.registrationInfo();
    registration_info.encode(ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mobilityProcedureSubscription)) {
    const ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureSubscription& mobility_procedure_subscription = msg.mobilityProcedureSubscription();
    mobility_procedure_subscription.encode(ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else {
    return json_codec::encode(msg, data);
  }
@@ -73,6 +77,21 @@ int json_codec_mec021::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo
      registration_info.decode(ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
      msg.registrationInfo() = registration_info;
    }
  } else if ((it->second.find("\"subscription\"") != std::string::npos) && (it->second.find("\"_links\"") != std::string::npos)) { // SubscriptionLinkList
    ApplicationMobilityServiceAPI__TypesAndValues::SubscriptionLinkList subscription_link_list;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    subscription_link_list.decode(ApplicationMobilityServiceAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.subscriptionLinkList__ams() = subscription_link_list;
  } else if (it->second.find("\"MobilityProcedureSubscription\"") != std::string::npos) {
    ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureSubscription mobility_procedure_subscription;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    mobility_procedure_subscription.decode(ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.mobilityProcedureSubscription() = mobility_procedure_subscription;
  } else if (it->second.find("\"MobilityProcedureNotification\"") != std::string::npos) {
    ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureNotification mobility_procedure_notification;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    mobility_procedure_notification.decode(ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.mobilityProcedureNotification() = mobility_procedure_notification;
  } else {
    return json_codec::decode(p_data, msg, p_params);
  }
+9 −7
Changes for etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_: 9 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ LibCommon_Time.PX_TAC := 30.0
LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0;
LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0;

LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.21"
LibHttp_Pics.PICS_HEADER_HOST := "yanngarcia.ddns.net"

LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json"
LibHttp_Pics.PICS_USE_TOKEN_HEADER    := true
@@ -19,11 +19,13 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in o
LibMec_Pics.PICS_MEC_PLAT := true

# LibMec/ApplicationMobilityServiceAPI
# Application Instance ID
ApplicationMobilityServiceAPI_Pixits.PX_APP_INS_ID   := "b96f8a13-4253-4a8c-9485-33e5391f950d"
ApplicationMobilityServiceAPI_Pixits.PX_APP_INS_ID_2 := "83a79787-2ceb-4b9b-ab0d-174463cb1896"

# Application Instance ID. Get them from the MEC Sandbox GUI.
ApplicationMobilityServiceAPI_Pixits.PX_APP_INS_ID         := "6534adc3-9732-4c4a-8d6f-18b105a3890c"
ApplicationMobilityServiceAPI_Pixits.PX_APP_INS_ID_2       := "d3ba5131-deb9-43e1-99ab-02c16d7e8c0b"
ApplicationMobilityServiceAPI_Pixits.PX_MEP_ID             := "MEP1"
# Callbacks
ApplicationMobilityServiceAPI_Pixits.PX_CALLBACK_REFERENCE := "https://yanngarcia.ddns.net:36001/ams/v1"
ApplicationMobilityServiceAPI_Pixits.PX_CALLBACK_URI       := "http://yanngarcia.ddns.net:36001/ams/v1"

[LOGGING]
# In this section you can specify the name of the log file and the classes of events
@@ -70,7 +72,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec021)/TCP(debug=1
#AtsMec_ApplicationMobiltyServiceAPI_TestControl.control

# Check that the AMS service returns information about the registered application mobility services when requested
AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_01
#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_01
# Check that the AMS service returns information about the a specific registered application mobility service when requested - filter
#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_02
# Check that the AMS service returns information about the a specific registered application mobility service when requested - filter
@@ -88,7 +90,7 @@ AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_01
# Check that the AMS service returns information about the available subscriptions when requested
#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_003_OK
# Check that the AMS service sends an error when it receives a malformed query about the available subscriptions
#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_003_BR
AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_003_BR
# Check that the AMS service creates a notification subscriptions when requested
#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_004_OK
# Check that the AMS service sends an error when it receives a malformed request to create a notification subscription
−115

File deleted.

+32 −2
Changes for etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_: 32 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -19,7 +19,10 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign i
LibMec_Pics.PICS_MEC_PLAT := true

# Application Instance ID
EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "f1e4d448-e277-496b-bf63-98391cfd20fb" # Copied from ETSI MEC Sandbox GUI
EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "52bd535e-7a3e-4fef-8678-b2c832c9be95" # Copied from ETSI MEC Sandbox GUI
# MEC APIs
EdgePlatformApplicationEnablementAPI_Pixits.PX_API_NAME        := "mec015-1"                              # Pickup from MEC Sandbox logs console 
EdgePlatformApplicationEnablementAPI_Pixits.PX_API_ID          := "a6612a80-85f2-41e0-8565-4bf477483fb7"

# Callbacks

@@ -72,7 +75,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec011)/TCP(debug=1
# 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 responds with an error when a request with an unknown service is sent by a MEC Application
AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_NF
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_NF
# Check that the IUT notifies the authorised relevant (subscribed) application instances when a new service for a given application instance is registered
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_002_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
@@ -193,6 +196,33 @@ AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_0
# Check that the IUT responds with current time when queried by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TIME_002_OK

# Check that the IUT responds with all service APIs when queried by a MEC Application - No filter
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_01
# Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiName
AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02
# Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiId
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_03
# Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiId and apiName
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_05
# Check that the IUT responds with an error when applying a malformed filter
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_BR
# Check that the IUT responds with an error when applying a filter on an unknown apiName
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_NF
# Check that the IUT responds with all service APIs for a specific apfId when queried by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_OK
# Check that the IUT responds with an error when applying a filter on an unknown apfId
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_NF
# Check that the IUT responds with all service APIs for a specific apfId when queried by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_OK
# Check that the IUT responds with an error when incorrect parameters were sent by a MEC Application - supportedFeatures shall be present
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_BR
# Check that the IUT responds with a serviceAPIDescription when queried by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_OK
# Check that the IUT responds with an error when applying a filter on an unknown apfId
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_01
# Check that the IUT responds with an error when applying a filter on an unknown serviceApiId
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts.
Loading