Merge branch 'master' into arehbein/devtests

'merge-theirs' to update this custom branch

Change-Id: Ib8da85a30fc1a4d9d06304dfcb73e33bab4fd31e
This commit is contained in:
arehbein 2023-01-08 22:41:49 +01:00
commit 229191824d
10 changed files with 41 additions and 57 deletions

View File

@ -1,12 +0,0 @@
ARG USER
ARG REGISTRY=docker.io
ARG UPSTREAM_DISTRO=almalinux:8
FROM ${REGISTRY}/${UPSTREAM_DISTRO}
# dnf-utils: for repoquery
RUN dnf install -y \
systemd \
dnf-utils
# Make additional development libraries available
RUN yum config-manager --set-enabled powertools

View File

@ -1,2 +0,0 @@
UPSTREAM_DISTRO=almalinux:8
include ../make/Makefile

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
if [ $# -lt 2 ]; then
echo
echo "usage: ttcn3-docker-run SUBDIR SUITE"
@ -18,11 +18,12 @@ if [ -n "$WAIT_FOR_NETDEV" ]; then
pipework --wait -i "$WAIT_FOR_NETDEV"
while true; do
if [ ! -f /sys/class/net/${WAIT_FOR_NETDEV}/operstate ]; then
if [ ! -f /sys/class/net/${WAIT_FOR_NETDEV}/flags ]; then
exit 23
fi
OPSTATE=$(cat /sys/class/net/${WAIT_FOR_NETDEV}/operstate)
if [ "$OPSTATE" = "up" ]; then
FLAGS=$(cat /sys/class/net/${WAIT_FOR_NETDEV}/flags)
let FLAG_UP=$FLAGS\&1
if [ "$FLAG_UP" = "1" ]; then
break
fi
echo "Waiting for ${WAIT_FOR_NETDEV} to become operational"

View File

@ -1,13 +0,0 @@
ARG USER
ARG REGISTRY=docker.io
ARG UPSTREAM_DISTRO=debian:buster
FROM ${REGISTRY}/${UPSTREAM_DISTRO}
# ca-certificates: needed for limesuite-images post-install script
RUN apt-get update && \
apt-get install -y --no-install-recommends \
aptitude \
ca-certificates \
gnupg \
systemd

View File

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

View File

@ -1,13 +0,0 @@
ARG USER
ARG REGISTRY=docker.io
ARG UPSTREAM_DISTRO=debian:bullseye
FROM ${REGISTRY}/${UPSTREAM_DISTRO}
# ca-certificates: needed for limesuite-images post-install script
RUN apt-get update && \
apt-get install -y --no-install-recommends \
aptitude \
ca-certificates \
gnupg \
systemd

View File

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

View File

@ -168,7 +168,9 @@ docker_images_require() {
pull_arg=""
fi
set +x
echo "Building image: $i (export NO_DOCKER_IMAGE_BUILD=1 to prevent this)"
set -x
make -C "${IMAGE_DIR_PREFIX}/${dir}" \
BUILD_ARGS="$pull_arg" \
UPSTREAM_DISTRO="$upstream_distro_arg" \
@ -179,6 +181,7 @@ docker_images_require() {
# Detect missing images (build skipped)
if ! docker_image_exists "$i"; then
set +x
echo "ERROR: missing image: $i"
exit 1
fi
@ -195,26 +198,34 @@ network_clean() {
network_create() {
NET=$1
if docker network ls | grep -q $NET_NAME; then
echo removing stale network and containers...
set +x
echo "Removing stale network and containers..."
set -x
network_clean
network_remove
fi
SUB4="172.18.$NET.0/24"
SUB6="fd02:db8:$NET::/64"
echo Creating network $NET_NAME
set +x
echo "Creating network $NET_NAME"
set -x
docker network create --internal --subnet $SUB4 --ipv6 --subnet $SUB6 $NET_NAME
}
network_bridge_create() {
NET=$1
if docker network ls | grep -q $NET_NAME; then
echo removing stale network and containers...
set +x
echo "Removing stale network and containers..."
set -x
network_clean
network_remove
fi
SUB4="172.18.$NET.0/24"
SUB6="fd02:db8:$NET::/64"
echo Creating network $NET_NAME
set +x
echo "Creating network $NET_NAME"
set -x
docker network create \
--driver=bridge \
--subnet $SUB4 \
@ -224,7 +235,9 @@ network_bridge_create() {
}
network_remove() {
echo Removing network $NET_NAME
set +x
echo "Removing network $NET_NAME"
set -x
docker network remove $NET_NAME
}
@ -238,7 +251,9 @@ docker_network_params() {
}
fix_perms() {
echo Fixing permissions
set +x
echo "Fixing permissions"
set -x
docker run --rm \
-v $VOL_BASE_DIR:/data \
-v $CACHE_DIR:/cache \
@ -360,6 +375,7 @@ kernel_test_wait_for_vm() {
done
# Let clean_up_common kill the VM
set +x
echo "Timeout while waiting for kernel test VM"
exit 1
}
@ -437,6 +453,7 @@ else
fi
if [ ! -d "$VOL_BASE_DIR" ]; then
set +x
echo "ERROR: \$VOL_BASE_DIR does not exist: '$VOL_BASE_DIR'"
exit 1
fi

View File

@ -21,7 +21,8 @@ fi
docker_images_require \
"$NAME-$IMAGE_SUFFIX"
network_create 16
SUBNET=16
network_create "$SUBNET"
container_create() {
CONTAINERNAME=$1
@ -35,15 +36,21 @@ container_create() {
}
container_create "$NAME-$IMAGE_SUFFIX" 172.18.16.23
container_create "$NAME-$IMAGE_SUFFIX" "172.18.$SUBNET.23"
# Get asciidoc counter info
${OSMO_INTERACT_VTY} \
-c "enable;show asciidoc counters" -p "$PORT" -H 172.18.16.23 -O "$COUNTERFILE"
-c "enable;show asciidoc counters" \
-p "$PORT" \
-H "172.18.$SUBNET.23" \
-O "$COUNTERFILE"
# Get vty reference
${OSMO_INTERACT_VTY} \
-X -p "$PORT" -H 172.18.16.23 -O "$VTYFILE"
-X \
-p "$PORT" \
-H "172.18.$SUBNET.23" \
-O "$VTYFILE"
docker container kill "${BUILD_TAG}-$NAME-$IMAGE_SUFFIX"

View File

@ -31,11 +31,12 @@ GGSN_CMD="osmo-ggsn -c /data/osmo-ggsn.cfg"
GGSN_DOCKER_ARGS=""
if [ "$KERNEL_TEST" = "1" ]; then
cp osmo-ggsn-kernel-gtp.cfg $VOL_BASE_DIR/ggsn/osmo-ggsn.cfg
cp initrd-ggsn.sh $VOL_BASE_DIR/ggsn/
kernel_test_prepare \
"defconfig" \
"fragment.config" \
"initrd-ggsn.sh" \
"$VOL_BASE_DIR/ggsn/initrd-ggsn.sh" \
"$REPO_USER/osmo-ggsn-$IMAGE_SUFFIX" \
-v $VOL_BASE_DIR/ggsn:/data