Commit e1ac5976 authored by Yann Garcia's avatar Yann Garcia
Browse files

Add RnisAPI tests

parent 0b3144c7
/**
* @author ETSI / STF569
* @version $URL:$
* $ID:$
* @desc This module provides the MEC test cases.
* @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.
* @see ETSI GS MEC 003, Draft ETSI GS MEC 013 V2.0.3 (2018-10)
*/
module AtsMec_RnisAPI_TestCases {
// Libcommon
import from LibCommon_Time all;
import from LibCommon_VerdictControl all;
import from LibCommon_Sync all;
// LibHttp
import from LibItsHttp_TypesAndValues all;
import from LibItsHttp_Functions all;
import from LibItsHttp_Templates all;
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
// LibMec_RnisAPI
import from RnisAPI_TypesAndValues all;
import from RnisAPI_Templates all;
import from RnisAPI_Pics all;
import from RnisAPI_Pixits all;
// LibMec
import from LibMec_Functions all;
import from LibMec_Pics all;
import from LibMec_Pixits all;
group me_app_role {
/**
* @desc Check that the RNIS service sends all RNIS subscriptions when requested
* @see Check that the RNIS service sends all RNIS subscriptions when requested
*/
testcase TC_MEC025_RNI_SUBSCRIPTION_05() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
var HttpMessage v_response;
// Test control
if (not(PICS_RNIS_IUT) or not(PICS_RNIS_ALL_SUBSCRIPTIONS)) {
log("*** " & testcasename() & ": PICS_RNIS_IUT and PICS_RNIS_ALL_SUBSCRIPTIONS 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_get(
PICS_RNIS_SUBSCRITIONS_URI & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")),
v_headers
)
)
);
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(
mw_body_json_(
mw_cell_change_subscription
))))) -> value v_response {
log("*** " & testcasename() & ": PASS: IUT successfully responds with a cell subscription ***");
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_MEC025_RNI_SUBSCRIPTION_05
} // End of group me_app_role
} // End of module AtsMec_RnisAPI_TestCases
module AtsMec_TestControl {
// LibMec_LocationAPI
// LibMec/LocationAPI
import from LocationAPI_Pics all;
// LibMec_UEidentityAPI
// LibMec/UEidentityAPI
import from UEidentityAPI_Pics all;
// LibMec/RnisAPI
import from RnisAPI_Pics all;
// LibMec
import from LibMec_Pics all;
......@@ -16,7 +18,7 @@ module AtsMec_TestControl {
control {
if (PICS_ME_APP_IUT) {
if (PICS_ME_PLAT_IUT) {
if (PICS_LOCATION_API_SUPPORTED) {
execute(TC_MEC_PLAT_MP1_LOC_BV_001());
}
......@@ -29,6 +31,12 @@ module AtsMec_TestControl {
execute(TC_MEC_PLAT_MP1_INF_BV_001());
}
}
if (PICS_RNIS_IUT) {
if (PICS_RNIS_ALL_SUBSCRIPTIONS) {
execute(TC_MEC025_RNIS_SUBSCRIPTION_005());
}
}
}
} // End of module AtsMec_TestControl
module RnisAPI_Pics {
/**
* @desc Does the IUT support all subscriptions?
*/
modulepar boolean PICS_RNIS_ALL_SUBSCRIPTIONS := true;
modulepar charstring PICS_RNIS_SUBSCRITIONS_URI := "/rni/v2/subscriptions";
} // End of module RnisAPI_Pics
module RnisAPI_TypesAndValues {
// LibCommon
import from LibCommon_BasicTypesAndValues all;
// LibMec/RnisAPI
import from module RnisAPI_TypesAndValues all;
group subscriptions {
group cell {
template (omit) CellChangeSubscription m_cell_change_subscription(
in template (value) CallbackReference p_callbackReference,
in template (value) Link p_links,
in template (value) FilterCriteriaAssocHo p_filterCriteria,
in template (omit) TimeStamp p_expiryDeadline := omit
) := {
callbackReference := p_callbackReference,
_links := p_links,
filterCriteria := p_filterCriteria,
expiryDeadline := p_expiryDeadline
} // End of template m_cell_change_subscription
template CellChangeSubscription mw_cell_change_subscription(
template (present) CallbackReference p_callbackReference := ?,
template (present) Link p_links := ?,
template (present) FilterCriteriaAssocHo p_filterCriteria := ?,
template TimeStamp p_expiryDeadline := *
) := {
callbackReference := p_callbackReference,
_links := p_links,
filterCriteria := p_filterCriteria,
expiryDeadline := p_expiryDeadline
} // End of template mw_cell_change_subscription
} // End of group cell
} // End of group subscriptions
} // End of module RnisAPI_TypesAndValues
......@@ -471,6 +471,8 @@ module RnisAPI_TypesAndValues {
*/
type record Link {
LinkType self_,
} with {
variant (self_) "name as 'self'";
}
/**
......@@ -484,7 +486,7 @@ module RnisAPI_TypesAndValues {
* @member
*/
type record Subscription {
LinkTypehref,
LinkType href,
SubscriptionType subscriptionType
}
......@@ -569,6 +571,8 @@ module RnisAPI_TypesAndValues {
Plmn plmn,
CellId cellId,
Trigger trigger_
} with {
variant (trigger_) "name as 'trigger'";
}
/**
......@@ -584,6 +588,8 @@ module RnisAPI_TypesAndValues {
Plmn plmn,
CellId cellId,
Trigger trigger_
} with {
variant (trigger_) "name as 'trigger'";
}
/**
......
......@@ -2,8 +2,15 @@ module LibMec_Pics {
/**
* @desc Does the IUT act as Edge Mobile Application?
* TODO Renane into PIC_MEC_PLAT
*/
modulepar boolean PICS_ME_APP_IUT := false;
modulepar boolean PICS_ME_PLAT_IUT := false;
/**
* @desc Does the IUT act as Edge Mobile Application?
* TODO Renane into PIC_RNSI
*/
modulepar boolean PICS_RNIS_IUT := false;
modulepar charstring PICS_ME_APP_Q_ZONE_ID_URI := "/exampleAPI/location/v2/zones/";
......
......@@ -13,12 +13,13 @@ module LibItsHttp_JsonMessageBodyTypes {
type union JsonBody {
// TODO Add here your custom variants
UserInfo userInfo,
UserList userList,
ZoneInfo zoneInfo,
ProblemDetails problemDetails,
UeIdentityTagInfo ueIdentityTagInfo,
universal charstring raw
UserInfo userInfo,
UserList userList,
ZoneInfo zoneInfo,
ProblemDetails problemDetails,
UeIdentityTagInfo ueIdentityTagInfo,
CellChangeSubscription cellChangeSubscription,
universal charstring raw
} with {
variant ""
}
......
......@@ -81,13 +81,13 @@ module LibItsHttp_JsonTemplates {
in template (value) UeIdentityTagInfo p_ueIdentityTagInfo
) := {
ueIdentityTagInfo := p_ueIdentityTagInfo
} // End of template m_body_json_ue_identity_tags
} // End of template m_body_json_ue_identity_tag_info
template (present) JsonBody mw_body_json_ue_identity_tag_info(
template (present) UeIdentityTagInfo p_ueIdentityTagInfo := ?
) := {
ueIdentityTagInfo := p_ueIdentityTagInfo
} // End of template mw_body_json_ue_identity_tags
} // End of template mw_body_json_ue_identity_tag_info
template (value) JsonBody m_body_json_ue_problem_details(
in template (value) ProblemDetails p_problemDetails
......@@ -102,5 +102,21 @@ module LibItsHttp_JsonTemplates {
} // End of template mw_body_json_ue_problem_details
} // End of group ue_identity_api
group rnis_subscriptions {
template (value) JsonBody m_body_json_cell_change_subscription(
in template (value) CellChangeSubscription p_cellChangeSubscription
) := {
cellChangeSubscription := p_cellChangeSubscription
} // End of template m_body_json_cell_change_subscription
template (present) JsonBody mw_body_json_cell_change_subscription(
template (present) CellChangeSubscription p_cellChangeSubscription := ?
) := {
cellChangeSubscription := p_cellChangeSubscription
} // End of template mw_body_json_cell_change_subscription
} // End of group rnis_subscriptions
} // 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