Add GBProxy_Test

Change-Id: I6661887c741b44aa0927079f79b4d5fcc40d8acf
This commit is contained in:
Daniel Willmann 2020-10-14 19:20:41 +02:00
parent f567542874
commit 687ea83fc6
5 changed files with 194 additions and 0 deletions

View File

@ -0,0 +1,35 @@
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
RUN cd osmo-ttcn3-hacks && \
git checkout -f -B master origin/master && \
make deps
RUN git config --global user.email docker@dock.er && \
git config --global user.name "Dock Er"
ARG OSMO_TTCN3_BRANCH="master"
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 gbproxy
VOLUME /data
RUN ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-start.sh / && \
ln -s /osmo-ttcn3-hacks/ttcn3-tcpdump-stop.sh /
COPY GBProxy_Tests.cfg /data/GBProxy_Tests.cfg
CMD cd /data && \
/osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/gbproxy/GBProxy_Tests; \
exit_code=$?; \
/osmo-ttcn3-hacks/log_merge.sh GBProxy_Tests --rm; \
exit $exit_code

View File

@ -0,0 +1,59 @@
[ORDERED_INCLUDE]
# Common configuration, shared between test suites
"/osmo-ttcn3-hacks/Common.cfg"
# testsuite specific configuration, not expected to change
"/osmo-ttcn3-hacks/gbproxy/GBProxy_Tests.default"
# Local configuration below
[LOGGING]
[TESTPORT_PARAMETERS]
*.GBPVTY.CTRL_HOSTNAME := "172.18.24.10"
[MODULE_PARAMETERS]
GBProxy_Tests.mp_nsconfig_sgsn := {
{
provider := {
ip := {
address_family := AF_INET,
local_ip := "172.18.24.103",
remote_ip := "172.18.24.10"
}
}
}
}
GBProxy_Tests.mp_nsconfig_pcu := {
{
provider := {
ip := {
address_family := AF_INET,
local_ip := "172.18.24.103",
remote_ip := "172.18.24.10"
}
}
},
{
provider := {
ip := {
address_family := AF_INET,
local_ip := "172.18.24.103",
remote_ip := "172.18.24.10"
}
}
},
{
provider := {
ip := {
address_family := AF_INET,
local_ip := "172.18.24.103",
remote_ip := "172.18.24.10"
}
}
}
}
[MAIN_CONTROLLER]
[EXECUTE]
GBProxy_Tests.control

View File

@ -0,0 +1 @@
include ../make/Makefile

60
ttcn3-gbproxy-test/jenkins.sh Executable file
View File

@ -0,0 +1,60 @@
#!/bin/sh
. ../jenkins-common.sh
IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
docker_images_require \
"osmo-sgsn-$IMAGE_SUFFIX" \
"ttcn3-gbproxy-test"
SUBNET=24
network_create $SUBNET
mkdir $VOL_BASE_DIR/gbproxy-tester
cp GBProxy_Tests.cfg $VOL_BASE_DIR/gbproxy-tester/
mkdir $VOL_BASE_DIR/sgsn
cp osmo-gbproxy.cfg $VOL_BASE_DIR/sgsn/
# Disable features not in latest yet
if [ "$IMAGE_SUFFIX" = "latest" ]; then
true;
fi
mkdir $VOL_BASE_DIR/unix
echo Starting container with SGSN
docker run --rm \
$(docker_network_params $SUBNET 10) \
--ulimit core=-1 \
-v $VOL_BASE_DIR/sgsn:/data \
--name ${BUILD_TAG}-sgsn -d \
$DOCKER_ARGS \
$REPO_USER/osmo-sgsn-$IMAGE_SUFFIX \
/bin/sh -c "osmo-gbproxy -c /data/osmo-gbproxy.cfg >/data/osmo-gbproxy.log 2>&1"
echo Starting container with SGSN testsuite
docker run --rm \
$(docker_network_params $SUBNET 103) \
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/gbproxy-tester:/data \
--name ${BUILD_TAG}-ttcn3-gbproxy-test \
$DOCKER_ARGS \
$REPO_USER/ttcn3-gbproxy-test $@
echo Starting container to merge logs
docker run --rm \
$(docker_network_params $SUBNET 103) \
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/gbproxy-tester:/data \
--name ${BUILD_TAG}-ttcn3-gbproxy-test-logmerge \
--entrypoint /osmo-ttcn3-hacks/log_merge.sh GBProxy_Tests --rm \
$DOCKER_ARGS \
$REPO_USER/ttcn3-gbproxy-test
echo Stopping containers
docker container kill ${BUILD_TAG}-sgsn
network_remove
collect_logs

View File

@ -0,0 +1,39 @@
!
! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty
!!
!
log gsmtap 172.18.24.103
logging level set-all debug
logging filter all 1
!
log stderr
logging filter all 1
logging color 1
logging print category 1
logging timestamp 1
logging print extended-timestamp 1
logging print file 1
logging level all everything
!
line vty
no login
bind 0.0.0.0
!
gbproxy
sgsn nsei 101
ns
nse 101 nsvci 101
nse 101 remote-role sgsn
nse 101 encapsulation udp
nse 101 remote-ip 172.18.24.103
nse 101 remote-port 23000
timer tns-block 3
timer tns-block-retries 3
timer tns-reset 3
timer tns-reset-retries 3
timer tns-test 30
timer tns-alive 3
timer tns-alive-retries 10
encapsulation udp local-ip 172.18.24.10
encapsulation udp local-port 23000
encapsulation framerelay-gre enabled 0