Commit 5dd9e087 authored by YannGarcia's avatar YannGarcia
Browse files

Merge branch v2.2.1-dev into master

parents c56308e2 b3d46463
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
#!/bin/bash
# Copyright ETSI 2018
# Copyright ETSI 2018-2021
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt

#set -vx
set -vx
#set -e

cd "$(dirname "$0")"
cd $(dirname $0)

cd ./docker
run_dir="$(pwd)"
run_dir=`pwd`

./build.sh
# Docker version 2
cd ./virtualization/docker
./build.sh #--force-stfubuntu
#./run.sh

cd -

exit 0
if [ "$1" == "--remove" ]
then
    docker rmi --force ttf_t012_mec:latest
fi

cd -
+22 −6
Original line number Diff line number Diff line
@@ -203,10 +203,24 @@ Procedure:
- Clone the ETSI MEC Testing Framework project into $HOME/dev folder

```sh
$ git clone 
$ git clone --recurse-submodules --branch TTF012_Mec https://forge.etsi.org/rep/mec/gs032p3-ttcn-test-suite.git ./TTF012_Mec
$ cd /home/etsi/dev/TTF012_Mec/ttcn/LibIts
$ rm -fr t3q
$ cd ttcn && rm -fr Common
```

- Update your default environment with the content of the script $HOME/dev/STF569_Mec/scripts/devenv.bash.ubuntu
- Apply patches

```sh
$ cd /home/etsi/dev/TTF012_Mec
$ cp ./ttcn/patch_lib_common_titan/module.mk ./ttcn/LibCommon/
$ cp ./ttcn/patch_lib_common_titan/*.ttcn ./ttcn/LibCommon/
$ cp ./ttcn/patch_lib_http/*.ttcn ./ttcn/LibIts/ttcn/Http/
$ cp  ./ttcn/patch_lib_its/module.mk ./ttcn/LibIts/
```

- Update your default environment with the content of the script $HOME/dev/TTF012_Mec/scripts/devenv.bash.ubuntu

- Switch to the next clause (Usage)


@@ -223,16 +237,17 @@ Procedure using Eclipse TITAN:
- Start eclipse using a new workspace, (e.g. with the name workspace_titan)
- Download and follow the steps to install Eclipse plugins for TITAN, accessible [here]{https://www.eclipse.org/downloads/download.php?file=/titan/Eclipse_installationguide.pdf}
- Open the workspace_titan
- Create a new TITAN project (e.g. STF569_Mec)
- Create a new TITAN project (e.g. TTF012_Mec)
<TODO>

Procedure in TITAN command line:
- Open several SSH session (PuTTY...)
- Change to the directory ~/dev/STF569_Mec/src/AtsMec/objs
- Change to the directory ~/dev/TTF012_Mec/src/AtsMec/objs
- Build the test suite AtsMec

```sh
$ ../bin/mec_generate_makefile.bash
$ cd ~/dev/TTF012_Mec/ && export ATS=AtsMec
$ make
...
```

@@ -243,7 +258,8 @@ $ ../bin/mec_generate_makefile.bash
- To run the test suite, execute the following command:

```sh
$ ../bin/run-all.bash
$ cd ~/dev/TTF012_Mec/scripts/
$ ./run-all.bash
...
```

+2 −0
Original line number Diff line number Diff line
@@ -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
  
+2 −0
Original line number Diff line number Diff line
@@ -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");

+10 −1
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ int http_codec::decode (const OCTETSTRING& data, LibItsHttp__TypesAndValues::Htt
    return -1;
  }
  loggers::get_instance().log_msg("http_codec::decode: message_id: ", message_id);

  // Extract parameters
  try {
    std::string str(static_cast<const char*>(message_id));
@@ -555,6 +556,14 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
        loggers::get_instance().log("http_codec::decode_body: str: '%s'", str.c_str());
        int len = std::stoi(str, nullptr, 16);//converter::get_instance().string_to_int(str);
        loggers::get_instance().log("http_codec::decode_body: Chunk len: %d", len);
        if (len > body.lengthof()) { // Missing data :(
          loggers::get_instance().warning("http_codec::decode_body: Missing data and chunked mode");
          _params->insert(std::pair<std::string, std::string>("missing_data", "1"));
          _params->log();
          OCTETSTRING raw_trunk(len, idx + static_cast<const unsigned char*>(body));
          loggers::get_instance().log_msg("http_codec::decode_body: raw_trunk: ", raw_trunk);
          return -1;
        }
        while (counter < body.lengthof() && ((body[counter].get_octet() == '\r') || (body[counter].get_octet() == '\n'))) { // Skip additional \n
          counter += 1;
        } // End of 'while' statement
Loading