mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-10 06:52:36 +00:00
topotests: add ability to check that a prefix is not in BGP RIB
Add an "exist" key to check the existence of a prefix in the BGP RIB. Useful to check that a prefix has not leaked by error. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
This commit is contained in:
parent
5f6c0ba6d2
commit
a7e794215c
@ -48,7 +48,15 @@ class BgpRib:
|
|||||||
for pfx in pfxtbl.keys():
|
for pfx in pfxtbl.keys():
|
||||||
if debug:
|
if debug:
|
||||||
self.log("trying pfx %s" % pfx)
|
self.log("trying pfx %s" % pfx)
|
||||||
if pfx != want["p"]:
|
if "exist" in want and want["exist"] == False:
|
||||||
|
if pfx == want["p"]:
|
||||||
|
if debug:
|
||||||
|
self.log("unexpected route: pfx=" + want["p"])
|
||||||
|
return 0
|
||||||
|
if debug:
|
||||||
|
self.log("unwant pfx=" + want["p"] + ", not " + pfx)
|
||||||
|
continue
|
||||||
|
elif pfx != want["p"]:
|
||||||
if debug:
|
if debug:
|
||||||
self.log("want pfx=" + want["p"] + ", not " + pfx)
|
self.log("want pfx=" + want["p"] + ", not " + pfx)
|
||||||
continue
|
continue
|
||||||
@ -75,6 +83,9 @@ class BgpRib:
|
|||||||
if debug:
|
if debug:
|
||||||
self.log("missing route: pfx=" + want["p"] + ", nh=" + want["n"])
|
self.log("missing route: pfx=" + want["p"] + ", nh=" + want["n"])
|
||||||
return 0
|
return 0
|
||||||
|
if "exist" in want and want["exist"] == False:
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
def RequireVpnRoutes(self, target, title, wantroutes, debug=0):
|
def RequireVpnRoutes(self, target, title, wantroutes, debug=0):
|
||||||
import json
|
import json
|
||||||
|
Loading…
Reference in New Issue
Block a user