Introduce ttcn3-stp-test

Currently builds from osmo-ttcn3-hacks.git branch laforge/stp instead of
master, since it's only available in the former branch. Once it gets
merged, we can modify Dockerfile as explained in it.

OS#4220
Change-Id: I635c891f5da7b8c59527abbad14d7377465d1045
This commit is contained in:
Pau Espin 2019-10-24 16:45:59 +02:00
parent dbeec9ec47
commit 5e70a29727
5 changed files with 164 additions and 0 deletions

40
ttcn3-stp-test/Dockerfile Normal file
View File

@ -0,0 +1,40 @@
ARG USER
FROM $USER/debian-stretch-titan
RUN mkdir /root/projects && (cd /root/projects && ln -sf / git)
RUN git clone git://git.osmocom.org/osmo-ttcn3-hacks.git
# FIXME: Once M3UA dep update patches in laforge/stp is merged into master, the
# line checking it out can be removed.
RUN cd osmo-ttcn3-hacks && \
git checkout -f -B master origin/master && \
git fetch && git checkout -f -B laforge/stp origin/laforge/stp && \
make deps
RUN git config --global user.email docker@dock.er && \
git config --global user.name "Dock Er"
# FIXME: Once STP patches in laforge/stp are merged into master, then
# OSMO_TTCN3_BRANCH can be set again to "master".
ARG OSMO_TTCN3_BRANCH="laforge/stp"
ADD http://git.osmocom.org/osmo-ttcn3-hacks/patch?h=$OSMO_TTCN3_BRANCH /tmp/commit
RUN cd osmo-ttcn3-hacks && \
git fetch && \
git checkout $OSMO_TTCN3_BRANCH && \
(git symbolic-ref -q HEAD && git reset --hard origin/$OSMO_TTCN3_BRANCH || exit 1); \
git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \
make stp
VOLUME /data
RUN ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-start.sh / && \
ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-stop.sh /
COPY STP_Tests.cfg /data/STP_Tests.cfg
CMD cd /data && \
/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/stp/STP_Tests; \
exit_code=$?; \
/osmo-ttcn3-hacks/log_merge.sh STP_Tests --rm; \
exit $exit_code

3
ttcn3-stp-test/Makefile Normal file
View File

@ -0,0 +1,3 @@
RUN_ARGS?=--sysctl net.ipv6.conf.all.disable_ipv6=0 --rm --network sigtran --ip 172.18.2.202 -v ggsn-test-vol:/data
include ../make/Makefile

View File

@ -0,0 +1,20 @@
[ORDERED_INCLUDE]
"/osmo-ttcn3-hacks/Common.cfg"
"/osmo-ttcn3-hacks/stp/STP_Tests.default"
[LOGGING]
*.JUnitLogger.testsuite_name := "STP_Tests"
[TESTPORT_PARAMETERS]
*.VTY.CTRL_HOSTNAME := "172.18.19.200"
[MODULE_PARAMETERS]
STP_Tests_Common.mp_stp_ip := "172.18.19.200";
STP_Tests_Common.mp_local_ip := "172.18.19.203";
[MAIN_CONTROLLER]
[EXECUTE]
STP_Tests.control

37
ttcn3-stp-test/jenkins.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/sh
. ../jenkins-common.sh
IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
docker_images_require \
"debian-stretch-build" \
"osmo-stp-$IMAGE_SUFFIX" \
"debian-stretch-titan" \
"ttcn3-stp-test"
mkdir $VOL_BASE_DIR/stp-tester
cp STP_Tests.cfg $VOL_BASE_DIR/stp-tester/
mkdir $VOL_BASE_DIR/stp
cp osmo-stp.cfg $VOL_BASE_DIR/stp/
network_create 172.18.19.0/24
echo Starting container with STP
docker run --rm \
--network $NET_NAME --ip 172.18.19.200 \
-v $VOL_BASE_DIR/stp:/data \
--name ${BUILD_TAG}-stp -d \
$REPO_USER/osmo-stp-$IMAGE_SUFFIX
echo Starting container with STP testsuite
docker run --rm \
--network $NET_NAME --ip 172.18.19.203 \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/stp-tester:/data \
--name ${BUILD_TAG}-ttcn3-stp-test \
$REPO_USER/ttcn3-stp-test
docker container kill ${BUILD_TAG}-stp
network_remove
collect_logs

View File

@ -0,0 +1,64 @@
!
! OsmoSTP (1.1.0.2-3884) configuration saved from vty
!!
!
log stderr
logging filter all 1
logging color 1
logging print category-hex 1
logging print category 1
logging timestamp 0
logging print file 1
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 debug
logging level lsccp debug
logging level lsua debug
logging level lm3ua debug
logging level lmgcp notice
logging level ljibuf notice
logging level lrspro notice
!
stats interval 5
!
line vty
no login
bind 0.0.0.0
!
cs7 instance 0
point-code format 24
asp asp-sender 9999 2905 m3ua
local-ip 172.18.19.200
remote-ip 172.18.19.203
asp asp-receiver0 10000 2905 m3ua
local-ip 172.18.19.200
remote-ip 172.18.19.203
asp asp-receiver1 10001 2905 m3ua
local-ip 172.18.19.200
remote-ip 172.18.19.203
as as-sender m3ua
asp asp-sender
routing-key 1023 23
as as-receiver m3ua
asp asp-receiver0
routing-key 1042 42
as mahlzeit ipa
routing-key 0 5
point-code override dpc 23
route-table system
update route 23 16777215 linkset as-sender
update route 42 16777215 linkset as-receiver
listen m3ua 2905
accept-asp-connections dynamic-permitted
listen ipa 5000
accept-asp-connections dynamic-permitted