summaryrefslogtreecommitdiffstats
path: root/test/vpp_neighbor.py
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-03-27 13:25:17 -0700
committerMarco Varlese <marco.varlese@suse.de>2018-03-28 08:10:59 +0000
commitf0404e9fb60bf98036cfe768d7e80b31ada05f81 (patch)
tree2e63bb699dddf7807dca3b1f2235e5bb63010e5f /test/vpp_neighbor.py
parentd4ac4bb26618053b1960dcdf963225884af54d4f (diff)
test: fix VppNeighbor.query_vpp_config
Change-Id: I2a879ee9d5065a14eb351eccd0350693eb1ff521 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'test/vpp_neighbor.py')
-rw-r--r--test/vpp_neighbor.py24
1 files 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))