aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_interface.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-03-05 16:58:24 +0100
committerOle Troan <ot@cisco.com>2019-03-06 21:13:05 +0100
commit9a475373ed9b1ff9952acc06353ddaa50c2c96bd (patch)
tree6fb046cc31165335863646cba0f4b453d4538b10 /test/vpp_interface.py
parentfb6c75293cb82501f80975c6a46365ab14d7a85a (diff)
test framework: vpp_papi_provider.py - further cleanup
Part of further cleanups of this file. Removed most wrappers that don't have conflicting signature with message API. Change-Id: I6acd93d20291feb7731eb35ab2eb8c9f22f4632c Signed-off-by: Ole Troan <ot@cisco.com>
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