#!/bin/bash
#set -e
set -vx
echo -e "*****************************\n* Install titan\n*****************************\n"
SRC_DIR=${HOME}/frameworks/titan/titan.core
export TTCN3_DIR=$HOME/frameworks/titan/Install
[ -f /usr/bin/java ] && export JAVA_HOME=`readlink -f /usr/bin/java | sed "s:bin/java::"`
TITAN_REPO=`cat ${HOME}/etc/titan_repos.txt | grep 'titan\.core\.git' | head -n 1`
export PATH=$PATH:$TTCN3_DIR/bin
mkdir -p "$SRC_DIR"
cd "$SRC_DIR/.." || exit 1
# Install titan core
git clone --progress "$TITAN_REPO" || exit 1
cd titan.core || exit 1
cat >Makefile.personal <<EOF
TTCN3_DIR=$TTCN3_DIR
JNI=no
GUI=no
DEBUG=no
GEN_PDF=no
JDKDIR=$JAVA_HOME
EOF
# To prevent link error /usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command lineema
sed --in-place 's/LINUX_LIBS := -lxml2/LINUX_LIBS := -lxml2 -lpthread/g' ./core/Makefile
make && make install || exit 1
# To be compiant with build_ttcn3.bash
# TODO Refactor build_ttcn3.bash & devenv.bash
mv ${TTCN3_DIR} ${SRC_DIR}
export TTCN3_DIR=${SRC_DIR}/Install
echo "export TTCN3_DIR=$TTCN3_DIR" >> $HOME/.bashrc
echo "export PATH=\$PATH:\$TTCN3_DIR/bin" >> $HOME/.bashrc
# Install other repos
cd $SRC_DIR/.. || exit 1
cat ${HOME}/etc/titan_repos.txt | grep -v -e '^\s*#' -e 'titan\.core' | while read REPO; do
[ -z $ $REPO ] && continue
WS=`echo $REPO | sed -e 's|.*/||g' -e 's|\.git||g'`
if git clone --progress "${REPO}" "${WS}"; then
[ -f "$WS/Makefile" ] && make -C "$WS"
fi
done
cd $HOME
#!/bin/bash
#set -e
set -vx
echo -e "*****************************\n* Install osip\n*****************************\n"
cd ${HOME}/frameworks
git clone https://git.savannah.gnu.org/git/osip.git ./osip
cd osip
./autogen.sh
./configure --prefix=/home/etsi
make && make install
cd ${HOME}
#!/bin/bash
#set -e
set -vx
echo -e "*****************************\n* Checkout TTF T012 sources\n*****************************\n"
mkdir -p ${HOME}/dev && cd ${HOME}/dev || exit 1
git clone --branch devel --recurse-submodules --single-branch https://forge.etsi.org/rep/int/vxlte/emergency-iop.git || exit 1
echo -e "*****************************\n* Set up environment\n*****************************\n"
cd /home/etsi/dev/emergency-iop/scripts || exit 1
ln -sf /home/etsi/dev/emergency-iop/scripts/devenv.bash.ubuntu /home/etsi/devenv.bash || exit 1
. /home/etsi/devenv.bash || exit 1
echo -e "*****************************\n* Apply patched \n*****************************\n"
cd /home/etsi/dev/emergency-iop || exit 1
./install.sh || exit 1
echo -e "*****************************\n* Build test suites\n*****************************\n"
ATS_LIST="AtsLIS AtsECRF AtsESRP AtsPSAP AtsBCF"
for i in ${ATS_LIST}
do
export ATS=$i
make
done
echo -e "*****************************\n* Init Eclipse Workspace\n*****************************\n"
echo -e "*****************************\n* Setup a configuration file\n*****************************\n"
cd ./etc/AtsImsIot
ln -sf AtsImsIot.cfg_ AtsImsIot.cfg
cd -
echo -e "*****************************\n* Change sudo in command line\n*****************************\n"
cd /home/etsi/dev/emergency-iop/scripts
export ATS=AtsLIS
#sed --in-place 's/sudo/echo "etsi" \| sudo -S/' ./run_all.bash
cd /home/etsi/dev/emergency-iop
#!/bin/bash
#set -e
set -vx
echo -e "*****************************\n* Build docs \n*****************************\n"
. /home/etsi/devenv.bash
cd ${HOME}/dev/emergency-iop/docs || exit 1
doxygen ./o2.cfg || exit 1
# Generate PDF file
cd ${HOME}/dev/emergency-iop/docs/AtsImsIotDocs/latex
make && mv refman.pdf ${HOME}/docs/AtsImsIot_help.pdf
cd ${HOME}
exit 0
https://gitlab.eclipse.org/eclipse/titan/titan.core.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.Common_Components.Abstract_Socket.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.HTTPmsg.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.LANL2asp.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.PCAPasp.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.PIPEasp.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.SCTPasp.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.SIPmsg.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.SQLasp.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.TCPasp.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.TELNETasp.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.UDPasp.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.COMMON.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.DHCP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.DHCPv6.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.DIAMETER_ProtocolModule_Generator.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.DNS.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.ICMP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.ICMPv6.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.IP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.RTP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.RTSP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.SMPP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.SMTP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.SNMP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.TCP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.UDP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.XMPP.git
https://gitlab.eclipse.org/eclipse/titan/titan.misc.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.LDAPasp_RFC4511.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.LDAPmsg.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.Common_Components.Socket-API.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.SSHCLIENTasp.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.STDINOUTmsg.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.SUNRPCasp.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.UNIX_DOMAIN_SOCKETasp.git
https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.IPL4asp.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.FrameRelay.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.H248_v2.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.IMAP_4rev1.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.ICAP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.IKEv2.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.IPsec.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.IUA.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.JSON_v07_2006.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.L2TP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.M3UA.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.MIME.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.MSRP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.PPP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.ProtoBuff.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.RADIUS_ProtocolModule_Generator.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.SRTP.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.WebSocket.git
https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.HTTP2.0.git
https://gitlab.eclipse.org/eclipse/titan/titan.Libraries.TCCUsefulFunctions.git
#!/bin/bash
# Copyright ETSI 2018-2020
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -e
set -vx
docker run --interactive --tty --rm --publish 2222:22 --env DISPLAY=$DISPLAY --volume /tmp/.X11-unix:/tmp/.X11-unix --cap-add=NET_RAW --cap-add=NET_ADMIN etsiforge/AtsImsIot:latest
# That's all Floks
exit 0
FROM alpine:latest
# Install dependencies
RUN apk update && \
apk add --no-cache autoconf automake sudo make git g++ diffutils expect openssl-dev libxml2-dev libxml2-utils libxslt-dev libtool ncurses-dev jsoncpp-dev readline-dev flex bison perl libexecinfo-dev bash libedit libedit-dev lksctp-tools lksctp-tools-dev libpcap-dev
# Create user and sudouser
RUN \
addgroup -g 1000 etsi && \
adduser -S -D -u 1000 -G etsi -h /home/etsi -s /bin/bash etsi && \
echo "etsi:etsi" | chpasswd && \
echo "etsi ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers || exit 1
USER etsi
# Setup Hosts file at the boot time
RUN \
echo 'sudo sh -c "cp /etc/hosts /etc/append && (echo \"127.0.1.1 $HOSTNAME\"; cat /etc/append) > /etc/hosts"' >> /home/etsi/.bashrc \
echo 'sh' >> /home/etsi/.bashrc || exit 1
# Clone OSIP
WORKDIR /home/etsi
RUN \
mkdir -p frameworks dev tmp && cd frameworks \
&& cd ${HOME}/frameworks \
&& git clone https://git.savannah.gnu.org/git/osip.git ./osip \
&& cd osip \
&& ./autogen.sh \
&& ./configure --prefix=/home/etsi \
&& make && make install \
&& cd - || exit 1
# Clone Titan
RUN git clone https://github.com/eclipse/titan.core.git || exit 1
WORKDIR /home/etsi/frameworks/titan.core/
# Setup ENV variables
ENV TTCN3_DIR=/home/etsi/frameworks/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH \
LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH
# Set flags
RUN \
echo "ALPINE_LINUX=yes" > Makefile.personal && \
echo "TTCN3_DIR=$TTCN3_DIR" >> Makefile.personal && \
echo "JNI=no" >> Makefile.personal && \
echo "GUI=no" >> Makefile.personal && \
echo "DEBUG=no" >> Makefile.personal || exit 1
# Build Titan
RUN \
sed --in-place 's/LINUX_LIBS := -lxml2/LINUX_LIBS := -lxml2 -lpthread/g' ./core/Makefile && \
make install && make clean || exit 1
WORKDIR /home/etsi/dev
EXPOSE 443/tcp
EXPOSE 5060/udp
EXPOSE 5061/udp
ENTRYPOINT /home/yann/dev/cise/virtualization/docker/docker-entrypoint.sh
#!/usr/bin/env bash
set -euo pipefail
usage() {
echo "No command specified. Available commands:"
for i in $(echo $commands | sed "s/,/ /g")
do
echo " $i"
done
}
commands="help,build,clean,list,modulepar,rebuild,run,version"
if [ $# == 0 ]; then
usage
exit 1
fi
if [ $# == 2 ]; then
if [ "$2" != "" ]; then
export ATS=Ats$2
cli="${GEN_DIR}/bin/$ATS"
echo "cli: $cli"
fi
fi
case "$1" in
build)
cd ${GEN_DIR} && make
;;
clean)
cd ${GEN_DIR} && make clean
;;
list)
${cli} -l
;;
modulepar)
${cli} -p
;;
rebuild)
cd ${GEN_DIR} && rm -fr ./bin ./build ; make
;;
run)
cd ${GEN_DIR}/scripts && ./run_all.bash
;;
version)
compiler -v
;;
*)
usage
exit 1
;;
esac
unset ATS
exit 0
\ No newline at end of file
#!/bin/bash
set -exo pipefail
cd "$(dirname ${BASH_SOURCE})"
docker run --rm -it \
-w /home/yann/dev/AtsImsIot \
-e GEN_DIR=/home/yann/dev/AtsImsIot \
-p 0.0.0.0:443:443 \
-p 0.0.0.0:5060:5060/udp \
-p 0.0.0.0:5061:5061/udp \
-u "$(id -u):$(id -g)" \
-v "${PWD}/../..:/home/yann/dev/AtsImsIot" \
--entrypoint /home/yann/dev/AtsImsIot/virtualization/docker/docker-entrypoint.sh \
alpine-AtsImsIot:latest "$@"
# -*- 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 = "bento/ubuntu-18.04"
# 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", 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 apt-get install software-properties-common -y
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get --allow-unauthenticated install emacs openjdk-11-jre gcc-9 g++-9 git subversion lsof ntp gdb make cmake flex bison autoconf doxygen graphviz libedit2 libedit-dev libtool libncurses5-dev expect libssl-dev libgcrypt-dev libxml2-dev xutils-dev tcpdump libpcap-dev libwireshark-dev wget tree unzip sshpass kubuntu-desktop valgrind qt5-default qttools5-dev qtmultimedia5-dev libqt5svg5-dev vim tzdata dos2unix xsltproc -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
export HOME=/home/vagrant
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
mkdir -p ${PATH_DEV}
if [ ! -d ${PATH_DEV} ]
then
exit -1
fi
cd /home/vagrant
echo "" >> /home/vagrant/.bashrc
echo "export LD_LIBRARY_PATH=/home/vagrant/dev/emergency-iop/lib:$LD_LIBRARY_PATH" >> /home/vagrant/.bashrc
echo "export PATH=/home/vagrant/bin:$PATH" >> /home/vagrant/.bashrc
echo ". ~/devenv.bash" >> /home/vagrant/.bashrc
cd /home/vagrant/dev
git clone --recurse-submodules --branch=devel https://forge.etsi.org/rep/int/vxlte/emergency-iop.git
cd /home/vagrant/dev/emergency-iop
./install.sh
# Install all frameworks
# Install osip
cd ${HOME_FRAMEWORKS}
git clone git://git.savannah.gnu.org/osip.git ./osip
cd ./osip
./autogen.sh
./configure --prefix=/home/vagrant
make && make install
# 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
# Install latest LCOV
cd ${HOME_FRAMEWORKS}
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
# Install lcov to coveralls conversion
sudo gem install coveralls-lcov
lcov --version
coveralls-lcov -h
# Build TITAN
cd /home/vagrant/dev/emergency-iop/scripts
./build_titan.bash
. /home/vagrant/devenv.bash
# Build the AtsLIS
cd /home/vagrant/dev/emergency-iop
export ATS=AtsLIS
make
# Change user in cfg files
cd ${HOME}/dev/emergency-iop/scripts
./update_user_name.sh emergency-iop
cd ${OLD_PWD}
sudo init 6
exit 0