summaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-02-23 09:26:30 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-03-02 11:56:47 +0000
commit738844871220f853629504f61c248f0c9402dc77 (patch)
tree63892d6c317c1d1067f9ecd2a913d2ac7c671fcb /test/vpp_papi_provider.py
parentc3a814be9dc769be942ff8029c7b6eccd4b3af05 (diff)
BFD: command line interface
Implement command line interface to the BFD binary APIs. Add corresponding unit tests. Change-Id: Ia0542d0bc4c8d78e6f7b777a08fd94ebfe4d524f Signed-off-by: Klement Sekera <ksekera@cisco.com>
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,