aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_neighbor.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2020-04-28 00:27:38 -0400
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2020-04-28 15:43:28 +0000
commite64e5fff4ddea88f386657c5d95ae8dc78138d20 (patch)
treea4b91682810f8d64dfe2ae0934c21d1f67b94f9d /test/vpp_neighbor.py
parent58db6e16cf4f3bb1740ca2f62d7d887baad58d63 (diff)
tests: implement ipaddress convenience methods
Add vpp specific properties to ip addresses for use in the api. .vapi_af -- returns [ADDRESS_IP4, ADDRESS_IP6] .vapi_af_name -- returns the string ['ip4', 'ip6'] Update tests to demonstrate usage. Type: feature Change-Id: I43447a1522769d99f89debdc714c51700068d771 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/vpp_neighbor.py')
-rw-r--r--test/vpp_neighbor.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/test/vpp_neighbor.py b/test/vpp_neighbor.py
index 6172d8f871d..ffe87d93b58 100644
--- a/test/vpp_neighbor.py
+++ b/test/vpp_neighbor.py
@@ -16,11 +16,8 @@ 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 \