From f0404e9fb60bf98036cfe768d7e80b31ada05f81 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 27 Mar 2018 13:25:17 -0700 Subject: test: fix VppNeighbor.query_vpp_config Change-Id: I2a879ee9d5065a14eb351eccd0350693eb1ff521 Signed-off-by: Neale Ranns --- test/vpp_neighbor.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/test/vpp_neighbor.py b/test/vpp_neighbor.py index 5919cf8e48b..e8ba3b28823 100644 --- a/test/vpp_neighbor.py +++ b/test/vpp_neighbor.py @@ -38,13 +38,14 @@ class VppNeighbor(VppObject): self.af = af self.is_static = is_static self.is_no_fib_entry = is_no_fib_entry - self.nbr_addr = inet_pton(af, nbr_addr) + self.nbr_addr = nbr_addr + self.nbr_addr_n = inet_pton(af, nbr_addr) def add_vpp_config(self): self._test.vapi.ip_neighbor_add_del( self.sw_if_index, self.mac_addr, - self.nbr_addr, + self.nbr_addr_n, is_add=1, is_ipv6=1 if AF_INET6 == self.af else 0, is_static=self.is_static, @@ -55,25 +56,20 @@ class VppNeighbor(VppObject): self._test.vapi.ip_neighbor_add_del( self.sw_if_index, self.mac_addr, - self.nbr_addr, + self.nbr_addr_n, is_ipv6=1 if AF_INET6 == self.af else 0, is_add=0, is_static=self.is_static) def query_vpp_config(self): - dump = self._test.vapi.ip_neighbor_dump( - self.sw_if_index, - is_ipv6=1 if AF_INET6 == self.af else 0) - for n in dump: - if self.nbr_addr == n.ip_address \ - and self.is_static == n.is_static: - return True - return False + return find_nbr(self._test, + self.sw_if_index, + self.nbr_addr, + self.is_static, + self.af) def __str__(self): return self.object_id() def object_id(self): - return ("%d:%s" - % (self.sw_if_index, - inet_ntop(self.af, self.nbr_addr))) + return ("%d:%s" % (self.sw_if_index, self.nbr_addr)) -- cgit 1.2.3-korg