aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r--test/vpp_papi_provider.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index 67b3e141447..bebbe76dfd6 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -29,6 +29,11 @@ class L2_VTR_OP:
L2_POP_1 = 3
+class UnexpectedApiReturnValueError(Exception):
+ """ exception raised when the API return value is unexpected """
+ pass
+
+
class VppPapiProvider(object):
"""VPP-api provider using vpp-papi
@@ -144,13 +149,13 @@ class VppPapiProvider(object):
"return value instead of %d in %s" % \
(reply.retval, repr(reply))
self.test_class.logger.info(msg)
- raise Exception(msg)
+ raise UnexpectedApiReturnValueError(msg)
elif self._expect_api_retval == self._zero:
if hasattr(reply, 'retval') and reply.retval != expected_retval:
msg = "API call failed, expected zero return value instead "\
"of %d in %s" % (expected_retval, repr(reply))
self.test_class.logger.info(msg)
- raise Exception(msg)
+ raise UnexpectedApiReturnValueError(msg)
else:
raise Exception("Internal error, unexpected value for "
"self._expect_api_retval %s" %
@@ -1188,6 +1193,9 @@ class VppPapiProvider(object):
return self.api(self.papi.bfd_udp_set_echo_source,
{'sw_if_index': sw_if_index})
+ def bfd_udp_del_echo_source(self):
+ return self.api(self.papi.bfd_udp_del_echo_source, {})
+
def classify_add_del_table(
self,
is_add,