diff --git a/ttcn3-pcap-client-test/Dockerfile b/ttcn3-pcap-client-test/Dockerfile new file mode 100644 index 00000000..2a3799fb --- /dev/null +++ b/ttcn3-pcap-client-test/Dockerfile @@ -0,0 +1,13 @@ +ARG REGISTRY +ARG USER +FROM $REGISTRY/$USER/debian-stretch-titan +ARG OSMO_TTCN3_BRANCH="master" + +ADD http://git.osmocom.org/osmo-ttcn3-hacks/patch?h=$OSMO_TTCN3_BRANCH /tmp/commit +RUN ttcn3-docker-prepare "$OSMO_TTCN3_BRANCH" pcap-client + +VOLUME /data + +COPY OPCAP_CLIENT_Tests.cfg /data/OPCAP_CLIENT_Tests.cfg + +CMD ttcn3-docker-run pcap-client OPCAP_CLIENT_Tests diff --git a/ttcn3-pcap-client-test/Makefile b/ttcn3-pcap-client-test/Makefile new file mode 100644 index 00000000..1c6de69d --- /dev/null +++ b/ttcn3-pcap-client-test/Makefile @@ -0,0 +1,3 @@ +RUN_ARGS?=--sysctl net.ipv6.conf.all.disable_ipv6=0 --rm + +include ../make/Makefile diff --git a/ttcn3-pcap-client-test/OPCAP_CLIENT_Tests.cfg b/ttcn3-pcap-client-test/OPCAP_CLIENT_Tests.cfg new file mode 100644 index 00000000..e76fc4ff --- /dev/null +++ b/ttcn3-pcap-client-test/OPCAP_CLIENT_Tests.cfg @@ -0,0 +1,22 @@ +[ORDERED_INCLUDE] +"/osmo-ttcn3-hacks/Common.cfg" +"/osmo-ttcn3-hacks/pcap-client/OPCAP_CLIENT_Tests.default" + +# Local configuration below + +[LOGGING] + +[TESTPORT_PARAMETERS] +*.VTY.CTRL_HOSTNAME := "172.18.31.20"; + +[MODULE_PARAMETERS] +OPCAP_CLIENT_Tests.mp_local_opcap_ip := "172.18.31.10"; +OPCAP_CLIENT_Tests.mp_local_opcap_port := 5000; +OPCAP_CLIENT_Tests.mp_traffic_a := { "172.18.31.10", 44423 }; +OPCAP_CLIENT_Tests.mp_traffic_b := { "172.18.31.20", 44442 }; + + +[MAIN_CONTROLLER] + +[EXECUTE] +OPCAP_CLIENT_Tests.control diff --git a/ttcn3-pcap-client-test/jenkins.sh b/ttcn3-pcap-client-test/jenkins.sh new file mode 100755 index 00000000..60d44e69 --- /dev/null +++ b/ttcn3-pcap-client-test/jenkins.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +. ../jenkins-common.sh +IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}" +docker_images_require \ + "osmo-pcap-$IMAGE_SUFFIX" \ + "ttcn3-pcap-client-test" + +set_clean_up_trap +set -e + +mkdir $VOL_BASE_DIR/pcap-client-tester +cp OPCAP_CLIENT_Tests.cfg $VOL_BASE_DIR/pcap-client-tester/ + +mkdir $VOL_BASE_DIR/pcap-client +cp osmo-pcap-client.cfg $VOL_BASE_DIR/pcap-client/ + +SUBNET=31 +network_create $SUBNET + +echo Starting container with pcap-client +docker run --rm \ + $(docker_network_params $SUBNET 20) \ + --ulimit core=-1 \ + -v $VOL_BASE_DIR/pcap-client:/data \ + --name ${BUILD_TAG}-pcap-client -d \ + $DOCKER_ARGS \ + $REPO_USER/osmo-pcap-$IMAGE_SUFFIX + +echo Starting container with pcap-client testsuite +docker run --rm \ + $(docker_network_params $SUBNET 10) \ + --ulimit core=-1 \ + -e "TTCN3_PCAP_PATH=/data" \ + -v $VOL_BASE_DIR/pcap-client-tester:/data \ + --name ${BUILD_TAG}-ttcn3-pcap-client-test \ + $DOCKER_ARGS \ + $REPO_USER/ttcn3-pcap-client-test diff --git a/ttcn3-pcap-client-test/osmo-pcap-client.cfg b/ttcn3-pcap-client-test/osmo-pcap-client.cfg new file mode 100644 index 00000000..7394c967 --- /dev/null +++ b/ttcn3-pcap-client-test/osmo-pcap-client.cfg @@ -0,0 +1,15 @@ +! +! OsmoPCAPClient (UNKNOWN-dirty) configuration saved from vty +!! +! +! +line vty + no login + bind 0.0.0.0 +! +client + pcap device eth0 + pcap filter udp port 44423 + pcap detect-loop 0 + server ip 172.18.31.10 + server port 5000