Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/developer/topotests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Installing Topotest Requirements
python3 -m pip install 'scapy>=2.4.5'
python3 -m pip install 'libyang<4'
python3 -m pip install pyyaml xmltodict
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@0659057837cd6c6351579e9f0fa47e9fb7de7311
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@5d36bc40253235a913664599ac5cf85bc7adb996 # ExaBGP 5.0.9
useradd -d /var/run/exabgp/ -s /bin/false exabgp

The version of protobuf package that is installed on your system will determine
Expand Down
2 changes: 1 addition & 1 deletion docker/ubuntu-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ RUN for i in $(seq 1 ${APT_RETRIES}); do \
python3 -m pip install 'scapy>=2.4.5' && \
python3 -m pip install pyyaml && \
python3 -m pip install xmltodict && \
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@0659057837cd6c6351579e9f0fa47e9fb7de7311
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@5d36bc40253235a913664599ac5cf85bc7adb996 # ExaBGP 5.0.9

# LTTng tracing dependencies (conditional)
RUN if [ "$ENABLE_LTTNG" = "true" ]; then \
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ RUN apt update -y && apt upgrade -y && \
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
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@5d36bc40253235a913664599ac5cf85bc7adb996 # ExaBGP 5.0.9

# Install FRR built packages
RUN mkdir -p /etc/apt/keyrings && \
Expand Down
27 changes: 14 additions & 13 deletions tests/topotests/lib/topogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,21 @@ def is_string(value):


def get_exabgp_cmd(commander=None):
"""Return the command to use for ExaBGP version >= 4.2.11"""
"""Return the command to use for ExaBGP version >= 5.0.0"""

if commander is None:
commander = Commander("exabgp", logger=logging.getLogger("exabgp"))

def exacmd_version_ok(exacmd):
logger.debug("checking %s for exabgp version >= 4.2.11", exacmd)
_, stdout, _ = commander.cmd_status(exacmd + " --version", warn=False)
logger.debug("checking %s for exabgp version >= 5.0.0", exacmd)
_, stdout, _ = commander.cmd_status(exacmd + " version", warn=False)
m = re.search(r"ExaBGP\s*:\s*((\d+)\.(\d+)(?:\.(\d+))?)", stdout)
if not m:
return False
version = m.group(1)
if topotest.version_cmp(version, "4.2.11") < 0:
if topotest.version_cmp(version, "5.0.0") < 0:
logging.debug(
"found exabgp version < 4.2.11 in %s will keep looking", exacmd
"found exabgp version < 5.0.0 in %s will keep looking", exacmd
)
return False
logger.info("Using ExaBGP version %s in %s", version, exacmd)
Expand Down Expand Up @@ -1331,7 +1331,7 @@ def start(self, peer_dir, env_file=None):
* Run ExaBGP with env file `env_file` and configuration peer*/exabgp.cfg
"""
exacmd = self.tgen.get_exabgp_cmd()
assert exacmd, "Can't find a usable ExaBGP (must be version >= 4.2.11)"
assert exacmd, "Can't find a usable ExaBGP (must be version >= 5.0.0)"

self.run("mkdir -p /etc/exabgp")
self.run("chmod 755 /etc/exabgp")
Expand All @@ -1342,10 +1342,6 @@ def start(self, peer_dir, env_file=None):
self.run("chmod 644 /etc/exabgp/*")
self.run("chmod a+x /etc/exabgp/*.py")
self.run("chown -R exabgp:exabgp /etc/exabgp")
self.run("[ -p /var/run/exabgp.in ] || mkfifo /var/run/exabgp.in")
self.run("[ -p /var/run/exabgp.out ] || mkfifo /var/run/exabgp.out")
self.run("chown exabgp:exabgp /var/run/exabgp.{in,out}")
self.run("chmod 600 /var/run/exabgp.{in,out}")

log_dir = os.path.join(self.logdir, self.name)
self.run("chmod 777 {}".format(log_dir))
Expand All @@ -1354,10 +1350,15 @@ def start(self, peer_dir, env_file=None):

env_cmd = "env exabgp.log.level=INFO "
env_cmd += "exabgp.log.destination={} ".format(log_file)
env_cmd += "EXABGP_ENVFILE=/etc/exabgp/exabgp.env "

output = self.run(
env_cmd + exacmd + " -e /etc/exabgp/exabgp.env /etc/exabgp/exabgp.cfg "
# Without the stdio redirect the daemonized exabgp keeps the
# launch pipe open and self.run() blocks forever.
invocation = (
exacmd + " server /etc/exabgp/exabgp.cfg </dev/null >/dev/null 2>&1"
)

output = self.run(env_cmd + invocation)
if output is None or len(output) == 0:
output = "<none>"

Expand Down Expand Up @@ -1530,7 +1531,7 @@ def diagnose_env_linux(rundir):
logger.info("LDPd tests will not run (missing mpls-iptunnel kernel module)")

if not get_exabgp_cmd():
logger.warning("Failed to find exabgp >= 4.2.11")
logger.warning("Failed to find exabgp >= 5.0.0")

logger.removeHandler(fhandler)
fhandler.close()
Expand Down
Loading