X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fvpp_interface.py;h=7b9de828e6c7ea7901aaa4a6ae10dd0d1cb16323;hb=097fa66b986f06281f603767d321ab13ab6c88c3;hp=36118192915c8d7dd328f5b0a18d2e6b3c0a3870;hpb=39baa32186fd3e4b20d9f58afbbfe7b8daebed62;p=vpp.git diff --git a/test/vpp_interface.py b/test/vpp_interface.py index 36118192915..7b9de828e6c 100644 --- a/test/vpp_interface.py +++ b/test/vpp_interface.py @@ -7,6 +7,12 @@ from six import moves from util import Host, mk_ll_addr from vpp_papi import mac_ntop +from ipaddress import IPv4Network + +try: + text_type = unicode +except NameError: + text_type = str @six.add_metaclass(abc.ABCMeta) @@ -406,9 +412,10 @@ class VppInterface(object): def is_ip4_entry_in_fib_dump(self, dump): for i in dump: - if i.address == self.local_ip4n and \ - i.address_length == self.local_ip4_prefix_len and \ - i.table_id == self.ip4_table_id: + n = IPv4Network(text_type("%s/%d" % (self.local_ip4, + self.local_ip4_prefix_len))) + if i.route.prefix == n and \ + i.route.table_id == self.ip4_table_id: return True return False