Commit 781425c1 authored by YannGarcia's avatar YannGarcia
Browse files

Enhance docker scripts

parent ffd5535b
Loading
Loading
Loading
Loading
+33 −2
Original line number Diff line number Diff line
@@ -66,6 +66,12 @@ In this case, the easiest way is to use Vagrant.
Vagrant requires a virtual machine. You can use either VirtualBox or WMware.
Docker does not need a virtual machine, so it is the more efficant way.

The following clauses describes four ways to build and deploy the CISE  Test System:
- [Using TITAN compiler on a Docker image](#using-titan-compiler-on-a-docker-image)
- [Using development Docker image](#using-development-docker-image)
- [Using Vagrant](#using-vagrant)
- [From scratch](#from-scratch)


### Using TITAN compiler on a Docker image

@@ -77,10 +83,27 @@ Pre-requisites on your host machine:
Procedure on the host machine:
- Open a Terminal
- Clone the ETSI CISE Test System

```sh
$ git clone --recurse-submodules --branch --branch stf637 https://forge.etsi.org/rep/cdm/cise-data-model ./cise-devel
$ cd /home/etsi/dev/cise-devel/titan-test-system-framework
$ git checkout devel
$ cd /home/etsi/dev/cise-devel/titan-test-system-framework/ttcn/LibHttp
$ ln -sf module_cise.mk module.mk
```

- Patch the LibCommon

```sh
$ cd /home/etsi/dev/cise-devel
$ cp ./ttcn/patch_lib_common_titan/module.mk ./ttcn/LibCommon/
$ cp ./ttcn/patch_lib_common_titan/*.ttcn ./ttcn/LibCommon/
```

- From the ETSI CISE Test System root directory, build the Docker image executing the following commands:

```sh
$ cd ./virtualization/docker
$ cd /home/etsi/dev/cise-devel/virtualization/docker
$ docker build --no-cache --tag alpine-cise -f Dockerfile --force-rm .
$ docker images
```
@@ -106,6 +129,14 @@ $ ln -sf ../../etc/AtsCise/AtsCise_Cnit.cf_ ../../etc/AtsCise/AtsCise.cfg
$ vi ../../etc/AtsCise/AtsCise.cfg # To update it
```

The paramaters to be updated are:
- PICS_CISE_SECURITY
- PICS_CISE_CERTIFICATES_DB_PATH
- PX_SECURITY_SIGN_CERT
- PICS_HEADER_HOST
- system.httpPort.params
- system.httpPort_notif.params

To execute the CISE Test Suite, execute the following command:

```sh
@@ -119,6 +150,7 @@ $ ./docker-run.sh run
. Updating value of PICs and PIXITs
. Updating HTTP port setting


### Using development Docker image

In this configuration, the TITAN compiler, the sources and the outputs are located on the Docker image.
@@ -269,7 +301,6 @@ $ ln -sf module_cise.mk module.mk
$ cd /home/etsi/dev/cise-devel
$ 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/
```

- Update your default environment with the content of the script $HOME/dev/cise-devel/scripts/devenv.bash.ubuntu
+74 −54
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
#include <string>
#include <ctime>

#include "xml_codec.hh"

namespace LibCise__Functions {

  static unsigned char random_char() {
@@ -70,4 +72,22 @@ namespace LibCise__Functions {
    return dt;
  }

  OCTETSTRING fx__enc__PullRequest__1(const http__www__cise__eu__servicemodel__v1__message::PullRequest& p) {
    loggers::get_instance().log(">>> fx__enc__PullRequest__1");

    LibHttp__XmlMessageBodyTypes::XmlBody msg;
    msg.pull__request() = p;
    xml_codec c;
    OCTETSTRING os;
    int result = c.encode(msg, os);
    loggers::get_instance().log_msg("fx__enc__PullRequest__1: os: ", os);

    // Remove XML header added by the XML codec.
    OCTETSTRING h = char2oct("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n");
    os = OCTETSTRING(os.lengthof() - h.lengthof(), static_cast<const unsigned char*>(os) + h.lengthof());
    loggers::get_instance().log_msg("fx__enc__PullRequest__1: os: ", os);

    return os;
  }

} // End of namespace LibCise__Functions
 No newline at end of file

cise.code-workspace

0 → 100644
+68 −0
Original line number Diff line number Diff line
{
	"folders": [
		{
			"path": "."
		},
		{
			"path": "../../frameworks/xmlsec"
		}
	],
	"settings": {
		"files.associations": {
			"array": "cpp",
			"bit": "cpp",
			"*.tcc": "cpp",
			"cctype": "cpp",
			"chrono": "cpp",
			"clocale": "cpp",
			"cmath": "cpp",
			"cstdarg": "cpp",
			"cstdint": "cpp",
			"cstdio": "cpp",
			"cstdlib": "cpp",
			"ctime": "cpp",
			"cwchar": "cpp",
			"cwctype": "cpp",
			"deque": "cpp",
			"map": "cpp",
			"unordered_map": "cpp",
			"vector": "cpp",
			"exception": "cpp",
			"fstream": "cpp",
			"functional": "cpp",
			"initializer_list": "cpp",
			"iomanip": "cpp",
			"iosfwd": "cpp",
			"iostream": "cpp",
			"istream": "cpp",
			"limits": "cpp",
			"memory": "cpp",
			"new": "cpp",
			"optional": "cpp",
			"ostream": "cpp",
			"ratio": "cpp",
			"sstream": "cpp",
			"stdexcept": "cpp",
			"streambuf": "cpp",
			"string": "cpp",
			"string_view": "cpp",
			"system_error": "cpp",
			"type_traits": "cpp",
			"tuple": "cpp",
			"typeinfo": "cpp",
			"utility": "cpp",
			"codecvt": "cpp",
			"set": "cpp",
			"bitset": "cpp",
			"condition_variable": "cpp",
			"cstddef": "cpp",
			"cstring": "cpp",
			"memory_resource": "cpp",
			"mutex": "cpp",
			"regex": "cpp",
			"shared_mutex": "cpp",
			"thread": "cpp",
			"numeric": "cpp"
		}
	}
}
 No newline at end of file
+85 −0
Original line number Diff line number Diff line
[MODULE_PARAMETERS]
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.

# IUT roles
LibCise_Pics.PICS_IUT_NODE    := true
LibCise_Pics.PICS_IUT_ADAPTOR := true

# LibCise
LibCise_Pics.PICS_CISE_SECURITY             := true
LibCise_Pics.PICS_CISE_CERTIFICATES_DB_PATH := "/home/etsi/var/ssl/live/yanngarcia.ddns.net/";
LibCise_Pixits.PX_SECURITY_SIGN_CERT := "cert.pem";

# LibHttp
LibHttp_Pics.PICS_HEADER_HOST         := "172.17.0.3"
LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/xml"
LibHttp_Pics.PICS_USE_TOKEN_HEADER    := true
#LibHttp_Pics.PICS_TOKEN_HEADER       := "Basic WrongToken"

[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).

LogFile := "../logs/AtsCise/%e.%h-%r.%s"
FileMask := LOG_ALL | USER | DEBUG | MATCHING
ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING
#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE
#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE
LogSourceInfo := Stack
LogEntityName:= Yes
LogEventTypes:= Yes
#TimeStampFormat := DateTime

[TESTPORT_PARAMETERS]
# In this section you can specify parameters that are passed to Test Ports.
# Unsecured
system.httpPort.params := "HTTP(codecs=xml:xml_codec)/TCP(debug=1,server=172.17.0.2,port=3000)"
system.httpPort_notif.params := "HTTP(codecs=xml:xml_codec)/TCP(debug=1,server_mode=1,local_port=30181)"
# TLS
#system.httpPort.params := "HTTP(codecs=xml:xml_codec)/TCP(debug=1,server=192.168.1.39,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)"
#system.httpPort_notif.params := "HTTP(codecs=xml:xml_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1,mutual_auth=1,mutual_tls=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)"

[DEFINE]
# In this section you can create macro definitions,
# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE].

[INCLUDE]
# To use configuration settings given in other configuration files,
# the configuration files just need to be listed in this section, with their full or relative pathnames.

[ORDERED_INCLUDE]
# To use configuration settings given in other configuration files,
# the configuration files just need to be listed in this section, with their full or relative pathnames.

[EXTERNAL_COMMANDS]
# This section can define external commands (shell scripts) to be executed by the ETS
# whenever a control part or test case is started or terminated.

#BeginTestCase := ""
#EndTestCase := ""
#BeginControlPart := ""
#EndControlPart := ""

[EXECUTE]
# In this section you can specify what parts of your test suite you want to execute.
#AtsCise_TestControl.control

# Check that the IUT sends a PullResponse when recieving a PullRequest with no Acknowledgement
#AtsCise_TestCases.TC_CISE_xxx_BV_01
AtsCise_TestCases.TC_CISE_xxx_BV_02
# Check that the IUT is requested to send a PullRequest with no Acknowledgement, the IUT sends a PullRequest with entry Acknowledgement set to False
#AtsCise_TestCases.TC_CISE_yyy_BV_01

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts.

[COMPONENTS]
# This section consists of rules restricting the location of created PTCs.

[MAIN_CONTROLLER]
# The options herein control the behavior of MC.
KillTimer := 10.0
LocalAddress := 127.0.0.1
TCPPort := 12000
NumHCs := 1
Original line number Diff line number Diff line
Subproject commit 683ea737b145b03518cbe462485fe7bee3a858b6
Subproject commit 07e483b6f5f83ea55de07fe84eaa924c7f401724
Loading