From 1430ea83da59492e81297242696f3a65ade245d6 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 22 Oct 2021 14:20:16 -0400 Subject: [PATCH] tests: Fix bgp_ecmp_topo3 to look for a bit more state During a local CI run, bgp_ecmp_topo3 was failing to properly notice the fast-convergence command issued before the interface is shut down. As such there exists a race condition where under high load the zebra process can actually shut an interface down before we have properly ensured that fast convergence is on for ibgp. Modify the test for in two ways: 1) Ensure that previous section makes sure that we have properly converged for when we bring back up the interfaces instead of assuming that we have done so. 2) After issuing the fast-convergence command. Ensure that bgp has fully processed it and is ready to receive the interface down events as triggers for shutting down the ibgp session. Signed-off-by: Donald Sharp --- .../topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py b/tests/topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py index 54b3e80da..2a51dc83e 100644 --- a/tests/topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py +++ b/tests/topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py @@ -29,6 +29,7 @@ import os import sys import time import pytest +import re from time import sleep # Save the Current Working Directory to find configuration files. @@ -221,6 +222,9 @@ def test_ecmp_fast_convergence(request, test_type, tgen, topo): shutdown_bringup_interface(tgen, "r2", intf1, True) shutdown_bringup_interface(tgen, "r2", intf2, True) + logger.info("Ensure that the links are still up") + result = verify_bgp_convergence(tgen, topo) + logger.info("Enable bgp fast-convergence cli") raw_config = { "r2": { @@ -233,6 +237,13 @@ def test_ecmp_fast_convergence(request, test_type, tgen, topo): result = apply_raw_config(tgen, raw_config) assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) + logger.info("Ensure BGP has processed the cli") + r2 = tgen.gears["r2"] + output = r2.vtysh_cmd("show run") + verify = re.search(r"fast-convergence", output ) + assert verify is not None, ( + "r2 does not have the fast convergence command yet") + logger.info("Shutdown one link b/w r2 and r3") shutdown_bringup_interface(tgen, "r2", intf1, False) -- 2.39.5