Commit ac38f7c1 authored by Yann Garcia's avatar Yann Garcia

Review current TCs

parent ce629822
......@@ -54,7 +54,12 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
// ..and create the decoding buffer
TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
if (it->second.find("\"userInfo\"") != std::string::npos) {
if (it->second.find("\"userList\"") != std::string::npos) { // Be carefull to the order
// TODO To be refined, find("\"userList\"") is not optimal
LocationAPI__TypesAndValues::UserList user_list;
user_list.decode(LocationAPI__TypesAndValues::UserList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.userList() = user_list;
} else if (it->second.find("\"userInfo\"") != std::string::npos) {
LocationAPI__TypesAndValues::UserInfo user_info;
user_info.decode(LocationAPI__TypesAndValues::UserInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.userInfo() = user_info;
......
......@@ -7,12 +7,14 @@ LibCommon_Time.PX_TAC := 30.0
LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0;
LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0;
LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.0.5"
LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.1.140"
#LibItsHttp_Pics.PICS_HEADER_HOST := "172.28.4.87"
LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json"
LibMec_Pics.PICS_ME_APP_IUT := true
LibMec_Pics.PICS_PLAT_IUT := true
LibMec_Pics.PICS_RNIS_IUT := false
[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).
......@@ -29,7 +31,7 @@ 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.0.5,use_ssl=0)"
system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.140,port=8081,use_ssl=0)"
[DEFINE]
# In this section you can create macro definitions,
......
......@@ -37,8 +37,9 @@ module AtsMec_LocationAPI_TestCases {
group me_app_role {
/**
* @desc Check that the IUT responds with a list for the location of User Equipments when queried by a MEC Application
* @desc Check that the IUT responds with a list for the location of User Equipments when queried by a MEC Application
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeLocation/PlatUeLocation.tplan2
* @see https://forge.etsi.org/gitlab/mec/gs013-location-api/blob/master/LocationAPI.yaml#/definitions/UserInfo
*/
testcase TC_MEC_PLAT_MP1_LOC_BV_001() runs on HttpComponent system HttpTestAdapter {
// Local variables
......@@ -62,7 +63,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
PICS_ME_APP_Q_ZONE_ID_URI & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")),
PICS_ME_APP_Q_USERS_LIST_URI & "?zoneId=" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")),
v_headers
)
)
......@@ -76,9 +77,14 @@ module AtsMec_LocationAPI_TestCases {
mw_http_response(
mw_http_response_ok(
mw_http_message_body_json(
mw_body_json_user_info(
mw_user_info(-, -, PX_ZONE_ID)
))))) -> value v_response {
mw_body_json_user_list(
mw_user_list(
{
*,
mw_user_info(PX_USER, PX_ACCESS_POINT_ID, PX_ZONE_ID, PX_RESOURCE_URL),
*
}
)))))) -> value v_response {
log("*** " & testcasename() & ": PASS: IUT successfully responds with a ZoneId ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
......
......@@ -40,7 +40,7 @@ module AtsMec_RnisAPI_TestCases {
* @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_005() runs on HttpComponent system HttpTestAdapter {
testcase TC_MEC025_RNIS_SUBSCRIPTION_005() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
var HttpMessage v_response;
......@@ -90,7 +90,7 @@ module AtsMec_RnisAPI_TestCases {
// Postamble
f_cf_01_http_down();
} // End of testcase TC_MEC025_RNI_SUBSCRIPTION_005
} // End of testcase TC_MEC025_RNIS_SUBSCRIPTION_005
} // End of group me_app_role
......
......@@ -25,7 +25,7 @@ module AtsMec_TestControl {
if (PICS_UE_IDENTITY_API_SUPPORTED) {
execute(TC_MEC_PLAT_MP1_UETAG_BV_001());
execute(TC_MEC_PLAT_MP1_UETAG_BV_002());
execute(TC_MEC_PLAT_MP1_UETAG_BV_003());
//execute(TC_MEC_PLAT_MP1_UETAG_BV_003());
}
if (PICS_LOCATION_API_SUPPORTED) {
execute(TC_MEC_PLAT_MP1_INF_BV_001());
......
/**
* @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_LocationAPI_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_LocationAPI
import from LocationAPI_TypesAndValues all;
import from LocationAPI_Templates all;
import from LocationAPI_Pics all;
import from LocationAPI_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 IUT acknowledges the subscription by a MEC Application to the notifications on UE distance
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeDistance/PlatUeDistance.tplan2
*/
testcase TC_MEC_PLAT_MP1_DIST_BV_001() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
var HttpMessage v_response;
// Test control
if (not(PICS_PLAT_IUT) or not(PICS_LOCATION_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_PLAT_IUT and PICS_LOCATION_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_get(
PICS_ME_APP_Q_ZONE_ID_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_user_info(
mw_user_info(-, -, PX_ZONE_ID)
))))) -> value v_response {
log("*** " & testcasename() & ": PASS: IUT successfully responds with a ZoneId ***");
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_PLAT_MP1_DIST_BV_001
} // End of group me_app_role
} // End of module AtsMec_TestCases
......@@ -61,14 +61,14 @@ module AtsMec_UEidentityAPI_TestCases {
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
PICS_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info",
v_headers
)
m_http_request_get(
PICS_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);
// Test Body
tc_ac.start;
alt {
......@@ -78,7 +78,7 @@ module AtsMec_UEidentityAPI_TestCases {
mw_http_message_body_json(
mw_body_json_ue_identity_tag_info(
mw_ue_identity_tag_info(
{ *, mw_ue_identity_tag_item(PX_UE_IDENTITY_TAG, REGISTERED), * }
{ *, mw_ue_identity_tag_item(PX_UE_IDENTITY_TAG), * }
)))))) -> value v_response {
log("*** " & testcasename() & ": PASS: IUT successfully responds with a UeIdentityTag ***");
......
......@@ -39,57 +39,58 @@ module AtsMec_UEinformation_TestCases {
/**
* @desc Check that the IUT responds with the information pertaining to one or more UEs in a particular location when queried by a MEC Application
* @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeInformation/PlatUeInformation.tplan2
* @see https://forge.etsi.org/gitlab/mec/gs013-location-api/blob/master/LocationAPI.yaml#/definitions/UserList
*/
testcase TC_MEC_PLAT_MP1_INF_BV_001() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
var HttpMessage v_response;
// Test control
if (not(PICS_PLAT_IUT) or not(PICS_LOCATION_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_PLAT_IUT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
setverdict(inconc);
stop;
// Local variables
var HeaderLines v_headers;
var HttpMessage v_response;
// Test control
if (not(PICS_PLAT_IUT) or not(PICS_LOCATION_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_PLAT_IUT and PICS_LOCATION_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_get(
PICS_ME_APP_Q_USERS_LIST_URI,
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_user_list(
mw_user_list(-, ?)
))))) -> value v_response {
log("*** " & testcasename() & ": PASS: IUT successfully responds with a UserList ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
// 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_ME_APP_Q_USERS_LIST_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_user_list(
mw_user_list(-, ?)
))))) -> value v_response {
log("*** " & testcasename() & ": PASS: IUT successfully responds with a UserList ***");
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();
[] 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_PLAT_MP1_INF_BV_001
} // End of group me_app_role
......
......@@ -6,13 +6,13 @@ module LocationAPI_Pixits {
// LibMec/LocationAPI
import from LocationAPI_TypesAndValues all;
modulepar universal charstring PX_ADDRESS := "acr:127.0.0.1";
modulepar universal charstring PX_USER := "acr:192.0.0.1";
modulepar universal charstring PX_ACCESS_POINT_ID := "001010000000000000000000000000001";
modulepar universal charstring PX_ZONE_ID := "zone01";
modulepar universal charstring PX_RESOURCE_URL := "http://example.com/exampleAPI/location/v2/zones/zone01";
modulepar universal charstring PX_RESOURCE_URL := "http://example.com/exampleAPI/location/v2/users?address:acr:192.0.0.1";
modulepar TimeStamp PX_TIME_STAMP := { seconds := 1483231138, nanoSeconds := 0 };
......
......@@ -8,17 +8,15 @@ module LocationAPI_Templates {
import from LocationAPI_Pixits all;
template (value) UserInfo m_user_info(
in universal charstring p_address := PX_ADDRESS,
in universal charstring p_address := PX_USER,
in universal charstring p_access_point_id := PX_ACCESS_POINT_ID,
in universal charstring p_zone_id := PX_ZONE_ID,
in universal charstring p_resource_url := PX_RESOURCE_URL,
in TimeStamp p_time_stamp := PX_TIME_STAMP
in universal charstring p_resource_url := PX_RESOURCE_URL
) := {
address_ := p_address,
accessPointId := p_access_point_id,
zoneId := p_zone_id,
resourceURL := p_resource_url,
timeStamp := p_time_stamp,
locationInfo := omit,
contextLocationInfo := omit,
ancillaryInfo := omit
......@@ -28,14 +26,12 @@ module LocationAPI_Templates {
template (present) universal charstring p_address := ?,
template (present) universal charstring p_access_point_id := ?,
template (present) universal charstring p_zone_id := ?,
template (present) universal charstring p_resource_url := ?,
template (present) TimeStamp p_time_stamp := ?
template (present) universal charstring p_resource_url := ?
) := {
address_ := p_address,
accessPointId := p_access_point_id,
zoneId := p_zone_id,
resourceURL := p_resource_url,
timeStamp := p_time_stamp,
locationInfo := *,
contextLocationInfo := *,
ancillaryInfo := *
......
......@@ -19,15 +19,15 @@ module LocationAPI_TypesAndValues {
* @member accessPointId Identifier of access point, <E-CGI><Cell Portion ID> (reference ETSI TS 129 171).
* @member zoneId Identifier of zone
* @member resourceURL Self referring URL.
* @member timeStamp Indicates the time of day for zonal presence notification.
* @member locationInfo A type containing location information with latitude, longitude and altitude, in addition the accuracy of the information are provided.
* @member contextLocationInfo
* @member ancillaryInfo
*/
type record UserInfo {
universal charstring address_,
universal charstring accessPointId,
universal charstring zoneId,
universal charstring resourceURL,
TimeStamp timeStamp,
LocationInfo locationInfo optional,
universal charstring contextLocationInfo optional,
universal charstring ancillaryInfo optional
......
......@@ -5,6 +5,6 @@ module RnisAPI_Pics {
*/
modulepar boolean PICS_RNIS_ALL_SUBSCRIPTIONS := true;
modulepar charstring PICS_RNIS_SUBSCRITIONS_URI := "/rni/v2/subscriptions";
modulepar charstring PICS_RNIS_SUBSCRITIONS_URI := "/rni/v2/subscriptions/";
} // End of module RnisAPI_Pics
......@@ -8,6 +8,6 @@ module UEidentityAPI_Pixits {
modulepar universal charstring PX_APP_INSTANCE_ID := "appInst01";
modulepar universal charstring PX_UE_IDENTITY_TAG := "ueIdentityTag";
modulepar universal charstring PX_UE_IDENTITY_TAG := "UeTagA";
} // End of module UEidentityAPI_Pixits
......@@ -12,7 +12,7 @@ module LibMec_Pics {
*/
modulepar boolean PICS_RNIS_IUT := false;
modulepar charstring PICS_ME_APP_Q_ZONE_ID_URI := "/exampleAPI/location/v2/zones/";
modulepar charstring PICS_ME_APP_Q_ZONE_ID_URI := "/exampleAPI/location/v2/zones";
modulepar charstring PICS_ME_APP_Q_USERS_LIST_URI := "/exampleAPI/location/v2/users";
......
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