aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2019-09-02 13:28:52 +0200
committerDamjan Marion <dmarion@me.com>2019-09-04 19:54:44 +0000
commit4682feb1f0b15d0f1940cd5984ae82ccaea168f7 (patch)
tree2ddad95d6efc3d7f1c926deb9450efb0735aafdf /test/vpp_papi_provider.py
parent0f09a828ad2dc53d4f1e69de536f3104eaccc4b0 (diff)
bfd: API cleanup
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I4b91ebe8aadbec8b95716ed1cde4b0a13eee3a3f Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r--test/vpp_papi_provider.py86
1 files changed, 5 insertions, 81 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index f9bb470ec1d..663f688e1db 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -27,6 +27,10 @@ defaultmapping = {
'acl_interface_list_dump': {'sw_if_index': 4294967295, },
'app_namespace_add_del': {'sw_if_index': 4294967295, },
'bd_ip_mac_add_del': {'is_add': 1, },
+ 'bfd_udp_add': {'is_authenticated': False, 'bfd_key_id': None,
+ 'conf_key_id': None},
+ 'bfd_udp_auth_activate': {'bfd_key_id': None, 'conf_key_id': None,
+ 'is_delayed': False},
'bier_disp_entry_add_del': {'next_hop_rpf_id': -1, 'next_hop_is_ip4': 1,
'is_add': 1, },
'bier_disp_table_add_del': {'is_add': 1, },
@@ -272,7 +276,7 @@ class VppPapiProvider(object):
for i, o in enumerate(fields[3:]):
try:
d[o] = a[i]
- except:
+ except BaseException:
break
# Default override
@@ -762,86 +766,6 @@ class VppPapiProvider(object):
'mt_paths': paths,
}})
- def bfd_udp_add(self, sw_if_index, desired_min_tx, required_min_rx,
- detect_mult, local_addr, peer_addr, is_ipv6=0,
- bfd_key_id=None, conf_key_id=None):
- if bfd_key_id is None:
- return self.api(self.papi.bfd_udp_add,
- {
- 'sw_if_index': sw_if_index,
- 'desired_min_tx': desired_min_tx,
- 'required_min_rx': required_min_rx,
- 'local_addr': local_addr,
- 'peer_addr': peer_addr,
- 'is_ipv6': is_ipv6,
- 'detect_mult': detect_mult,
- })
- else:
- return self.api(self.papi.bfd_udp_add,
- {
- 'sw_if_index': sw_if_index,
- 'desired_min_tx': desired_min_tx,
- 'required_min_rx': required_min_rx,
- 'local_addr': local_addr,
- 'peer_addr': peer_addr,
- 'is_ipv6': is_ipv6,
- 'detect_mult': detect_mult,
- 'is_authenticated': 1,
- 'bfd_key_id': bfd_key_id,
- 'conf_key_id': conf_key_id,
- })
-
- def bfd_udp_mod(self, sw_if_index, desired_min_tx, required_min_rx,
- detect_mult, local_addr, peer_addr, is_ipv6=0):
- return self.api(self.papi.bfd_udp_mod,
- {
- 'sw_if_index': sw_if_index,
- 'desired_min_tx': desired_min_tx,
- 'required_min_rx': required_min_rx,
- 'local_addr': local_addr,
- 'peer_addr': peer_addr,
- 'is_ipv6': is_ipv6,
- 'detect_mult': detect_mult,
- })
-
- def bfd_udp_auth_activate(self, sw_if_index, local_addr, peer_addr,
- is_ipv6=0, bfd_key_id=None, conf_key_id=None,
- is_delayed=False):
- return self.api(self.papi.bfd_udp_auth_activate,
- {
- 'sw_if_index': sw_if_index,
- 'local_addr': local_addr,
- 'peer_addr': peer_addr,
- 'is_ipv6': is_ipv6,
- 'is_delayed': 1 if is_delayed else 0,
- 'bfd_key_id': bfd_key_id,
- 'conf_key_id': conf_key_id,
- })
-
- def bfd_udp_session_set_flags(self, admin_up_down, sw_if_index, local_addr,
- peer_addr, is_ipv6=0):
- return self.api(self.papi.bfd_udp_session_set_flags, {
- 'admin_up_down': admin_up_down,
- 'sw_if_index': sw_if_index,
- 'local_addr': local_addr,
- 'peer_addr': peer_addr,
- 'is_ipv6': is_ipv6,
- })
-
- def want_bfd_events(self, enable_disable=1):
- return self.api(self.papi.want_bfd_events, {
- 'enable_disable': enable_disable,
- 'pid': os.getpid(),
- })
-
- def bfd_auth_set_key(self, conf_key_id, auth_type, key):
- return self.api(self.papi.bfd_auth_set_key, {
- 'conf_key_id': conf_key_id,
- 'auth_type': auth_type,
- 'key': key,
- 'key_len': len(key),
- })
-
def classify_add_del_table(
self,
is_add,