]> git.puffer.fish Git - mirror/frr.git/commit
tests: fix bgp_bmp race condition
authorLouis Scalbert <louis.scalbert@6wind.com>
Thu, 24 Oct 2024 13:35:35 +0000 (15:35 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Fri, 25 Oct 2024 12:17:20 +0000 (14:17 +0200)
commit771284474d3660e5b7808b4f81038307bc63b585
tree0298ea3ec6f501ac721407b40d7fc828af9efb40
parent14eed3ab8b2fb7067d537eee1df7536bfa97f9b4
tests: fix bgp_bmp race condition

The bgp_bmp topotest is randomly failing with similar messages:

> 2024-10-24 16:59:03,037 ERROR: topo: test failed at "bgp_bmp.test_bgp_bmp/test_bmp_bgp_unicast": Checking the updated prefixes has failed ! Generated JSON diff error report:
>
> $->pre-policy->update: expected has key '172.31.0.15/32' which is not present in output

It is particularly unsuccessful when run with valgrind:

> python3 -m pytest -vvss --valgrind-leak-kinds=all --valgrind-extra --valgrind-memleaks bgp_bmp

bgp_bmp is configuring a BMP policy on r1 and then some static BGP
prefixes on r2. If for some reasons, the BGP UPDATE arrives to r1 before
the BMP configuration is operational, the UPDATE is not sent to the BMP
server and the test fails.

Pre-configure the BMP policies at startup to avoid this race condition.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
tests/topotests/bgp_bmp/r1/bgpd.conf
tests/topotests/bgp_bmp/test_bgp_bmp.py