diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-08-23 16:33:28 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-08-28 14:32:38 +0200 |
commit | a94ec07c0fe24fe9681ef8c03c203737fa596414 (patch) | |
tree | 2ae035ab6b04d91d4b42f4ed228fef9a48b3fa18 | |
parent | 6e7628989945ee76bd370282dc2ebaff8ee99e00 (diff) |
Introduce osmo-dia2gsup-master, ttcn3-dia2gsup-test
- Add a docker container to run osmo_dia2gsup from git master.
- Add infrastructure to run the osmo-dia2gsup container against
osmo-ttcn3-hacks.git/dia2gsup testsuite.
Related: OS#5757
Change-Id: I646096d5a010df02af75aefa33b023b55997a6d7
-rw-r--r-- | jenkins-common.sh | 1 | ||||
-rw-r--r-- | make/Makefile | 2 | ||||
-rw-r--r-- | osmo_dia2gsup-master/Dockerfile | 28 | ||||
-rw-r--r-- | osmo_dia2gsup-master/Makefile | 1 | ||||
-rw-r--r-- | osmo_dia2gsup-master/osmo_dia2gsup.config | 12 | ||||
-rw-r--r-- | ttcn3-dia2gsup-test/DIA2GSUP_Tests.cfg | 17 | ||||
-rw-r--r-- | ttcn3-dia2gsup-test/Dockerfile | 14 | ||||
-rw-r--r-- | ttcn3-dia2gsup-test/Makefile | 1 | ||||
-rwxr-xr-x | ttcn3-dia2gsup-test/jenkins.sh | 41 | ||||
-rw-r--r-- | ttcn3-dia2gsup-test/osmo_dia2gsup.config | 12 |
10 files changed, 129 insertions, 0 deletions
diff --git a/jenkins-common.sh b/jenkins-common.sh index f069ffc..72eaec2 100644 --- a/jenkins-common.sh +++ b/jenkins-common.sh @@ -315,6 +315,7 @@ network_replace_subnet_in_configs() { "$VOL_BASE_DIR" \ -name '*.cfg' -o \ -name '*.conf' -o \ + -name '*.config' -o \ -name '*.confmerge' -o \ -name '*.inc' -o \ -name '*.scm' -o \ diff --git a/make/Makefile b/make/Makefile index d3bd727..126fd94 100644 --- a/make/Makefile +++ b/make/Makefile @@ -23,6 +23,7 @@ OSMO_BB_BRANCH?=master OSMO_BSC_BRANCH?=master OSMO_BTS_BRANCH?=master OSMO_CBC_BRANCH?=master +OSMO_DIA2GSUP_BRANCH?=master OSMO_GBPROXY_BRANCH?=master OSMO_GGSN_BRANCH?=master OSMO_GSM_TESTER_BRANCH?=master @@ -103,6 +104,7 @@ docker-build: .release --build-arg OSMO_BSC_BRANCH=$(OSMO_BSC_BRANCH) \ --build-arg OSMO_BTS_BRANCH=$(OSMO_BTS_BRANCH) \ --build-arg OSMO_CBC_BRANCH=$(OSMO_CBC_BRANCH) \ + --build-arg OSMO_DIA2GSUP_BRANCH=$(OSMO_DIA2GSUP_BRANCH) \ --build-arg OSMO_GBPROXY_BRANCH=$(OSMO_GBPROXY_BRANCH) \ --build-arg OSMO_GGSN_BRANCH=$(OSMO_GGSN_BRANCH) \ --build-arg OSMO_GSM_TESTER_BRANCH=$(OSMO_GSM_TESTER_BRANCH) \ diff --git a/osmo_dia2gsup-master/Dockerfile b/osmo_dia2gsup-master/Dockerfile new file mode 100644 index 0000000..f8f535b --- /dev/null +++ b/osmo_dia2gsup-master/Dockerfile @@ -0,0 +1,28 @@ +ARG USER +ARG DISTRO +FROM $USER/$DISTRO-erlang +# Arguments used after FROM must be specified again +ARG DISTRO + +WORKDIR /tmp + +ARG OSMO_DIA2GSUP_BRANCH="master" + +RUN git clone https://gerrit.osmocom.org/erlang/osmo_dia2gsup.git +ADD https://gerrit.osmocom.org/plugins/gitiles/erlang/osmo_dia2gsup/+/$OSMO_DIA2GSUP_BRANCH?format=TEXT /tmp/commit-osmo_dia2gsup + +RUN cd osmo_dia2gsup && \ + git fetch && git checkout $OSMO_DIA2GSUP_BRANCH && \ + (git symbolic-ref -q HEAD && git reset --hard origin/$OSMO_DIA2GSUP_BRANCH || exit 1); \ + git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ + rebar3 compile && \ + rebar3 escriptize + +VOLUME /data + +COPY osmo_dia2gsup.config /data/osmo_dia2gsup.config + +WORKDIR /data +CMD ["/bin/sh", "-c", "ERL_FLAGS='-config /data/osmo_dia2gsup.config' /tmp/osmo_dia2gsup/_build/default/bin/osmo-dia2gsup > /data/osmo_dia2gsup.config.log 2>&1"] + +#EXPOSE diff --git a/osmo_dia2gsup-master/Makefile b/osmo_dia2gsup-master/Makefile new file mode 100644 index 0000000..8d0e10b --- /dev/null +++ b/osmo_dia2gsup-master/Makefile @@ -0,0 +1 @@ +include ../make/Makefile diff --git a/osmo_dia2gsup-master/osmo_dia2gsup.config b/osmo_dia2gsup-master/osmo_dia2gsup.config new file mode 100644 index 0000000..dc0b876 --- /dev/null +++ b/osmo_dia2gsup-master/osmo_dia2gsup.config @@ -0,0 +1,12 @@ +[{osmo_dia2gsup, [ + {hlr_ip, "172.18.10.103"}, + {hlr_port, 4222}, + + {diameter_ip, "172.18.10.20"}, + {diameter_port, 3868}, + {diameter_proto, sctp}, + + {origin_host, "hss.localdomain"}, + {origin_realm, "localdomain"}, + {vendor_id, 0} +]}]. diff --git a/ttcn3-dia2gsup-test/DIA2GSUP_Tests.cfg b/ttcn3-dia2gsup-test/DIA2GSUP_Tests.cfg new file mode 100644 index 0000000..ce68c1f --- /dev/null +++ b/ttcn3-dia2gsup-test/DIA2GSUP_Tests.cfg @@ -0,0 +1,17 @@ +[ORDERED_INCLUDE] +"/osmo-ttcn3-hacks/Common.cfg" +"/osmo-ttcn3-hacks/dia2gsup/DIA2GSUP_Tests.default" + +[LOGGING] + +[TESTPORT_PARAMETERS] + +[MODULE_PARAMETERS] +DIA2GSUP_Tests.mp_hlr_ip := "172.18.10.103" +DIA2GSUP_Tests.mp_s6_local_ip := "172.18.10.103" +DIA2GSUP_Tests.mp_hss_ip := "172.18.10.20" + +[MAIN_CONTROLLER] + +[EXECUTE] +DIA2GSUP_Tests.control diff --git a/ttcn3-dia2gsup-test/Dockerfile b/ttcn3-dia2gsup-test/Dockerfile new file mode 100644 index 0000000..ff93371 --- /dev/null +++ b/ttcn3-dia2gsup-test/Dockerfile @@ -0,0 +1,14 @@ +ARG REGISTRY +ARG USER +FROM $REGISTRY/$USER/debian-bookworm-titan + +ARG OSMO_TTCN3_BRANCH="master" + +ADD https://gerrit.osmocom.org/plugins/gitiles/osmo-ttcn3-hacks/+/$OSMO_TTCN3_BRANCH?format=TEXT /tmp/commit +RUN ttcn3-docker-prepare "$OSMO_TTCN3_BRANCH" dia2gsup + +VOLUME /data + +COPY DIA2GSUP_Tests.cfg /data/DIA2GSUP_Tests.cfg + +CMD ttcn3-docker-run dia2gsup DIA2GSUP_Tests diff --git a/ttcn3-dia2gsup-test/Makefile b/ttcn3-dia2gsup-test/Makefile new file mode 100644 index 0000000..8d0e10b --- /dev/null +++ b/ttcn3-dia2gsup-test/Makefile @@ -0,0 +1 @@ +include ../make/Makefile diff --git a/ttcn3-dia2gsup-test/jenkins.sh b/ttcn3-dia2gsup-test/jenkins.sh new file mode 100755 index 0000000..d8acc43 --- /dev/null +++ b/ttcn3-dia2gsup-test/jenkins.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +. ../jenkins-common.sh +IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}" +docker_images_require \ + "osmo_dia2gsup-$IMAGE_SUFFIX" \ + "ttcn3-dia2gsup-test" + +set_clean_up_trap +set -e + +mkdir $VOL_BASE_DIR/dia2gsup-tester +cp DIA2GSUP_Tests.cfg $VOL_BASE_DIR/dia2gsup-tester/ +write_mp_osmo_repo "$VOL_BASE_DIR/dia2gsup-tester/DIA2GSUP_Tests.cfg" + +mkdir $VOL_BASE_DIR/dia2gsup +cp osmo_dia2gsup.config $VOL_BASE_DIR/dia2gsup/ + +network_create +network_replace_subnet_in_configs + +echo Starting container with osmo_dia2gsup +docker run --rm \ + $(docker_network_params $SUBNET 20) \ + --ulimit core=-1 \ + -v $VOL_BASE_DIR/dia2gsup:/data \ + --name ${BUILD_TAG}-dia2gsup -d \ + $DOCKER_ARGS \ + $REPO_USER/osmo_dia2gsup-$IMAGE_SUFFIX + +echo Starting container with DIA2GSUP testsuite +docker run --rm \ + $(docker_network_params $SUBNET 103) \ + --ulimit core=-1 \ + -e "TTCN3_PCAP_PATH=/data" \ + -e "OSMO_SUT_HOST=172.18.$SUBNET.20" \ + -e "OSMO_SUT_PORT=4258" \ + -v $VOL_BASE_DIR/dia2gsup-tester:/data \ + --name ${BUILD_TAG}-ttcn3-dia2gsup-test \ + $DOCKER_ARGS \ + $REPO_USER/ttcn3-dia2gsup-test diff --git a/ttcn3-dia2gsup-test/osmo_dia2gsup.config b/ttcn3-dia2gsup-test/osmo_dia2gsup.config new file mode 100644 index 0000000..dc0b876 --- /dev/null +++ b/ttcn3-dia2gsup-test/osmo_dia2gsup.config @@ -0,0 +1,12 @@ +[{osmo_dia2gsup, [ + {hlr_ip, "172.18.10.103"}, + {hlr_port, 4222}, + + {diameter_ip, "172.18.10.20"}, + {diameter_port, 3868}, + {diameter_proto, sctp}, + + {origin_host, "hss.localdomain"}, + {origin_realm, "localdomain"}, + {vendor_id, 0} +]}]. |