summaryrefslogtreecommitdiffstats
path: root/test/vpp_interface.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/vpp_interface.py')
-rw-r--r--test/vpp_interface.py43
1 files changed, 18 insertions, 25 deletions
diff --git a/test/vpp_interface.py b/test/vpp_interface.py
index b6f3a916798..6797b10b3fe 100644
--- a/test/vpp_interface.py
+++ b/test/vpp_interface.py
@@ -252,7 +252,8 @@ class VppInterface(object):
def config_ip4(self):
"""Configure IPv4 address on the VPP interface."""
self.test.vapi.sw_interface_add_del_address(
- self.sw_if_index, self.local_ip4n, self.local_ip4_prefix_len)
+ sw_if_index=self.sw_if_index, address=self.local_ip4n,
+ address_length=self.local_ip4_prefix_len)
self.has_ip4_config = True
def unconfig_ip4(self):
@@ -260,10 +261,8 @@ class VppInterface(object):
try:
if self.has_ip4_config:
self.test.vapi.sw_interface_add_del_address(
- self.sw_if_index,
- self.local_ip4n,
- self.local_ip4_prefix_len,
- is_add=0)
+ sw_if_index=self.sw_if_index, address=self.local_ip4n,
+ address_length=self.local_ip4_prefix_len, is_add=0)
except AttributeError:
self.has_ip4_config = False
self.has_ip4_config = False
@@ -281,8 +280,8 @@ class VppInterface(object):
def config_ip6(self):
"""Configure IPv6 address on the VPP interface."""
self.test.vapi.sw_interface_add_del_address(
- self.sw_if_index, self._local_ip6n, self.local_ip6_prefix_len,
- is_ipv6=1)
+ sw_if_index=self.sw_if_index, address=self._local_ip6n,
+ address_length=self.local_ip6_prefix_len, is_ipv6=1)
self.has_ip6_config = True
def unconfig_ip6(self):
@@ -290,10 +289,9 @@ class VppInterface(object):
try:
if self.has_ip6_config:
self.test.vapi.sw_interface_add_del_address(
- self.sw_if_index,
- self.local_ip6n,
- self.local_ip6_prefix_len,
- is_ipv6=1, is_add=0)
+ sw_if_index=self.sw_if_index, address=self.local_ip6n,
+ address_length=self.local_ip6_prefix_len, is_ipv6=1,
+ is_add=0)
except AttributeError:
self.has_ip6_config = False
self.has_ip6_config = False
@@ -392,34 +390,29 @@ class VppInterface(object):
def enable_mpls(self):
"""Enable MPLS on the VPP interface."""
- self.test.vapi.sw_interface_set_mpls_enable(
- self.sw_if_index)
+ self.test.vapi.sw_interface_set_mpls_enable(self.sw_if_index)
def disable_mpls(self):
"""Enable MPLS on the VPP interface."""
- self.test.vapi.sw_interface_set_mpls_enable(
- self.sw_if_index, 0)
+ self.test.vapi.sw_interface_set_mpls_enable(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 \
- i.address_length == self.local_ip4_prefix_len and \
- i.table_id == self.ip4_table_id:
+ i.address_length == self.local_ip4_prefix_len and \
+ 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)
+ self.test.vapi.sw_interface_set_unnumbered(ip_sw_if_index,
+ self.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)
+ self.test.vapi.sw_interface_set_unnumbered(ip_sw_if_index,
+ self.sw_if_index, is_add=0)
def set_proxy_arp(self, enable=1):
""" Set the interface to enable/disable Proxy ARP """
@@ -434,7 +427,7 @@ class VppInterface(object):
def get_interface_config_from_dump(self, dump):
for i in dump:
if i.interface_name.rstrip(' \t\r\n\0') == self.name and \
- i.sw_if_index == self.sw_if_index:
+ i.sw_if_index == self.sw_if_index:
return i
else:
return None