Commit 03ce4c61 authored by garciay's avatar garciay
Browse files

Add README.md

parent d1baf3b7
#!/bin/bash
# Copyright ETSI 2018
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -vx
set -e
cd "$(dirname "$0")"
run_dir="$(pwd)"
cd docker
./build-container.sh
./run-container.sh "${run_dir}"
# ETSI ITS protocols project
## General Information
This repositories contains the test specifications and test adapter code for ETSI ITS protocols testing.
ETSI ITS protocols project supports:
- ETSI EN 302 637-2: "Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Part 2: Specification of Cooperative Awareness Basic Service"
- ETSI EN 102 637-3: "Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Part 3: Specifications of Decentralized Environmental Notification Basic Service"
- ETSI TS 103 301: "Intelligent Transport Systems (ITS); Vehicular Communications; Basic Set of Applications; Facilities layer protocols and communication requirements for infrastructure services"
- EN 302 636-5-1: "Intelligent Transport Systems (ITS); Vehicular Communications; GeoNetworking; Part 5: Transport Protocols; Sub-part 1: Basic Transport Protocol"
- EN 302 636-4-1: "Intelligent Transport Systems (ITS); Vehicular Communications; GeoNetworking; Part 4: Geographical addressing and forwarding for point-to-point and point-to-multipoint communications; Sub-part 1: Media-Independent Functionality"
In addition, it also support ITS Security as define by:
- ETSI TS 103 940: "Intelligent Transport Systems (ITS); Security; Security Architecture and Management".
- ETSI TS 102 941: "Intelligent Transport Systems (ITS); Security; Trust and Privacy Management technical specification"
- IEEE Std 1609.2™-2016: "IEEE Standard for Wireless Access in Vehicular Environments –Security Services for Applications and Management Messages"
- IEEE Std 1609.2a™-2017: "Standard for Wireless Access In Vehicular Environments – Security Services for Applications and Management Messages Amendment 1".
Contact information
Email at cti_support at etsi dot org
License
Unless specified otherwise, the content of this repository and the files contained are released under the ETSI Software License.
See the attached LICENSE file or visit
https://forge.etsi.org/etsi-software-license
## STFs
The following STFs were or are currently involved in the evolutions of the ETSI ITS protocols project:
- STF 405, STF 422, STF 424, STF 455, STF 462, STF 481, STF 484, STF 507, STF 517, STF 525, STF 538, STF 545
## Installation
The ETSI ITS protocol project builds and tests regularly on the following platforms:
- Linux (Ubuntu)
### 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/)
- Credentials to access [ETSI forge](https://oldforge.etsi.org/!/#)
- Set the environment variable USERNAME to your ETSI OEL account user name
- Set the environment variable PASSWORD to your ETSI OEL account password
Procedure:
- On your host machine, open a command line session (PUTTY, DOS window...)
- From the ETSI ITS protocols project, clone the Vagrant folder
- In the file Vagrantfilemodify 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
```
- Enjoy your tests
### Using Docbox
Pre-requisites on your host machine:
- Install Virtualbox
- Install Docbox
Procedure:
- On your host machine, open a command line session (PUTTY, DOS window...)
- On your host machine, clone the ETSI ITS protocols project. NOTE that only Docbox folder and .jenkins.sh script file are required
- From the ETSI ITS protocols 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
# su - etsi
```
- Switch to the next clause (Usage)
### From scratch
Pre-requisites:
- Install Virtualbox
Procedure:
- Install a new Linux Virtual machine (Mint, Debian...)
- Install the following packages
NOTE According to the Linux chosen, the package naming can be different
- Install Java
- Install Eclipse
- Install TITAN
- Create the user/group etsi/etsi
- Switch to the etsi account
- Clone the ETSI ITS protocols project
- ...
- Switch to the next clause (Usage)
## Usage
This clause describes how to compile and execute an Abstract Test Suite.
The procedures below illustrate how to run the CAM test suite. The same procedures will apply for any other ETSI ITS test suite.
Pre-requisites:
- Your machine is installed followimg one of the installation method describes in the previous clause
- Your are logged as 'etsi' user
Procedure using Eclipse TITAN:
Procedure in TITAN command line:
- Open several SSH session (PUTTY...)
- Change to the directory ~/dev/STF525_Its/src/AtsCAM/objs
- Edit the file ../etc/AtsCAM.cfg
- Update the following fields:
- system.camPort.params
- system.utPort.params
- Execute the following command:
```sh
$ ../bin/run-all.bash
# su - etsi
```
- The log files are located in ../logs folder. Yu can edit them using any editor or using the Eclipse TITAN log plugins
## How to Report a Bug
The ETSI ITS protocol 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.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/bionic64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
config.vm.boot_timeout = 900
# Use this hostname to force provisioner script to using SVN instead of external HDD
#config.vm.hostname = "vagrant-prov"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
#config.vm.network "private_network", ip: "192.168.4.94"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
#config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
#vb.gui = true
vb.customize ["modifyvm", :id, "--monitorcount", "1"]
vb.customize ["modifyvm", :id, "--vram", "12"]
# Customize the amount of memory on the VM:
vb.memory = "4096"
end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", path: "provisioner.bash", args: "<username> <password>", privileged: false
end
#!/bin/bash
# Prepare environment for the build
set -e # Exit with non 0 if any command fails
#set -vx
# Update system
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:linuxuprising/java -y
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install emacs gcc-8 g++-8 git subversion lsof ntp gdb make cmake flex bison autoconf doxygen graphviz libtool libncurses5-dev expect libssl-dev libxml2-dev xutils-dev tcpdump libpcap-dev libwireshark-dev wget tree unzip sshpass kubuntu-desktop valgrind qt5-default qtmultimedia5-dev libqt5svg5-dev -y
sudo DEBIAN_FRONTEND=noninteractive apt-get install oracle-java10-installer oracle-java10-set-default -y
sudo DEBIAN_FRONTEND=noninteractive apt --fix-broken install -y
sudo DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y
sudo DEBIAN_FRONTEND=noninteractive apt-get clean
gcc --version
g++ --version
valgrind --version
java -version
# Add vagrant user into sudo
sudo adduser vagrant sudo
# Create esti user
sudo useradd --create-home --shell /bin/bash etsi
echo "etsi:etsi" | chpasswd
sudo adduser etsi sudo
sudo su - etsi
USER=
if [ "${USER}" != "etsi" ]
then
exit -1
fi
export USERNAME=$1
export PASSWORD=$2
export PATH_DEV=${HOME}/dev
export HOME_FRAMEWORKS=${HOME}/frameworks
export HOME_LIB=${HOME}/lib
export HOME_BIN=${HOME}/bin
export HOME_ETC=${HOME}/etc
export HOME_INC=${HOME}/include
export HOME_TMP=${HOME}/tmp
export HOME_DOCS=${HOME}/docs
export PATH=${HOME_BIN}:${PATH}
export LD_LIBRARY_PATH=${HOME_LIB}:/usr/local/lib:${LD_LIBRARY_PATH}
OLD_PWD=`pwd`
# Create directories
mkdir -p ${HOME_LIB}
if [ ! -d ${HOME_LIB} ]
then
exit -1
fi
mkdir -p ${HOME_INC}
if [ ! -d ${HOME_INC} ]
then
exit -1
fi
mkdir -p ${HOME_BIN}
if [ ! -d ${HOME_BIN} ]
then
exit -1
fi
mkdir -p ${HOME_TMP}
if [ ! -d ${HOME_TMP} ]
then
exit -1
fi
mkdir -p ${HOME_DOCS}
if [ ! -d ${HOME_DOCS} ]
then
exit -1
fi
mkdir -p ${HOME_FRAMEWORKS}
if [ ! -d ${HOME_FRAMEWORKS} ]
then
exit -1
fi
cd /home/etsi/dev
svn co --username $USERNAME --password $PASSWORD --non-interactive https://oldforge.etsi.org/svn/ITS/branches/STF525 ./STF525_Its
cd /home/etsi/dev/STF525_Its/scripts
chmod 775 *.bash devenv.bash.ubuntu
cd /home/etsi
ln -sf /home/etsi/dev/STF525_Its/scripts/devenv.bash.ubuntu /home/etsi/devenv.bash
export HOME=/home/etsi
. /home/etsi/devenv.bash
# Install all frameworks
cd ${HOME_FRAMEWORKS}
# Install asn1c
cd ${HOME_FRAMEWORKS}
git clone https://github.com/vlm/asn1c.git asn1c
cd ${HOME_FRAMEWORKS}/asn1c
test -f configure || autoreconf -iv
./configure
make && sudo make install
cd -
# Install GoogleTest
cd ${HOME_FRAMEWORKS}
git clone https://github.com/google/googletest.git googletest
cd ${HOME_FRAMEWORKS}/googletest/
cmake .
make CXX=g++
sudo make install
cd -
# Install latest LCOV
mkdir -p ${HOME_FRAMEWORKS}/lcov
cd ${HOME_FRAMEWORKS}/lcov
wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz
tar xf lcov_1.13.orig.tar.gz
sudo make -C lcov-1.13/ install
cd -
# Install lcov to coveralls conversion
sudo gem install coveralls-lcov
lcov --version
coveralls-lcov -h
# Install java
sudo DEBIAN_FRONTEND=noninteractive apt-get install oracle-java9-installer oracle-java9-set-default -y
java --version
# Install eclipse
cd ${HOME_FRAMEWORKS}
wget 'http://ftp.halifax.rwth-aachen.de/eclipse//technology/epp/downloads/release/oxygen/2/eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz' -Oeclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz
tar -zxvf ./eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz
rm -f ./eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz
# Checkout the project
if [ ${USERNAME} != '' ] && [ ${PASSWORD} != '' ]
then
cd ${HOME}/tmp
svn co --username $USERNAME --password $PASSWORD --non-interactive https://oldforge.etsi.org/svn/ITS/branches/STF525
fi
cd ${HOME}/TriesAndDelete/scripts
. ${HOME}/devenv.bash
./build_titan.bash
. ${HOME}/devenv.bash
./update_its_project.bash
ln -sf ~/TriesAndDelete/etsi_its/lib/libItsAsn.so ~/lib/libItsAsn.so
cd ${HOME}/TriesAndDelete/etsi_its/src/TestCodec/objs
. ${HOME}/devenv.bash
../bin/testcodec_generate_makefile.bash
../bin/run_mtc.bash &
../bin/run_ptcs.bash
cd ${OLD_PWD}
unset USERNAME
unset PASSWORD
sudo init 6
exit 0
FROM gcc:latest
MAINTAINER STF525
LABEL description="STF525 Docker Image"
ENV TERM=linux
ENV HOSTNAME docker-titan-STF525
ARG USERNAME
ARG PASSWORD
RUN echo "docker-titan" > /etc/hostname \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y \
&& DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:linuxuprising/java -y \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
autoconf \
bison \
build-essential \
cmake \
curl \
doxygen \
emacs \
expect \
flex \
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 \
vsftpd \
xutils-dev \
tree \
unzip \
wget \
&& DEBIAN_FRONTEND=noninteractive apt-get install oracle-java10-installer oracle-java10-set-default -y \
&& DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \
&& DEBIAN_FRONTEND=noninteractive apt-get autoclean \
&& java -version \
&& useradd --create-home --shell /bin/bash etsi \
&& echo "etsi:etsi" | chpasswd \
&& adduser etsi sudo \
&& su - etsi \
&& whoami \
&& cd /home/etsi \
&& mkdir -p bin lib include tmp frameworks docs dev \
&& cd /home/etsi/dev \
&& svn co --username $USERNAME --password $PASSWORD --non-interactive https://oldforge.etsi.org/svn/ITS/branches/STF525 ./STF525_Its \
&& cd /home/etsi/dev/STF525_Its/scripts \
&& chmod 775 *.bash devenv.bash.ubuntu \
&& cd /home/etsi \
&& ln -sf /home/etsi/dev/STF549_Ng112/scripts/devenv.bash.ubuntu /home/etsi/devenv.bash \
&& export HOME=/home/etsi \
&& . /home/etsi/devenv.bash \
&& cd /home/etsi/frameworks \
&& wget 'http://ftp.halifax.rwth-aachen.de/eclipse//technology/epp/downloads/release/oxygen/2/eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz' -Oeclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz \
&& tar -zxvf ./eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz \
&& rm -f ./eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz \
&& cd /home/etsi/tmp \
&& echo "" >> /etc/profile \
&& echo "export HOME=/home/etsi" >> /etc/profile \
&& echo "export LD_LIBRARY_PATH=/home/etsi/TriesAndDelete/etsi_its/lib:$LD_LIBRARY_PATH" >> /etc/profile \
&& echo "export PATH=/home/etsi/bin:$PATH" >> /etc/profile \
&& echo "cd /home/etsi" >> /etc/profile \
&& echo ". ./devenv.bash" >> /etc/profile \
&& cd /home/etsi/STF525_Its/scripts \
&& ./build_titan.bash \
&& cd /home/etsi \
&& . /home/etsi/devenv.bash \
&& cd /home/etsi/STF525_Its/scripts \
CMD ["/bin/bash"]
# That's all Floks
#!/bin/bash
# Copyright ETSI 2018
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
set -e
set -vx
USERNAME=garciay
PASSWORD=d08dga510
DOCKER_FILE=./Dockerfile
if [ -f ${DOCKER_FILE} ]
then
docker rmi -f $(docker images -q)
docker build --tag stf525_its --force-rm --build-arg USERNAME=${USERNAME} --build-arg PASSWORD=${PASSWORD} .
if [ "$?" != "0" ]
then
echo "Docker build failed: $?"
exit -1
fi
docker image ls -a
docker inspect stf525_its:latest
if [ "$?" != "0" ]
then
echo "Docker inspect failed: $?"
exit -1
fi
else
exit -2
fi
# That's all Floks
exit 0
#!/bin/bash
# Copyright ETSI 2018
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -e
#set -vx
docker run -it --rm stf525_its:latest /bin/bash -c "sudo stf525"
# That's all Floks
exit 0
#/bin/bash
set -e
#set -vx
clear
if [ -z "${TOP}" ]
then
echo "Failed, TOP variable not defined, exit"
exit 1
fi
CURDIR=`pwd`
TITAN_DIR=${TOP}/..
# Move to the right directory
if [ ! -d ${TITAN_DIR} ]
then
echo "Titan directory does not exist, create it"
# Create TITAN directories
mkdir -p ${TITAN_DIR}
if [ ! "$?" -eq "0" ]
then
echo "Failed, TOP variable not defined, exit"
exit 2
fi
cd ${TITAN_DIR}
# Clone all TITAN repositories
if [ ! -f ${CURDIR}/titan_repos.txt ]
then
echo "${HOME_BIN}/titan_repos.txt file does not exist, exit"
rm -fr ${TOP}
rm -fr ${TOP}/..
exit 3
fi
TITAN_REPOS=`cat ${CURDIR}/titan_repos.txt`
for i in ${TITAN_REPOS};
do
git clone $i
if [ ! "$?" -eq "0" ]
then
echo "Failed to clone $i, exit"
exit 4
fi
done
else
cd ${TITAN_DIR}
# Update github folders
DIRS=`find . -type d -name ".git" -exec dirname {} \;`
for i in ${DIRS};
do
echo "Processing $i..."
cd $i
git fetch
if [ ! "$?" -eq "0" ]
then
echo "Failed to fetch $i, continue"
else
git pull
if [ ! "$?" -eq "0" ]
then
echo "Failed to pull $i, continue"
fi
fi
cd -
done
fi
# Build TITAN core
export JNI=no
export GUI=no
export DEBUG=no
export GEN_PDF=no
if [ -d ${TTCN3_DIR} ]
then
rm -fr ${TTCN3_DIR}
fi
mkdir ${TTCN3_DIR}