Commit 6aad2ffd authored by YannGarcia's avatar YannGarcia
Browse files

Finalyze TPs implementation for MEC016

parent 93968200
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
@@ -441,21 +441,41 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    predicted_qos.decode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.predictedQos() = predicted_qos;
  } else if ((it->second.find("\"provChgUuUniSubscription\"") != std::string::npos) || (it->second.find("\"v2xApplicationServer\"") != std::string::npos)) {
  } else if (it->second.find("\"ProvChgUuUniSubscription\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription prov_chg_uu_uni_subscription;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_uu_uni_subscription.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgUuUniSubscription() = prov_chg_uu_uni_subscription;
  } else if ((it->second.find("\"provChgUuMbmsSubscription\"") != std::string::npos) || (it->second.find("\"v2xApplicationServer\"") != std::string::npos)) {
  } else if (it->second.find("\"ProvChgUuMbmsSubscription\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsSubscription prov_chg_uu_mbms_subscription;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_uu_mbms_subscription.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgUuMbmsSubscription() = prov_chg_uu_mbms_subscription;
  } else if ((it->second.find("\"provChgPc5Subscription\"") != std::string::npos) || (it->second.find("\"v2xApplicationServer\"") != std::string::npos)) {
  } else if (it->second.find("\"ProvChgPc5Subscription\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Subscription prov_chg_pc5_subscription;
    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("\"ProvChgUuUniNotification\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniNotification prov_chg_uu_uni_notification;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_uu_uni_notification.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgUuUniNotification() = prov_chg_uu_uni_notification;
  } else if (it->second.find("\"ProvChgUuMbmsNotification\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsNotification prov_chg_uu_mbms_notification;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_uu_mbms_notification.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuMbmsNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgUuMbmsNotification() = prov_chg_uu_mbms_notification;
  } else if (it->second.find("\"provChgPc5Notification\"") != std::string::npos) {
    V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Notification prov_chg_pc5_notification;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    prov_chg_pc5_notification.decode(V2XInformationServiceAPI__TypesAndValues::ProvChgPc5Notification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.provChgPc5Notification() = prov_chg_pc5_notification;



  } 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()));
+22 −8
Original line number Diff line number Diff line
@@ -21,10 +21,16 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la
  } else if (it->second.compare("1") == 0) {
    set_socket_debugging(true);
  }
  it = _params.find(std::string("tcp_fragmented"));
  if (it == _params.cend()) {
    _params.insert(std::pair<std::string, std::string>(std::string("tcp_fragmented"), "0"));
  }
  bool server_mode = false;
  it = _params.find(params::server_mode);
  if (it != _params.cend()) {
    server_mode = (1 == std::stoi(it->second));
  } else {
    _params.insert(std::pair<std::string, std::string>(std::string("server_mode"), "0"));
  }
  it = _params.find(params::server);
  if (it == _params.cend()) {
@@ -72,10 +78,10 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la
  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(), "/etc/ssl/certs/ca-certificates.crt");
      parameter_set(ssl_certificate_file_name(), "/etc/ssl/certs/ca-certificates.crt");
      parameter_set(ssl_trustedCAlist_file_name(), "/etc/ssl/certs/ca-certificates.crt"); // FIXME Use a parameter
      parameter_set(ssl_verifycertificate_name(), "no");
      parameter_set(ssl_private_key_file_name(), "../certificates/out/privates/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa.key.pem");
      parameter_set(ssl_certificate_file_name(), "../certificates/out/certs/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa.cert.pem");
      parameter_set(ssl_trustedCAlist_file_name(), "../certificates/out/certs/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa.cert.pem"); // FIXME Use a parameter
    }
  }
  set_ttcn_buffer_usercontrol(false);
@@ -83,10 +89,11 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la

  map_user();

  parameter_set(client_TCP_reconnect_name(), "yes");

  if (!server_mode) {
    if (!_reconnect_on_send) {
    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);
    }
  }
                                                                                                                                                            }

@@ -117,7 +124,14 @@ void tcp_layer::send_data(OCTETSTRING& data, params& params) {
  loggers::get_instance().log_msg(">>> tcp_layer::send_data: ", data);

  loggers::get_instance().log("tcp_layer::send_data: SSL mode: %x", get_ssl_use_ssl());
  loggers::get_instance().log("tcp_layer::send_data: server_mode: %s", _params[params::server_mode].c_str());
  loggers::get_instance().log("tcp_layer::send_data: peer_list_get_nr_of_peers: %d", peer_list_get_nr_of_peers());

  if ((_params[params::server_mode].compare("0") == 0) && (peer_list_get_nr_of_peers() == 0)) {
    // Reconnect (e.g. HTTP connection lost
    loggers::get_instance().log("tcp_layer::send_data: Re-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);
  }
  send_outgoing(static_cast<const unsigned char*>(data), data.lengthof(), _client_id);
}

+7 −4
Original line number Diff line number Diff line
@@ -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               := "/sbxdtd587f" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application'
LibMec_Pics.PICS_ROOT_API               := "/sbxcyccf53" # 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"
@@ -75,6 +75,7 @@ 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\""
WlanInformationAPI_Pixits.PX_ASSOC_STA_SUBSCRIPTION_CALLBACK := "https://yanngarcia.ddns.net/wai/v2/notif"

# Mec-030 V2X Information Service API

@@ -96,7 +97,7 @@ LogEventTypes:= Yes
# 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_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=8081,use_ssl=0)"
system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1)"

[DEFINE]
# In this section you can create macro definitions,
@@ -305,7 +306,7 @@ 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_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
#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
@@ -331,7 +332,7 @@ AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_005_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
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
@@ -421,6 +422,8 @@ AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_005_OK
#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
# 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_V2XInformationServiceAPI_TestCases.TC_MEC_MEC028_SRV_WAI_011_OK

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
+1081 −0

File added.

Preview size limit exceeded, changes collapsed.

+0 −3
Original line number Diff line number Diff line
module AtsMec_DeviceApplicationInterface_TestCases {

} // End of module AtsMec_DeviceApplicationInterface_TestCases
Loading