aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_exceptions.py
diff options
context:
space:
mode:
authorKlement Sekera <klement.sekera@gmail.com>2022-04-14 16:29:07 +0200
committerDave Wallace <dwallacelf@gmail.com>2022-05-03 15:07:41 +0000
commit77c821ccc6b72d18a247e95816ac1013b4dc664d (patch)
tree06028c888750ca5181e5468443f2c5b3d8e05f14 /test/vpp_papi_exceptions.py
parent2ca88ff97884ec9ed20a853b13cee6d86f9c9d0f (diff)
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>
Diffstat (limited to 'test/vpp_papi_exceptions.py')
-rw-r--r--test/vpp_papi_exceptions.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/vpp_papi_exceptions.py b/test/vpp_papi_exceptions.py
new file mode 100644
index 00000000000..2f7da963f70
--- /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)