lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/37351?usp=email )
Change subject: osmo-epdg: add support for testing for latest ......................................................................
osmo-epdg: add support for testing for latest
Create a new osmo-epdg-latest docker image. Use a different configuration for ttcn3-epdg-test if running the latest. The latest comes from the obs repository and has different paths for libraries.
Change-Id: Ia31a92446e82a25fb592a2c91d0204db8f265d52 --- A osmo-epdg-latest/Dockerfile A osmo-epdg-latest/Makefile A osmo-epdg-latest/osmo-epdg.config M ttcn3-epdg-test/epdg.sh M ttcn3-epdg-test/jenkins.sh A ttcn3-epdg-test/osmo-epdg.latest.config 6 files changed, 142 insertions(+), 1 deletion(-)
Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve
diff --git a/osmo-epdg-latest/Dockerfile b/osmo-epdg-latest/Dockerfile new file mode 100644 index 0000000..10f7437 --- /dev/null +++ b/osmo-epdg-latest/Dockerfile @@ -0,0 +1,32 @@ +ARG USER +ARG DISTRO +ARG OSMOCOM_REPO_VERSION="latest" +FROM $USER/$DISTRO-erlang +# Arguments used after FROM must be specified again +ARG DISTRO + +WORKDIR /tmp + +# erlang repo is using build user +USER root +RUN case "$DISTRO" in \ + debian*) \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + osmo-epdg && \ + apt-get clean \ + ;; \ + centos*) \ + dnf install -y \ + osmo-epdg \ + ;; \ + esac + +WORKDIR /data + +VOLUME /data +COPY osmo-epdg.config /data/osmo-epdg.config + +CMD ["/bin/sh", "-c", "ERL_FLAGS='-config /data/osmo-epdg.config' /usr/bin/osmo-epdg > /data/osmo-epdg.log 2>&1"] + +#EXPOSE diff --git a/osmo-epdg-latest/Makefile b/osmo-epdg-latest/Makefile new file mode 100644 index 0000000..8d0e10b --- /dev/null +++ b/osmo-epdg-latest/Makefile @@ -0,0 +1 @@ +include ../make/Makefile diff --git a/osmo-epdg-latest/osmo-epdg.config b/osmo-epdg-latest/osmo-epdg.config new file mode 100644 index 0000000..be49216 --- /dev/null +++ b/osmo-epdg-latest/osmo-epdg.config @@ -0,0 +1,2 @@ +[{osmo_epdg, [ +]}]. diff --git a/ttcn3-epdg-test/epdg.sh b/ttcn3-epdg-test/epdg.sh index 2614bf9..b8cb7b7 100755 --- a/ttcn3-epdg-test/epdg.sh +++ b/ttcn3-epdg-test/epdg.sh @@ -11,7 +11,11 @@ ip addr add $UE_ADDR dev $UE_IFACE ip link set $UE_IFACE up ip rule add from $UE_SUBNET table 45 -ERL_FLAGS='-config /data/osmo-epdg.config' /tmp/osmo-epdg/_build/default/bin/osmo-epdg & +if [ "$IMAGE_SUFFIX" = "latest" ]; then + ERL_FLAGS='-config /data/osmo-epdg.latest.config' /usr/bin/osmo-epdg & +else + ERL_FLAGS='-config /data/osmo-epdg.config' /tmp/osmo-epdg/_build/default/bin/osmo-epdg & +fi MYPID=$!
# We cannot set a route for the interface until it is created by osmo-epdg... diff --git a/ttcn3-epdg-test/jenkins.sh b/ttcn3-epdg-test/jenkins.sh index cdd3a5e..07d9ea8 100755 --- a/ttcn3-epdg-test/jenkins.sh +++ b/ttcn3-epdg-test/jenkins.sh @@ -15,6 +15,7 @@
mkdir $VOL_BASE_DIR/epdg cp osmo-epdg.config $VOL_BASE_DIR/epdg/ +cp osmo-epdg.latest.config $VOL_BASE_DIR/epdg/ cp epdg.sh $VOL_BASE_DIR/epdg/ cp ../common/pipework $VOL_BASE_DIR/epdg/
@@ -28,6 +29,7 @@ docker run --rm \ $(docker_network_params $SUBNET 20) \ -u root \ + -e IMAGE_SUFFIX=$IMAGE_SUFFIX \ --ulimit core=-1 \ --cap-add=NET_ADMIN \ --device /dev/net/tun:/dev/net/tun \ diff --git a/ttcn3-epdg-test/osmo-epdg.latest.config b/ttcn3-epdg-test/osmo-epdg.latest.config new file mode 100644 index 0000000..ab176c8 --- /dev/null +++ b/ttcn3-epdg-test/osmo-epdg.latest.config @@ -0,0 +1,87 @@ +[ + %% =========================================== + %% Application config + %% =========================================== + {osmo_epdg, + [% GSUP Server connection parameters + {gsup_local_ip, "172.18.10.20"}, + {gsup_local_port, 4222}, + % Diameter Connection parameters + {dia_swx_remote_ip, "172.18.10.103"}, + {dia_swx_remote_port, 3868}, + {dia_swx_proto, sctp}, + {dia_swx_connect_timer, 200}, + {dia_swx_watchdog_timer, 6000}, + {dia_swx_watchdog_config, + [{okay, 1}, + {suspect, 1}]}, + {dia_swx_vendor_id, 0}, + {dia_swx_origin_host, "epdg.localdomain"}, + {dia_swx_origin_realm, "localdomain"}, + {dia_swx_context_id, "epdg@localdomain"}, + % Diameter s6b Connection parameters + {dia_s6b_local_ip, "172.18.10.20"}, + {dia_s6b_local_port, 3869}, + {dia_s6b_proto, sctp}, + {dia_s6b_connect_timer, 200}, + {dia_s6b_watchdog_timer, 6000}, + {dia_s6b_watchdog_config, + [{okay, 1}, + {suspect, 1}]}, + {dia_s6b_vendor_id, 0}, + {dia_s6b_origin_host, "aaa.localdomain"}, + {dia_s6b_origin_realm, "localdomain"}, + {dia_s6b_context_id, "aaa@localdomain"}, + % GTPv2C Connection parameters + {gtpc_local_ip, "172.18.10.20"}, + {gtpc_local_port, 2123}, + {gtpc_remote_ip, "172.18.10.103"}, + {gtpc_remote_port, 2123} + ] + }, + %% =========================================== + %% gtp_u_kmod config + %% =========================================== + {gtp_u_kmod, [ + {sockets, [{gtp0, [%% ip: IP Address assigned at the tunnel: + {ip, {172,18,10,20}}, + %% Allow binding to an IP address that is nonlocal or does not (yet) exist (IP_FREEBIND): + freebind, + % Create gtp tundev with role SGSN: + {role, sgsn} + ] + }] + } + ]}, + %% =========================================== + %% gen_socket config + %% =========================================== + {gen_socket, [ + {libdir, "/usr/lib"} +]}, + %% =========================================== + %% Lager logging config + %% =========================================== + {lager, [ + {log_root, "/data/"}, + {colored, true}, + {handlers, + [{lager_console_backend, [{level, debug}]}, + {lager_file_backend, + [{file, "console.log"}, {level, debug}, {size, 104857600}, {date, "$D0"}, {count, 10}]}, + {lager_file_backend, + [{file, "error.log"}, {level, error}, {size, 104857600}, {date, "$D0"}, {count, 10}]}]}, + {crash_log, "crash.log"}, + {crash_log_msg_size, 65536}, + {crash_log_size, 104857600}, + {crash_log_date, "$D0"}, + {crash_log_count, 10}, + {error_logger_redirect, true} + ]}, + {kernel, [ + {logger, [{handler, debug, logger_std_h, % {handler, HandlerId, Module, + #{config => #{file => "/data/erlang.log"}} + }] + } + ]} +].