Commit e477d327 authored by Yann Garcia's avatar Yann Garcia
Browse files

Merge branch 'devel'

parents c27029a4 ed00235c
Loading
Loading
Loading
Loading
+53 −1
Original line number Diff line number Diff line
# TITAN Test System Framework

## Introduction

This module provides the bases to start the development of any Conformance Testing project or Interoperability Testing project.
It contains:
- A set C/C++ modules such as logging, codec support,
- A set of TTCN-3 modules such as LibHttp
- A set of TTCN-3 modules such as LibHelper or LibHttp

## How to use it

### The layers

The purpose of a lower test adapter is to prepare and adapt the protocol messages used by TTCN-3 test suites so that they can be transmitted successfully to the SUT.
The lower layers implement and encapsulate protocol messages accordingly. For instance, TCP need to be encapsulated into IP layer and ETHERNET layer.
Each Layer is responsible for encapsulating and decapsulating packets and transmitting result to lower using send_data()/receive_data() methods

#### Final layers

The final layer is where the physical communication is done. PCAP is an example a the final layer: this layer read and write data to the network interface controller (NIC).
Some final layer such as PCAP, PCAP_OFFLINE, SCTP are provided by this framework to facilitate the development of the Test Adapter.

#### Layers

Some layers such as ETHERNET, IP, TCP or UDP are provided by this framework to facilitate the development of the Test Adapter.

### The C++ libraries

This framework provides some C++ and TTCN-3 libraries such as layer parameters processor (class params), base time (class base_time), basic data convertions (class converter).
These classes can be derived to enhance and add new functionalities.

### The external functions

This framework provides some useful TTCN-3 external function such as time access (e.g. fx__getCurrentTimeUtc) or base 64 encoding/decoding.

### The logger class

This class provides a logging framework with log levels and some special features such as hexadecimal dump of TITAN data structure logging (e.g. RECORD...).

### The TTCN-3 libraries

This framework provides some TTCN-3 libraries such as LibXSD, libHTTP or LibJson.
These libraries provides the typing and the templates to manipulate these protocols.
They can be used and extend to enhance and add new typings and functionalities.

### The LibSecurity

This libraries provides the minimal set of functionalities such SHA and HMAC computing, Signature and Certificates manipulations.

## How to add it in your project

When you create your project, you just need to add it as a GIT submodule:

```bash
$ git submodule add --branch devel https://labs.etsi.org/rep/cti-tools/titan-test-system-framework.git ./titan-test-system-framework
$ git submodule init
$ git submodule update
$ git add .
$ git commit -a -m "Added submodule titan-test-system-framework"
$ git push
```
+8 −0
Original line number Diff line number Diff line
@@ -389,6 +389,14 @@ public:
   */
  std::vector<uint8_t> base64_to_buffer(const std::vector<uint8_t> &p_value, const bool p_remove_crlf = true);

  /*!
   * \brief Split a string line by line
   * \param[in] p_input The buffer value
   * \return The lines list
   */
  std::vector<std::string> split_lines(const std::string& p_input);


  static const std::string lut_u;
  static const std::string lut_l;
  static const std::string base64_enc_map[2];
+14 −0
Original line number Diff line number Diff line
@@ -268,3 +268,17 @@ std::vector<uint8_t> converter::base64_to_buffer(const std::vector<uint8_t> &p_v

  return out;
}

#include <string>
#include <string_view>
#include <vector>

std::vector<std::string> converter::split_lines(const std::string& p_input) {
    std::vector<std::string> lines;
    std::istringstream stream(p_input);
    std::string line;
    while (std::getline(stream, line)) {
        lines.push_back(line);
    }
    return lines;
}
+3 −3
Original line number Diff line number Diff line
/*!
 * \file      udp_layer.hh
 * \brief     Header file for ITS UDP/IP protocol layer definition.
 * \author    ETSI STF525
 * \file      ethernet_layer.hh
 * \brief     Header file for Ethernet protocol layer definition.
 * \author    ETSI TTF T048
 * \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.
+1 −1
Original line number Diff line number Diff line
@@ -659,7 +659,7 @@ int http_codec::decode_body(TTCN_Buffer &decoding_buffer, LibHttp__MessageBodyTy
      LibHttp__XmlMessageBodyTypes::XmlBody xml_body;
      decode_body_xml(body, xml_body, p_content_type, &p);
      message_body.xml__body() = xml_body;
    } else if (p["decode_str"].find("<html>") != std::string::npos) { // Try to identify HTML
    } else if (p["decode_str"].find("<html") != std::string::npos) { // Try to identify HTML
      loggers::get_instance().log("http_codec::decode_body: Find html message");
      LibHttp__MessageBodyTypes::HtmlBody html_body;
      decode_body_html(body, html_body, p_content_type, &p);
Loading