diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-03-22 11:35:28 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-03-22 11:35:28 -0400 | 
| commit | 3fdb2079f6ba6d9dd94386ba471055cdc9295147 (patch) | |
| tree | ab7396359c9ba86a4e6c5669b008a04cae0fdf6a /tests/topotests/bgp_suppress_fib | |
| parent | 51655ef01a89f4e31c1ffe89f702ba975c106465 (diff) | |
bgpd: Ensure suppress-fib-pending works with network statements
The flag for telling BGP that a route is expected to be installed
first before notifying a peer was always being set upon receipt
of a path that could be accepted as bestpath.  This is not correct:
imagine that you have a peer sending you a route and you have a
network statement that covers the same route.  Irrelevant if the
network statement would win the flag on the dest was being set
in bgp_update.  Thus you could get into a situation where
the network statement path wins but since the flag is set on
the node, it will never be announced to a peer.
Let's just move the setting of the flag into bgp_zebra_announce
and _withdraw.  In _announce set the flag to TRUE when suppress-fib
is enabled.  In _withdraw just always unset the flag as that a withdrawal
does not need to wait for rib removal before announcing.  This will
cover the case when a network statement is added after the route has
been learned from a peer.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'tests/topotests/bgp_suppress_fib')
| -rw-r--r-- | tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py | 14 | 
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py b/tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py index ed8e41903f..ef9200b197 100644 --- a/tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py +++ b/tests/topotests/bgp_suppress_fib/test_bgp_suppress_fib.py @@ -217,6 +217,20 @@ def test_bgp_allow_as_in():      assertmsg = '"r2" 192.168.1.1/32 route should be gone'      assert result is None, assertmsg +def test_local_vs_non_local(): +    tgen = get_topogen() + +    if tgen.routers_have_failure(): +        pytest.skip(tgen.errors) + +    r2 = tgen.gears["r2"] + +    output = json.loads(r2.vtysh_cmd("show bgp ipv4 uni 60.0.0.0/24 json")) +    paths = output["paths"] +    for i in range(len(paths)): +        if "fibPending" in paths[i]: +            assert(False),  "Route 60.0.0.0/24 should not have fibPending" +  if __name__ == "__main__":      args = ["-s"] + sys.argv[1:]  | 
