X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fvpp_interface.py;h=5dba0978cb94941e3cbd9a9079ebf82ccce4786f;hb=180279b912827c30494ec1b90ee4325a15cb337c;hp=ee4a9ef6c986112b358a184c3e45d49331c447c0;hpb=46a87adf10d41af4b1b14f06bdab33228cbaae95;p=vpp.git diff --git a/test/vpp_interface.py b/test/vpp_interface.py index ee4a9ef6c98..5dba0978cb9 100644 --- a/test/vpp_interface.py +++ b/test/vpp_interface.py @@ -2,6 +2,7 @@ from abc import abstractmethod, ABCMeta import socket from util import Host +from vpp_neighbor import VppNeighbor class VppInterface(object): @@ -195,7 +196,7 @@ class VppInterface(object): self.has_ip4_config = False self.has_ip4_config = False - def configure_ipv4_neighbors(self, vrf_id=0): + def configure_ipv4_neighbors(self): """For every remote host assign neighbor's MAC to IPv4 addresses. :param vrf_id: The FIB table / VRF ID. (Default value = 0) @@ -204,7 +205,7 @@ class VppInterface(object): macn = host.mac.replace(":", "").decode('hex') ipn = host.ip4n self.test.vapi.ip_neighbor_add_del( - self.sw_if_index, macn, ipn, vrf_id) + self.sw_if_index, macn, ipn) def config_ip6(self): """Configure IPv6 address on the VPP interface.""" @@ -227,11 +228,15 @@ class VppInterface(object): self.has_ip6_config = False def configure_ipv6_neighbors(self): - """For every remote host assign neighbor's MAC to IPv6 address.""" + """For every remote host assign neighbor's MAC to IPv6 addresses. + + :param vrf_id: The FIB table / VRF ID. (Default value = 0) + """ for host in self._remote_hosts: macn = host.mac.replace(":", "").decode('hex') + ipn = host.ip6n self.test.vapi.ip_neighbor_add_del( - self.sw_if_index, macn, host.ip6n, is_ipv6=1) + self.sw_if_index, macn, ipn, is_ipv6=1) def unconfig(self): """Unconfigure IPv6 and IPv4 address on the VPP interface.""" @@ -260,12 +265,24 @@ class VppInterface(object): """Configure IPv6 RA suppress on the VPP interface.""" self.test.vapi.sw_interface_ra_suppress(self.sw_if_index) - def ip6_ra_config(self, suppress=0, send_unicast=0): + def ip6_ra_config(self, no=0, suppress=0, send_unicast=0): """Configure IPv6 RA suppress on the VPP interface.""" self.test.vapi.ip6_sw_interface_ra_config(self.sw_if_index, + no, suppress, send_unicast) + def ip6_ra_prefix(self, address, address_length, is_no=0, + off_link=0, no_autoconfig=0, use_default=0): + """Configure IPv6 RA suppress on the VPP interface.""" + self.test.vapi.ip6_sw_interface_ra_prefix(self.sw_if_index, + address, + address_length, + is_no=is_no, + off_link=off_link, + no_autoconfig=no_autoconfig, + use_default=use_default) + def admin_up(self): """Put interface ADMIN-UP.""" self.test.vapi.sw_interface_set_flags(self.sw_if_index, @@ -304,6 +321,11 @@ class VppInterface(object): self.test.vapi.sw_interface_enable_disable_mpls( self.sw_if_index) + def disable_mpls(self): + """Enable MPLS on the VPP interface.""" + self.test.vapi.sw_interface_enable_disable_mpls( + self.sw_if_index, 0) + def is_ip4_entry_in_fib_dump(self, dump): for i in dump: if i.address == self.local_ip4n and \ @@ -311,3 +333,22 @@ class VppInterface(object): i.table_id == self.ip4_table_id: return True return False + + def set_unnumbered(self, ip_sw_if_index): + """ Set the interface to unnumbered via ip_sw_if_index """ + self.test.vapi.sw_interface_set_unnumbered( + self.sw_if_index, + ip_sw_if_index) + + def unset_unnumbered(self, ip_sw_if_index): + """ Unset the interface to unnumbered via ip_sw_if_index """ + self.test.vapi.sw_interface_set_unnumbered( + self.sw_if_index, + ip_sw_if_index, + is_add=0) + + def set_proxy_arp(self, enable=1): + """ Set the interface to enable/disable Proxy ARP """ + self.test.vapi.proxy_arp_intfc_enable_disable( + self.sw_if_index, + enable)