README.md 8.13 KB
Newer Older
ETSI CTI's avatar
ETSI CTI committed
1
# MEC Testing Framework in TTCN-3 - - GS 032-3
Yann Garcia's avatar
Yann Garcia committed
2

Yann Garcia's avatar
Yann Garcia committed
3
## Introduction
ETSI CTI's avatar
ETSI CTI committed
4
5
This repositories contains the test specifications and test adapter code for MEC API Conformance Testing in TTCN-3, GS 032-3.

Michele Carignani's avatar
Michele Carignani committed
6
More information and dowload of the standard at https://portal.etsi.org/webapp/WorkProgram/Report_WorkItem.asp?WKI_ID=56776.
ETSI CTI's avatar
ETSI CTI committed
7
8

For more information on ETSI ISG Multi-access Edge Computing (MEC), visit https://www.etsi.org/technologies/multi-access-edge-computing.
Yann Garcia's avatar
Yann Garcia committed
9
10

## Contact information
Michele Carignani's avatar
Michele Carignani committed
11

ETSI CTI's avatar
ETSI CTI committed
12
Email at `cti_support` at `etsi` dot `org`.
Yann Garcia's avatar
Yann Garcia committed
13
14

## License
Michele Carignani's avatar
Michele Carignani committed
15

16
17
18
Unless specified otherwise, the content of this repository and the files contained are released under the BSD-3-Clause license.
See the attached LICENSE file or visit https://forge.etsi.org/legal-matters.

Yann Garcia's avatar
Yann Garcia committed
19
## Standard links
Michele Carignani's avatar
Michele Carignani committed
20
- Multi-access Edge Computating standards, accessible [here](https://www.etsi.org/standards#page=1&search=MEC&title=1&etsiNumber=1&content=1&version=0&onApproval=1&published=1&historical=1&startDate=1988-01-15&endDate=2019-05-06&harmonized=0&keyword=&TB=&stdType=&frequency=&mandate=&collection=&sort=1).
Yann Garcia's avatar
Yann Garcia committed
21
22
23
24
25

## RFC links
- RFC 7159 - The JavaScript Object Notation (JSON) Data Interchange Format, accessible [here](https://tools.ietf.org/html/rfc7159.html)

NOTE All draft can be found in the 'IETF XML Registry', accessible [here](https://www.iana.org/assignments/xml-registry/xml-registry.xhtml)
YannGarcia's avatar
YannGarcia committed
26

27
## Download required libraries
YannGarcia's avatar
YannGarcia committed
28

29
30
31
32
33
34
35
36
37
38
This projects requires the LibCommon and LibIts libraries to compile. The libraries location are git submodules of the current repository.

Once you have cloned the present repository, in order to install the libraries you want to execute:

    git submodule init
    git submodule update

Alternatively, you may clone the project together with the required libraries with the following command:

    git clone --recurse-submodules <URL to the repository>
YannGarcia's avatar
YannGarcia committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205

## Installation

The MEC Testing Framework project builds and tests regularly on the following platforms:

  - Linux (Ubuntu)

Note: The [OpenSSL](https://www.openssl.org) version > 1.1.x is also required.

### How to do it?

They are two different methods:
- Using [Vagrant](https://www.vagrantup.com/)
- Using [Docker](https://www.docker.com/)

How to choose one of these methods is depending of your host system.

NOTE: In all case, if you want to setup an continuous integration process (e.g. Jenkins), Docker is the best choice. 


#### The host system is Windows
The both methods require a virtual machine. You can use either VirtualBox or WMware.
In this case, the easiest way is to use Vagrant.


#### The host system is Linux
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.


### Using Vagrant

Pre-requisites on your host machine:
- Install [Virtualbox](https://www.virtualbox.org/manual/ch01.html)
- Install [Vagrant](https://www.vagrantup.com/intro/getting-started/)
- Install Vagrant plugin vagrant-vbguest
- Credentials to access [ETSI forge](https://forge.etsi.org/gitlab/users/sign_in)
    - Set the environment variable USERNAME to your ETSI EOL account user name
    - Set the environment variable PASSWORD to your ETSI EOL account password

Procedure:
- On your host machine, open a command line session (PuTTY, DOS window...)
- From the ETSI MEC Testing Framework project, clone the Vagrant folder
- In the file Vagrantfile, modify the tag config.vm.provision replacing <username> & <password> strings by your ETSI credentials
- In the Vagrant folder, execute the following commands:

```sh
$ vagrant up --provider virtualbox --provision
...
```

NOTE The creation and the installations will take some time to achieve
- Stop vagrant virtual machine

```sh
$ vagrant halt
...
```

- Update the file 'Vagrantfile' to match with your networks configuration
- Re-start the vagrant virtual machine and log to to the machine

```sh
$ vagrant up
...
$ vagrant ssh
```

- Switch to the next clause (Usage)

NOTE The user password is vagrant.


### Using Docker

Pre-requisites on your host machine:
- Install Virtualbox
- Install Docker

Procedure for a Windows host machine:
- On your host machine, open a the Docker Quickstart Terminal
- On your host machine, clone the ETSI MEC Testing Framework project. NOTE that only Docker folder and .jenkins.sh script file are required
- From the ETSI MEC Testing Framework project root directory, execute the following commands:

```sh
$ ./.jenkins.sh
...
```

NOTE The creation and the installations will take some time to achieve
- Start the container

```sh
$ ./docker/run-container.sh
...
```

- Switch to the next clause (Usage)


### From scratch

Pre-requisites:
- Install Virtualbox

Procedure:
- Install a new Linux Virtual machine (Mint, Debian...)
- Update your system with the latest version of kernel and security packages
- Install the following packages (According to the Linux chosen, the package naming can be different)
    autoconf
    bison
    build-essential
    cmake
    curl
    dos2unix
    doxygen
    emacs
    expect
    flex
    g++:latest
    gcc:latest
    graphviz
    gdb 
    git-core
    gnutls-bin
    libglib2.0-dev
    libpcap-dev
    libgcrypt-dev
    libncurses5-dev
    libssl-dev
    libtool-bin
    libtool
    libwireshark-dev
    libxml2-dev
    lsof
    ntp
    pkg-config
    qt5-default
    qtmultimedia5-dev
    libqt5svg5-dev
    subversion
    sudo
    sshpass
    tcpdump
    texlive-font-utils
    tshark
    valgrind
    vim
    vsftpd
    xutils-dev 
    tree
    tzdata
    unzip
    wget
    xsltproc
- In your home directory, create the following folders: 
    - $HOME/frameworks, 
    - $HOME/dev
    - $HOME/lib
- In $HOME/frameworks, build the following package:
    - asn1c, according the procedure specified [here](https://github.com/vlm/asn1c.git)
    - Eclipse IDE for C/C++ Developers, according the procedure specified [here](https://www.eclipse.org/cdt/)
    - TITAN, according the procedure specified [here](https://github.com/eclipse/titan.core)
    - Import the TITAN plugin into your Eclipse IDE, according the procedure specified [here](https://github.com/eclipse/titan.core)
- Clone the ETSI MEC Testing Framework project into $HOME/dev folder

```sh
206
207
208
209
$ 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
YannGarcia's avatar
YannGarcia committed
210
211
```

212
213
214
215
216
217
218
219
- 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/
YannGarcia's avatar
YannGarcia committed
220
221
```

YannGarcia's avatar
YannGarcia committed
222
- Update your default environment with the content of the script $HOME/dev/TTF012_Mec/scripts/devenv.bash.ubuntu
223

YannGarcia's avatar
YannGarcia committed
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
- Switch to the next clause (Usage)


## Usage

This clause describes how to compile and execute an Abstract Test Suite.


Pre-requisites:
- Your machine is installed following one of the installation method describes in the previous clause
- Your are logged as 'etsi' or 'vagrant' user

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
YannGarcia's avatar
YannGarcia committed
240
- Create a new TITAN project (e.g. TTF012_Mec)
YannGarcia's avatar
YannGarcia committed
241
242
243
244
<TODO>

Procedure in TITAN command line:
- Open several SSH session (PuTTY...)
YannGarcia's avatar
YannGarcia committed
245
- Change to the directory ~/dev/TTF012_Mec/src/AtsMec/objs
YannGarcia's avatar
YannGarcia committed
246
247
248
- Build the test suite AtsMec

```sh
YannGarcia's avatar
YannGarcia committed
249
250
$ cd ~/dev/TTF012_Mec/ && export ATS=AtsMec
$ make
YannGarcia's avatar
YannGarcia committed
251
252
253
254
...
```

- Edit the file ../etc/AtsMec.cfg
Yann Garcia's avatar
Yann Garcia committed
255
- Update the following fields:
YannGarcia's avatar
YannGarcia committed
256
257
258
259
260
    - PICS_HEADER_HOST, the HTTP host header value
    - system.httpPort.params
- To run the test suite, execute the following command:

```sh
YannGarcia's avatar
YannGarcia committed
261
262
$ cd ~/dev/TTF012_Mec/scripts/
$ ./run-all.bash
YannGarcia's avatar
YannGarcia committed
263
264
265
266
267
268
269
270
271
272
...
```

- The log files are located in ../logs folder. You can edit them using any editor or using the Eclipse TITAN log plugins


## How to Report a Bug

The ETSI MEC Testing Framework project is under constant development, so it is possible that you will
encounter a bug while using it. Please report bugs at cti_support at etsi dot org.