From 773376a3c3a84435bbdbf46dbfe1fcf05b17b138 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 6 Jun 2023 12:13:50 -0400 Subject: [PATCH 1/3] tests: The bgp_flowspec frequently fails try to gather more data Add a bit of code to allow the bgp_flowspec topotest to gather data when something goes wrong. Signed-off-by: Donald Sharp --- tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py b/tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py index fd675dc8ae..4454545326 100644 --- a/tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py +++ b/tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py @@ -51,6 +51,7 @@ sys.path.append(os.path.join(CWD, "../")) from lib import topotest from lib.topogen import Topogen, TopoRouter, get_topogen from lib.topolog import logger +from lib.common_config import generate_support_bundle # Required to instantiate the topology builder class. @@ -139,7 +140,9 @@ def test_bgp_convergence(): ) _, res = topotest.run_and_expect(test_func, None, count=90, wait=0.5) assertmsg = "BGP router network did not converge" - assert res is None, assertmsg + if res is not None: + generate_support_bundle() + assert res is None, assertmsg def test_bgp_flowspec(): From 6ec106521764a98c0f98a5d8d209a21f43a5d559 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 6 Jun 2023 14:50:25 -0400 Subject: [PATCH 2/3] tests: test_bgp_flowspec_topo.py changes as per linter Signed-off-by: Donald Sharp --- tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py b/tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py index 4454545326..b1bec1034b 100644 --- a/tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py +++ b/tests/topotests/bgp_flowspec/test_bgp_flowspec_topo.py @@ -186,7 +186,6 @@ def test_bgp_flowspec(): if __name__ == "__main__": - args = ["-s"] + sys.argv[1:] ret = pytest.main(args) From c1ce67e26c88e88c7cb3cb239160a188aa6b8897 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 7 Jun 2023 10:09:27 -0400 Subject: [PATCH 3/3] bgpd: Add some color to why nexthop_set failed We are seeing some frequent test failures with setting the nexthop correctly. At this point in time, I have no idea what is going wrong, but I don't have a bunch of information either, so let's add the local and remote values. Signed-off-by: Donald Sharp --- bgpd/bgp_network.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index e235a61f59..73fe00c7ab 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -810,8 +810,9 @@ int bgp_getsockname(struct peer *peer) &peer->nexthop, peer)) { flog_err( EC_BGP_NH_UPD, - "%s: nexthop_set failed, resetting connection - intf %s", - peer->host, + "%s: nexthop_set failed, local: %pSUp remote: %pSUp update_if: %s resetting connection - intf %s", + peer->host, peer->su_local, peer->su_remote, + peer->update_if ? peer->update_if : "(None)", peer->nexthop.ifp ? peer->nexthop.ifp->name : "(Unknown)"); return -1;