diff --git a/ccsrc/Protocols/Json/json_codec.cc b/ccsrc/Protocols/Json/json_codec.cc index a86f2219dff3235576a03ce5655896dc4ecae307..cb6d90c92b5f6500d9e05b0cfbc44102201a3302 100644 --- a/ccsrc/Protocols/Json/json_codec.cc +++ b/ccsrc/Protocols/Json/json_codec.cc @@ -8,35 +8,34 @@ #include "LibHttp_JsonMessageBodyTypes.hh" -int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTETSTRING& data) +int json_codec::encode(const LibHttp__JsonMessageBodyTypes::JsonBody &msg, OCTETSTRING &data) { - loggers::get_instance().log_msg(">>> json_codec::encode: ", (const Base_Type&)msg); + loggers::get_instance().log_msg(">>> json_codec::encode: ", (const Base_Type &)msg); TTCN_EncDec::clear_error(); TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); TTCN_Buffer encoding_buffer; - if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_ueIdentityTagInfo)) { - const UEidentityAPI__TypesAndValues::UeIdentityTagInfo& ue_identity_tag_info = msg.ueIdentityTagInfo(); + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_ueIdentityTagInfo)) + { + const UEidentityAPI__TypesAndValues::UeIdentityTagInfo &ue_identity_tag_info = msg.ueIdentityTagInfo(); ue_identity_tag_info.encode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); - } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appContext)) { - const UEAppInterfaceAPI__TypesAndValues::AppContext& app_context = msg.appContext(); + } + else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_cellChangeSubscription)) + { + const RnisAPI__TypesAndValues::CellChangeSubscription &cell_change_subscription = msg.cellChangeSubscription(); + cell_change_subscription.encode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = /*char2oct(CHARSTRING("{\"CellChangeSubscription\": ")) + */ OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) /* + char2oct(CHARSTRING("}"))*/; + } + else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appContext)) + { + const UEAppInterfaceAPI__TypesAndValues::AppContext &app_context = msg.appContext(); app_context.encode(UEAppInterfaceAPI__TypesAndValues::AppContext_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"AppContext\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); - } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwInfo)) { - const TrafficManagementAPI__TypesAndValues::BwInfo& bw_info = msg.bwInfo(); - bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_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_bwChgEventSubscription)) { - const TrafficManagementAPI__TypesAndValues::BwChgEventSubscription& bw_chg_event_subscription = msg.bwChgEventSubscription(); - bw_chg_event_subscription.encode(TrafficManagementAPI__TypesAndValues::BwChgEventSubscription_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_mtsSessionInfo)) { - const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo(); - mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; - } else { + } + else + { loggers::get_instance().error("json_codec::encode: Not supported"); } @@ -44,18 +43,22 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE return 0; } -int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) +int json_codec::decode(const OCTETSTRING &p_data, LibHttp__JsonMessageBodyTypes::JsonBody &msg, params *p_params) { loggers::get_instance().log_msg(">>> json_codec::decode: p_data=", p_data); // Sanity checks params::const_iterator it; - if (p_params == nullptr) { + if (p_params == nullptr) + { loggers::get_instance().warning("json_codec::decode: Failed to access p_params (null pointer)"); return -1; // TODO Use p_data instead of return -1 - } else { + } + else + { it = p_params->find("decode_str"); - if (it == p_params->cend()) { + if (it == p_params->cend()) + { loggers::get_instance().warning("json_codec::decode: Failed to access p_params item (decode_str)"); return -1; // TODO Use p_data instead of return -1 } @@ -64,91 +67,109 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes // Remove data structure name (if present) ... std::string str; - if ((it->second[0] != '[') && (it->second[0] != '{')) { + if ((it->second[0] != '[') && (it->second[0] != '{')) + { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); - } else { + } + else + { str = it->second; } // ..and create the decoding buffer TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); TTCN_EncDec::clear_error(); loggers::get_instance().log("json_codec::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); - TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); - if (it->second.find("\"ueIdentityTagInfo\"") != std::string::npos) { + if (it->second.find("\"ueIdentityTagInfo\"") != std::string::npos) + { UEidentityAPI__TypesAndValues::UeIdentityTagInfo ue_identity_tag_info; ue_identity_tag_info.decode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.ueIdentityTagInfo() = ue_identity_tag_info; - } else if (it->second.find("\"associateDevAppId\"") != std::string::npos) { + } + else if (it->second.find("\"CellChangeSubscription\"") != std::string::npos) + { + RnisAPI__TypesAndValues::CellChangeSubscription cell_change_subscription; + cell_change_subscription.decode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.cellChangeSubscription() = cell_change_subscription; + // TODO Continue with other ChangeSubscription + } + else if (it->second.find("\"cellInfo\"") != std::string::npos) + { + RnisAPI__TypesAndValues::L2Meas l2_meas; + l2_meas.decode(RnisAPI__TypesAndValues::L2Meas_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.l2Meas() = l2_meas; + } + else if ((it->second.find("\"appInstanceId\"") != std::string::npos) && (it->second.find("\"requestId\"") != std::string::npos)) + { + RnisAPI__TypesAndValues::RabInfo rab_info; + rab_info.decode(RnisAPI__TypesAndValues::RabInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.rabInfo() = rab_info; + } + else if (it->second.find("\"S1BearerInfo\"") != std::string::npos) + { + RnisAPI__TypesAndValues::S1BearerInfo s1_nearer_info; + s1_nearer_info.decode(RnisAPI__TypesAndValues::S1BearerInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.s1BearerInfo() = s1_nearer_info; + } + else if ((it->second.find("\"appInstanceId\"") != std::string::npos) && (it->second.find("\"plmn\"") != std::string::npos)) + { + RnisAPI__TypesAndValues::PlmnInfos plmn_infos; + plmn_infos.decode(RnisAPI__TypesAndValues::PlmnInfos_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.plmnInfos() = plmn_infos; + } + else if (it->second.find("\"RabEstSubscription\"") != std::string::npos) + { + RnisAPI__TypesAndValues::RabEstSubscription rab_est_subscription; + rab_est_subscription.decode(RnisAPI__TypesAndValues::RabEstSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.rabEstSubscription() = rab_est_subscription; + } + else if (it->second.find("\"RabModSubscription\"") != std::string::npos) + { + RnisAPI__TypesAndValues::RabModSubscription rab_mod_subscription; + rab_mod_subscription.decode(RnisAPI__TypesAndValues::RabModSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.rabModSubscription() = rab_mod_subscription; + } + else if (it->second.find("\"RabRelSubscription\"") != std::string::npos) + { + RnisAPI__TypesAndValues::RabRelSubscription rab_rel_subscription; + rab_rel_subscription.decode(RnisAPI__TypesAndValues::RabRelSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.rabRelSubscription() = rab_rel_subscription; + } + else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) + { // SubscriptionLinkList + // FIXME Conflict with MEC-028 SubscriptionLinkList data type + RnisAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; + subscription_link_list.decode(RnisAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.subscriptionLinkList() = subscription_link_list; + } + else if (it->second.find("\"associateDevAppId\"") != std::string::npos) + { UEAppInterfaceAPI__TypesAndValues::AppContext appContext; appContext.decode(UEAppInterfaceAPI__TypesAndValues::AppContext_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appContext() = appContext; - } else if (it->second.find("\"appInfo\"") != std::string::npos) { + } + else if (it->second.find("\"appInfo\"") != std::string::npos) + { UEAppInterfaceAPI__TypesAndValues::AppInfo appInfo; appInfo.decode(UEAppInterfaceAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appInfo() = appInfo; - } else if ((it->second.find("\"bwInfo\"") != std::string::npos) || (it->second.find("\"fixedBWPriority\"") != std::string::npos)) { - // Need to change some enumerated string not supported by TTCN-3 language - while (true) { - if (str.find("\"00\"") != std::string::npos) { - str = regex_replace(str, regex("\"00\""), "\"Downlink\""); - } else if (str.find("\"01\"") != std::string::npos) { - str = regex_replace(str, regex("\"01\""), "\"Uplink\""); - } else if (str.find("\"10\"") != std::string::npos) { - str = regex_replace(str, regex("\"10\""), "\"Symmetrical\""); - } else { - loggers::get_instance().log("json_codec::decode: BwInfo in break"); - break; - } - } // End of 'while' loop - loggers::get_instance().log("json_codec::decode: BwInfo after converting enum: %s", str.c_str()); - if (it->second[0] == '[') { // BwInfoList - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - TrafficManagementAPI__TypesAndValues::BwInfoList bw_info_list; - bw_info_list.decode(TrafficManagementAPI__TypesAndValues::BwInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.bwInfoList() = bw_info_list; - } else { // BwInfo - TrafficManagementAPI__TypesAndValues::BwInfo bw_info; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - bw_info.decode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.bwInfo() = bw_info; - } - } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) { // SubscriptionLinkList - TrafficManagementAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; - subscription_link_list.decode(TrafficManagementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.subscriptionLinkList__bw() = subscription_link_list; - } else if (it->second.find("\"BwChgEventSubscription\"") != std::string::npos) { - TrafficManagementAPI__TypesAndValues::BwChgEventSubscription bw_chg_event_subscription; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - bw_chg_event_subscription.decode(TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.bwChgEventSubscription() = bw_chg_event_subscription; - } else if ((it->second.find("\"mtsCapabilityInfo\"") != std::string::npos) || (it->second.find("\"mtsAccessInfo\"") != std::string::npos)) { - TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo mts_cap_info; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - mts_cap_info.decode(TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.mtsCapabilityInfo() = mts_cap_info; - } else if ((it->second.find("\"mtsSessionInfo\"") != std::string::npos) || (it->second.find("\"mtsMode\"") != std::string::npos)) { - TrafficManagementAPI__TypesAndValues::MtsSessionInfo mts_session_info; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - mts_session_info.decode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.mtsSessionInfo() = mts_session_info; - } else if ((it->second[0] == '[') && (it->second.find("\"iotPlatformId\"") != std::string::npos)) { - IoTAPI__TypesAndValues::IotPlatformInfoList iot_platform_info_list; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - iot_platform_info_list.decode(IoTAPI__TypesAndValues::IotPlatformInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.iotPlatformInfoList() = iot_platform_info_list; - } else if (it->second.find("\"detail\"") != std::string::npos) { + } + else if (it->second.find("\"detail\"") != std::string::npos) + { LibMec__TypesAndValues::ProblemDetails problem_details; problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.problemDetails() = problem_details; - } else { + } + else + { loggers::get_instance().warning("json_codec::decode: Unsupported variant"); return -1; } - loggers::get_instance().log_msg("<<< json_codec::decode: ", (const Base_Type&)msg); + loggers::get_instance().log_msg("<<< json_codec::decode: ", (const Base_Type &)msg); return 0; } diff --git a/ccsrc/Protocols/Json/json_codec_factory_mec015.hh b/ccsrc/Protocols/Json/json_codec_factory_mec015.hh new file mode 100644 index 0000000000000000000000000000000000000000..d02ab430fb1e276d55409bd6f3d17121b491d681 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_factory_mec015.hh @@ -0,0 +1,46 @@ +/*! + * \file json_codec_factory_mec015.hh + * \brief Header file for ITS JSON/IP protocol codec factory. + * \author ETSI STF569 / TTF T027 + * \copyright ETSI Copyright Notification + * 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. + * \version 0.1 + */ +#pragma once + +#include "codec_stack_builder.hh" + +#include "json_codec_mec015.hh" + +class Record_Type; //! TITAN forward declaration + +/*! + * \class json_codec_factory_mec015 + * \brief This class provides a factory class to create a json_codec class instance + */ +class json_codec_factory_mec015: public codec_factory { + static json_codec_factory_mec015 _f; //! Reference to the unique instance of this class +public: //! \publicsection + /*! + * \brief Default constructor + * Create a new instance of the json_codec_factory_mec015 class + * \remark The MEC015 codec identifier is json_codec_mec015 + */ + json_codec_factory_mec015() { + // register factory + codec_stack_builder::register_codec_factory("json_codec_mec015", this); + }; + /*! + * \fn codec* create_codec(const std::string & type, const std::string & param); + * \brief Create the codecs stack based on the provided codecs stack description + * \param[in] p_type The provided codecs stack description + * \param[in] p_params Optional parameters + * \return 0 on success, -1 otherwise + * \inline + */ + inline virtual codec_gen* create_codec() { + return (codec_gen*)new json_codec_mec015(); + }; +}; // End of class json_codec_factory_mec015 diff --git a/ccsrc/Protocols/Json/json_codec_factory_mec016.hh b/ccsrc/Protocols/Json/json_codec_factory_mec016.hh new file mode 100644 index 0000000000000000000000000000000000000000..a6dd5b98cad567694fe6ecc5b9ca44e2117029b8 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_factory_mec016.hh @@ -0,0 +1,46 @@ +/*! + * \file json_codec_factory_mec013.hh + * \brief Header file for ITS JSON/IP protocol codec factory. + * \author ETSI STF569 / TTF T027 + * \copyright ETSI Copyright Notification + * 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. + * \version 0.1 + */ +#pragma once + +#include "codec_stack_builder.hh" + +#include "json_codec_mec016.hh" + +class Record_Type; //! TITAN forward declaration + +/*! + * \class json_codec_factory_mec013 + * \brief This class provides a factory class to create an json_codec class instance + */ +class json_codec_factory_mec016: public codec_factory { + static json_codec_factory_mec016 _f; //! Reference to the unique instance of this class +public: //! \publicsection + /*! + * \brief Default constructor + * Create a new instance of the json_codec_factory_mec013 class + * \remark The HELD/IP codec identifier is HELD + */ + json_codec_factory_mec016() { + // register factory + codec_stack_builder::register_codec_factory("json_codec_mec016", this); + }; + /*! + * \fn codec* create_codec(const std::string & type, const std::string & param); + * \brief Create the codecs stack based on the provided codecs stack description + * \param[in] p_type The provided codecs stack description + * \param[in] p_params Optional parameters + * \return 0 on success, -1 otherwise + * \inline + */ + inline virtual codec_gen* create_codec() { + return (codec_gen*)new json_codec_mec016(); + }; +}; // End of class json_codec_factory_mec013 diff --git a/ccsrc/Protocols/Json/json_codec_mec015.cc b/ccsrc/Protocols/Json/json_codec_mec015.cc new file mode 100644 index 0000000000000000000000000000000000000000..cd3c997df5048f98c3df79d475a43335a939b553 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec015.cc @@ -0,0 +1,223 @@ +#include +#include +#include + +#include "json_codec_factory_mec015.hh" +#include "loggers.hh" +#include "LibHttp_JsonMessageBodyTypes.hh" + +int json_codec_mec015::encode(const LibHttp__JsonMessageBodyTypes::JsonBody &msg, OCTETSTRING &data) +{ + loggers::get_instance().log_msg(">>> json_codec::encode: ", (const Base_Type &)msg); + + TTCN_EncDec::clear_error(); + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_Buffer encoding_buffer; + + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwInfo)) + { + const TrafficManagementAPI__TypesAndValues::BwInfo &bw_info = msg.bwInfo(); + bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + // Convert raw buffer to string + std::string json_str((const char *)encoding_buffer.get_data(), encoding_buffer.get_len()); + + // Apply single substitution + if (json_str.find("\"Downlink\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Downlink\""), "\"00\""); + else if (json_str.find("\"Uplink\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Uplink\""), "\"01\""); + else if (json_str.find("\"Symmetrical\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Symmetrical\""), "\"10\""); + + // Set output + data = OCTETSTRING(json_str.length(), (const unsigned char *)json_str.c_str()); + } + else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwInfoDeltas)) + { + const TrafficManagementAPI__TypesAndValues::BwInfoDeltas &bw_info_deltas = msg.bwInfoDeltas(); + bw_info_deltas.encode(TrafficManagementAPI__TypesAndValues::BwInfoDeltas_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); + } + else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwchgeventsubscription)) + { + const TrafficManagementAPI__TypesAndValues::BwChgEventSubscription &bw_chg_event_subscription = msg.bwchgeventsubscription(); + bw_chg_event_subscription.encode(TrafficManagementAPI__TypesAndValues::BwChgEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); + } + else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mtsSessionInfo)) + { + const TrafficManagementAPI__TypesAndValues::MtsSessionInfo &mts_session_info = msg.mtsSessionInfo(); + mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + // Convert raw buffer to string + std::string json_str((const char *)encoding_buffer.get_data(), encoding_buffer.get_len()); + + // Apply single substitution + if (json_str.find("\"Downlink\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Downlink\""), "\"00\""); + else if (json_str.find("\"Uplink\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Uplink\""), "\"01\""); + else if (json_str.find("\"Symmetrical\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Symmetrical\""), "\"10\""); + + // Set output + data = OCTETSTRING(json_str.length(), (const unsigned char *)json_str.c_str()); + } + else + { + return json_codec::encode(msg, data); + } + + loggers::get_instance().log("<<< json_codec_mec015::encode"); + return 0; +} + +int json_codec_mec015::decode(const OCTETSTRING &p_data, LibHttp__JsonMessageBodyTypes::JsonBody &msg, params *p_params) +{ + loggers::get_instance().log_msg(">>> json_codec::decode: p_data=", p_data); + + params::const_iterator it; + if (p_params == nullptr) + { + loggers::get_instance().warning("json_codec::decode: Failed to access p_params (null pointer)"); + return -1; + } + else + { + it = p_params->find("decode_str"); + if (it == p_params->cend()) + { + loggers::get_instance().warning("json_codec::decode: Failed to access p_params item (decode_str)"); + return -1; + } + } + + std::string str; + if ((it->second[0] != '[') && (it->second[0] != '{')) + { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + } + else + { + str = it->second; + } + + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_EncDec::clear_error(); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + + if (it->second == "[]") + { + msg.bwInfoList().set_size(0); // Assign bound empty list + return 0; + } + + if ((it->second.find("\"bwInfo\"") != std::string::npos) || (it->second.find("\"fixedBWPriority\"") != std::string::npos) || (it->second.find("\"allocationId\"") != std::string::npos)) + { + while (true) + { + if (str.find("\"00\"") != std::string::npos) + str = regex_replace(str, regex("\"00\""), "\"Downlink\""); + else if (str.find("\"01\"") != std::string::npos) + str = regex_replace(str, regex("\"01\""), "\"Uplink\""); + else if (str.find("\"10\"") != std::string::npos) + str = regex_replace(str, regex("\"10\""), "\"Symmetrical\""); + else + break; + } + + if (it->second[0] == '[') + { + OCTETSTRING json_str_oct((int)str.length(), (const unsigned char *)str.c_str()); + loggers::get_instance().log_msg("Attempting to decode BwInfoList JSON string:", json_str_oct); + + TTCN_Buffer decoding_buffer_(json_str_oct); + TrafficManagementAPI__TypesAndValues::BwInfoList bw_info_list; + bw_info_list.decode(TrafficManagementAPI__TypesAndValues::BwInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + loggers::get_instance().warning("Decoded BwInfoList successfully."); + msg.bwInfoList() = bw_info_list; + } + else + { + TrafficManagementAPI__TypesAndValues::BwInfo bw_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + bw_info.decode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.bwInfo() = bw_info; + } + } + else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) + { + TrafficManagementAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; + subscription_link_list.decode(TrafficManagementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.subscriptionLinkList__bw() = subscription_link_list; + } + else if ((it->second.find("\"BwChgEventSubscription\"") != std::string::npos)) + { + TrafficManagementAPI__TypesAndValues::BwChgEventSubscription bw_chg_event_subscription; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + bw_chg_event_subscription.decode(TrafficManagementAPI__TypesAndValues::BwChgEventSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.bwchgeventsubscription() = bw_chg_event_subscription; + } + else if ((it->second.find("\"notificationType\"") != std::string::npos)) + { + TrafficManagementAPI__TypesAndValues::BwChgEventNotification bw_chg_event_notification; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + bw_chg_event_notification.decode(TrafficManagementAPI__TypesAndValues::BwChgEventNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.bwChgEventNotification() = bw_chg_event_notification; + } + else if ((it->second.find("\"mtsCapabilityInfo\"") != std::string::npos) || (it->second.find("\"mtsAccessInfo\"") != std::string::npos) || (it->second.find("\"allocationId\"") != std::string::npos)) + { + TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo mts_cap_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + mts_cap_info.decode(TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.mtsCapabilityInfo() = mts_cap_info; + } + else if ((it->second.find("\"mtsSessionInfo\"") != std::string::npos) || (it->second.find("\"sessionId\"") != std::string::npos)) + { + while (true) + { + if (str.find("\"00\"") != std::string::npos) + str = regex_replace(str, regex("\"00\""), "\"Downlink\""); + else if (str.find("\"01\"") != std::string::npos) + str = regex_replace(str, regex("\"01\""), "\"Uplink\""); + else if (str.find("\"10\"") != std::string::npos) + str = regex_replace(str, regex("\"10\""), "\"Symmetrical\""); + else + break; + } + if (it->second[0] == '[') + { + OCTETSTRING json_str_oct((int)str.length(), (const unsigned char *)str.c_str()); + loggers::get_instance().log_msg("Attempting to decode mtsSessionInfoList JSON string:", json_str_oct); + + TTCN_Buffer decoding_buffer_(json_str_oct); + TrafficManagementAPI__TypesAndValues::MtsSessionInfos mts_session_infos; + mts_session_infos.decode(TrafficManagementAPI__TypesAndValues::MtsSessionInfos_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + loggers::get_instance().warning("Decoded mtsSessionInfoList successfully"); + msg.mtsSessionInfos() = mts_session_infos; + } + else + { + TrafficManagementAPI__TypesAndValues::MtsSessionInfo mts_session_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + mts_session_info.decode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.mtsSessionInfo() = mts_session_info; + } + } + else if (it->second.find("\"detail\"") != std::string::npos) + { + LibMec__TypesAndValues::ProblemDetails problem_details; + problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.problemDetails() = problem_details; + } + else + { + return json_codec::decode(p_data, msg, p_params); + } + + loggers::get_instance().log_msg("<<< json_codec::decode: ", (const Base_Type &)msg); + return 0; +} + +json_codec_factory_mec015 json_codec_factory_mec015::_f; diff --git a/ccsrc/Protocols/Json/json_codec_mec015.hh b/ccsrc/Protocols/Json/json_codec_mec015.hh new file mode 100644 index 0000000000000000000000000000000000000000..a235de49dd1ffc9aaddf0a2bf916587f52c78ff5 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec015.hh @@ -0,0 +1,24 @@ +#pragma once + +#include "codec_gen.hh" +#include "params.hh" +#include "json_codec.hh" + +class Base_Type; +class TTCN_Typedescriptor_t; +class TTCN_Buffer; + +namespace LibHttp__JsonMessageBodyTypes { + class JsonBody; +} + +class json_codec_mec015: public json_codec +{ +public: + explicit json_codec_mec015() : json_codec() { }; + virtual ~json_codec_mec015() { }; + + int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data); + int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL); + +}; // End of class json_codec_mec015 diff --git a/ccsrc/Protocols/Json/json_codec_mec016.cc b/ccsrc/Protocols/Json/json_codec_mec016.cc new file mode 100644 index 0000000000000000000000000000000000000000..eccd133d2ecbf103d29ba0607e7708d8816830dc --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec016.cc @@ -0,0 +1,93 @@ +#include +#include +#include + +#include "json_codec_factory_mec016.hh" + +#include "loggers.hh" +#include "LibHttp_JsonMessageBodyTypes.hh" + +int json_codec_mec016::encode(const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTETSTRING& data) { + loggers::get_instance().log_msg(">>> json_codec_mec016::encode: ", (const Base_Type&)msg); + + TTCN_EncDec::clear_error(); + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_Buffer encoding_buffer; + + // Application Context + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appContext__device__info)) { + const DeviceApplicationInterfaceAPI__TypesAndValues::AppContext& ctx = msg.appContext__device__info(); + ctx.encode(DeviceApplicationInterfaceAPI__TypesAndValues::AppContext_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + //data = char2oct(CHARSTRING("{\"appContext\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_applicationLocationAvailability)) { + const DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationLocationAvailability& ctx = msg.applicationLocationAvailability(); + ctx.encode(DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationLocationAvailability_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); + } + // // Fallback to generic codec + else { + return json_codec::encode(msg, data); + } + + loggers::get_instance().log("<<< json_codec_mec016::encode"); + return 0; +} + +int json_codec_mec016::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) { + + loggers::get_instance().log_msg(">>> json_codec_mec016::decode: p_data=", p_data); + + // Sanity checks + params::const_iterator it; + if (p_params == nullptr) { + loggers::get_instance().warning("json_codec_mec016::decode: Failed to access p_params (null pointer)"); + return -1; // TODO Use p_data instead of return -1 + } else { + it = p_params->find("decode_str"); + if (it == p_params->cend()) { + loggers::get_instance().warning("json_codec_mec016::decode: Failed to access p_params item (decode_str)"); + return -1; // TODO Use p_data instead of return -1 + } + loggers::get_instance().log("json_codec_mec016::decode: it->second='%c' / '%s'", it->second.c_str()[0], it->second.c_str()); + } + + // Remove data structure name (if present) ... + std::string str; + if ((it->second[0] != '[') && (it->second[0] != '{')) { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; // Remove the last '}' + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + } else { + str = it->second; + } + + + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_EncDec::clear_error(); + loggers::get_instance().log("json_codec_mec016::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.size(), (const unsigned char*)str.c_str())); + + // Determine body type by finding JSON field name + if ((str.find("\"userAppInstanceInfo\"") != std::string::npos) && (str.find("\"appInfo\"") != std::string::npos)) { + DeviceApplicationInterfaceAPI__TypesAndValues::AppContext ctx; + ctx.decode(DeviceApplicationInterfaceAPI__TypesAndValues::AppContext_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.appContext__device__info() = ctx; + } else if ((str.find("\"appList\"") != std::string::npos) && (str.find("\"appInfo\"") != std::string::npos)) { + DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationList ctx; + ctx.decode(DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.applicationList() = ctx; + } else if ((it->second.find("\"appInfo\"") != std::string::npos) && (str.find("\"availableLocations\"") != std::string::npos)) { + DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationLocationAvailability application_location_availability; + application_location_availability.decode(DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationLocationAvailability_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.applicationLocationAvailability() = application_location_availability; + } else { + return json_codec::decode(p_data, msg, p_params); + } + + loggers::get_instance().log_msg("<<< json_codec_mec016::decode: ", (const Base_Type&)msg); + return 0; +} + +// Register codec factory +json_codec_factory_mec016 json_codec_factory_mec016::_f; diff --git a/ccsrc/Protocols/Json/json_codec_mec016.hh b/ccsrc/Protocols/Json/json_codec_mec016.hh new file mode 100644 index 0000000000000000000000000000000000000000..f8e194da2783431d7f33ed5300ca595434db3deb --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec016.hh @@ -0,0 +1,24 @@ +#pragma once + +#include "codec_gen.hh" +#include "params.hh" +#include "json_codec.hh" + +class Base_Type; +class TTCN_Typedescriptor_t; +class TTCN_Buffer; + +namespace LibHttp__JsonMessageBodyTypes { + class JsonBody; +} + +class json_codec_mec016: public json_codec +{ +public: + explicit json_codec_mec016() : json_codec() { }; + virtual ~json_codec_mec016() { }; + + int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data); + int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL); + +}; // End of class json_codec_mec013 diff --git a/ccsrc/Protocols/Json/module.mk b/ccsrc/Protocols/Json/module.mk index 60a7071447e6496a986d71ec5244dc4b33373d17..9f3c3ae895d1984caa6a312a738d4c7e135be4cf 100644 --- a/ccsrc/Protocols/Json/module.mk +++ b/ccsrc/Protocols/Json/module.mk @@ -3,13 +3,12 @@ sources := \ json_codec_mec011.cc \ json_codec_mec012.cc \ json_codec_mec013.cc \ + json_codec_mec015.cc \ + json_codec_mec016.cc \ json_codec_mec030.cc \ json_codec_mec021.cc \ json_codec_mec028.cc \ - json_codec_mec029.cc \ - json_codec_mec033.cc \ json_codec_mec040.cc \ - json_codec_mec046.cc \ includes := . diff --git a/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg b/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg new file mode 100644 index 0000000000000000000000000000000000000000..27b44cf2c4db3fc0ed5b4bf416814b4a1e4a023d --- /dev/null +++ b/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg @@ -0,0 +1,115 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 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.40.50" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +#LibMec_Pics.PICS_ROOT_API := "/sbxnfzm34p/mep1/" + +# LibMec_Pixits +DeviceApplicationInterfaceAPI_Pixits.PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b" +# DeviceApplicationInterfaceAPI_Pixits.PX_APPD_ID := "onboarded-demo4" +# DeviceApplicationInterfaceAPI_Pixits.PX_APP_DESCRIPTION := "Basic HTTP" +# DeviceApplicationInterfaceAPI_Pixits.PX_APP_PROVIDER := "demo" +# DeviceApplicationInterfaceAPI_Pixits.PX_ASSOCIATE_DEV_APPID := "bcee2135-2750-4d23-b786-a3062a371c8a" + + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_DeviceApplicationInterface/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec_mec016)/TCP(debug=1,server=192.168.40.50,port=80,use_ssl=0)" +#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" +#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server_mode=1,use_ssl=0)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_TestControl.control + +# Check that the IUT responds with the list of user applications when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_001_OK +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_001_NF +# Check that the IUT responds with the list of user applications when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_002_OK +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_002_BR +#Check that the IUT acknowledges the creation of the application context when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_OK +# Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_BR +# Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_NF +# Check that the IUT acknowledges the creation of the application context when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_BR +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_NF +# Check that the IUT deletes the application context when commanded by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_003_OK +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_003_NF +# Check that the IUT sends the locations available for instantiation of a specific user application when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_BR +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_NF + +[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. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ b/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ index 5464190fa66baf6cde7579dd9e8fe3e1f3e6d1b4..0f34812ab30d22c7360d5b6f512357139e600862 100644 --- a/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ +++ b/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ @@ -8,14 +8,17 @@ 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.39" +LibHttp_Pics.PICS_HEADER_HOST := "192.168.40.50" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true #LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" -# LibMec_Pixits +LibMec_Pics.PICS_ROOT_API := "/sbxnfzm34p/mep1/" +# LibMec_Pixits +TrafficManagementAPI_Pixits.PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b" +TrafficManagementAPI_Pixits.PX_APP_INSTANCE_ID_2 := "81c51643-8c6f-4781-ad45-f8a457ca549b" [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -33,9 +36,9 @@ LogEventTypes:= Yes [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. -system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.12,port=30030,use_ssl=0)" +system.httpPort.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server=192.168.40.50,port=80,use_ssl=0)" #system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" -system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" +#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server_mode=1,use_ssl=0)" [DEFINE] # In this section you can create macro definitions, @@ -84,30 +87,32 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_002_BR_01 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be present #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_002_BR_02 -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +# Check that the IUT responds with the configured bandwidth allocation when queried by a MEC Application #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_003_OK -#Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_003_NF +# Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be omitted #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_BR_01 #Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be present -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_BR_01 -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_BR_02 +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_NF #Check that the IUT when provided with just the changes (deltas) updates the requested bandwidth requirements when commanded by a MEC Application -#TC_MEC_MEC015_SRV_TM_005_OK +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_OK #Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be omitted #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_BR_01 #Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be present #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_BR_02 #Check that the IUT when provided with just the changes (deltas) updates the requested bandwidth requirements when commanded by a MEC Application -#TC_MEC_MEC015_SRV_TM_005_NF +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_NF #Check that the IUT unregisters from the Bandwidth Management Service when commanded by a MEC Application #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_006_OK #Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_006_NF -// Multi-access Traffic Steering information Test Cases +# Multi-access Traffic Steering information Test Cases #Check that the IUT responds with the Multi-access Traffic Steering information when queried by a MEC Application #AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_001_OK #Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application - none @@ -145,7 +150,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server #Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application #AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_006_NF -// BWM change event susbsciption Testcases +# BWM change event susbsciption Testcases #Check that the IUT responds with a list of BWM change event susbsciption when queried by a MEC Application #AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BWMSUBLOOKUP_001_OK #Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application diff --git a/etc/AtsMec_UEidentity/AtsMec_UEidentity.cfg_ b/etc/AtsMec_UEidentity/AtsMec_UEidentity.cfg_ new file mode 100644 index 0000000000000000000000000000000000000000..7d8a960908457a6d9acb1e214adbbaab2df0951f --- /dev/null +++ b/etc/AtsMec_UEidentity/AtsMec_UEidentity.cfg_ @@ -0,0 +1,90 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 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.40.7" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +#LibMec_Pics.PICS_ROOT_API := "/sbxnfzm34p/mep1/" + +# LibMec_Pixits +UEidentityAPI_Pixits.PX_APP_INSTANCE_ID := "APP_INSTANCE_ID" +UEidentityAPI_Pixits.PX_UE_IDENTITY_TAG := "UE_IDENTITY_TAG" + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_UEidentity/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.40.7,port=5000,use_ssl=0)" +#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" +#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server_mode=1,use_ssl=0)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_TestControl.control + +# Check that the IUT responds with the information on a UE Identity tag when queried by a MEC Application +#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_001_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Applicati +#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_001_BR +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_001_NF +# Check that the IUT registers a tag (representing a UE) or a list of tags when commanded by a MEC Application +AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_002_OK + + +[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. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn index 5bd1c8f7975a32f9f9b55dc2812b2b653520379d..2a336f49d4380e3803c828ded5024d9443f5215e 100644 --- a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn +++ b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn @@ -623,7 +623,7 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { m_create_package_management( PX_APP_PKG_NAME, PX_APP_PKG_VERSION, - m_checksum(-, PX_CHECKSUM) + m_checksum(-,PX_CHECKSUM) )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -639,8 +639,9 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { -, mw_checksum, CREATED, - PX_OPERATIONAL_STATE, - PX_USAGE_STATE + -, + PX_USAGE_STATE, + - )))))) -> value v_response { tc_ac.stop; @@ -753,11 +754,11 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { { *, mw_app_pkg_info( - -, + v_app_pkg_info.id, mw_checksum, - PX_ONBOARDED_STATE, - PX_OPERATIONAL_STATE, - PX_USAGE_STATE, + CREATED, + -, + -, - ), * @@ -821,13 +822,14 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { { *, mw_app_pkg_info_onboarded( - -, -, + v_app_pkg_info.id, + -, PX_APP_PKG_NAME, PX_APP_PKG_VERSION, -, mw_checksum, -, - PX_ONBOARDED_STATE_ONBOARDED + PX_ONBOARDED_STATE_ONBOARDED ), * } @@ -938,7 +940,12 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_http_message_body_json( mw_body_json_app_pkg_info( mw_app_pkg_info( - v_app_pkg_info.id + v_app_pkg_info.id, + -, + PX_ONBOARDED_STATE, + -, + PX_USAGE_STATE, + v_app_pkg_info.links )))))) -> value v_response { tc_ac.stop; @@ -996,11 +1003,22 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_http_message_body_json( mw_body_json_app_pkg_info( mw_app_pkg_info_onboarded( - v_app_pkg_info.id + v_app_pkg_info.id, + v_app_pkg_info.appDId, + v_app_pkg_info.appName, + v_app_pkg_info.appSoftwareVersion, + v_app_pkg_info.appDVersion, + v_app_pkg_info.checksum, + -, + PX_ONBOARDED_STATE_ONBOARDED, + -, + -, + v_app_pkg_info.mecInfo, + v_app_pkg_info.links )))))) -> value v_response { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with an App Package ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with an Onboarded App Package ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -2215,7 +2233,7 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { -, mw_checksum, PX_ONBOARDED_STATE, - PX_OPERATIONAL_STATE, + PX_APPPKGINFO_OPERATIONAL_STATE, PX_USAGE_STATE ), * @@ -2288,7 +2306,7 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { ))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with an App Package list ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with an Onboarded App Package list ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -2390,7 +2408,8 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_body_json_app_pkg_info( mw_app_pkg_info( v_app_pkg_info.id, - v_app_pkg_info.appDId + -, + PX_ONBOARDED_STATE_ONBOARDED )))))) { tc_ac.stop; diff --git a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/module.mk b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/module.mk index 9b2aa7c42141e6b3cece25b5ad4d464448546b41..13df0a94afcf091732203ce7c88a913b589844b5 100644 --- a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/module.mk +++ b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/module.mk @@ -22,7 +22,6 @@ modules := ../LibCommon \ ../LibMec/WlanInformationAPI \ ../LibMec/FixedAccessInformationServiceAPI \ ../LibMec/ApplicationMobilityServiceAPI \ - ../LibMec/FederationEnablementAPI \ ../LibMec/IoTAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ diff --git a/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn b/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn index eda51f702ba34faf0e0bd34a7d064778e8e7bf7e..ce716204dbc6707dfb285812a59b80b11732144f 100644 --- a/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn @@ -83,7 +83,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_device_info_app_list - )))) -> value v_response { + )))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); @@ -125,7 +125,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "appName", + PICS_ROOT_API & "dev_app/v1/app_list_error", v_headers ) ) @@ -181,7 +181,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "?appName=" & PX_DEVICE_APP_NAME, + PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "?appName=" & oct2char(unichar2oct(PX_DEVICE_APP_NAME, "UTF-8")), v_headers ) ) @@ -238,7 +238,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "appName", + PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "?APP_NAME", v_headers ) ) @@ -331,7 +331,9 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { // Local variables var Headers v_headers; var HttpMessage v_response; - + + var UserAppInstanceInfoList v_userAppInstanceInfo := {{appInstanceId := PX_APP_INSTANCE_ID, referenceURI := "http://example.com/aeiou", appLocation := {countryCode := "countryCode", civicAddressElement := {{caType := 7, caValue := "caValue"}, {caType := 7, caValue := "caValue"}}, area := {coordinates := {{{2.302136, 2.302136}, {2.302136, 2.302136}}, {{2.302136, 2.302136}, {2.302136, 2.302136}}}}}}}; + // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***"); @@ -354,12 +356,16 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + -, PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, - PX_APPD_VERSION + PX_APPD_VERSION, + PX_APP_DESCRIPTION, + PX_APP_SOFT_VERSION, + v_userAppInstanceInfo ), PX_DEVICE_APP_CALLBACK ) @@ -427,17 +433,21 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "Invalid", + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI, v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + -, PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, - PX_APPD_VERSION + PX_APPD_VERSION, + PX_APP_DESCRIPTION, + PX_APP_SOFT_VERSION, + omit ), PX_DEVICE_APP_CALLBACK ) @@ -496,11 +506,12 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "WRONGURL", v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + -, PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, @@ -568,17 +579,18 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & v_device_info_app_context.contextId, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & oct2char(unichar2oct(v_device_info_app_context.contextId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + v_device_info_app_context.contextId, PX_ASSOCIATE_DEV_APPID, m_app_context_info( - PX_APPD_ID, - PX_APP_NAME, - PX_APP_PROVIDER, - PX_APPD_VERSION + PX_APPD_ID_2, + PX_APP_NAME_2, + PX_APP_PROVIDER_2, + PX_APPD_VERSION_2 ), PX_DEVICE_NEW_APP_CALLBACK ) @@ -642,11 +654,12 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & v_device_info_app_context.contextId, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & oct2char(unichar2oct(v_device_info_app_context.contextId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + -, PX_INVALID_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, @@ -711,11 +724,12 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & PX_UNKNOWN_APP_CONTEXT_ID, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_APP_CONTEXT_ID, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + PX_UNKNOWN_APP_CONTEXT_ID, PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, @@ -782,7 +796,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & PX_UNKNOWN_APP_CONTEXT_ID, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & oct2char(unichar2oct(v_device_info_app_context.contextId, "UTF-8")), v_headers ) ) @@ -837,7 +851,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & PX_UNKNOWN_APP_CONTEXT_ID, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_APP_CONTEXT_ID, "UTF-8")), v_headers ) ) @@ -872,71 +886,90 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_OK() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI, - v_headers, - m_http_message_body_json( - m_body_json_device_info_app_location_availability( - m_application_location_availability( - PX_ASSOCIATE_DEV_APPID, - m_application_location_availability_info( - PX_APPD_ID, - PX_APP_NAME, - PX_APP_PROVIDER, - PX_APPD_VERSION - ) - ) - ) - ) - ) - ) - ); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); + // Local variables + var Headers v_headers; + template (value) ApplicationLocationAvailability_AppInfo t_appLocAvail := + { + appName := "onboarded-demo4", + appProvider := "ETSI", + appSoftVersion := "v0.1.0", + appDVersion := "v0.1.0", + appDescription := "Basic HTTP Ping Pong", + availableLocations := { + { + appLocation := { + countryCode := "492", + civicAddressElement := { + { caType := 1, caValue := "A1" }, + { caType := 2, caValue := "A2" } + }, + area := {coordinates := {{{2.302136, 2.302136}, {2.302136, 2.302136}}, {{2.302136, 2.302136}, {2.302136, 2.302136}}}} + } + } + }, + appPackageSource := "http://example.com/aeiou" + }; - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - m_body_json_device_info_app_location_availability( - mw_application_location_availability( - PX_ASSOCIATE_DEV_APPID, - mw_application_location_availability_info - )))))) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_DEVICE_APP_LOC_URI, + v_headers, + m_http_message_body_json( + m_body_json_device_info_app_location_availability( + m_application_location_availability( + PX_ASSOCIATE_DEV_APPID, + t_appLocAvail + ) + + ) + + ) + ) + ) + + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + m_body_json_device_info_app_location_availability( + mw_application_location_availability( + PX_ASSOCIATE_DEV_APPID, + t_appLocAvail + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); } // End of testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_OK /** @@ -965,7 +998,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "_invalid", + PICS_ROOT_API & PX_DEVICE_APP_LIST_URI, v_headers, m_http_message_body_json( m_body_json_device_info_app_location_availability( @@ -973,7 +1006,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { PX_ASSOCIATE_DEV_APPID, m_application_location_availability_info( PX_APPD_ID, - PX_APP_NAME, + PX_UNKNOWN_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ) @@ -1062,7 +1095,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { )) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn index 21ad76437fb64295b132d8a88e327d267e4d03b5..09663cb488d4007713b51a801a6e704375b9508a 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn @@ -50,6 +50,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { var Headers v_headers; var BwChgEventSubscription v_bw_chg_event_subscription; var charstring v_subscription_id; + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { @@ -83,14 +84,15 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_bw_subscription_link_list( - mw_subscription_link_list( - { href := pattern "http?+" & PICS_ROOT_API & PX_ME_BWM_SUB_URI }, - superset( - mw_subscription( - v_bw_chg_event_subscription.links.self_.href, - "BwChgEventSubscription" - ) - ))))))) { + mw_subscription_link( + mw_subscription_link_list( + -, + superset( + mw_subscription( + v_bw_chg_event_subscription.links.self_.href, + "BwChgEventSubscription" + ) + )))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a BW event subscription list ***"); @@ -254,14 +256,15 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_bw_subscription_link_list( - mw_subscription_link_list( - { href := pattern "http?+" & PICS_ROOT_API & PX_ME_BWM_SUB_URI }, - superset( - mw_subscription( - v_bw_chg_event_subscription.links.self_.href, - "BwChgEventSubscription" - ) - ))))))) { + mw_subscription_link( + mw_subscription_link_list( + -, + superset( + mw_subscription( + v_bw_chg_event_subscription.links.self_.href, + v_bw_chg_event_subscription.subscriptionType + ) + )))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a BW event subscription list ***"); @@ -379,11 +382,11 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { v_bw_chg_event_subscription.callbackReference, -, mw_links( - v_bw_chg_event_subscription.links.self_.href + v_bw_chg_event_subscription.links.self_ ), - mw_filter_criteria( - v_bw_chg_event_subscription.filterCriteria.appInsId - ) + v_bw_chg_event_subscription.filterCriteria + + )))))) { tc_ac.stop; @@ -451,7 +454,6 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_bw_chg_event_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_NF @@ -492,12 +494,15 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + {m_filter_criteria(PX_APP_INSTANCE_ID,-)} )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + tc_ac.start; alt { [] httpPort.receive( @@ -506,10 +511,11 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { mw_http_message_body_json( mw_body_json_bw_chg_event_subscription( mw_bw_chg_event_subscription( + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + {m_filter_criteria(PX_APP_INSTANCE_ID,-)} )))))) -> value v_response { tc_ac.stop; @@ -541,7 +547,6 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_001_OK - /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType */ @@ -575,7 +580,9 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_bw_chg_event_subscription( PX_UNKNOWN_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, - m_filter_Criteria + -, + -, + {m_filter_criteria} )))))); // Test Body @@ -632,10 +639,13 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( + PX_BW_SUBSCRIPTION_TYPE, -, -, -, - m_filter_criteria + { + m_filter_criteria + } )))))); // Test Body @@ -690,11 +700,11 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_Type, + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, { websocketUri := PX_BW_SUB_WEB_SOCKET, requestWebsocketUri := omit }, -, - m_filter_criteria + {m_filter_criteria} )))))); // Test Body @@ -750,11 +760,11 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_Type, + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + {m_filter_criteria} )))))); tc_ac.start; @@ -765,12 +775,14 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { mw_http_message_body_json( mw_body_json_bw_chg_event_subscription( mw_bw_chg_event_subscription( - PX_BW_Subcription_Type, + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria - )))))) -> value v_response { + { + m_filter_criteria + } + )))))) { tc_ac.stop; @@ -821,11 +833,16 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_Type, + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + { + m_filter_criteria ( + -, + - + ) + } )))))); // Test Body tc_ac.start; @@ -969,8 +986,10 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { // Local variables var Headers v_headers; var HttpMessage v_response; + var BwChgEventSubscription v_bw_chg_event_subscription; var charstring v_subscription_id; + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); @@ -986,34 +1005,33 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { // Preamble f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); + action("Trigger a event"); f_selfOrClientSyncAndVerdict(c_prDone, e_success); tc_ac.start; alt { [] httpPort_notif.receive( - mw_http_response( + mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_bw_chg_event_notification( mw_bw_chg_event_notification( + PX_BW_NOTIFICATION_TYPE, -, - -, - mw_data_vol_dispersion( - 1024,PX_APP_INSTANCE_ID - ), - - + { + mw_data_vol_dispersion( + 1024,PX_APP_INSTANCE_ID,- + ) + }, + v_bw_chg_event_subscription.links )))))) -> value v_response { tc_ac.stop; f_init_default_headers_list(-, -, v_headers); - httpPort_notif.send( - m_http_response( - m_http_response_ok_no_body( - v_headers - ))); + httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn index 091c2232c602937f42cf9853906a960a33452c37..4838dab4a5685a4ef234d8f5c806efe5e28c19c3 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn @@ -141,13 +141,17 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { mw_mts_session_info( v_mts_session_info_1.appInsId, v_mts_session_info_1.requestType, - -, -, -, + -, + -, + -, v_mts_session_info_1.sessionId ), mw_mts_session_info( v_mts_session_info_2.appInsId, v_mts_session_info_2.requestType, - -, -, -, + -, + -, + -, v_mts_session_info_2.sessionId ), * @@ -209,16 +213,22 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_mts_session_info( - mw_mts_session_info( - v_mts_session_info.appInsId, - v_mts_session_info.requestType, - -, -, -, - v_mts_session_id - )))))) { + mw_body_json_mts_session_info_list( + { + *, + mw_mts_session_info( + v_mts_session_info.appInsId, + v_mts_session_info.requestType, + -,-,-, + v_mts_session_info.sessionId + ), + * + } + + ))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list - app_instance_id ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -228,7 +238,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); + f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8"))); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_002_OK_02 @@ -271,14 +281,19 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_mts_session_info( - mw_mts_session_info( - v_mts_session_info.appInsId, - v_mts_session_info.requestType, - -, -, -, - v_mts_session_id, - v_mts_session_info.appName - )))))) { + mw_body_json_mts_session_info_list( + { + *, + mw_mts_session_info( + v_mts_session_info.appInsId, + v_mts_session_info.requestType, + -, -, -, + v_mts_session_info.sessionId, + v_mts_session_info.appName + ), + * + } + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list ***"); @@ -291,7 +306,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); + f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8"))); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_002_OK_03 @@ -334,14 +349,19 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_mts_session_info( + mw_body_json_mts_session_info_list( + { + *, mw_mts_session_info( v_mts_session_info.appInsId, v_mts_session_info.requestType, -, -, -, v_mts_session_info.sessionId, v_mts_session_info.appName - )))))) { + ), + * + } + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list ***"); @@ -506,7 +526,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd, // QoS - LowCost, // MtsMode + QoS, // MtsMode Downlink // TrafficDirection )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -584,7 +604,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { PX_APP_INSTANCE_ID, FLOW_SPECIFIC_MTS_SESSION, // Request type m_qosd, // QoS - LowCost, // MtsMode + QoS, // MtsMode Downlink, // TrafficDirection -, -, { m_flow_filter("10.10.10.10", 1010) } // FIXME Use PIXITs @@ -721,7 +741,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & v_mts_session_id, + PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8")), v_headers ))); @@ -741,7 +761,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { )))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a BwInfo ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a MTS session ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -751,7 +771,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); + f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8"))); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_004_OK @@ -785,7 +805,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & "mts/v0/mts_sessions/" & PX_UNKNOWN_APP_INSTANCE_ID, // Wrong version number + PICS_ROOT_API & "mts/v0/mts_sessions/" & oct2char(unichar2oct(PX_UNKNOWN_APP_INSTANCE_ID, "UTF-8")), // Wrong version number v_headers ) ) @@ -794,12 +814,8 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_404_not_found( - mw_http_message_body_json( - mw_body_json_problem_details( - mw_problem_details( - -, -, 404 - )))))) { + mw_http_response_404_not_found + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); @@ -846,7 +862,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & PX_UNKNOWN_APP_INSTANCE_ID, + PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_APP_INSTANCE_ID, "UTF-8")), v_headers ) ) @@ -904,7 +920,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & v_mts_session_id, + PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_mts_session_info( @@ -912,10 +928,10 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd_1, // QoS - LowCost, // MtsMode + QoS, // MtsMode Downlink // TrafficDirection )))))); - + f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { @@ -928,7 +944,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type mw_qosd_1, // QoS - LowCost, // MtsMode + QoS, // MtsMode Downlink // TrafficDirection )))))) { tc_ac.stop; @@ -943,7 +959,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); + f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8"))); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_005_OK @@ -980,10 +996,12 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { m_body_json_mts_session_info( m_mts_session_info( // MEC015 Clause 7.2.5 Type: MtsSessionInfo Table 7.2.5-1: Elements of MtsSessionInfo, flowFilter shall be omit PX_APP_INSTANCE_ID, - FLOW_SPECIFIC_MTS_SESSION, // Request type + APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd_1, // QoS - LowCost, // MtsMode - Downlink // TrafficDirection + QoS, // MtsMode + Downlink, // TrafficDirection + -,-, + { m_flow_filter("10.10.10.10", 1010) } )))))); // Test Body @@ -1156,7 +1174,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & PX_UNKNOWN_APP_INSTANCE_ID, + PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_APP_INSTANCE_ID, "UTF-8")), v_headers ))); diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn index 50d2114794b6c2966cdd0536f7da9a13caf374ee..6a05b125de1e624f69f141e599ab70c99ea8fbfa 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn @@ -47,7 +47,7 @@ module AtsMec_TrafficManagementAPI_TestCases { testcase TC_MEC_MEC015_SRV_TM_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_BWMANAGEMENT_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_BWMANAGEMENT_API_SUPPORTED required for executing the TC ***"); @@ -77,7 +77,7 @@ module AtsMec_TrafficManagementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_bw_info_list + mw_body_json_bw_info_list({}) )))) { tc_ac.stop; @@ -100,6 +100,8 @@ module AtsMec_TrafficManagementAPI_TestCases { testcase TC_MEC_MEC015_SRV_TM_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + var charstring v_bw_allocation_id; + var BwInfo v_bw_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_BWMANAGEMENT_API_SUPPORTED)) { @@ -114,11 +116,12 @@ module AtsMec_TrafficManagementAPI_TestCases { // Test adapter configuration // Preamble + f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?app_instance_id=" & PX_APP_INSTANCE_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "?app_instance_id=" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -130,13 +133,19 @@ module AtsMec_TrafficManagementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_bw_info( - mw_bw_info( - PX_APP_INSTANCE_ID - )))))) { + mw_body_json_bw_info_list( + { + *, + mw_bw_info( + PX_APP_INSTANCE_ID + ), + * + } + + ))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with the required BwInfo ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with the required BwInfo List***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -146,6 +155,7 @@ module AtsMec_TrafficManagementAPI_TestCases { } // End of 'alt' statement // Postamble + f_delete_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_TM_001_OK_02 @@ -155,6 +165,8 @@ module AtsMec_TrafficManagementAPI_TestCases { testcase TC_MEC_MEC015_SRV_TM_001_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + var charstring v_bw_allocation_id; + var BwInfo v_bw_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_BWMANAGEMENT_API_SUPPORTED)) { @@ -169,11 +181,12 @@ module AtsMec_TrafficManagementAPI_TestCases { // Test adapter configuration // Preamble + f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?app_name=" & PX_APP_NAME, + PICS_ROOT_API & PX_ME_BWM_URI & "?app_name=" & oct2char(unichar2oct(PX_APP_NAME, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -185,12 +198,17 @@ module AtsMec_TrafficManagementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_bw_info( - mw_bw_info( - PX_APP_INSTANCE_ID, - -, -, -, - PX_APP_NAME - )))))) { + mw_body_json_bw_info_list( + { + *, + mw_bw_info( + PX_APP_INSTANCE_ID, + -, -, -, + PX_APP_NAME + ), + * + } + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the required BwInfo ***"); @@ -203,6 +221,7 @@ module AtsMec_TrafficManagementAPI_TestCases { } // End of 'alt' statement // Postamble + f_delete_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_TM_001_OK_03 @@ -212,6 +231,9 @@ module AtsMec_TrafficManagementAPI_TestCases { testcase TC_MEC_MEC015_SRV_TM_001_OK_04() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + var charstring v_bw_allocation_id; + var BwInfo v_bw_info; + // Test control if (not(PICS_MEC_PLAT) or not(PICS_BWMANAGEMENT_API_SUPPORTED)) { @@ -226,11 +248,12 @@ module AtsMec_TrafficManagementAPI_TestCases { // Test adapter configuration // Preamble + f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?session_id=" & PX_APP_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "?session_id=" & oct2char(unichar2oct(v_bw_info.allocationId, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -242,16 +265,21 @@ module AtsMec_TrafficManagementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_bw_info( - mw_bw_info( - PX_APP_INSTANCE_ID, - -, -, -, - PX_APP_NAME, - PX_APP_ALLOCATION_ID - )))))) { + mw_body_json_bw_info_list( + { + *, + mw_bw_info( + PX_APP_INSTANCE_ID, + -, -, -, + PX_APP_NAME, + v_bw_info.allocationId + ), + * + } + ))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with the required BwInfo ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with the required BwInfo - session_id ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -261,6 +289,7 @@ module AtsMec_TrafficManagementAPI_TestCases { } // End of 'alt' statement // Postamble + f_delete_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_TM_001_OK_04 @@ -288,7 +317,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?appInstId=" & PX_APP_INSTANCE_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "?appInstId=" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -339,7 +368,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?app_instance_id=" & PX_UNKNOWN_APP_INSTANCE_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "?app_instance_id=" & oct2char(unichar2oct(PX_UNKNOWN_APP_INSTANCE_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -390,7 +419,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?app_name=" & PX_UNKNOWN_APP_NAME, + PICS_ROOT_API & PX_ME_BWM_URI & "?app_name=" & oct2char(unichar2oct(PX_UNKNOWN_APP_NAME, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -441,7 +470,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?session_id=" & PX_UNKNOWN_APP_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "?session_id=" & oct2char(unichar2oct(PX_UNKNOWN_APP_ALLOCATION_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -494,7 +523,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), + PICS_ROOT_API & PX_ME_BWM_URI, v_headers, m_http_message_body_json( m_body_json_bw_info( @@ -526,7 +555,7 @@ module AtsMec_TrafficManagementAPI_TestCases { // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { - log("*** " & testcasename() & ": FAIL: IUT failed in Area subscription ***"); + log("*** " & testcasename() & ": FAIL: IUT failed in creation of a bandwidthAllocation resource ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; @@ -540,6 +569,7 @@ module AtsMec_TrafficManagementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully responds with a BwInfo, CreationID: ", v_bw_allocation_id," ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); @@ -576,7 +606,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), + PICS_ROOT_API & PX_ME_BWM_URI, v_headers, m_http_message_body_json( m_body_json_bw_info( @@ -587,7 +617,7 @@ module AtsMec_TrafficManagementAPI_TestCases { Downlink, PX_APP_NAME, PX_APP_ALLOCATION_ID, - { m_session_filter("10.10.10.10", 1010) } // FIXME Use PIXITs + { m_session_filter(PX_SESSION_IPv4, PX_SESSION_PORT), m_session_filter(PX_SESSION_IPv4, PX_SESSION_PORT) } // sessionFilter shall be omitted when APPLICATION_SPECIFIC_BW_ALLOCATION )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -637,7 +667,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), + PICS_ROOT_API & PX_ME_BWM_URI, v_headers, m_http_message_body_json( m_body_json_bw_info( @@ -762,7 +792,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & PX_UNKNOWN_BW_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -816,18 +846,21 @@ module AtsMec_TrafficManagementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); } f_init_default_headers_list(-, -, v_headers); + httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & v_bw_allocation_id, - v_headers, - m_http_message_body_json( + PICS_ROOT_API & PX_ME_BWM_URI & "/" & v_bw_allocation_id, + v_headers, + m_http_message_body_json( m_body_json_bw_info( m_bw_info( PX_APP_INSTANCE_ID, - APPLICATION_SPECIFIC_BW_ALLOCATION, // Request type - "2048", // FixedAllocation - Downlink // AllocationDirection + APPLICATION_SPECIFIC_BW_ALLOCATION, + "2048", + Downlink, + PX_APP_NAME, + PX_APP_ALLOCATION_ID )))))); // Test Body @@ -887,15 +920,15 @@ module AtsMec_TrafficManagementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); } f_init_default_headers_list(-, -, v_headers); - v_bw_info.sessionFilter := { valueof(m_session_filter("10.10.10.10", 1010)) }; // FIXME Use PIXITs + v_bw_info.sessionFilter := { valueof(m_session_filter(PX_SESSION_IPv4, PX_SESSION_PORT)) }; // FIXME Use PIXITs httpPort.send( m_http_request( - m_http_request_put( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & v_bw_allocation_id, - v_headers, - m_http_message_body_json( - m_body_json_bw_info( - v_bw_info + m_http_request_put( + PICS_ROOT_API & PX_ME_BWM_URI & "/" & v_bw_allocation_id, + v_headers, + m_http_message_body_json( + m_body_json_bw_info( + v_bw_info ))))); // Test Body @@ -944,9 +977,9 @@ module AtsMec_TrafficManagementAPI_TestCases { // Preamble f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); - if (v_bw_allocation_id == "") { - f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); - } + // if (v_bw_allocation_id == "") { + // f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + // } f_init_default_headers_list(-, -, v_headers); v_bw_info.requestType := SESSION_SPECIFIC_BW_ALLOCATION; httpPort.send( @@ -998,23 +1031,26 @@ module AtsMec_TrafficManagementAPI_TestCases { // Test component configuration f_cf_01_http_up(); - - // Test adapter configuration - + + // oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), + // Preamble + f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & PX_UNKNOWN_BW_ALLOCATION_ID, - v_headers, - m_http_message_body_json( + PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), + v_headers, + m_http_message_body_json( m_body_json_bw_info( m_bw_info( PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_BW_ALLOCATION, - "2048", // FixedAllocation - Downlink - )))))); + "2048", + Downlink, + PX_APP_NAME, + PX_UNKNOWN_BW_ALLOCATION_ID + )))))); // Test Body tc_ac.start; @@ -1074,7 +1110,8 @@ module AtsMec_TrafficManagementAPI_TestCases { m_body_json_bw_info_deltas( m_bw_info_deltas( PX_APP_INSTANCE_ID, - APPLICATION_SPECIFIC_BW_ALLOCATION + APPLICATION_SPECIFIC_BW_ALLOCATION, + v_bw_info.allocationId )))))); // Test Body @@ -1145,7 +1182,7 @@ module AtsMec_TrafficManagementAPI_TestCases { PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_BW_ALLOCATION, v_bw_info.allocationId, - { m_session_filter("10.10.10.10", 1010) } // FIXME Use PIXITs + { m_session_filter(PX_SESSION_IPv4, PX_SESSION_PORT) } // FIXME Use PIXITs )))))); // Test Body @@ -1213,7 +1250,7 @@ module AtsMec_TrafficManagementAPI_TestCases { PX_APP_INSTANCE_ID, SESSION_SPECIFIC_BW_ALLOCATION, v_bw_info.allocationId - //{ m_session_filter("10.10.10.10", 1010) } sessionFilter shall be present + //{ m_session_filter(PX_SESSION_IPv4, PX_SESSION_PORT) } sessionFilter shall be present )))))); // Test Body @@ -1267,7 +1304,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & PX_UNKNOWN_BW_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_bw_info_deltas( @@ -1321,9 +1358,9 @@ module AtsMec_TrafficManagementAPI_TestCases { // Preamble f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); - if (v_bw_allocation_id == "") { - f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); - } + // if (v_bw_allocation_id == "") { + // f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + // } f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -1344,6 +1381,7 @@ module AtsMec_TrafficManagementAPI_TestCases { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds to deletion ***"); + setverdict(pass, "IUT successfully responds to deletion"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -1379,14 +1417,14 @@ module AtsMec_TrafficManagementAPI_TestCases { // Preamble f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); - if (v_bw_allocation_id == "") { - f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); - } + // if (v_bw_allocation_id == "") { + // f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + // } f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & PX_UNKNOWN_BW_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), v_headers ))); @@ -1395,11 +1433,10 @@ module AtsMec_TrafficManagementAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_204_no_content - )) { + mw_http_response_404_not_found + )) { tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds to deletion ***"); + log("*** " & testcasename() & ": PASS: IUT responds with an error when a request for an unknown URI is sent by a MEC Application ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { diff --git a/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn b/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn index 7a85b02e2773142362b7843db2d01822874183f1..f8d87cd20d2597d80aed9deef507282cccf7bb71 100644 --- a/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn +++ b/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn @@ -60,7 +60,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -115,7 +115,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/invalid/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -125,15 +125,11 @@ module AtsMec_UEidentityAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_400_bad_request( - mw_http_message_body_json( - mw_body_json_problem_details( - mw_problem_details( - -, -, 400 - )))))) { + mw_http_response_400_bad_request + )) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -170,7 +166,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -179,13 +175,13 @@ module AtsMec_UEidentityAPI_TestCases { tc_ac.start; alt { [] httpPort.receive( - mw_http_response( - mw_http_response_404_not_found( - mw_http_message_body_json( - mw_body_json_problem_details( - mw_problem_details( - -, -, 404 - )))))) { + mw_http_response( + mw_http_response_404_not_found( + mw_http_message_body_json( + mw_body_json_problem_details( + mw_problem_details( + -, -, 404 + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***"); @@ -230,7 +226,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", v_headers, m_http_message_body_json( m_body_json_ue_identity_tag_info( @@ -304,7 +300,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", v_headers, m_http_message_body_json( m_body_json_ue_identity_tag_info( @@ -368,7 +364,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", v_headers, m_http_message_body_json( m_body_json_ue_identity_tag_info( diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn index b59ceeb5c245252095b694ea88ce7c66e62cfc8d..243a9123e744578627d6baecb2874e787bb40b23 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn @@ -142,12 +142,14 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Functions { mw_http_response_201_created( mw_http_message_body_json( mw_body_json_app_pkg_info( - mw_app_pkg_info_onboarded( - -, -, - PX_APP_PKG_NAME, - PX_APP_PKG_VERSION, - -, - mw_checksum + mw_app_pkg_info( + -, + mw_checksum(-, PX_CHECKSUM), + CREATED, + -, + -, + - + )))))) -> value v_response { tc_ac.stop; diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn index ff38b9d5b6df15dec29d30e6d0cad8e73a05d384..cf91989272c208b8924a3b663fa5f7382b844e19 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn @@ -54,10 +54,12 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits { modulepar Json.String PX_APP_PKG_PATH := "APP_PKG_PATH"; - modulepar Json.String PX_ONBOARDED_STATE_ONBOARDED := "ONBOARDED"; + modulepar OnboardingState PX_ONBOARDED_STATE_ONBOARDED := ONBOARDED; + + modulepar OnboardingState PX_ONBOARDED_STATE := CREATED; + + modulepar AppPkgInfo_OperationalState PX_APPPKGINFO_OPERATIONAL_STATE := ENABLED; - modulepar Json.String PX_ONBOARDED_STATE := "CREATED"; - modulepar OperationalState PX_OPERATIONAL_STATE := STARTED; modulepar UsageState PX_USAGE_STATE := NOT_IN_USE; diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn index b3ce9c8d7dcc85942413058a075954392cdd489e..cb314d43a76f311d18ffcc6645bc21d85db6bfe3 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn @@ -189,7 +189,7 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Templates { in String p_appPkgName, in String p_appPkgVersion, in template (value) Checksum p_checksum, - in AnyURI p_appPkgPath + in template (omit) AnyURI p_appPkgPath := omit ) := { appPkgName := p_appPkgName, appPkgVersion := p_appPkgVersion, diff --git a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn index 0f43a1f941f3888618e93f15ad7c370b5a641623..4cf0942fdd98f3671c09d37aad2a710e2e7bf44f 100644 --- a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn +++ b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn @@ -33,6 +33,7 @@ module DeviceApplicationInterfaceAPI_Functions { ) runs on HttpComponent { var Headers v_headers; var HttpMessage v_response; + var UserAppInstanceInfoList v_userAppInstanceInfo := {{appInstanceId := PX_APP_INSTANCE_ID, referenceURI := "http://example.com/aeiou", appLocation := {countryCode := "countryCode", civicAddressElement := {{caType := 7, caValue := "caValue"}, {caType := 7, caValue := "caValue"}}, area := {coordinates := {{{2.302136, 2.302136}, {2.302136, 2.302136}}, {{2.302136, 2.302136}, {2.302136, 2.302136}}}}}}}; f_init_default_headers_list(-, -, v_headers); httpPort.send( @@ -43,14 +44,18 @@ module DeviceApplicationInterfaceAPI_Functions { m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( - PX_ASSOCIATE_DEV_APPID, - m_app_context_info( - PX_APPD_ID, - PX_UNKNOWN_APP_NAME, - PX_APP_PROVIDER, - PX_APPD_VERSION - ), - PX_DEVICE_APP_CALLBACK + -, + PX_ASSOCIATE_DEV_APPID, + m_app_context_info( + PX_APPD_ID, + PX_APP_NAME, + PX_APP_PROVIDER, + PX_APPD_VERSION, + PX_APP_DESCRIPTION, + PX_APP_SOFT_VERSION, + v_userAppInstanceInfo + ), + PX_DEVICE_APP_CALLBACK ) ) ) diff --git a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Pixits.ttcn b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Pixits.ttcn index 49e31f2f4c6ea2a2b87a834b28a98bf195822802..56a6d9ffd322dfe2ad456019a6b8d713992ac27e 100644 --- a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Pixits.ttcn +++ b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Pixits.ttcn @@ -3,34 +3,46 @@ module DeviceApplicationInterfaceAPI_Pixits { // JSON import from Json all; - modulepar charstring PX_DEVICE_APP_LIST_URI := "/dev_app/v1/app_list"; + modulepar Json.String PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b"; - modulepar charstring PX_DEVICE_APP_CTX_URI := "/dev_app/v1/app_contexts"; + modulepar Json.String PX_DEVICE_APP_NAME := ""; - modulepar charstring PX_DEVICE_APP_LOC_URI := "/dev_app/v1/obtain_app_loc_availability"; + modulepar Json.String PX_DEVICE_UNKNOWN_APP_NAME := ""; - modulepar charstring PX_DEVICE_APP_NAME := ""; + modulepar Json.String PX_ASSOCIATE_DEV_APPID := "bcee2135-2750-4d23-b786-a3062a371c8a"; - modulepar charstring PX_DEVICE_UNKNOWN_APP_NAME := ""; + modulepar Json.String PX_UNKNOWN_ASSOCIATE_DEV_APPID := "bcee2135-2750-4d23"; - modulepar charstring PX_ASSOCIATE_DEV_APPID := ""; + modulepar Json.String PX_INVALID_ASSOCIATE_DEV_APPID := ""; - modulepar charstring PX_INVALID_ASSOCIATE_DEV_APPID := ""; + modulepar Json.String PX_DEVICE_APP_CALLBACK := "http://clientApp.example.com/location_notifications/123456"; - modulepar charstring PX_DEVICE_APP_CALLBACK := ""; + modulepar Json.String PX_DEVICE_NEW_APP_CALLBACK := ""; - modulepar charstring PX_DEVICE_NEW_APP_CALLBACK := ""; + modulepar Json.String PX_APPD_ID := ""; + + modulepar Json.String PX_APPD_ID_2 := "Ccee2135-2750-4d23-b786-a3062a371c8a"; - modulepar charstring PX_APPD_ID := ""; + modulepar Json.String PX_APP_NAME := "onboarded-demo4"; - modulepar charstring PX_APP_NAME := ""; + modulepar Json.String PX_APP_NAME_2 := "demo2"; - modulepar charstring PX_UNKNOWN_APP_NAME := ""; + modulepar Json.String PX_UNKNOWN_APP_NAME := "UNKNOWN"; - modulepar charstring PX_APP_PROVIDER := ""; + modulepar Json.String PX_APP_PROVIDER := "ETSI"; - modulepar charstring PX_APPD_VERSION := ""; + modulepar Json.String PX_APP_PROVIDER_2 := "ETSI_2"; - modulepar charstring PX_UNKNOWN_APP_CONTEXT_ID := ""; + modulepar Json.String PX_APPD_VERSION := "v0.1.0"; + + modulepar Json.String PX_APPD_VERSION_2 := "v0.1.1"; + + modulepar Json.String PX_APP_SOFT_VERSION := "v0.1.0" + + modulepar Json.String PX_APP_SOFT_VERSION_2 := "v0.1.1" + + modulepar Json.String PX_APP_DESCRIPTION := "" + + modulepar Json.String PX_UNKNOWN_APP_CONTEXT_ID := "ccee2135-2750-4d23-b786-a3062a371c8aaa"; } // End of module DeviceApplicationInterfaceAPI_Pixits diff --git a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Templates.ttcn b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Templates.ttcn index 8b1ab83eaba1949555ab2ada8e6ad683a88c4a41..8114254c78eabea7b814f1cb3ee722bb458065fc 100644 --- a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Templates.ttcn +++ b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Templates.ttcn @@ -12,13 +12,14 @@ module DeviceApplicationInterfaceAPI_Templates { template (omit) AppContext m_device_app_context( + in template (omit) Json.String p_contextID := omit, in template (value) Json.String p_associateDevAppId, in template (value) ApplicationContext_AppInfo p_appInfo, in template (omit) Json.AnyURI p_callbackReference := omit, in template (omit) boolean p_appLocationUpdates := omit, in template (omit) boolean p_appAutoInstantiation := omit ) := { - contextId := omit, + contextId := p_contextID, associateDevAppId := p_associateDevAppId, callbackReference := p_callbackReference, appLocationUpdates := p_appLocationUpdates, @@ -82,24 +83,23 @@ module DeviceApplicationInterfaceAPI_Templates { appPackageSource := p_appPackageSource } // End ot template mw_app_context_info - template (value) ApplicationLocationAvailability m_application_location_availability( - in Json.String p_associateDevAppId, - in template (value) ApplicationLocationAvailability_AppInfo p_appInfo + template (omit) ApplicationLocationAvailability m_application_location_availability( + in template (value) Json.String p_associateDevAppId, + in template (omit) ApplicationLocationAvailability_AppInfo p_appInfo := omit ) := { associateDevAppId := p_associateDevAppId, appInfo := p_appInfo } // End of template m_application_location_availability - template (present) ApplicationLocationAvailability mw_application_location_availability( - template (present) Json.String p_associateDevAppId := ?, - template (present) ApplicationLocationAvailability_AppInfo p_appInfo := ? - ) := { + template ApplicationLocationAvailability mw_application_location_availability( + template (present) Json.String p_associateDevAppId := ?, + template (present) ApplicationLocationAvailability_AppInfo p_appInfo := ? + ) := { associateDevAppId := p_associateDevAppId, appInfo := p_appInfo } // End of template mw_application_location_availability template (omit) ApplicationLocationAvailability_AppInfo m_application_location_availability_info( - in Json.String p_appDId, in Json.String p_appName, in Json.String p_appProvider, in Json.String p_appDVersion, @@ -108,7 +108,6 @@ module DeviceApplicationInterfaceAPI_Templates { in template (omit) AvailableLocationsList p_availableLocations := omit, in template (omit) Json.AnyURI p_appPackageSource := omit ) := { - appDId := p_appDId, appName := p_appName, appProvider := p_appProvider, appSoftVersion := p_appSoftVersion, @@ -118,8 +117,7 @@ module DeviceApplicationInterfaceAPI_Templates { appPackageSource := p_appPackageSource } // End of template m_application_location_availability_info - template (present) ApplicationLocationAvailability_AppInfo mw_application_location_availability_info( - template (present) Json.String p_appDId := ?, + template ApplicationLocationAvailability_AppInfo mw_application_location_availability_info( template (present) Json.String p_appName := ?, template (present) Json.String p_appProvider := ?, template (present) Json.String p_appDVersion := ?, @@ -128,7 +126,6 @@ module DeviceApplicationInterfaceAPI_Templates { template AvailableLocationsList p_availableLocations := *, template Json.AnyURI p_appPackageSource := * ) := { - appDId := p_appDId, appName := p_appName, appProvider := p_appProvider, appSoftVersion := p_appSoftVersion, diff --git a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn index 72e35ca86fcbebf3000bfcf391e57ffadd175913..f1b0575c03cd5877fb5fa0ca74796a98e8e3f200 100644 --- a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn @@ -174,7 +174,6 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @seeETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.4 Type: ApplicationLocationAvailability */ type record ApplicationLocationAvailability_AppInfo { - Json.String appDId, Json.String appName, Json.String appProvider, Json.String appSoftVersion optional, @@ -255,7 +254,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { */ type record LocationConstraints { Json.String countryCode optional, - CivicAddressElement civicAddressElement optional, + CivicAddressElementList civicAddressElement optional, Polygon area optional } type set of LocationConstraints LocationConstraintsList; @@ -270,33 +269,45 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { Json.Integer caType, Json.String caValue } + type set of CivicAddressElement CivicAddressElementList /** * @desc * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.5.2 Type: LocationConstraints */ - type record Polygon { - Json.String type_, - Geometry geometry, - Properties properties, - Json.String this_ - } with { - variant (type_) "name as 'type'"; - variant (this_) "name as 'this'"; - } + // type record Polygon_ { + // Json.String type_, + // Geometry geometry, + // Properties properties, + // Json.String this_ + // } with { + // variant (type_) "name as 'type'"; + // variant (this_) "name as 'this'"; + // } +type record Polygon { + Coordinates coordinates +} with { + variant (coordinates) "name as 'coordinates'" +} /** * @desc * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.5.2 Type: LocationConstraints */ type record Geometry { - Json.String type_, - Coordinates coordinates + Json.String type_ optional, + Coordinates coordinates_ } with { variant (type_) "name as 'type'"; + variant (coordinates_) "name as 'coordinates'"; } - type set of Json.Number Coordinate; - type set of Coordinate Coordinates; + + + +type record length(2) of Json.Number Position; +type set of Position LinearRing; +type set of LinearRing Coordinates; + /** * @desc diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn index 2f0fcf62c4af8c81541f8313d633cfb62ca88f9f..b1642532b81aa53a25d6289458c4248c312d6f16 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn @@ -36,20 +36,23 @@ module TrafficManagementAPI_Functions { var HttpMessage v_response; p_bw_allocation_id := ""; + f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_ME_BWM_URI, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_ME_BWM_URI, + v_headers, + m_http_message_body_json( m_body_json_bw_info( m_bw_info( p_app_instance_id, - APPLICATION_SPECIFIC_BW_ALLOCATION, // Request type - "1024", // FixedAllocation - Downlink // AllocationDirection - )))))); + APPLICATION_SPECIFIC_BW_ALLOCATION, + "1024", + Downlink, + PX_APP_NAME, + PX_APP_ALLOCATION_ID + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -59,11 +62,9 @@ module TrafficManagementAPI_Functions { mw_body_json_bw_info( mw_bw_info( p_app_instance_id - )))))) -> value v_response { - var charstring_list v_header_location; - + )))))) -> value v_response { + // var charstring_list v_header_location; tc_ac.stop; - log("f_create_bw_allocation_resource: BwInfo resource created: ", v_response); f_get_header(valueof(v_response.response.header), "Location", v_header_location); p_bw_allocation_id := regexp( @@ -124,10 +125,11 @@ module TrafficManagementAPI_Functions { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - { m_filter_criteria } + {m_filter_criteria(-,-)} )))))); tc_ac.start; alt { @@ -137,10 +139,15 @@ module TrafficManagementAPI_Functions { mw_http_message_body_json( mw_body_json_bw_chg_event_subscription( mw_bw_chg_event_subscription( + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - { m_filter_criteria } + { + mw_filter_criteria( + PX_APP_INSTANCE_ID + ) + } )))))) -> value v_response { tc_ac.stop; @@ -153,7 +160,7 @@ module TrafficManagementAPI_Functions { "?+" & PX_ME_BWM_SUB_URI & "/(?*)", 0 ); - p_bw_chg_event_subscription := v_response.response.body.json_body.bwChgEventSubscription; + p_bw_chg_event_subscription := v_response.response.body.json_body.bwchgeventsubscription; log("f_create_bw_chg_event_subscription: INFO: IUT successfully responds to the subscription: ", p_bw_chg_event_subscription); log("f_create_bw_chg_event_subscription: INFO: p_subscription_id: ", p_subscription_id); } @@ -212,9 +219,11 @@ module TrafficManagementAPI_Functions { PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd, // QoS - LowCost, // MtsMode - Downlink // TrafficDirection - )))))); + QoS, // MtsMode + Downlink, // TrafficDirection + -, + PX_APP_NAME + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -235,6 +244,8 @@ module TrafficManagementAPI_Functions { p_mts_session_id := v_mts_session_info_id[0]; p_mts_session_info := v_response.response.body.json_body.mtsSessionInfo; } + p_mts_session_info := v_response.response.body.json_body.mtsSessionInfo; + log("f_create_mts_session_info_resource: BwInfo resource created: ", p_mts_session_info); } [] tc_ac.timeout { log("f_create_mts_session_info_resource: Expected message not received"); diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn index 3abc8a695b2efe8e6cf536cc9577871ecb8225bf..442f5e39c57bb1327dff2c3d11b626f94cd638cb 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn @@ -8,16 +8,18 @@ module TrafficManagementAPI_Pixits { // LibMec/TrafficManagementAPI import from TrafficManagementAPI_TypesAndValues all; - // LibMec/LocationAPI - import from LocationAPI_TypesAndValues all; - modulepar Json.String PX_APP_INSTANCE_ID := "appInst01"; + modulepar Json.String PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b"; modulepar Json.String PX_APP_INSTANCE_ID_2 := "appInst02"; - modulepar Json.String PX_APP_ALLOCATION_ID := "appAllocationId01"; + modulepar Json.String PX_APP_ALLOCATION_ID := "1"; modulepar Json.String PX_APP_NAME := "appName01"; + + modulepar Json.String PX_SESSION_IPv4 := "10.10.10.10"; + + modulepar Json.String PX_SESSION_PORT := "1010"; modulepar Json.String PX_UNKNOWN_APP_INSTANCE_ID := "appInst99"; @@ -26,10 +28,10 @@ module TrafficManagementAPI_Pixits { modulepar Json.String PX_UNKNOWN_APP_ALLOCATION_ID := "appAllocationId99"; modulepar Json.String PX_UNKNOWN_BW_ALLOCATION_ID := "bwAllocationId99"; - - modulepar ResourceURL PX_RESOURCE_URL := "http://example.com/exampleAPI/location/v2/users?address:acr:192.0.0.1"; - modulepar Json.String PX_BW_Subcription_Type := "BwChgEventSubscription"; + modulepar Json.String PX_BW_SUBSCRIPTION_TYPE := "BwChgEventSubscription"; + + modulepar Json.String PX_BW_NOTIFICATION_TYPE := "BwChgEventNotification"; modulepar Json.String PX_BW_EVENT_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn index b63d19772e9052c386b99c8b3ae7713975640480..4aa25b60d49d321a01404f3a82a06e05e92fc8da 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn @@ -14,7 +14,7 @@ module TrafficManagementAPI_Templates { import from TrafficManagementAPI_Pixits all; template (omit) BwInfo m_bw_info( - in AppInsId p_appInsId := PX_APP_INSTANCE_ID, + in AppInsId p_appInsId, in BwRequestType p_requestType, in FixedAllocation p_fixedAllocation, in AllocationDirection p_allocationDirection, @@ -120,89 +120,101 @@ module TrafficManagementAPI_Templates { } // End of template mw_session_filter template (omit) BwChgEventSubscription m_bw_chg_event_subscription( - in template (omit) Json.AnyURI p_callbackReference, - in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, - in template (omit) Links p_links := omit, - in template (value) FilterCriteria p_filterCriteria - ) := { - subscriptionType := "BwChgEventSubscription", - callbackReference := p_callbackReference, - websockNotifConfig := p_websockNotifConfig, - links := p_links, - filterCriteria := p_filterCriteria - } // End of template m_bw_chg_event_subscription + in Json.String p_subscription_type, + in template (omit) Json.AnyURI p_callbackReference := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) Links p_links := omit, + in template (omit) FilterCriteria p_filtercriteria := omit + ) := { + subscriptionType := p_subscription_type, + callbackReference := p_callbackReference, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + filterCriteria := p_filtercriteria + } + + template (present) Links m_links( + template (present) LinkType p_self := ? + ) := { + self_ := p_self + } // End of template m_links template (omit) FilterCriteria_ m_filter_criteria( - in AppInsId p_appInsId := PX_APP_INSTANCE_ID, - in template (omit) Json.String p_ueIp := omit - ) := { + in AppInsId p_appInsId := PX_APP_INSTANCE_ID, + in template (omit) Json.String p_ueIp := omit + ) := { appInsId := p_appInsId, ueIp := p_ueIp } // End of template m_filter_criteria template (present) BwChgEventSubscription mw_bw_chg_event_subscription( - template (present) Json.AnyURI p_callbackReference := ?, - template WebsockNotifConfig p_websockNotifConfig := *, - template Links p_links := *, - template (present) FilterCriteria p_filterCriteria := ? - ) := { - subscriptionType := "BwChgEventSubscription", + template (present) Json.String p_subscriptionType := ?, + template (present) Json.AnyURI p_callbackReference := ?, + template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + template Links p_links := *, + template (present) FilterCriteria p_filtercriteria := ? + ) := { + subscriptionType := p_subscriptionType, callbackReference := p_callbackReference, websockNotifConfig := p_websockNotifConfig, links := p_links, - filterCriteria := p_filterCriteria + filterCriteria := p_filtercriteria } + template (present) SubscriptionLinkList mw_subscription_link( + template (present) SubscriptionLink_List p_links := ? + ) := { + links := p_links + } // End of template mw_subscription_link_list - template (present) SubscriptionLinkList mw_subscription_link_list( - template (present) Links p_links := ?, - template Subscriptions p_subscription := * + template (present) SubscriptionLink_List mw_subscription_link_list( + template LinkType p_links := *, + template (present) Subscriptions p_subscription := ? ) := { - links := p_links, - subscription := p_subscription + self_ := p_links, + subscriptions := p_subscription } // End of template mw_subscription_link_list template (present) Links mw_links( - template (value) LinkType p_self - ) :={ + template (present) LinkType p_self := ? + ) := { self_ := p_self - } // End of template m_links + } // End of template mw_links template (present) Subscription mw_subscription( template (present) Json.AnyURI p_href := ?, template (present) Json.String p_subscriptionType := ? - ) := { + ) := { href := p_href, subscriptionType := p_subscriptionType } // End of template mw_subscription - - template (present) FilterCriteria_ mw_filter_criteria( - template Json.String p_appInsId := *, - template Json.String p_ueIp := * - ) := { + template Json.String p_appInsId := *, + template (omit) Json.String p_ueIp := omit + ) := { appInsId := p_appInsId, ueIp := p_ueIp } // End of template m_flowfilterW - template (present) BwChgEventNotification mw_bw_chg_event_notificatipn( - template TimeStamp p_timeStamp := ?, - template DataVolDispersion p_dataVolDispersion := *, - template Links p_links := ? - ) := { - notificationType := "BwChgEventNotification", - timeStamp := p_timeStamp, + template (present) BwChgEventNotification mw_bw_chg_event_notification( + template (present) Json.String p_notificationType := ?, + template TimeStamp p_timeStamp := *, + template (present) DataVolDispersion p_dataVolDispersion := ?, + template Links p_links := ? + ) := { + notificationType := p_notificationType, + timeStamp := p_timeStamp, dataVolDispersion := p_dataVolDispersion, - links := p_links + links := p_links } // End of template mw_bw_chg_event_notificatipn template (present) DataVolDispersion_ mw_data_vol_dispersion( - template (present) Json.UInteger p_dataVol := ?, - template (present) Json.String p_appInsId := ?, - template (present) Json.String p_ueIp := ? - ) := { - dataVol := p_dataVol, + template (present) UInt32 p_dataVol, + template (present) Json.String p_appInsId, + template Json.String p_ueIp := * + ) := { + dataVol := p_dataVol, appInsId := p_appInsId, ueIp := p_ueIp } // End of template mw_data_vol_dispersion @@ -252,7 +264,7 @@ module TrafficManagementAPI_Templates { template MtsSessionInfo mw_mts_session_info( template (present) AppInsId p_appInsId := ?, template (present) MtsRequestType p_requestType := ?, - template (present) QosD p_qosD := ?, + template QosD p_qosD := *, template (present) MtsMode p_mtsMode := ?, template (present) TrafficDirection p_trafficDirection := ?, template SessionId p_sessionId := *, @@ -273,7 +285,7 @@ module TrafficManagementAPI_Templates { template (omit) FlowFilterItem m_flow_filter( in template (value) SourceIp p_sourceIp, - in template (value) SourcePort p_sourcePort, + in template (value) Json.UInteger p_sourcePort, in template (omit) DstAddress p_dstIp := omit, in template (omit) DstPort p_dstPort := omit, in template (omit) Protocol p_protocol := omit, @@ -291,7 +303,7 @@ module TrafficManagementAPI_Templates { template FlowFilterItem mw_flow_filter( template (present) SourceIp p_sourceIp := ?, - template (present) SourcePort p_sourcePort := ?, + template (present) Json.UInteger p_sourcePort := ?, template DstAddress p_dstIp := *, template DstPort p_dstPort := *, template Protocol p_protocol := *, diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn index 0a1be0903a1ec9efa6e7d09fa5b0d2dee5686307..8819943fd46c4dc2500dea54acd1a794e40dd7e8 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn @@ -3,6 +3,9 @@ module TrafficManagementAPI_TypesAndValues { // JSON import from Json all; + // LibCommon + import from LibCommon_BasicTypesAndValues all; + // LibMec import from LibMec_TypesAndValues all; @@ -28,7 +31,7 @@ module TrafficManagementAPI_TypesAndValues { FixedBWPriority fixedBWPriority optional, FixedAllocation fixedAllocation, AllocationDirection allocationDirection - } + } type set of BwInfo BwInfoList; /** @@ -139,6 +142,7 @@ module TrafficManagementAPI_TypesAndValues { * @desc The direction of the requested BW allocation * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ + type enumerated AllocationDirection { Downlink, Uplink, @@ -155,7 +159,7 @@ module TrafficManagementAPI_TypesAndValues { * @desc Source port identity of session * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ - type Json.UInteger SourcePort; + type Json.String SourcePort; /** * @desc Destination address identity of session (including range) @@ -212,8 +216,8 @@ module TrafficManagementAPI_TypesAndValues { * @see ETSI GS MEC 015 V3.1.1 (2024-04) Table 7.3.2: Attributes of the BwChgEventSubscription */ type record FilterCriteria_ { - Json.String appInsId optional, - Json.String ueIp optional + AppInsId appInsId optional, + Json.String ueIp optional } type set of FilterCriteria_ FilterCriteria @@ -224,12 +228,25 @@ module TrafficManagementAPI_TypesAndValues { * @see Table 7.3.3-1: Attributes of the SubscriptionLinkList */ type record SubscriptionLinkList { - Links links optional, // URI of this resource - Subscriptions subscription optional // List of subscriptions + SubscriptionLink_List links optional // URI of this resource } with { variant (links) "name as '_links'"; } + /** + * @desc List of links related to currently existing subscriptions for the service consumer + * @member links List of hyperlinks related to the resource + * @member subscription + * @see Table 7.3.3-1: Attributes of the SubscriptionLinkList + */ + type record SubscriptionLink_List { + LinkType self_, + Subscriptions subscriptions optional // List of subscriptions + } with { + variant (self_) "name as 'self'"; + } + + /** * @desc Hyperlink related to the resource * @see ETSI GS MEC 015 V3.1.1 (2024-03) Table 7.3.2: Attributes of the BwChgEventSubscription @@ -256,7 +273,7 @@ module TrafficManagementAPI_TypesAndValues { * @see Table 7.3.3-1: Attributes of the SubscriptionLinkList */ type record Subscription { - Json.AnyURI href, // The URI referring to the subscription + Json.AnyURI href, // The URI referring to the subscription Json.String subscriptionType // Type of the subscription } type set of Subscription Subscriptions @@ -292,6 +309,7 @@ module TrafficManagementAPI_TypesAndValues { type set of DataVolDispersion_ DataVolDispersion + /** * @desc The information on access network connection * @member timeStamp Time stamp to indicate when the corresponding information elements are sent @@ -392,8 +410,8 @@ type set of DataVolDispersion_ DataVolDispersion AppInsId appInsId, Json.String appName optional, MtsRequestType requestType, - FlowFilter flowFilter, - QosD qosD, + FlowFilter flowFilter optional, + QosD qosD optional, MtsMode mtsMode, TrafficDirection trafficDirection } @@ -418,7 +436,7 @@ type set of DataVolDispersion_ DataVolDispersion */ type record FlowFilterItem { SourceIp sourceIp optional, - SourcePort sourcePort optional, + Json.UInteger sourcePort optional, DstAddress dstIp optional, DstPort dstPort optional, Protocol protocol optional, diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Functions.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Functions.ttcn index 7b48d6409f38817a2199c558e7ae637871718573..7795a256bba802026cb546bdff9e5d6445ab5b9b 100644 --- a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Functions.ttcn +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Functions.ttcn @@ -39,8 +39,8 @@ module UEidentityAPI_Functions { httpPort.send( m_http_request( m_http_request_get( - "/" & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(p_ue_identity_tag, "UTF-8")), - p_headers + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(p_ue_identity_tag, "UTF-8")), + p_headers ) ) ); @@ -60,7 +60,7 @@ module UEidentityAPI_Functions { for (var integer v_i := 0; v_i < lengthof(v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags); v_i := v_i + 1) { if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].ueIdentityTag == p_ue_identity_tag) { //log("Processing ", v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].ueIdentityTag); - //log("State ", v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state); + log("State ", v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state); if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state == UNREGISTERED) { v_result := 0; } else if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state == REGISTERED) { diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index 24a3c88bc39c6a7af218d5869f2e4908621d011e..7504f8c243a0c220f135f43dbe39cfd05a13945f 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -30,6 +30,12 @@ module LibMec_Pixits { // FIXME FSCOM Split this file according to the different modulepar charstring PX_ME_MTS_SESSIONS_URI := "mts/v1/mts_sessions"; + modulepar charstring PX_DEVICE_APP_LIST_URI := "dev_app/v1/app_list"; + + modulepar charstring PX_DEVICE_APP_CTX_URI := "dev_app/v1/app_contexts"; + + modulepar charstring PX_DEVICE_APP_LOC_URI := "dev_app/v1/obtain_app_loc_availability"; + modulepar charstring PX_ME_WLAN_QUERIES_URI := "wai/v2/queries"; modulepar charstring PX_ME_WLAN_URI := "wai/v2"; diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 80bef4dcd0c36736e9f0dd4151002f57e9b1e19f..9e11d8c10783f2c8b2e3279b2e7993448d7dec08 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -83,7 +83,7 @@ module LibHttp_JsonMessageBodyTypes { BwInfoList bwInfoList, BwInfo bwInfo, BwInfoDeltas bwInfoDeltas, - BwChgEventSubscription bwChgEventSubscription, + BwChgEventSubscription bwchgeventsubscription, TrafficManagementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_bw, BwChgEventNotification bwChgEventNotification, MtsCapabilityInfo mtsCapabilityInfo, diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 69f4da0b66d8c3f04487b059251ed101e51b70c9..c0025aa873ee9e0e91ddddb96d9088fe94f334e0 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -926,28 +926,34 @@ module LibHttp_JsonTemplates { } // End of template mw_body_json_bw_info_list template (value) JsonBody m_body_json_bw_chg_event_subscription( - in template (value) BwChgEventSubscription p_bwchgeventsubscription - ) := { - bwChgEventSubscription := p_bwchgeventsubscription - } // End of template m_body_json_bw_chg_event_subscription + in template (value) BwChgEventSubscription p_bwchgeventsubscription + ) := { + bwchgeventsubscription := p_bwchgeventsubscription + } // End template (present) JsonBody mw_body_json_bw_chg_event_subscription( - template (present) BwChgEventSubscription p_bwchgeventsubscription := ? - ) := { - bwChgEventSubscription := p_bwchgeventsubscription - } // End of template mw_body_json_bw_chg_event_subscription + template (present) BwChgEventSubscription p_bwchgeventsubscription := ? + ) := { + bwchgeventsubscription := p_bwchgeventsubscription + } // End + + template (present) JsonBody mw_body_json_bw_subscription_link_list( + template (present) TrafficManagementAPI_TypesAndValues.SubscriptionLinkList p_subscriptionlinklist := ? + ) := { + subscriptionLinkList_bw := p_subscriptionlinklist + } // End template (value) JsonBody m_body_json_bw_chg_event_notification( - in template (value) BwChgEventNotification p_bwChgEventNotification + in template (value) BwChgEventNotification p_bwchgeventnotification ) := { - bwChgEventNotification := p_bwChgEventNotification - } // End of template m_body_json_bw_chg_event_notification + bwChgEventNotification := p_bwchgeventnotification + } // End of template m_body_json__bw_chg_event_notification template (present) JsonBody mw_body_json_bw_chg_event_notification( - template (present) BwChgEventNotification p_bwChgEventNotification := ? - ) := { - bwChgEventNotification := p_bwChgEventNotification - } // End of template mw_body_json_bw_chg_event_notification + template (present) BwChgEventNotification p_bwchgeventnotification := ? + ) := { + bwChgEventNotification := p_bwchgeventnotification + } // End of template mw_body_json__bw_chg_event_notification template (value) JsonBody m_body_json_mts_capability_info( in template (value) MtsCapabilityInfo p_mtsCapabilityInfo