Skip to content

Commit

Permalink
Merge pull request FRRouting#14890 from louis-6wind/exabgp4
Browse files Browse the repository at this point in the history
topotests: convert to exabgp 4 and python3
  • Loading branch information
mwinter-osr authored Dec 14, 2023
2 parents 5e87eae + 73ce39c commit 0d57a9a
Show file tree
Hide file tree
Showing 88 changed files with 849 additions and 880 deletions.
14 changes: 1 addition & 13 deletions doc/developer/building-frr-for-ubuntu2004.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,14 @@ Installing Dependencies
pkg-config libpam0g-dev libjson-c-dev bison flex \
libc-ares-dev python3-dev python3-sphinx \
install-info build-essential libsnmp-dev perl \
libcap-dev python2 libelf-dev libunwind-dev
libcap-dev libelf-dev libunwind-dev
.. include:: building-libunwind-note.rst

Note that Ubuntu 20 no longer installs python 2.x, so it must be
installed explicitly. Ensure that your system has a symlink named
``/usr/bin/python`` pointing at ``/usr/bin/python3``.

In addition, ``pip`` for python2 must be installed if you wish to run
the FRR topotests. That version of ``pip`` is not available from the
ubuntu apt repositories; in order to install it:

.. code-block:: shell
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 ./get-pip.py
# And verify the installation
pip2 --version
.. include:: building-libyang.rst

Protobuf
Expand Down
14 changes: 1 addition & 13 deletions doc/developer/building-frr-for-ubuntu2204.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Installing Dependencies
pkg-config libpam0g-dev libjson-c-dev bison flex \
libc-ares-dev python3-dev python3-sphinx \
install-info build-essential libsnmp-dev perl \
libcap-dev python2 libelf-dev libunwind-dev \
libcap-dev libelf-dev libunwind-dev \
libyang2 libyang2-dev
.. include:: building-libunwind-note.rst
Expand All @@ -29,18 +29,6 @@ installed explicitly. Ensure that your system has a symlink named
sudo ln -s /usr/bin/python3 /usr/bin/python
python --version
In addition, ``pip`` for python2 must be installed if you wish to run
the FRR topotests. That version of ``pip`` is not available from the
ubuntu apt repositories; in order to install it:

.. code-block:: shell
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 ./get-pip.py
# And verify the installation
pip2 --version
Protobuf
^^^^^^^^
Expand Down
11 changes: 4 additions & 7 deletions doc/developer/topotests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ Topotests is a suite of topology tests for FRR built on top of micronet.
Installation and Setup
----------------------

Topotests run under python3. Additionally, for ExaBGP (which is used
in some of the BGP tests) an older python2 version (and the python2
version of ``pip``) must be installed.
Topotests run under python3.

Tested with Ubuntu 20.04,Ubuntu 18.04, and Debian 11.

Instructions are the same for all setups (i.e. ExaBGP is only used for
BGP tests).
Instructions are the same for all setups. However, ExaBGP is only used for
BGP tests.

Tshark is only required if you enable any packet captures on test runs.

Expand All @@ -39,8 +37,7 @@ Installing Topotest Requirements
python3 -m pip install 'pytest-xdist>=2.3.0'
python3 -m pip install 'scapy>=2.4.5'
python3 -m pip install xmltodict
# Use python2 pip to install older ExaBGP
python2 -m pip install 'exabgp<4.0.0'
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@0659057837cd6c6351579e9f0fa47e9fb7de7311
useradd -d /var/run/exabgp/ -s /bin/false exabgp
# To enable the gRPC topotest install:
Expand Down
7 changes: 2 additions & 5 deletions docker/ubuntu-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RUN apt update && apt upgrade -y && \
libssl-dev \
lua5.3 \
net-tools \
python2 \
python3 \
python3-pip \
snmp \
snmp-mibs-downloader \
Expand All @@ -67,17 +67,14 @@ RUN apt update && apt upgrade -y && \
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 && \
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output /tmp/get-pip.py && \
python2 /tmp/get-pip.py && \
rm -f /tmp/get-pip.py && \
python3 -m pip install wheel && \
python3 -m pip install pytest && \
python3 -m pip install pytest-sugar && \
python3 -m pip install pytest-xdist && \
python3 -m pip install "scapy>=2.4.2" && \
python3 -m pip install xmltodict && \
python3 -m pip install grpcio grpcio-tools && \
python2 -m pip install 'exabgp<4.0.0'
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@0659057837cd6c6351579e9f0fa47e9fb7de7311

RUN groupadd -r -g 92 frr && \
groupadd -r -g 85 frrvty && \
Expand Down
1 change: 1 addition & 0 deletions tests/topotests/bgp_ecmp_topo1/exabgp.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

[exabgp.api]
ack = false
encoder = text
highres = false
respawn = false
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bgp_ecmp_topo1/peer1/exa-send.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
exa-send.py: Send a few testroutes with ExaBGP
Expand Down
33 changes: 15 additions & 18 deletions tests/topotests/bgp_ecmp_topo1/peer1/exabgp.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
group controller {

process announce-routes {
run "/etc/exabgp/exa-send.py 1 10";
}

process receive-routes {
run "/etc/exabgp/exa-receive.py 1";
receive-routes;
encoder text;
}
process announce-routes {
run /etc/exabgp/exa-send.py 1 10;
encoder text;
}

neighbor 10.0.1.1 {
router-id 10.0.1.101;
local-address 10.0.1.101;
local-as 99;
peer-as 100;
graceful-restart;
}
process receive-routes {
run /etc/exabgp/exa-receive.py 1;
encoder text;
}

neighbor 10.0.1.1 {
router-id 10.0.1.101;
local-address 10.0.1.101;
local-as 99;
peer-as 100;
capability {graceful-restart;}
api {processes [ announce-routes, receive-routes ];}
}
2 changes: 1 addition & 1 deletion tests/topotests/bgp_ecmp_topo1/peer10/exa-send.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
exa-send.py: Send a few testroutes with ExaBGP
Expand Down
33 changes: 15 additions & 18 deletions tests/topotests/bgp_ecmp_topo1/peer10/exabgp.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
group controller {

process announce-routes {
run "/etc/exabgp/exa-send.py 10 10";
}

process receive-routes {
run "/etc/exabgp/exa-receive.py 10";
receive-routes;
encoder text;
}
process announce-routes {
run /etc/exabgp/exa-send.py 10 10;
encoder text;
}

neighbor 10.0.2.1 {
router-id 10.0.2.110;
local-address 10.0.2.110;
local-as 99;
peer-as 100;
graceful-restart;
}
process receive-routes {
run /etc/exabgp/exa-receive.py 10;
encoder text;
}

neighbor 10.0.2.1 {
router-id 10.0.2.110;
local-address 10.0.2.110;
local-as 99;
peer-as 100;
capability {graceful-restart;}
api {processes [ announce-routes, receive-routes ];}
}
2 changes: 1 addition & 1 deletion tests/topotests/bgp_ecmp_topo1/peer11/exa-send.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
exa-send.py: Send a few testroutes with ExaBGP
Expand Down
33 changes: 15 additions & 18 deletions tests/topotests/bgp_ecmp_topo1/peer11/exabgp.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
group controller {

process announce-routes {
run "/etc/exabgp/exa-send.py 11 10";
}

process receive-routes {
run "/etc/exabgp/exa-receive.py 11";
receive-routes;
encoder text;
}
process announce-routes {
run /etc/exabgp/exa-send.py 11 10;
encoder text;
}

neighbor 10.0.3.1 {
router-id 10.0.3.111;
local-address 10.0.3.111;
local-as 111;
peer-as 100;
graceful-restart;
}
process receive-routes {
run /etc/exabgp/exa-receive.py 11;
encoder text;
}

neighbor 10.0.3.1 {
router-id 10.0.3.111;
local-address 10.0.3.111;
local-as 111;
peer-as 100;
capability {graceful-restart;}
api {processes [ announce-routes, receive-routes ];}
}
2 changes: 1 addition & 1 deletion tests/topotests/bgp_ecmp_topo1/peer12/exa-send.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
exa-send.py: Send a few testroutes with ExaBGP
Expand Down
33 changes: 15 additions & 18 deletions tests/topotests/bgp_ecmp_topo1/peer12/exabgp.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
group controller {

process announce-routes {
run "/etc/exabgp/exa-send.py 12 10";
}

process receive-routes {
run "/etc/exabgp/exa-receive.py 12";
receive-routes;
encoder text;
}
process announce-routes {
run /etc/exabgp/exa-send.py 12 10;
encoder text;
}

neighbor 10.0.3.1 {
router-id 10.0.3.112;
local-address 10.0.3.112;
local-as 112;
peer-as 100;
graceful-restart;
}
process receive-routes {
run /etc/exabgp/exa-receive.py 12;
encoder text;
}

neighbor 10.0.3.1 {
router-id 10.0.3.112;
local-address 10.0.3.112;
local-as 112;
peer-as 100;
capability {graceful-restart;}
api {processes [ announce-routes, receive-routes ];}
}
2 changes: 1 addition & 1 deletion tests/topotests/bgp_ecmp_topo1/peer13/exa-send.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
exa-send.py: Send a few testroutes with ExaBGP
Expand Down
33 changes: 15 additions & 18 deletions tests/topotests/bgp_ecmp_topo1/peer13/exabgp.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
group controller {

process announce-routes {
run "/etc/exabgp/exa-send.py 13 10";
}

process receive-routes {
run "/etc/exabgp/exa-receive.py 13";
receive-routes;
encoder text;
}
process announce-routes {
run /etc/exabgp/exa-send.py 13 10;
encoder text;
}

neighbor 10.0.3.1 {
router-id 10.0.3.113;
local-address 10.0.3.113;
local-as 113;
peer-as 100;
graceful-restart;
}
process receive-routes {
run /etc/exabgp/exa-receive.py 13;
encoder text;
}

neighbor 10.0.3.1 {
router-id 10.0.3.113;
local-address 10.0.3.113;
local-as 113;
peer-as 100;
capability {graceful-restart;}
api {processes [ announce-routes, receive-routes ];}
}
2 changes: 1 addition & 1 deletion tests/topotests/bgp_ecmp_topo1/peer14/exa-send.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
exa-send.py: Send a few testroutes with ExaBGP
Expand Down
33 changes: 15 additions & 18 deletions tests/topotests/bgp_ecmp_topo1/peer14/exabgp.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
group controller {

process announce-routes {
run "/etc/exabgp/exa-send.py 14 10";
}

process receive-routes {
run "/etc/exabgp/exa-receive.py 14";
receive-routes;
encoder text;
}
process announce-routes {
run /etc/exabgp/exa-send.py 14 10;
encoder text;
}

neighbor 10.0.3.1 {
router-id 10.0.3.114;
local-address 10.0.3.114;
local-as 114;
peer-as 100;
graceful-restart;
}
process receive-routes {
run /etc/exabgp/exa-receive.py 14;
encoder text;
}

neighbor 10.0.3.1 {
router-id 10.0.3.114;
local-address 10.0.3.114;
local-as 114;
peer-as 100;
capability {graceful-restart;}
api {processes [ announce-routes, receive-routes ];}
}
2 changes: 1 addition & 1 deletion tests/topotests/bgp_ecmp_topo1/peer15/exa-send.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
exa-send.py: Send a few testroutes with ExaBGP
Expand Down
Loading

0 comments on commit 0d57a9a

Please sign in to comment.