tests: Fix docker build for topotests

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2024-11-26 11:26:55 +02:00
parent 0bacbc6493
commit 2484793bc5
2 changed files with 92 additions and 55 deletions

View File

@ -1,60 +1,98 @@
FROM ubuntu:18.04 FROM ubuntu:22.04
RUN export DEBIAN_FRONTEND=noninteractive \ ARG DEBIAN_FRONTEND=noninteractive
&& apt-get update \ ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
&& apt-get install -y \
RUN apt update -y && apt upgrade -y && \
# Basic build requirements from documentation
apt-get install -y \
autoconf \ autoconf \
binutils \ automake \
bison \ bison \
ca-certificates \ build-essential \
flex \ flex \
gdb \
git \ git \
gpg \
install-info \ install-info \
iputils-ping \
iproute2 \
less \
libtool \
libjson-c-dev \
libpcre3-dev \
libpython-dev \
libpython3-dev \
libreadline-dev \
libc-ares-dev \ libc-ares-dev \
libcap-dev \ libcap-dev \
libelf-dev \ libelf-dev \
man \ libjson-c-dev \
mininet \ libpam0g-dev \
libreadline-dev \
libsnmp-dev \
libsqlite3-dev \
lsb-release \
libtool \
lcov \
make \
perl \
pkg-config \ pkg-config \
python-pip \
python3 \
python3-dev \ python3-dev \
python3-sphinx \ python3-sphinx \
python3-pytest \ screen \
rsync \
strace \
tcpdump \
texinfo \ texinfo \
tmux \ tmux \
&& \
# Protobuf build requirements
apt-get install -y \
libprotobuf-c-dev \
protobuf-c-compiler \
&& \
# Libyang2 extra build requirements
apt-get install -y \
cmake \
libpcre2-dev \
&& \
# GRPC extra build requirements
apt-get install -y \
libgrpc-dev \
libgrpc++-dev \
protobuf-compiler-grpc \
&& \
# Runtime/triage/testing requirements
apt-get install -y \
rsync \
curl \
gdb \
kmod \
iproute2 \
iputils-ping \
liblua5.3-dev \
libssl-dev \
lua5.3 \
net-tools \
python3 \
python3-pip \
snmp \
snmp-mibs-downloader \
snmpd \
sudo \
time \
tshark \
valgrind \ valgrind \
vim \ yodl \
wget \ strace \
x11-xserver-utils \ tcpdump \
xterm \ && \
&& pip install \ download-mibs && \
exabgp==3.4.17 \ wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/iana/IANA-IPPM-METRICS-REGISTRY-MIB -O /usr/share/snmp/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB && \
"scapy>=2.4.2" \ wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/SNMPv2-PDU -O /usr/share/snmp/mibs/ietf/SNMPv2-PDU && \
ipaddr \ wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/IPATM-IPMC-MIB -O /usr/share/snmp/mibs/ietf/IPATM-IPMC-MIB && \
pytest \ python3 -m pip install wheel && \
&& rm -rf /var/lib/apt/lists/* python3 -m pip install 'protobuf<4' grpcio grpcio-tools && \
python3 -m pip install 'pytest>=6.2.4' 'pytest-xdist>=2.3.0' && \
python3 -m pip install 'scapy>=2.4.5' && \
python3 -m pip install xmltodict && \
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@0659057837cd6c6351579e9f0fa47e9fb7de7311
RUN export DEBIAN_FRONTEND=noninteractive \ # Install FRR built packages
&& wget -qO- https://deb.frrouting.org/frr/keys.asc | apt-key add - \ RUN mkdir -p /etc/apt/keyrings && \
&& echo "deb https://deb.frrouting.org/frr bionic frr-stable" > /etc/apt/sources.list.d/frr.list \ curl -s -o /etc/apt/keyrings/frrouting.gpg https://deb.frrouting.org/frr/keys.gpg && \
&& apt-get update \ echo deb '[signed-by=/etc/apt/keyrings/frrouting.gpg]' https://deb.frrouting.org/frr \
&& apt-get install -y libyang-dev \ $(lsb_release -s -c) "frr-stable" > /etc/apt/sources.list.d/frr.list && \
&& rm -rf /var/lib/apt/lists/* apt-get update && apt-get install -y librtr-dev libyang2-dev libyang2-tools
RUN apt install -y openvswitch-switch
RUN groupadd -r -g 92 frr \ RUN groupadd -r -g 92 frr \
&& groupadd -r -g 85 frrvty \ && groupadd -r -g 85 frrvty \

View File

@ -58,9 +58,6 @@ if [ ! -e Makefile ]; then
fi fi
bash configure >&3 \ bash configure >&3 \
--enable-static-bin \
--enable-static \
--enable-shared \
--enable-dev-build \ --enable-dev-build \
--with-moduledir=/usr/lib/frr/modules \ --with-moduledir=/usr/lib/frr/modules \
--prefix=/usr \ --prefix=/usr \
@ -69,6 +66,8 @@ if [ ! -e Makefile ]; then
--sbindir=/usr/lib/frr \ --sbindir=/usr/lib/frr \
--enable-multipath=0 \ --enable-multipath=0 \
--enable-fpm \ --enable-fpm \
--enable-grpc \
--enable-scripting \
--enable-sharpd \ --enable-sharpd \
$EXTRA_CONFIGURE \ $EXTRA_CONFIGURE \
--with-pkg-extra-version=-topotests \ --with-pkg-extra-version=-topotests \