X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fvpp_neighbor.py;h=9ba87005c463a4bf7cf09918230dfeb3bb79f936;hb=ee60ac638c9abcd0763c57fce0e3e646723ea0e0;hp=6172d8f871df0d93656cdc848981194492dc568f;hpb=cbe25aab3be72154f2c706c39eeba6a77f34450f;p=vpp.git diff --git a/test/vpp_neighbor.py b/test/vpp_neighbor.py index 6172d8f871d..9ba87005c46 100644 --- a/test/vpp_neighbor.py +++ b/test/vpp_neighbor.py @@ -16,14 +16,12 @@ except NameError: def find_nbr(test, sw_if_index, nbr_addr, is_static=0, mac=None): ip_addr = ip_address(text_type(nbr_addr)) e = VppEnum.vl_api_ip_neighbor_flags_t - if 6 == ip_addr.version: - af = VppEnum.vl_api_address_family_t.ADDRESS_IP6 - else: - af = VppEnum.vl_api_address_family_t.ADDRESS_IP4 - nbrs = test.vapi.ip_neighbor_dump(sw_if_index=sw_if_index, af=af) + nbrs = test.vapi.ip_neighbor_dump(sw_if_index=sw_if_index, + af=ip_addr.vapi_af) for n in nbrs: - if ip_addr == n.neighbor.ip_address and \ + if sw_if_index == n.neighbor.sw_if_index and \ + ip_addr == n.neighbor.ip_address and \ is_static == (n.neighbor.flags & e.IP_API_NEIGHBOR_FLAG_STATIC): if mac: if mac == str(n.neighbor.mac_address): @@ -85,5 +83,5 @@ class VppNeighbor(VppObject): return ("%d:%s" % (self.sw_if_index, self.nbr_addr)) def get_stats(self): - c = self._test.statistics.get_counter("/net/adjacency") + c = self._test.statistics["/net/adjacency"] return c[0][self.stats_index]