tests: handle removed interface
Catch exception if sw_if_index is invalid when querying interface
binding config. If the interface is not there, it's surely not bound to
any table ...
Type: improvement
Change-Id: I1f3e04a631653feb5c2350662b6a041adccefa1f
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
diff --git a/test/vpp_papi_exceptions.py b/test/vpp_papi_exceptions.py
new file mode 100644
index 0000000..2f7da96
--- /dev/null
+++ b/test/vpp_papi_exceptions.py
@@ -0,0 +1,15 @@
+class CliFailedCommandError(Exception):
+ """ cli command failed."""
+
+
+class CliSyntaxError(Exception):
+ """ cli command had a syntax error."""
+
+
+class UnexpectedApiReturnValueError(Exception):
+ """ exception raised when the API return value is unexpected """
+
+ def __init__(self, retval, message):
+ self.retval = retval
+ self.message = message
+ super().__init__(message)