diff options
| -rw-r--r-- | bgpd/bgp_route.c | 3 | ||||
| -rw-r--r-- | doc/developer/topotests.rst | 2 | ||||
| -rw-r--r-- | tests/topotests/Dockerfile | 138 | ||||
| -rw-r--r-- | tests/topotests/docker/README.md | 2 | ||||
| -rwxr-xr-x | tests/topotests/docker/frr-topotests.sh | 7 | ||||
| -rwxr-xr-x | tests/topotests/docker/inner/compile_frr.sh | 5 | ||||
| -rwxr-xr-x | tests/topotests/docker/inner/entrypoint.sh | 5 |
7 files changed, 98 insertions, 64 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 72e798a7e2..5feda71837 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -12318,8 +12318,7 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp, } else { if (incremental_print) { vty_out(vty, "\"prefix\": \"%pFX\",\n", p); - vty_out(vty, "\"version\": \"%" PRIu64 "\",", - dest->version); + vty_out(vty, "\"version\": %" PRIu64 ",", dest->version); } else { json_object_string_addf(json, "prefix", "%pFX", p); diff --git a/doc/developer/topotests.rst b/doc/developer/topotests.rst index 5077745a15..9e05a99474 100644 --- a/doc/developer/topotests.rst +++ b/doc/developer/topotests.rst @@ -881,7 +881,7 @@ commands: .. code:: console make topotests-build - TOPOTEST_PULL=0 make topotests + make topotests .. _topotests-guidelines: diff --git a/tests/topotests/Dockerfile b/tests/topotests/Dockerfile index 1503e67d31..d55827fe6c 100644 --- a/tests/topotests/Dockerfile +++ b/tests/topotests/Dockerfile @@ -1,60 +1,98 @@ -FROM ubuntu:18.04 +FROM ubuntu:22.04 -RUN export DEBIAN_FRONTEND=noninteractive \ - && apt-get update \ - && apt-get install -y \ - autoconf \ - binutils \ - bison \ - ca-certificates \ - flex \ +ARG DEBIAN_FRONTEND=noninteractive +ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn + +RUN apt update -y && apt upgrade -y && \ + # Basic build requirements from documentation + apt-get install -y \ + autoconf \ + automake \ + bison \ + build-essential \ + flex \ + git \ + install-info \ + libc-ares-dev \ + libcap-dev \ + libelf-dev \ + libjson-c-dev \ + libpam0g-dev \ + libreadline-dev \ + libsnmp-dev \ + libsqlite3-dev \ + lsb-release \ + libtool \ + lcov \ + make \ + perl \ + pkg-config \ + python3-dev \ + python3-sphinx \ + screen \ + texinfo \ + 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 \ - git \ - gpg \ - install-info \ - iputils-ping \ + kmod \ iproute2 \ - less \ - libtool \ - libjson-c-dev \ - libpcre3-dev \ - libpython-dev \ - libpython3-dev \ - libreadline-dev \ - libc-ares-dev \ - libcap-dev \ - libelf-dev \ - man \ - mininet \ - pkg-config \ - python-pip \ + iputils-ping \ + liblua5.3-dev \ + libssl-dev \ + lua5.3 \ + net-tools \ python3 \ - python3-dev \ - python3-sphinx \ - python3-pytest \ - rsync \ + python3-pip \ + snmp \ + snmp-mibs-downloader \ + snmpd \ + sudo \ + time \ + tshark \ + valgrind \ + yodl \ strace \ tcpdump \ - texinfo \ - tmux \ - valgrind \ - vim \ - wget \ - x11-xserver-utils \ - xterm \ - && pip install \ - exabgp==3.4.17 \ - "scapy>=2.4.2" \ - ipaddr \ - pytest \ - && rm -rf /var/lib/apt/lists/* + && \ + download-mibs && \ + 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 && \ + wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/SNMPv2-PDU -O /usr/share/snmp/mibs/ietf/SNMPv2-PDU && \ + wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/IPATM-IPMC-MIB -O /usr/share/snmp/mibs/ietf/IPATM-IPMC-MIB && \ + python3 -m pip install wheel && \ + 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 + +# Install FRR built packages +RUN mkdir -p /etc/apt/keyrings && \ + curl -s -o /etc/apt/keyrings/frrouting.gpg https://deb.frrouting.org/frr/keys.gpg && \ + echo deb '[signed-by=/etc/apt/keyrings/frrouting.gpg]' https://deb.frrouting.org/frr \ + $(lsb_release -s -c) "frr-stable" > /etc/apt/sources.list.d/frr.list && \ + apt-get update && apt-get install -y librtr-dev libyang2-dev libyang2-tools -RUN export DEBIAN_FRONTEND=noninteractive \ - && wget -qO- https://deb.frrouting.org/frr/keys.asc | apt-key add - \ - && echo "deb https://deb.frrouting.org/frr bionic frr-stable" > /etc/apt/sources.list.d/frr.list \ - && apt-get update \ - && apt-get install -y libyang-dev \ - && rm -rf /var/lib/apt/lists/* +RUN apt install -y openvswitch-switch RUN groupadd -r -g 92 frr \ && groupadd -r -g 85 frrvty \ diff --git a/tests/topotests/docker/README.md b/tests/topotests/docker/README.md index 2b40994cf6..2bd58a15b8 100644 --- a/tests/topotests/docker/README.md +++ b/tests/topotests/docker/README.md @@ -68,5 +68,5 @@ without pulling from the registry using the following commands: ```console make topotests-build -TOPOTEST_PULL=0 make topotests +make topotests ``` diff --git a/tests/topotests/docker/frr-topotests.sh b/tests/topotests/docker/frr-topotests.sh index ce373d9bd0..bd37055147 100755 --- a/tests/topotests/docker/frr-topotests.sh +++ b/tests/topotests/docker/frr-topotests.sh @@ -45,9 +45,6 @@ if [[ "$1" = "-h" ]] || [[ "$1" = "--help" ]]; then TOPOTEST_OPTIONS These options are appended to the docker-run command for starting the tests. - TOPOTEST_PULL If set to 0, don't try to pull the most recent - version of the docker image from dockerhub. - TOPOTEST_SANITIZER Controls whether to use the address sanitizer. Enabled by default, set to 0 to disable. @@ -122,10 +119,6 @@ if [ -z "$TOPOTEST_BUILDCACHE" ]; then || docker volume create "${TOPOTEST_BUILDCACHE}" fi -if [ "${TOPOTEST_PULL:-1}" = "1" ]; then - docker pull frrouting/topotests:latest -fi - if [[ -n "$TMUX" ]]; then TMUX_OPTIONS="-v $(dirname $TMUX):$(dirname $TMUX) -e TMUX=$TMUX -e TMUX_PANE=$TMUX_PANE" fi diff --git a/tests/topotests/docker/inner/compile_frr.sh b/tests/topotests/docker/inner/compile_frr.sh index 4a88dc677f..e943c385c7 100755 --- a/tests/topotests/docker/inner/compile_frr.sh +++ b/tests/topotests/docker/inner/compile_frr.sh @@ -58,9 +58,6 @@ if [ ! -e Makefile ]; then fi bash configure >&3 \ - --enable-static-bin \ - --enable-static \ - --enable-shared \ --enable-dev-build \ --with-moduledir=/usr/lib/frr/modules \ --prefix=/usr \ @@ -69,6 +66,8 @@ if [ ! -e Makefile ]; then --sbindir=/usr/lib/frr \ --enable-multipath=0 \ --enable-fpm \ + --enable-grpc \ + --enable-scripting \ --enable-sharpd \ $EXTRA_CONFIGURE \ --with-pkg-extra-version=-topotests \ diff --git a/tests/topotests/docker/inner/entrypoint.sh b/tests/topotests/docker/inner/entrypoint.sh index 44e16db4b9..b92217440b 100755 --- a/tests/topotests/docker/inner/entrypoint.sh +++ b/tests/topotests/docker/inner/entrypoint.sh @@ -20,6 +20,11 @@ cd "${FRR_BUILD_DIR}/tests/topotests" log_info "Setting permissions on /tmp so we can generate logs" chmod 1777 /tmp +# This is a MUST, otherwise we have: +# AddressSanitizer:DEADLYSIGNAL +# Segmentation fault +sysctl -w vm.mmap_rnd_bits=28 + if [ $# -eq 0 ] || ([[ "$1" != /* ]] && [[ "$1" != ./* ]]); then export TOPOTESTS_CHECK_MEMLEAK=/tmp/memleak_ export TOPOTESTS_CHECK_STDERR=Yes |
