Commit 1a1ebb5d authored by YannGarcia's avatar YannGarcia
Browse files

Finalyze TPs implementation for MEC028

parent 110b9d05
......@@ -563,7 +563,7 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
os += OCTETSTRING(len, counter + static_cast<const unsigned char*>(body));
loggers::get_instance().log_msg("http_codec::decode_body: os=", os);
counter += len;
loggers::get_instance().log("http_codec::decode_body: Chunked: %02x %02x %02x", body[counter].get_octet(), body[counter + 1].get_octet(), body[counter + 2].get_octet());
//loggers::get_instance().log("http_codec::decode_body: Chunked: %02x %02x %02x", body[counter].get_octet(), body[counter + 1].get_octet(), body[counter + 2].get_octet());
loggers::get_instance().log("http_codec::decode_body: Chunked (2): prev = %d, counter=%d / %d", prev, counter, body.lengthof());
while (counter < body.lengthof() && ((body[counter].get_octet() == '\r') || (body[counter].get_octet() == '\n'))) { // Skip additional \n
counter += 1;
......
......@@ -76,6 +76,14 @@ int json_codec::encode (const LibItsHttp__JsonMessageBodyTypes::JsonBody& msg, O
const V2XInformationServiceAPI__TypesAndValues::PredictedQos& predicted_qos = msg.predictedQos();
predicted_qos.encode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
} else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_assocStaSubscription)) {
const WlanInformationAPI__TypesAndValues::AssocStaSubscription& assoc_sta_subscription = msg.assocStaSubscription();
assoc_sta_subscription.encode(WlanInformationAPI__TypesAndValues::AssocStaSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
} else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_staDataRateSubscription)) {
const WlanInformationAPI__TypesAndValues::StaDataRateSubscription& sta_data_rate_subscription = msg.staDataRateSubscription();
sta_data_rate_subscription.encode(WlanInformationAPI__TypesAndValues::StaDataRateSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
} else {
loggers::get_instance().error("json_codec::encode: Not supported");
}
......@@ -220,7 +228,7 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
AppEnablementAPI__TypesAndValues::SubscriptionLinkList sub_link_list;
sub_link_list.decode(AppEnablementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.subscriptionLinkList__app__ens() = sub_link_list;
} else if (it->second.find("\"subscriptionType\"") != std::string::npos) {
} else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"filteringCriteria\"") != std::string::npos)) {
AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription ser_av;
ser_av.decode(AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
msg.serAvailabilityNotificationSubscription() = ser_av;
......@@ -448,6 +456,36 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
prov_chg_pc5_subscription.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
msg.provChgPc5Subscription() = prov_chg_pc5_subscription;
} else if (it->second.find("\"AssocStaSubscription\"") != std::string::npos) {
WlanInformationAPI__TypesAndValues::AssocStaSubscription assoc_sta_subscription;
TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
assoc_sta_subscription.decode(WlanInformationAPI__TypesAndValues::AssocStaSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
msg.assocStaSubscription() = assoc_sta_subscription;
} else if (it->second.find("\"StaDataRateSubscription\"") != std::string::npos) {
WlanInformationAPI__TypesAndValues::StaDataRateSubscription sta_data_rate_subscription;
TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
sta_data_rate_subscription.decode(WlanInformationAPI__TypesAndValues::StaDataRateSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
msg.staDataRateSubscription() = sta_data_rate_subscription;
} else if ((it->second.find("\"apInfo\"") != std::string::npos) || (it->second.find("\"apId\"") != std::string::npos)) {
WlanInformationAPI__TypesAndValues::ApInfoList ap_info_list;
TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
ap_info_list.decode(WlanInformationAPI__TypesAndValues::ApInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
msg.apInfoList() = ap_info_list;
} else if ((it->second.find("\"staInfo\"") != std::string::npos) || (it->second.find("\"rssi\"") != std::string::npos)) {
WlanInformationAPI__TypesAndValues::StaInfoList sta_info_list;
TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
sta_info_list.decode(WlanInformationAPI__TypesAndValues::StaInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
msg.staInfoList() = sta_info_list;
} 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);
......
......@@ -8,13 +8,13 @@ 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.1.39"
LibItsHttp_Pics.PICS_HEADER_HOST := "try-mec.etsi.org" #"192.168.1.39"
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 := "" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application'
LibMec_Pics.PICS_ROOT_API := "/sbxdtd587f" # 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"
......@@ -68,6 +68,16 @@ UEidentityAPI_Pics.PICS_UE_IDENTITY_API_SUPPORTED := false
# Mec-015 TrafficManagementAPI
TrafficManagementAPI_Pics.PICS_BWMANAGEMENT_API_SUPPORTED := true
# Mec-028 WLAN Information API
LibMec_Pixits.PX_ME_WLAN_QUERIES_URI := "/wai/v2/queries"
LibMec_Pixits.PX_ME_WLAN_URI := "/wai/v2"
#WlanInformationAPI_Pixits.PX_WLAN_FILTER_FIELD := "ap/macId" # ApInfo filter
WlanInformationAPI_Pixits.PX_WLAN_FILTER_FIELD := "staId/macId" # StatInfo filter
WlanInformationAPI_Pixits.PX_WLAN_FILTER_VALUE := "\"005C06060606\""
# Mec-030 V2X Information Service API
[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).
......@@ -84,8 +94,8 @@ 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.39,port=30030,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.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.39,port=30030,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=8081,use_ssl=0)"
[DEFINE]
......@@ -282,6 +292,46 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server
# ETSI GS MEC 016
# 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
# 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
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_002_BR
# Check that the IUT responds with the list of Station Point
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_003_OK
# Check that the IUT responds with the list of Station Point filtered by the macId provided as query parameter
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_004_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_004_BR
# Check that the IUT responds with the requested list of subscription
AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_005_OK
# Check that the IUT responds with the requested list of subscription
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_BR
# Check that the IUT responds with an error when a request with not existing parameters is sent
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_NF
# Check that the IUT responds with a Notification Subscription
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_007_OK
# Check that the IUT responds with an error when an invalid Subscription request is sent
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_007_BR
# Check that the IUT responds with an error when a request with not existing parameters is sent
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_007_NF
# Check that the IUT responds with the list of Subscription
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_008_OK
# Check that the IUT responds with an error when a request for existing subscription with incorrect parameters is sent
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_008_NF
# Check that the IUT responds with a Notification Subscription when it is modified
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_009_OK
# Check that the IUT responds with an error when an invalid field is set in the subscription modification reques
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_009_BR
# Check that the IUT responds with 204 when an existing subscription is correctly deleted
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_010_OK
# Check that the IUT responds with an error when an not existing subscription cannot be deleted
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_010_NF
# Check that the IUT sends a notification about WLAN event notification if the MEC service has an associated subscription and the event is generated
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_011_OK
# ETSI GS MEC 030
# Check that the IUT responds with a configured provisioning information over Uu unicast when queried by a MEC Application
......@@ -309,11 +359,68 @@ 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 incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_NF
# Check that the IUT sends a request about QoS information for a vehicular UE when queried by a MEC Application
AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_OK
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_BR
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_NF
# Check that the IUT processes properly a request to publish a V2X message
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_005_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_005_BR
# Check that the IUT responds with the requested list of subscription when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_OK_01
# Check that the IUT responds with the requested list of subscription when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_OK_02
# Check that the IUT responds with the requested list of subscription when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_OK_03
# Check that the IUT responds with the requested list of subscription when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_OK_04
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_BR
# Check that the IUT responds with the requested to create a subscription
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_01
# Check that the IUT responds with the requested to create a subscription
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_02
# Check that the IUT responds with the requested to create a subscription
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_03
# Check that the IUT responds with the requested to create a subscription
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_04
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_BR
# Check that the IUT responds with the requested of subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_OK_01
# Check that the IUT responds with the requested of subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_OK_02
# Check that the IUT responds with the requested of subscription information when queried by a MEC Application#AtsMec_V2XInformationServiceAPI_TestCases.TC_#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_OK_03
# Check that the IUT responds with the requested of subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_OK_04
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_BR
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_NF
# Check that the IUT responds with the request of updating subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_OK_01
# Check that the IUT responds with the request of updating subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_OK_02
# Check that the IUT responds with the request of updating subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_OK_03
# Check that the IUT responds with the request of updating subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_OK_04
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_BR
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_NF
# Check that the IUT responds with the request of removing subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_01
# Check that the IUT responds with the request of removing subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_02
# Check that the IUT responds with the request of removing subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_03
# Check that the IUT responds with the request of removing subscription information when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_04
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_NF
[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
......
/**
* @author ETSI / STF569
* @author ETSI / TTF T012
* @version $URL$
* $ID:$
* @desc This module provides the custom templates for ITS HTTP based protocols.
......@@ -39,7 +39,7 @@ module V2XInformationServiceAPI_Functions {
function f_create_prov_uu_uni_subscription(
out ProvChgUuUniSubscription p_prov_chg_uu_uni_subscription
) runs on HttpComponent {
) runs on HttpComponent {
var Headers v_headers;
var HttpMessage v_response;
......@@ -47,7 +47,7 @@ module V2XInformationServiceAPI_Functions {
httpPort.send(
m_http_request(
m_http_request_post(
PX_ME_V2X_URI & "/subscriptions/prov_chg_uu_uni",
PICS_ROOT_API & PX_ME_V2X_URI & "/subscriptions/prov_chg_uu_uni",
v_headers,
m_http_message_body_json(
m_body_json_prov_chg_uu_uni_subscription(
......@@ -93,14 +93,14 @@ module V2XInformationServiceAPI_Functions {
function f_delete_prov_uu_uni_subscription(
in ProvChgUuUniSubscription p_prov_chg_uu_uni_subscription
) runs on HttpComponent {
) runs on HttpComponent {
var Headers v_headers;
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
PX_ME_V2X_URI & "/subscriptions/" & p_prov_chg_uu_uni_subscription.links.self_,
PICS_ROOT_API & p_prov_chg_uu_uni_subscription.links.self_,
v_headers
)));
......@@ -121,7 +121,7 @@ module V2XInformationServiceAPI_Functions {
function f_create_prov_uu_mbms_subscription(
out ProvChgUuMbmsSubscription p_prov_chg_uu_mbms_subscription
) runs on HttpComponent {
) runs on HttpComponent {
var Headers v_headers;
var HttpMessage v_response;
......@@ -129,7 +129,7 @@ module V2XInformationServiceAPI_Functions {
httpPort.send(
m_http_request(
m_http_request_post(
PX_ME_V2X_URI & "/subscriptions/prov_chg_uu_mbms",
PICS_ROOT_API & PX_ME_V2X_URI & "/subscriptions/prov_chg_uu_mbms",
v_headers,
m_http_message_body_json(
m_body_json_prov_chg_uu_mbms_subscription(
......@@ -183,14 +183,14 @@ module V2XInformationServiceAPI_Functions {
function f_delete_prov_uu_mbms_subscription(
in ProvChgUuMbmsSubscription p_prov_chg_uu_mbms_subscription
) runs on HttpComponent {
) runs on HttpComponent {
var Headers v_headers;
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
PX_ME_V2X_URI & "/subscriptions/" & p_prov_chg_uu_mbms_subscription.links.self_,
PICS_ROOT_API & PX_ME_V2X_URI & "/subscriptions/" & p_prov_chg_uu_mbms_subscription.links.self_,
v_headers
)));
......@@ -211,7 +211,7 @@ module V2XInformationServiceAPI_Functions {
function f_create_prov_pc5_subscription(
out ProvChgPc5Subscription p_prov_chg_pc5_subscription
) runs on HttpComponent {
) runs on HttpComponent {
var Headers v_headers;
var HttpMessage v_response;
......@@ -219,7 +219,7 @@ module V2XInformationServiceAPI_Functions {
httpPort.send(
m_http_request(
m_http_request_post(
PX_ME_V2X_URI & "/subscriptions/prov_chg_pc5",
PICS_ROOT_API & PX_ME_V2X_URI & "/subscriptions/prov_chg_pc5",
v_headers,
m_http_message_body_json(
m_body_json_prov_chg_pc5_subscription(
......@@ -262,14 +262,14 @@ module V2XInformationServiceAPI_Functions {
function f_delete_prov_pc5_subscription(
in ProvChgPc5Subscription p_prov_chg_pc5_subscription
) runs on HttpComponent {
) runs on HttpComponent {
var Headers v_headers;
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
PX_ME_V2X_URI & "/subscriptions/" & p_prov_chg_pc5_subscription.links.self_,
PICS_ROOT_API & PX_ME_V2X_URI & "/subscriptions/" & p_prov_chg_pc5_subscription.links.self_,
v_headers
)));
......@@ -290,7 +290,7 @@ module V2XInformationServiceAPI_Functions {
function f_create_v2x_msg_subscription(
out V2xMsgSubscription p_v2x_msg_subscription
) runs on HttpComponent {
) runs on HttpComponent {
var Headers v_headers;
var HttpMessage v_response;
......@@ -298,7 +298,7 @@ module V2XInformationServiceAPI_Functions {
httpPort.send(
m_http_request(
m_http_request_post(
PX_ME_V2X_URI & "/subscriptions/V2xMsgSubscription",
PICS_ROOT_API & PX_ME_V2X_URI & "/subscriptions/V2xMsgSubscription",
v_headers,
m_http_message_body_json(
m_body_json_v2x_msg_subscription(
......@@ -333,14 +333,14 @@ module V2XInformationServiceAPI_Functions {
function f_delete_v2x_msg_subscription(
in V2xMsgSubscription p_v2x_msg_subscription
) runs on HttpComponent {
) runs on HttpComponent {
var Headers v_headers;
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
PX_ME_V2X_URI & "/subscriptions/" & p_v2x_msg_subscription.links.self_,
PICS_ROOT_API & p_v2x_msg_subscription.links.self_,
v_headers
)));
......
......@@ -367,11 +367,11 @@ module V2XInformationServiceAPI_TypesAndValues {
* @member subscriptionType Type of the subscription. The values are as defined in the \"subscriptionType\" attribute for each different V2X information event subscription data type
* @see MEC030 Clause 6.3.6 Type: SubscriptionLinkList
*/
type record SubscriptionsLinks {
type record SubscriptionsLink_ {
JSON.AnyURI href,
JSON.String subscriptionType
}
type record of SubscriptionsLinks SubscriptionLinksList;
type record of SubscriptionsLink_ SubscriptionLinkList_;
/**
* @desc List of hyperlinks related to the resource
......@@ -379,22 +379,11 @@ module V2XInformationServiceAPI_TypesAndValues {
* @member subscriptions The service consumer’s subscriptions
* @see MEC030 Clause 6.3.6 Type: SubscriptionLinkList
*/
type record SubscriptionLinkListLink {
LinkType self_,
SubscriptionLinksList subscriptions
} with {
variant (self_) "name as 'self'";
}
/**
* @desc List of links related to currently existing subscriptions for the service consumer
* @member links List of hyperlinks related to the resource
* @see MEC030 Clause 6.3.6 Type: SubscriptionLinkList
*/
type record SubscriptionLinkList {
SubscriptionLinkListLink links
LinkType self_,
SubscriptionLinkList_ subscriptions
} with {
variant (links) "name as '_links'";
variant (self_) "name as 'self'";
}
/**
......
/**
* @author ETSI / TTF T012
* @version $URL$
* $ID:$
* @desc This module provides the custom templates for ITS HTTP based protocols.
* @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.
*/
module WlanInformationAPI_Functions {
// JSON
import from JSON all;
// LibCommon
import from LibCommon_BasicTypesAndValues all;
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/WlanInformationAPI
import from WlanInformationAPI_TypesAndValues all;
import from WlanInformationAPI_Templates all;
import from WlanInformationAPI_Pixits all;
// LibMec
import from LibMec_Templates all;
import from LibMec_Functions all;
import from LibMec_Pics all;
import from LibMec_Pixits all;
function f_create_assoc_sta_subscription(
out AssocStaSubscription p_assoc_sta_subscription
) runs on HttpComponent {
var Headers v_headers;
var HttpMessage v_response;
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions",
v_headers,
m_http_message_body_json(
m_body_json_assoc_sta_subscription(
m_assoc_sta_subscription(
PX_ASSOC_STA_SUBSCRIPTION_CALLBACK,
m_ap_identity(
PX_MAC_ID
)))))));
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_ok(
mw_http_message_body_json(
mw_body_json_assoc_sta_subscription(
mw_assoc_sta_subscription(
PX_ASSOC_STA_SUBSCRIPTION_CALLBACK,
-,
?
)))))) -> value v_response {
tc_ac.stop;
p_assoc_sta_subscription := v_response.response.body.json_body.assocStaSubscription;
log("f_create_assoc_sta_subscription: INFO: IUT successfully responds to the subscription: ", p_assoc_sta_subscription);
}
[] tc_ac.timeout {
log("f_create_assoc_sta_subscription: INCONC: Expected message not received");
}
} // End of 'alt' statement
} // End of function "f_create_assoc_sta_subscription
function f_delete_assoc_sta_subscription(
in AssocStaSubscription p_assoc_sta_subscription
) runs on HttpComponent {
var Headers v_headers;
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
PICS_ROOT_API & p_assoc_sta_subscription.links.self_.href,
v_headers
)));
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_204_no_content
)) {
tc_ac.stop;
}
[] tc_ac.timeout {
log("f_delete_assoc_sta_subscription: Expected message not received");
}
} // End of 'alt' statement
} // End of function f_delete_assoc_sta_subscription
} // End of module WlanInformationAPI_Functions
module WlanInformationAPI_Pics {
/**
* @desc Does the IUT support WlanInformationAPI?
*/
modulepar boolean PICS_WLAN_INFORMATION_API_SUPPORTED := true;
} // End of module WlanInformationAPI_Pics
module WlanInformationAPI_Pixits {
// JSON
import from JSON all;
modulepar charstring PX_WLAN_FILTER_FIELD := "ap/macId";
modulepar charstring PX_WLAN_FILTER_VALUE := "005C06060606";
modulepar JSON.String PX_MAC_ID := "005C06060606";
modulepar JSON.AnyURI PX_ASSOC_STA_SUBSCRIPTION_CALLBACK := "https://127.0.0.1/wai/v1/assoc_notif";
modulepar JSON.String PX_SSID := "WLAN_SSID";
modulepar JSON.String PX_IP_ADDRESS := "10.10.10.10";
} // End of module WlanInformationAPI_Pixits
module WlanInformationAPI_Templates {
// JSON
import from JSON all;
// LibCommon
import from LibCommon_BasicTypesAndValues all;
// LibMec/WlanInformationAPI
import from WlanInformationAPI_TypesAndValues all;
import from WlanInformationAPI_Pixits all;
template (omit) ApInfo m_ap_info(
in template (value) ApIdentity p_apId,
in template (omit) UInt32 p_channel := omit,
in template (omit) BssLoad p_bssLoad := omit,
in template (omit) ExtBssLoad p_extBssLoad := omit,
in template (omit) ApLocation p_apLocation := omit,
in template (omit) NeighborReport p_apNeighbor := omit,
in template (omit) TimeStamp p_timeStamp := omit
) := {
timeStamp := p_timeStamp,
apId := p_apId,
channel := p_channel,
bssLoad := p_bssLoad,
extBssLoad := p_extBssLoad,
apLocation := p_apLocation,