Commit 9f3d6ba6 authored by YannGarcia's avatar YannGarcia
Browse files

Validate MEC-028 against MEC Sandbox

parent dc1af394
......@@ -81,6 +81,8 @@ public: //! \publicsection
static const std::string& server; //! HTTP server address (e.g. www.etsi.org)
static const std::string& port; //! HTTP server port. Default: 80
static const std::string& use_ssl; //! Set to 1 to use SSL to communicate with the HTTP server. Default: false
static const std::string& mutual_auth; //! Set to 1 to use mutual authentication. Default: false
static const std::string& trusted_ca_list; //! List of trusted CA certificates
static const std::string& server_mode; //! Does the test sytem acting as a server. Default: 0
static const std::string& local_port; //! Local listener port. Default: 80
......
......@@ -73,6 +73,8 @@ const std::string& params::interface_id = std::string("interface_id");
const std::string& params::server = std::string("server");
const std::string& params::port = std::string("port");
const std::string& params::use_ssl = std::string("use_ssl");
const std::string& params::mutual_auth = std::string("mutual_auth");
const std::string& params::trusted_ca_list = std::string("trusted_ca_list");
const std::string& params::server_mode = std::string("server_mode");
const std::string& params::local_port = std::string("local_port");
......
......@@ -86,7 +86,7 @@ void http_layer::receive_data(OCTETSTRING& data, params& params)
// Decode HTTP message
LibItsHttp__TypesAndValues::HttpMessage http_message;
if (_codec.decode(data, http_message) == -1) {
if (_codec.decode(data, http_message, &params) == -1) {
loggers::get_instance().warning("http_layer::receive_data: Failed to decode data");
return;
}
......@@ -120,8 +120,8 @@ void http_layer::receive_data(OCTETSTRING& data, params& params)
loggers::get_instance().warning("http_layer::receive_data: An HTTP response is expected");
}
} else {
// Pass it to the ports
to_all_upper_ports(http_message, params);
// Pass it to the ports
to_all_upper_ports(http_message, params);
}
}
......
......@@ -23,7 +23,7 @@ int json_codec::encode (const LibItsHttp__JsonMessageBodyTypes::JsonBody& msg, O
} else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_userTrackingSubscription)) {
const LocationAPI__TypesAndValues::UserTrackingSubscription& user_tracking_subscription = msg.userTrackingSubscription();
user_tracking_subscription.encode(LocationAPI__TypesAndValues::UserTrackingSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
data = /*char2oct(CHARSTRING("{\"userTrackingSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
data = char2oct(CHARSTRING("{\"userTrackingSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}"));
} else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_zonalTrafficSubscription)) {
const LocationAPI__TypesAndValues::ZonalTrafficSubscription& zonal_traffic_subscription = msg.zonalTrafficSubscription();
zonal_traffic_subscription.encode(LocationAPI__TypesAndValues::ZonalTrafficSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
......
......@@ -77,12 +77,30 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la
set_server_mode(server_mode);
if (server_mode) {
parameter_set("serverPort", _params[params::local_port].c_str());
if (ssl_mode) { // Add certificate bundle
parameter_set(ssl_verifycertificate_name(), "yes");
parameter_set(ssl_private_key_file_name(), "../certificates/out/privates/e5e11abad8003766e4a7b721afb175a189b5f4cc7046af9b0d8eaebb86f28c40_server_dsa.key.pem");
parameter_set(ssl_certificate_file_name(), "../certificates/out/certs/e5e11abad8003766e4a7b721afb175a189b5f4cc7046af9b0d8eaebb86f28c40_server_dsa.cert.pem");
parameter_set(ssl_trustedCAlist_file_name(), "../certificates/out/certs/CA_dsa.cert.pem"); // FIXME Use a parameter
}
if (ssl_mode) { // Add certificate bundle
// Check mutual authentication param
_params.insert(std::pair<std::string, std::string>(std::string("mutual_tls"), "0"));
parameter_set(ssl_verifycertificate_name(), "no");
it = _params.find(params::mutual_auth);
if (it == _params.cend()) {
if (_params[params::mutual_auth].compare("1") == 0) { // Use mutual authentication
parameter_set(ssl_verifycertificate_name(), "yes");
_params.insert(std::pair<std::string, std::string>(std::string("mutual_tls"), "1"));
}
}
// Set trusted CA file
it = _params.find(params::mutual_auth);
if (it == _params.cend()) {
parameter_set(ssl_trustedCAlist_file_name(), it->second.c_str());
_params.insert(std::pair<std::string, std::string>(std::string("mutual_tls"), it->second));
} else {
parameter_set(ssl_trustedCAlist_file_name(), "/usr/share/ca-certificates/mozilla/Amazon_Root_CA_1.crt");
}
// Set additional certificates
//parameter_set(ssl_trustedCAlist_file_name(), "../certificates/out/certs/CA_dsa.cert.pem"); // FIXME Use a parameter
//parameter_set(ssl_private_key_file_name(), "../certificates/out/privates/e5e11abad8003766e4a7b721afb175a189b5f4cc7046af9b0d8eaebb86f28c40_server_dsa.key.pem");
//parameter_set(ssl_certificate_file_name(), "../certificates/out/certs/e5e11abad8003766e4a7b721afb175a189b5f4cc7046af9b0d8eaebb86f28c40_server_dsa.cert.pem");
}
set_ttcn_buffer_usercontrol(false);
set_handle_half_close(true);
......@@ -91,11 +109,11 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la
parameter_set(client_TCP_reconnect_name(), "yes");
if (!server_mode) {
if (server_mode == 0) {
loggers::get_instance().log("tcp_layer::tcp_layer: Establish connection: %s/%s", _params[params::server].c_str(), _params[params::port].c_str());
open_client_connection(_params[params::server].c_str(), _params[params::port].c_str(), NULL, NULL);
}
}
}
tcp_layer::~tcp_layer() {
loggers::get_instance().log(">>> tcp_layer::~tcp_layer: %d", _client_id);
......@@ -175,11 +193,10 @@ int tcp_layer::send_message_on_fd(int p_client_id, const unsigned char * message
{
loggers::get_instance().log(">>> tcp_layer::send_message_on_fd: %d", p_client_id);
if(get_user_data(p_client_id))
{
loggers::get_instance().log("tcp_layer::send_message_on_fd: SSL mode");
return SSL_Socket::send_message_on_fd(p_client_id, message_buffer, length_of_message);
}
if(get_user_data(p_client_id)) {
loggers::get_instance().log("tcp_layer::send_message_on_fd: SSL mode");
return SSL_Socket::send_message_on_fd(p_client_id, message_buffer, length_of_message);
}
loggers::get_instance().log("tcp_layer::send_message_on_fd: Non secured mode");
return Abstract_Socket::send_message_on_fd(p_client_id, message_buffer, length_of_message);
......@@ -189,11 +206,10 @@ int tcp_layer::send_message_on_nonblocking_fd(int p_client_id, const unsigned ch
{
loggers::get_instance().log(">>> tcp_layer::send_message_on_nonblocking_fd: %d", p_client_id);
if(get_user_data(p_client_id))
{
loggers::get_instance().log("tcp_layer::send_message_on_nonblocking_fd: SSL mode");
return SSL_Socket::send_message_on_nonblocking_fd(p_client_id, message_buffer, length_of_message);
}
if(get_user_data(p_client_id)) {
loggers::get_instance().log("tcp_layer::send_message_on_nonblocking_fd: SSL mode");
return SSL_Socket::send_message_on_nonblocking_fd(p_client_id, message_buffer, length_of_message);
}
loggers::get_instance().log("tcp_layer::send_message_on_nonblocking_fd: Non secured mode");
return Abstract_Socket::send_message_on_nonblocking_fd(p_client_id, message_buffer, length_of_message);
......@@ -210,6 +226,9 @@ int tcp_layer::receive_message_on_fd(int p_client_id)
}
loggers::get_instance().log("tcp_layer::receive_message_on_fd: Non secured mode");
if (_params[std::string("tcp_fragmented")].compare("1") == 0) {
sleep(5); // FIXME When HTTP paquet is fragmented into several TCP packets, a timer is required. This is a Q&D solution
}
return Abstract_Socket::receive_message_on_fd(p_client_id);
}
......
......@@ -14,7 +14,7 @@ LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json"
LibItsHttp_Pics.PICS_USE_TOKEN_HEADER := true
#LibItsHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken"
LibMec_Pics.PICS_ROOT_API := "/sbxzzmplso" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application'
LibMec_Pics.PICS_ROOT_API := "/sbx02yz7fl" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application'
# LibMec_Pixits
LibMec_Pixits.PX_ME_APP_Q_ZONE_ID_URI := "/location/v2/queries/zones"
......@@ -59,9 +59,11 @@ RnisAPI_Pixits.PX_QCI := 0
LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := true
LocationAPI_Pixits.PX_ZONE_ID := "zone02"
LocationAPI_Pixits.PX_ACCESS_POINT_ID := "4g-macro-cell-4"
LocationAPI_Pixits.PX_USER := "10.10.0.1"
LocationAPI_Pixits.PX_USER := "10.100.0.1"
LocationAPI_Pixits.PX_CLIENT_ID := "0123"
LocationAPI_Pixits.PX_SUBSCRIPTION_ID := "subscription0123"
LocationAPI_Pixits.PX_CALLBACK_REF_URL := { notifyURL := "https://yanngarcia.ddns.net/location/v2/notif/1", callbackData := omit, notificationFormat := omit };
UEidentityAPI_Pics.PICS_UE_IDENTITY_API_SUPPORTED := false
......@@ -201,14 +203,22 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server
#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_008_OK
# ETSI GS MEC 013
# Check that the IUT responds with a list for the location of User Equipments when queried by a MEC Application
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCLOOK_001_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCLOOK_001_BR
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCLOOK_001_NF
# Check that the IUT acknowledges the UE location change subscription request when commanded by a MEC Application and notifies it when the location changes
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_001_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_001_BR
# Check that the IUT acknowledges the cancellation of UE location change notifications when commanded by a MEC Application
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_002_OK
# 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_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_002_NF
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETRACKSUB_001_OK
# Check that the IUT acknowledges the UE location change subscription request when commanded by a MEC Application and notifies it when the UE changes location
AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETRACKSUB_001_OK
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETRACKSUB_001_BR
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETRACKSUB_002_OK
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETRACKSUB_002_NF
......@@ -219,6 +229,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEINFSUB_001_BR
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEINFSUB_002_OK
#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEINFSUB_002_NF
#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_RLOCLOOK_001_OK
#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_RLOCLOOK_001_NF
#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEAREASUB_001_OK
......@@ -294,7 +305,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server
# ETSI GS MEC 028
# Check that the IUT responds with the list of WLAN Access Point
AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_001_OK
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_001_OK
# Check that the IUT responds with the list of WLAN Access Point filtered by the macId provided as query parameter
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_002_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
......
......@@ -22,7 +22,9 @@ module AtsMec_LocationAPI_TestCases {
import from LibItsHttp_TestSystem all;
// LibMec/LocationAPI
import from LocationAPI_TypesAndValues all;
import from LocationAPI_Templates all;
import from LocationAPI_Functions all;
import from LocationAPI_Pics all;
import from LocationAPI_Pixits all;
......@@ -59,7 +61,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?zoneId=" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")),
PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?zoneId=" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")),
v_headers
)
)
......@@ -125,7 +127,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?areaId=" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")), // areaId instead of zoneId
PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?areaId=" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")), // areaId instead of zoneId
v_headers
)
)
......@@ -180,7 +182,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?zoneId=" & oct2char(unichar2oct(PX_NON_EXISTENT_ZONE_ID, "UTF-8")),
PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?zoneId=" & oct2char(unichar2oct(PX_NON_EXISTENT_ZONE_ID, "UTF-8")),
v_headers
)
)
......@@ -220,6 +222,7 @@ module AtsMec_LocationAPI_TestCases {
testcase TC_MEC_MEC013_SRV_UELOCSUB_001_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var Headers v_headers;
var HttpMessage v_response;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
......@@ -238,7 +241,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_LOC_SUB_URI,
PICS_ROOT_API & PX_ME_APP_Q_USERS_LOC_SUB_URI,
v_headers,
m_http_message_body_json(
m_body_json_user_tracking_subscription(
......@@ -266,7 +269,7 @@ module AtsMec_LocationAPI_TestCases {
PX_CLIENT_ID,
PX_CALLBACK_REF_URL,
PX_USER
)))))) {
)))))) -> value v_response {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a callbackURL ***");
......@@ -279,6 +282,7 @@ module AtsMec_LocationAPI_TestCases {
} // End of 'alt' statement
// Postamble
f_delete_user_tracking_subscription(v_response.response.body.json_body.userTrackingSubscription);
f_cf_01_http_down();
} // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_001_OK
......@@ -307,14 +311,14 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_LOC_SUB_URI,
PICS_ROOT_API & PX_ME_APP_Q_USERS_LOC_SUB_URI,
v_headers,
m_http_message_body_json(
m_body_json_user_tracking_subscription(
m_user_tracking_subscription(
PX_CLIENT_ID_UNKNOWN,
PX_CALLBACK_REF_URL,
PX_USER
PX_USER_UNKNOWN
)
)
)
......@@ -351,7 +355,9 @@ module AtsMec_LocationAPI_TestCases {
*/
testcase TC_MEC_MEC013_SRV_UELOCSUB_002_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var UserTrackingSubscription v_user_tracking_subscription;
var Headers v_headers;
var charstring v_uri;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
......@@ -366,18 +372,24 @@ module AtsMec_LocationAPI_TestCases {
// Test adapter configuration
// Preamble
f_create_user_tracking_subscription(v_user_tracking_subscription);
v_uri :=regexp(
oct2char(unichar2oct(v_user_tracking_subscription.resourceURL)),
"?+" & PX_ME_APP_Q_USERS_LOC_SUB_URI & "/(?*)",
0
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_LOC_SUB_URI & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), // TODO Shall be extract from Subscription request
PICS_ROOT_API & PX_ME_APP_Q_USERS_LOC_SUB_URI & "/" & v_uri,
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
......@@ -424,7 +436,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_delete(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_LOC_SUB_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), // TODO Shall be extract from Subscription request
PICS_ROOT_API & PX_ME_APP_Q_USERS_LOC_SUB_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
v_headers
)
)
......@@ -463,6 +475,8 @@ module AtsMec_LocationAPI_TestCases {
*/
testcase TC_MEC_MEC013_SRV_UETRACKSUB_001_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var UserTrackingSubscription v_user_tracking_subscription;
var charstring v_uri;
var Headers v_headers;
// Test control
......@@ -478,11 +492,17 @@ module AtsMec_LocationAPI_TestCases {
// Test adapter configuration
// Preamble
f_create_user_tracking_subscription(v_user_tracking_subscription);
v_uri := regexp(
oct2char(unichar2oct(v_user_tracking_subscription.resourceURL)),
"?+" & PX_ME_APP_Q_USERS_LOC_SUB_URI & "/(?*)",
0
);
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_TRACK_SUB_URI & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
PICS_ROOT_API & PX_ME_APP_Q_USERS_TRACK_SUB_URI & "/" & v_uri,
v_headers
)
)
......@@ -514,6 +534,7 @@ module AtsMec_LocationAPI_TestCases {
} // End of 'alt' statement
// Postamble
f_delete_user_tracking_subscription(v_user_tracking_subscription);
f_cf_01_http_down();
} // End of testcase TC_MEC_MEC013_SRV_UETRACKSUB_001_OK
......@@ -542,7 +563,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_TRACK_SUB_URI,
PICS_ROOT_API & PX_ME_APP_Q_USERS_TRACK_SUB_URI,
v_headers,
m_http_message_body_json(
m_body_json_user_tracking_subscription(
......@@ -605,7 +626,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_delete(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_TRACK_SUB_URI & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
PICS_ROOT_API & PX_ME_APP_Q_USERS_TRACK_SUB_URI & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
v_headers
)
)
......@@ -659,7 +680,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_delete(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_TRACK_SUB_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
PICS_ROOT_API & PX_ME_APP_Q_USERS_TRACK_SUB_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
v_headers
)
)
......@@ -717,7 +738,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI,
PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI,
v_headers
)
)
......@@ -774,7 +795,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "/invalid/" & oct2char(unichar2oct(PX_USER, "UTF-8")),
PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "/invalid/" & oct2char(unichar2oct(PX_USER, "UTF-8")),
v_headers
)
)
......@@ -828,7 +849,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "/" & oct2char(unichar2oct(PX_USER_UNKNOWN, "UTF-8")),
PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "/" & oct2char(unichar2oct(PX_USER_UNKNOWN, "UTF-8")),
v_headers
)
)
......@@ -886,7 +907,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI,
PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI,
v_headers,
m_http_message_body_json(
m_body_json_zonal_traffic_subscription(
......@@ -955,7 +976,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & "/invilad/" & PX_ME_APP_Q_USERS_INF_SUB_URI,
PICS_ROOT_API & "/invilad/" & PX_ME_APP_Q_USERS_INF_SUB_URI,
v_headers,
m_http_message_body_json(
m_body_json_zonal_traffic_subscription(
......@@ -1018,7 +1039,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_delete(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI,
PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI,
v_headers,
m_http_message_body_json(
m_body_json_zonal_traffic_subscription(
......@@ -1081,7 +1102,7 @@ module AtsMec_LocationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_delete(
"/" & PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI & "/" & oct2char(unichar2oct(PX_USER_UNKNOWN, "UTF-8")),
PICS_ROOT_API & PX_ME_APP_Q_USERS_INF_SUB_URI & "/" & oct2char(unichar2oct(PX_USER_UNKNOWN, "UTF-8")),
v_headers
)
)
......
......@@ -834,6 +834,7 @@ module AtsMec_WlanInformationAPI_TestCases {
var AssocStaSubscription v_assoc_sta_subscription;
var Headers v_headers;
var HttpMessage v_response;
var charstring v_uri;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
......@@ -850,10 +851,15 @@ module AtsMec_WlanInformationAPI_TestCases {
// Preamble
f_create_assoc_sta_subscription(v_assoc_sta_subscription);
f_init_default_headers_list(-, -, v_headers);
v_uri := regexp(
oct2char(unichar2oct(v_assoc_sta_subscription.links.self_.href)),
"?+" & PX_ME_WLAN_URI & "/subscriptions/" & "(?*)",
0
);
httpPort.send(
m_http_request(
m_http_request_get(
PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/subscriptions/" & v_assoc_sta_subscription.links.self_.href,
PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions/" & v_uri,
v_headers
)
)
......@@ -900,7 +906,8 @@ module AtsMec_WlanInformationAPI_TestCases {
var AssocStaSubscription v_assoc_sta_subscription;
var Headers v_headers;
var HttpMessage v_response;
var charstring v_uri := "unknown";
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
......@@ -919,7 +926,7 @@ module AtsMec_WlanInformationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_get(
PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/subscriptions/" & v_assoc_sta_subscription.links.self_.href & "_Invalid",
PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions/unknown",
v_headers
)
)
......@@ -959,6 +966,7 @@ module AtsMec_WlanInformationAPI_TestCases {
var AssocStaSubscription v_assoc_sta_subscription;
var Headers v_headers;
var HttpMessage v_response;
var charstring v_uri;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
......@@ -975,10 +983,15 @@ module AtsMec_WlanInformationAPI_TestCases {
// Preamble
f_create_assoc_sta_subscription(v_assoc_sta_subscription);
f_init_default_headers_list(-, -, v_headers);
v_uri := regexp(
oct2char(unichar2oct(v_assoc_sta_subscription.links.self_.href)),
"?+" & PX_ME_WLAN_URI & "/subscriptions/" & "(?*)",
0
);
httpPort.send(
m_http_request(
m_http_request_put(
PICS_ROOT_API & v_assoc_sta_subscription.links.self_.href,
PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions/" & v_uri,
v_headers,
m_http_message_body_json(
m_body_json_assoc_sta_subscription(
......@@ -988,8 +1001,11 @@ module AtsMec_WlanInformationAPI_TestCases {
PX_MAC_ID
),
-, -,
v_assoc_sta_subscription.links
))))));
v_assoc_sta_subscription.links,
12,
m_time_stamp(
f_get_current_timestamp_utc() / 1000 + 30 // Expiry time: T + 30 seconds
)))))));
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
......@@ -1030,7 +1046,6 @@ module AtsMec_WlanInformationAPI_TestCases {
// Local variables
var AssocStaSubscription v_assoc_sta_subscription;
var Headers v_headers;
var HttpMessage v_response;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
......@@ -1050,18 +1065,21 @@ module AtsMec_WlanInformationAPI_TestCases {
httpPort.send(
m_http_request(
m_http_request_put(
PICS_ROOT_API & v_assoc_sta_subscription.links.self_.href,
PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions/unknown",
v_headers,
m_http_message_body_json(
m_body_json_assoc_sta_subscription(
m_assoc_sta_subscription_invalid(
v_assoc_sta_subscription.callbackReference,
m_ap_identity(
PX_MAC_ID
),
-, -,
v_assoc_sta_subscription.links
))))));
m_assoc_sta_subscription(
v_assoc_sta_subscription.callbackReference,
m_ap_identity(
PX_MAC_ID
),
-, -,
v_assoc_sta_subscription.links,
12,
m_time_stamp(
f_get_current_timestamp_utc() / 1000 + 30 // Expiry time: T + 30 seconds
)))))));
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
......@@ -1070,7 +1088,7 @@ module AtsMec_WlanInformationAPI_TestCases {
[] httpPort.receive(
mw_http_response(
mw_http_response_400_bad_request
)) -> value v_response {
)) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds the correct error code ***");
......@@ -1083,7 +1101,7 @@ module AtsMec_WlanInformationAPI_TestCases {
} // End of 'alt' statement
// Postamble
f_delete_assoc_sta_subscription(v_response.response.body.json_body.assocStaSubscription);
f_delete_assoc_sta_subscription(v_assoc_sta_subscription);
f_cf_01_http_down();
} // End of testcase TC_MEC_MEC028_SRV_WAI_009_BR
......@@ -1096,7 +1114,7 @@ module AtsMec_WlanInformationAPI_TestCases {
// Local variables
var AssocStaSubscription v_assoc_sta_subscription;
var Headers v_headers;
var HttpMessage v_response;
var charstring v_uri;
// Test control
if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
......@@ -1113,10 +1131,15 @@ module AtsMec_WlanInformationAPI_TestCases {