Commit 98569301 authored by YannGarcia's avatar YannGarcia

Add UEAPPCTX & UEAPPS tests

parent d8c1634b
......@@ -3,6 +3,43 @@
## Introduction
This file provides the list of the TODOs related to the STF 569.
## MEO
### UEAPPCTX
ETSI GS MEC 016 V2.1.1
https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/MEO/UEAPPCTX/SysUeAppsContext.tplan2
- TC_MEC_MEO_UEAPPCTX_001_OK <font color="color:green">To be tested</font>
- TC_MEC_MEO_UEAPPCTX_001_BR <font color="color:green">To be tested</font>
- TC_MEC_MEO_UEAPPCTX_002_OK <font color="color:green">To be tested</font>
- TC_MEC_MEO_UEAPPCTX_002_BR <font color="color:green">To be tested</font>
- TC_MEC_MEO_UEAPPCTX_002_NF <font color="color:green">To be tested</font>
- TC_MEC_MEO_UEAPPCTX_003_OK <font color="color:green">To be tested</font>
- TC_MEC_MEO_UEAPPCTX_003_NF <font color="color:green">To be tested</font>
- TC_MEC_MEO_UEAPPS_001_OK <font color="color:green">To be tested</font>
- TC_MEC_MEO_UEAPPS_001_BR <font color="color:green">To be tested</font>
- TC_MEC_MEO_UEAPPS_001_NF <font color="color:green">To be tested</font>
### UEAPPS
ETSI GS MEC 016 V2.1.1
https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/MEO/UEAPPS/SysUeApplications.tplan2
## SRV
### AMS
......
......@@ -28,6 +28,10 @@ int json_codec::encode (const LibItsHttp__JsonMessageBodyTypes::JsonBody& msg, O
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(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_appContext)) {
const UEAppInterfaceAPI__TypesAndValues::AppContext& appContext = msg.appContext();
appContext.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 {
loggers::get_instance().error("json_codec::encode: Not supported");
}
......@@ -235,6 +239,14 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
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("\"AppContext\"") != 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) {
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) {
BwManagementAPI__TypesAndValues::BwInfo bw_info;
......
......@@ -23,7 +23,7 @@ module AtsMec_AppEnablementAPI_TestCases {
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
// LibMec_AppEnablementAPI
// LibMec/AppEnablementAPI
import from AppEnablementAPI_Templates all;
import from AppEnablementAPI_Pics all;
import from AppEnablementAPI_Pixits all;
......
......@@ -21,7 +21,7 @@ module AtsMec_LocationAPI_TestCases {
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
// LibMec_LocationAPI
// LibMec/LocationAPI
import from LocationAPI_Templates all;
import from LocationAPI_Pics all;
import from LocationAPI_Pixits all;
......
......@@ -23,7 +23,7 @@ module AtsMec_RadioNodeLocationAPI_TestCases {
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
// LibMec_LocationAPI
// LibMec/LocationAPI
import from LocationAPI_TypesAndValues all;
import from LocationAPI_Templates all;
import from LocationAPI_Pics all;
......
......@@ -24,7 +24,7 @@ module AtsMec_RnisAPI_TestCases {
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
// LibMec_RnisAPI
// LibMec/RnisAPI
import from RnisAPI_TypesAndValues all;
import from RnisAPI_Templates all;
import from RnisAPI_Pics all;
......
......@@ -10,6 +10,8 @@ module AtsMec_TestControl {
import from BwManagementAPI_Pics all;
// LibMec/AppEnablementAPI
import from AppEnablementAPI_Pics all;
// LibMec/UEAppInterfaceAPI
import from UEAppInterfaceAPI_Pics all;
// LibMec
import from LibMec_Pics all;
......@@ -21,6 +23,7 @@ module AtsMec_TestControl {
import from AtsMec_RnisAPI_TestCases all;
import from AtsMec_BwManagementAPI_TestCases all;
import from AtsMec_AppEnablementAPI_TestCases all;
import from AtsMec_UEAppInterfaceAPI_TestCases all;
control {
......@@ -68,6 +71,19 @@ module AtsMec_TestControl {
execute(TC_MEC_SRV_TRAF_003_OK());
execute(TC_MEC_SRV_TRAF_001_NF());
}
if (PICS_ENABLE_UE_APP_CTX) {
execute(TC_MEC_MEO_UEAPPCTX_001_OK());
execute(TC_MEC_MEO_UEAPPCTX_001_BR());
execute(TC_MEC_MEO_UEAPPCTX_002_OK());
execute(TC_MEC_MEO_UEAPPCTX_002_BR());
execute(TC_MEC_MEO_UEAPPCTX_002_NF());
execute(TC_MEC_MEO_UEAPPCTX_003_OK());
execute(TC_MEC_MEO_UEAPPCTX_003_NF());
execute(TC_MEC_MEO_UEAPPS_001_OK());
execute(TC_MEC_MEO_UEAPPS_001_BR());
execute(TC_MEC_MEO_UEAPPS_001_NF());
}
}
if (PICS_RNIS) {
......
This diff is collapsed.
......@@ -21,7 +21,7 @@ module AtsMec_UEidentityAPI_TestCases {
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
// LibMec_UEidentityAPI
// LibMec/UEidentityAPI
import from UEidentityAPI_Templates all;
import from UEidentityAPI_Pics all;
import from UEidentityAPI_Pixits all;
......
module UEAppInterfaceAPI_Functions {
// LibHttp
import from LibItsHttp_TypesAndValues all;
import from LibItsHttp_Functions all;
import from LibItsHttp_Templates all;
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
// LibMec/UEAppInterfaceAPI
import from UEAppInterfaceAPI_Templates all;
import from UEAppInterfaceAPI_Pixits all;
// LibMec
import from LibMec_Pics all;
import from LibMec_Pixits all;
group create_ue {
function f_create_ue_app_ctx() runs on HttpComponent system HttpTestAdapter return integer {
// Local variables
var HeaderLines v_headers;
var HttpMessage v_response;
var integer v_result := -1;
// Send createion request
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_UE_APP_CTX_URI,
v_headers,
m_http_message_body_json(
m_body_json_app_context(
m_app_context(
PX_CONTEXT_ID,
PX_ASSOCIATE_UE_APP_ID,
m_required_app_info(
PX_APP_NAME,
PX_APP_PROVIDER,
PX_REFERENCE_URL
)))))));
// Wait for the response
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_201_created(
mw_http_message_body_json(
mw_body_json_app_context(
mw_app_context(
-,
-,
mw_required_app_info(
PX_APP_NAME
))))))) -> value v_response {
tc_ac.stop;
v_result := 0;
log("*** " & testcasename() & ": INFO: IUT successfully responds with a AppContext ***");
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
}
} // End of 'alt' statement
return v_result;
} // End of function f_create_ue_app_ctx
} // End of group create_ue
group delete_ue {
function f_delete_ue_app_ctx() runs on HttpComponent system HttpTestAdapter return integer {
// Local variables
var HeaderLines v_headers;
var integer v_result := -1;
// Send createion request
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
"/" & PICS_ROOT_API & PX_UE_APP_CTX_URI,
v_headers
)));
// Wait for the response
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_204_no_content
)) {
tc_ac.stop;
v_result := 0;
log("*** " & testcasename() & ": INFO: IUT successfully responds with a AppContext ***");
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
}
} // End of 'alt' statement
return v_result;
} // End of function f_delete_ue_app_ctx
} // End of group delete_ue
} // End of module UEAppInterfaceAPI_Functions
module UEAppInterfaceAPI_Pics {
modulepar boolean PICS_ENABLE_UE_APP_CTX := false;
} // End of UEAppInterfaceAPI_Pics
module UEAppInterfaceAPI_Pixits {
// LibMec/EUAppInterfaceAPI
import from UEAppInterfaceAPI_TypesAndValues all;
modulepar AppName PX_APP_NAME := "MyWornderfulApp";
modulepar AppName PX_NON_EXISTENT_APP_NAME := "unknownName";
modulepar ContextId PX_CONTEXT_ID := "ueIdAppCtx01";
modulepar ContextId PX_NON_EXISTENT_CONTEXT_ID := "ueIdAppCtx99";
modulepar AssociateUeAppId PX_ASSOCIATE_UE_APP_ID := "associateUeAppId";
modulepar AppProvider PX_APP_PROVIDER := "ACME & Co";
modulepar ReferenceURL PX_REFERENCE_URL := "referenceUrl";
modulepar CallbackReference PX_CALLBACK_REF := "http://www.acme.com/MyWonderfulApp/v1";
} // End of UEAppInterfaceAPI_Pixits
......@@ -43,15 +43,16 @@ module UEAppInterfaceAPI_Templates {
vendorSpecificExt := p_vendor_specific_ext
} // End of template mw_application_list
template (value) AppContext m_app_context(
in template (value) ContextId p_context_id,
in template (value) AssociateUeAppId p_associate_ue_app_id,
in template (value) RequiredAppInfo p_app_info
) := {
template (omit) AppContext m_app_context(
in template (value) ContextId p_context_id,
in template (value) AssociateUeAppId p_associate_ue_app_id,
in template (value) RequiredAppInfo p_app_info,
in template (omit) CallbackReference p_callbackReference := omit
) := {
contextId := p_context_id,
associateUeAppId := p_associate_ue_app_id,
appInfo := p_app_info,
callbackReference := omit
callbackReference := p_callbackReference
} // End of template m_app_context
template (present) AppContext mw_app_context(
......
......@@ -122,13 +122,14 @@ module LibMec_Functions {
*/
function f_check_headers(
in HeaderLines p_headers,
in charstring p_header_name := "Location",
in template (present) charstring p_value := ?
) return boolean {
// Local variables
var boolean v_header_matched := false;
for (var integer v_idx := 0; v_idx < lengthof(p_headers); v_idx := v_idx + 1) {
if (p_headers[v_idx].header_name == "Location") {
if (p_headers[v_idx].header_name == p_header_name) {
if (match(p_headers[v_idx].header_value[0], p_value) == true) {
v_header_matched := true;
} // else, nothing to do
......
......@@ -23,7 +23,7 @@ module LibMec_Pixits {
modulepar charstring PX_RNIS_QUERIES_URI := "/rni/v2/queries";
modulepar charstring PX_ME_BWM_URI := "/bwm/v2/bw_allocations";
modulepar charstring PX_ME_APP_AMS_URI := "/amsi/v1/appMobilityServices"
modulepar charstring PX_ME_APP_AMS_SUBS := "/amsi/v1/subscriptions"
......@@ -31,7 +31,11 @@ module LibMec_Pixits {
modulepar charstring PX_MEO_GRANT_URI := "/granting/v1/grants"
modulepar charstring PX_MEO_PKGM_URI := "/apmi/v1/app_packages"
modulepar charstring PX_MEO_PKGM_SUBS := "/apmi/v1/subscriptions"
modulepar charstring PX_UE_APP_CTX_URI := "/mx2/v2/app_contexts";
modulepar charstring PX_UE_APPS_URI := "/mx2/v2/app_list";
} // End of module LibMec_Pixits
......@@ -12,6 +12,8 @@ module LibItsHttp_JsonMessageBodyTypes {
import from Ams_TypesAndValues all;
// LibMec/AppEnablementAPI
import from AppEnablementAPI_TypesAndValues all;
// LibMec/UEAppInterfaceAPI
import from UEAppInterfaceAPI_TypesAndValues all;
/**
* This file volontary contains a trivial declaration of the type JsonBody.
......@@ -21,39 +23,42 @@ module LibItsHttp_JsonMessageBodyTypes {
type union JsonBody {
// TODO Add here your custom variants
UserInfo userInfo,
UserList userList,
ZoneInfo zoneInfo,
AccessPointList accessPointList,
UserTrackingSubscription userTrackingSubscription,
ZonalTrafficSubscription zonalTrafficSubscription,
UEidentityAPI_TypesAndValues.ProblemDetails problemDetails_ue_identity,
UeIdentityTagInfo ueIdentityTagInfo,
SubscriptionLinkList subscriptionLinkList,
CellChangeSubscription cellChangeSubscription,
CellChangeSubscriptionPost cellChangeSubscriptionPost,
RabInfo rabInfo,
PlmnInfo plmnInfo,
S1BearerInfo s1BearerInfo,
RabEstSubscription rabEstSubscription,
RabModSubscription rabModSubscription,
RabRelSubscription rabRelSubscription,
MeasRepUeSubscription measRepUeSubscription,
MeasTaSubscription measTaSubscription,
CaReConfSubscription caReConfSubscription,
S1BearerSubscription s1BearerSubscription,
RnisAPI_TypesAndValues.ProblemDetails problemDetails_rnis,
BwInfo bwInfo,
BwManagementAPI_TypesAndValues.ProblemDetails problemDetails_bw_management,
TransportInfoList transportInfoList,
TrafficRuleList trafficRuleList,
TrafficRule trafficRule,
AppEnablementAPI_TypesAndValues.ProblemDetails problemDetails_svc_mgmt,
AppMobilityServiceInfo appMobilityServiceInfo,
Ams_TypesAndValues.ProblemDetails problemDetails_ams,
Ams_TypesAndValues.RegistrationRequest registrationRequest_ams,
Ams_TypesAndValues.AmsSubscriptionLinkLists subscriptionLinkList_ams,
universal charstring raw
UserInfo userInfo,
UserList userList,
ZoneInfo zoneInfo,
AccessPointList accessPointList,
UserTrackingSubscription userTrackingSubscription,
ZonalTrafficSubscription zonalTrafficSubscription,
UEidentityAPI_TypesAndValues.ProblemDetails problemDetails_ue_identity,
UeIdentityTagInfo ueIdentityTagInfo,
SubscriptionLinkList subscriptionLinkList,
CellChangeSubscription cellChangeSubscription,
CellChangeSubscriptionPost cellChangeSubscriptionPost,
RabInfo rabInfo,
PlmnInfo plmnInfo,
S1BearerInfo s1BearerInfo,
RabEstSubscription rabEstSubscription,
RabModSubscription rabModSubscription,
RabRelSubscription rabRelSubscription,
MeasRepUeSubscription measRepUeSubscription,
MeasTaSubscription measTaSubscription,
CaReConfSubscription caReConfSubscription,
S1BearerSubscription s1BearerSubscription,
RnisAPI_TypesAndValues.ProblemDetails problemDetails_rnis,
BwInfo bwInfo,
BwManagementAPI_TypesAndValues.ProblemDetails problemDetails_bw_management,
TransportInfoList transportInfoList,
TrafficRuleList trafficRuleList,
TrafficRule trafficRule,
AppEnablementAPI_TypesAndValues.ProblemDetails problemDetails_svc_mgmt,
AppContext appContext,
AppInfo appInfo,
UEAppInterfaceAPI_TypesAndValues.ProblemDetails problemDetails_ue_app_ctxt,
AppMobilityServiceInfo appMobilityServiceInfo,
Ams_TypesAndValues.ProblemDetails problemDetails_ams,
Ams_TypesAndValues.RegistrationRequest registrationRequest_ams,
Ams_TypesAndValues.AmsSubscriptionLinkLists subscriptionLinkList_ams,
universal charstring raw
} with {
variant ""
}
......
......@@ -25,9 +25,12 @@ module LibItsHttp_JsonTemplates {
// LibMec/AppEnablementAPI
import from AppEnablementAPI_TypesAndValues all;
import from AppEnablementAPI_Templates all;
// LibMec/Ams
import from Ams_TypesAndValues all;
import from Ams_Templates all;
// LibMec/AppEnablementAPI
import from UEAppInterfaceAPI_TypesAndValues all;
import from UEAppInterfaceAPI_Templates all;
// LibMec/Ams
import from Ams_TypesAndValues all;
import from Ams_Templates all;
// TODO Add here your custom RFCs import
......@@ -438,4 +441,44 @@ group ams_api {
} // End of group svc_mgmt
group ue_app_ctx {
template (value) JsonBody m_body_json_app_context(
in template (value) AppContext p_appContext
) := {
appContext := p_appContext
} // End of template m_body_json_app_context
template (present) JsonBody mw_body_json_app_context(
template (present) AppContext p_appContext := ?
) := {
appContext := p_appContext
} // End of template mw_body_json_app_context
template (value) JsonBody m_body_json_app_info(
in template (value) AppInfo p_appInfo
) := {
appInfo := p_appInfo
} // End of template m_body_json_app_info
template (present) JsonBody mw_body_json_app_info(
template (present) AppInfo p_appInfo := ?
) := {
appInfo := p_appInfo
} // End of template mw_body_json_app_info
template (value) JsonBody m_body_json_ue_app_ctx_problem_details(
in template (value) UEAppInterfaceAPI_TypesAndValues.ProblemDetails p_problemDetails
) := {
problemDetails_ue_app_ctxt := p_problemDetails
} // End of template m_body_json_ue_app_ctx_problem_details
template (present) JsonBody mw_body_json_ue_app_ctx_problem_details(
template (present) UEAppInterfaceAPI_TypesAndValues.ProblemDetails p_problemDetails := ?
) := {
problemDetails_ue_app_ctxt := p_problemDetails
} // End of template mw_body_json_ue_app_ctx_problem_details
} // End of group ue_app_ctx
} // End of module LibItsHttp_JsonTemplates
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment