Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ipsec: remove dedicated IPSec tunnels
[vpp.git]
/
test
/
vpp_papi_provider.py
diff --git
a/test/vpp_papi_provider.py
b/test/vpp_papi_provider.py
index
8cb7c97
..
cc7771e
100644
(file)
--- a/
test/vpp_papi_provider.py
+++ b/
test/vpp_papi_provider.py
@@
-334,17
+334,28
@@
class VppPapiProvider(object):
self.hook.after_api(api_fn.__name__, api_args)
return reply
self.hook.after_api(api_fn.__name__, api_args)
return reply
- def cli(self, cli):
+ def cli
_return_response
(self, cli):
""" Execute a CLI, calling the before/after hooks appropriately.
""" Execute a CLI, calling the before/after hooks appropriately.
+ Return the reply without examining it
:param cli: CLI to execute
:param cli: CLI to execute
- :returns:
CLI outpu
t
+ :returns:
response objec
t
"""
self.hook.before_cli(cli)
cli += '\n'
r = self.papi.cli_inband(cmd=cli)
self.hook.after_cli(cli)
"""
self.hook.before_cli(cli)
cli += '\n'
r = self.papi.cli_inband(cmd=cli)
self.hook.after_cli(cli)
+ return r
+
+ def cli(self, cli):
+ """ Execute a CLI, calling the before/after hooks appropriately.
+
+ :param cli: CLI to execute
+ :returns: CLI output
+
+ """
+ r = self.cli_return_response(cli)
if r.retval == -156:
raise CliSyntaxError(r.reply)
if r.retval != 0:
if r.retval == -156:
raise CliSyntaxError(r.reply)
if r.retval != 0:
@@
-358,8
+369,7
@@
class VppPapiProvider(object):
:param cli: CLI to execute
:returns: CLI output
"""
:param cli: CLI to execute
:returns: CLI output
"""
- return cli + "\n" + self.cli(cli).encode('ascii',
- errors='backslashreplace')
+ return cli + "\n" + self.cli(cli)
def want_ip4_arp_events(self, enable_disable=1, ip="0.0.0.0"):
return self.api(self.papi.want_ip4_arp_events,
def want_ip4_arp_events(self, enable_disable=1, ip="0.0.0.0"):
return self.api(self.papi.want_ip4_arp_events,
@@
-734,9
+744,8
@@
class VppPapiProvider(object):
:param current_data_flag: (Default value = 0)
:param current_data_offset: (Default value = 0)
"""
:param current_data_flag: (Default value = 0)
:param current_data_offset: (Default value = 0)
"""
-
- mask_len = ((len(mask) - 1) / 16 + 1) * 16
- mask = mask + '\0' * (mask_len - len(mask))
+ mask_len = ((len(mask) - 1) // 16 + 1) * 16
+ mask = mask + b'\0' * (mask_len - len(mask))
return self.api(
self.papi.classify_add_del_table,
{'is_add': is_add,
return self.api(
self.papi.classify_add_del_table,
{'is_add': is_add,
@@
-773,8
+782,8
@@
class VppPapiProvider(object):
:param metadata: (Default value = 0)
"""
:param metadata: (Default value = 0)
"""
- match_len = ((len(match) - 1) / 16 + 1) * 16
- match = match + '\0' * (match_len - len(match))
+ match_len = ((len(match) - 1) /
/
16 + 1) * 16
+ match = match +
b
'\0' * (match_len - len(match))
return self.api(
self.papi.classify_add_del_session,
{'is_add': is_add,
return self.api(
self.papi.classify_add_del_session,
{'is_add': is_add,
@@
-1708,7
+1717,7
@@
class VppPapiProvider(object):
remote_crypto_key, integ_alg, local_integ_key,
remote_integ_key, is_add=1, esn=0, salt=0,
anti_replay=1, renumber=0,
remote_crypto_key, integ_alg, local_integ_key,
remote_integ_key, is_add=1, esn=0, salt=0,
anti_replay=1, renumber=0,
- udp_encap=0, show_instance=0):
+ udp_encap=0, show_instance=0
xffffffff
):
return self.api(
self.papi.ipsec_tunnel_if_add_del,
{
return self.api(
self.papi.ipsec_tunnel_if_add_del,
{
@@
-2039,3
+2048,10
@@
class VppPapiProvider(object):
'sw_if_index': sw_if_index,
'is_enable': is_enable,
})
'sw_if_index': sw_if_index,
'is_enable': is_enable,
})
+
+ def feature_gso_enable_disable(self, sw_if_index, enable_disable=1):
+ return self.api(self.papi.feature_gso_enable_disable,
+ {
+ 'sw_if_index': sw_if_index,
+ 'enable_disable': enable_disable,
+ })