Commit 6847db95 authored by YannGarcia's avatar YannGarcia
Browse files

Review last created TPs

parent ed03a2d4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -40,7 +40,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_tls;            //! Set to 1 to use mutual TLS authentication to communicate with the HTTPS server. Default: false
  static const std::string& mutual_auth;  //! Set to 1 to use mutual TLS authentication to communicate with the HTTPS server. 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
  
+2 −1
Original line number Diff line number Diff line
@@ -34,7 +34,8 @@ const std::string& params::device_mode = std::string("device_mode");
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_tls = std::string("mutual_tls");
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");

+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ int http_codec::decode (const OCTETSTRING& data, LibItsHttp__TypesAndValues::Htt
      } else {
        response.tls().set_to_omit();
      }
      it = params->find(params::mutual_tls);
      it = params->find(params::mutual_auth);
      if (it != params->cend()) {
        loggers::get_instance().log("http_codec::receive_data: mutual_tls=%s", it->second.c_str());
        response.mutual__tls() = (it->second.compare("1") == 0) ? true : false;
+33 −19
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@
#include <errno.h>
#include <chrono>

//#include <experimental/filesystem>

#include "tcp_layer_factory.hh"

#include "loggers.hh"
@@ -81,12 +79,27 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la
    parameter_set("serverPort", _params[params::local_port].c_str());
  }
  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"));
    //    loggers::get_instance().log("####################### Current path is %s", std::experimental::filesystem::current_path().c_str());
      }
    }
    // 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_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(), "/usr/share/ca-certificates/mozilla/Amazon_Root_CA_1.crt");//"../certificates/out/certs/CA_dsa.cert.pem"); // FIXME Use a parameter
  }
  set_ttcn_buffer_usercontrol(false);
  set_handle_half_close(true);
@@ -95,7 +108,7 @@ 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);
  }
@@ -153,7 +166,7 @@ void tcp_layer::message_incoming(const unsigned char* message_buffer, int length
  float duration;
  loggers::get_instance().set_start_time(_time_key);
  OCTETSTRING data(length, message_buffer);
  params params(_params);
  params params;
  this->receive_data(data, params); // TODO Check execution time for decoding operation
  loggers::get_instance().set_stop_time(_time_key, duration);
}
@@ -179,8 +192,7 @@ 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))
    {
  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);
  }
@@ -193,8 +205,7 @@ 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))
    {
  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);
  }
@@ -214,6 +225,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);
}

+694 −620
Original line number Diff line number Diff line
@@ -105,9 +105,9 @@ Package NG112_PSAP {
    Test Purpose {
        TP Id TP_PSAP_SIP_INVITE_BV_01_01
        Test objective 
            "IUT successfully handles SIP INVITE with service urn and ULAW via UDP, with no SIP registration" 
            "IUT successfully handles SIP INVITE with different service urn and ULAW via UDP, with no SIP registration" 
        Reference 
            "ETSI TS 103 479 [1], clause 5.4 and clause 6.1.1",
            "ETSI TS 103 479 [1], clause 5.4, 6.1.1 and 6.1.2.2",
            "ETSI TS 103 698",
            "Next Generation 112 LTD [2], clause 4.7",
            "RFC3261 [6]",
@@ -137,9 +137,9 @@ Package NG112_PSAP {
    Test Purpose {
        TP Id TP_PSAP_SIP_INVITE_BV_01_02
        Test objective 
            "IUT successfully handles SIP INVITE with service urn and ULAW via UDP, with SIP registration" 
            "IUT successfully handles SIP INVITE with different service urn and ULAW via UDP, with SIP registration" 
        Reference 
            "ETSI TS 103 479 [1], clause 5.4 and clause 6.1.1",
            "ETSI TS 103 479 [1], clause 5.4, 6.1.1 and 6.1.2.2",
            "ETSI TS 103 698",
            "Next Generation 112 LTD [2], clause 4.7",
            "RFC3261 [6]",
@@ -170,9 +170,9 @@ Package NG112_PSAP {
    Test Purpose {
        TP Id TP_PSAP_SIP_INVITE_BV_02_01
        Test objective 
            "IUT successfully handles SIP INVITE with service urn and ALAW via UDP, with no SIP registration" 
            "IUT successfully handles SIP INVITE with different service urn and ALAW via UDP, with no SIP registration" 
        Reference 
            "ETSI TS 103 479 [1], clause 5.4 and clause 6.1.1",
            "ETSI TS 103 479 [1], clause 5.4, 6.1.1 and 6.1.2.2",
            "ETSI TS 103 698",
            "Next Generation 112 LTD [2], clause 4.7",
            "RFC3261 [6]",
@@ -202,9 +202,9 @@ Package NG112_PSAP {
    Test Purpose {
        TP Id TP_PSAP_SIP_INVITE_BV_02_02
        Test objective 
            "IUT successfully handles SIP INVITE with service urn and ALAW via UDP, with SIP registration" 
            "IUT successfully handles SIP INVITE with different service urn and ALAW via UDP, with SIP registration" 
        Reference 
            "ETSI TS 103 479 [1], clause 5.4 and clause 6.1.1",
            "ETSI TS 103 479 [1], clause 5.4, 6.1.1 and 6.1.2.2",
            "ETSI TS 103 698",
            "Next Generation 112 LTD [2], clause 4.7",
            "RFC3261 [6]",
@@ -235,9 +235,9 @@ Package NG112_PSAP {
    Test Purpose {
        TP Id TP_PSAP_SIP_INVITE_BV_03
        Test objective 
            "IUT successfully handles SIP INVITE with service urn via TCP" 
            "IUT successfully handles SIP INVITE with different service urn via TCP" 
        Reference 
            "ETSI TS 103 479 [1], clause 5.4 and clause 6.1.1",
            "ETSI TS 103 479 [1], clause 5.4, 6.1.1 and 6.1.2.2",
            "ETSI TS 103 698",
            "Next Generation 112 LTD [2], clause 4.7",
            "RFC3261 [6]",
@@ -269,7 +269,7 @@ Package NG112_PSAP {
        Test objective 
            "IUT successfully handles SIP INVITE with SDP and PIDF-LO content" 
        Reference 
            "ETSI TS 103 479 [1], clause 5.4 and clause 6.1.1",
            "ETSI TS 103 479 [1], clause 5.4, 6.1.1 and 6.1.2.2",
            "ETSI TS 103 698",
            "Next Generation 112 LTD [2], clause 4.7",
            "RFC3261 [6]",
@@ -353,6 +353,31 @@ Package NG112_PSAP {
            }
    } // End of TP_PSAP_SIP_BYE_BV_01

Test Purpose {
TP Id TP_PSAP_SIP_BYE_BV_02
Test objective 
    "IUT successfully trigger SIP BYE and accepts 200 OK response" 
Reference 
    "ETSI TS 103 479 [1], clause 5.4",
    "Next Generation 112 LTD [2], clause 4.7",
    "RFC3261 [6]",
    "RFC5301 [7]"
Config Id CFG_PSAP_01
PICS Selection S_SIP_TCP1 and E_SIP_URN1 and B_SDP_ULA1
Initial conditions with {
    the IUT entity inAnActiveIncomingCall
}
Expected behaviour
    ensure that {
        when {
            the IUT entity sends a SIP_BYE 
        }
        then {
            the IUT entity receives a SIP_OK
        }
    }
}  //End of TP_PSAP_SIP_BYE_BV_02

    Test Purpose {
        TP Id TP_PSAP_SIP_MESSAGE_BV_01
        Test objective 
@@ -402,6 +427,55 @@ Package NG112_PSAP {
                }
            }
    } // End of TP_PSAP_SIP_OPTION_BV_01
Test Purpose {
TP Id TP_PSAP_SIP_CANCEL_BV_01
Test objective 
    "Check that IUT successfully handles an incoming SIP CANCEL, release the call with 200 OK CANCEL and 487" 
Reference 
    "ETSI TS 103 479 [1], clause 5.4 XXXX",
    "Next Generation 112 LTD [2], clause 4.7",
    "RFC3261 [6]"
Config Id CFG_PSAP_01
PICS Selection S_SIP_UDP1 and A_SIP_BSC1 and B_SDP_ULA1
Initial conditions with {
    the IUT entity acceptingIncomingCalls
}
Expected behaviour
    ensure that {
        when {
            the IUT entity receives a SIP_CANCEL 
        }
        then {
            the IUT entity sends a SIP_OK and
            the IUT entity sends a SIP_487
        }
    }
}  //End of TP_PSAP_SIP_CANCEL_BV_01

Test Purpose {
TP Id TP_PSAP_SIP_INFO_BV_01
Test objective 
    "IUT successfully handles an incoming SIP INFO" 
Reference 
    "ETSI TS 103 479 [1], clause 5.4 TODO",
    "Next Generation 112 LTD [2], clause 4.7",
    "RFC3261 [6]",
    "RFC5301 [7]"
Config Id CFG_PSAP_01
PICS Selection S_SIP_TCP1 and E_SIP_URN1 and B_SDP_ULA1
Initial conditions with {
    the IUT entity inAnActiveIncomingCall
}
Expected behaviour
    ensure that {
        when {
            the IUT entity receives a SIP_INFO 
        }
        then {
            the IUT entity sends a SIP_OK
        }
    }
}  //End of TP_PSAP_SIP_INFO_BV_01

    Test Purpose {
        TP Id TP_PSAP_HTTP_DEQUEUE_BV_01
@@ -445,7 +519,7 @@ Package NG112_PSAP {
                            ;
                        ;
                    ;
                    to a ESRP entity and
                    from a ESRP entity and
                    the IUT entity sends a SIP_NOTIFY containing
                        "To" indicating value "{ESRP SIP URI}",
                        "From" indicating value "{PSAP SIP URI}",