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: infra for selecting backends
[vpp.git]
/
test
/
vpp_papi_provider.py
diff --git
a/test/vpp_papi_provider.py
b/test/vpp_papi_provider.py
index
1adcc1b
..
1fcc4ce
100644
(file)
--- a/
test/vpp_papi_provider.py
+++ b/
test/vpp_papi_provider.py
@@
-78,14
+78,23
@@
class VppPapiProvider(object):
def __enter__(self):
return self
def __enter__(self):
return self
- def expect_negative_api_retval(self):
- """ Expect API failure """
+ def assert_negative_api_retval(self):
+ """ Expect API failure - used with with, e.g.:
+ with self.vapi.assert_negative_api_retval():
+ self.vapi.<api call expected to fail>
+ """
self._expect_stack.append(self._expect_api_retval)
self._expect_api_retval = self._negative
return self
self._expect_stack.append(self._expect_api_retval)
self._expect_api_retval = self._negative
return self
- def expect_zero_api_retval(self):
- """ Expect API success """
+ def assert_zero_api_retval(self):
+ """ Expect API success - used with with, e.g.:
+ with self.vapi.assert_negative_api_retval():
+ self.vapi.<api call expected to succeed>
+
+ note: this is useful only inside another with block
+ as success is the default expected value
+ """
self._expect_stack.append(self._expect_api_retval)
self._expect_api_retval = self._zero
return self
self._expect_stack.append(self._expect_api_retval)
self._expect_api_retval = self._zero
return self
@@
-3443,6
+3452,13
@@
class VppPapiProvider(object):
'show_instance': show_instance
})
'show_instance': show_instance
})
+ def ipsec_select_backend(self, protocol, index):
+ return self.api(self.papi.ipsec_select_backend,
+ {'protocol': protocol, 'index': index})
+
+ def ipsec_backend_dump(self):
+ return self.api(self.papi.ipsec_backend_dump, {})
+
def app_namespace_add(self,
namespace_id,
ip4_fib_id=0,
def app_namespace_add(self,
namespace_id,
ip4_fib_id=0,
@@
-3537,13
+3553,14
@@
class VppPapiProvider(object):
""" GBP endpoint group Dump """
return self.api(self.papi.gbp_endpoint_group_dump, {})
""" GBP endpoint group Dump """
return self.api(self.papi.gbp_endpoint_group_dump, {})
- def gbp_bridge_domain_add(self, bd_id,
+ def gbp_bridge_domain_add(self, bd_id,
flags,
bvi_sw_if_index,
uu_fwd_sw_if_index):
""" GBP bridge-domain Add """
return self.api(self.papi.gbp_bridge_domain_add,
{'bd':
{
bvi_sw_if_index,
uu_fwd_sw_if_index):
""" GBP bridge-domain Add """
return self.api(self.papi.gbp_bridge_domain_add,
{'bd':
{
+ 'flags': flags,
'bvi_sw_if_index': bvi_sw_if_index,
'uu_fwd_sw_if_index': uu_fwd_sw_if_index,
'bd_id': bd_id
'bvi_sw_if_index': bvi_sw_if_index,
'uu_fwd_sw_if_index': uu_fwd_sw_if_index,
'bd_id': bd_id