aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-05-10 20:41:08 -0400
committerDave Wallace <dwallacelf@gmail.com>2019-05-17 20:42:10 +0000
commit9673e3e628b01c4ea4ac74a85e42b3686b029ea6 (patch)
treece1f9f40837924fcb144bfbfb0d68f10f1bf182b /test/vpp_papi_provider.py
parent3bfeff7a9812c025637ee232cca03a6f083bdbc6 (diff)
Tests: Raise exception if API cli_inband command fails.
* Configure tests to raise exception if cli_inband fails. * Fix failing tests. * Add filename detail to pcap.stat clib_error_return for debugging. Note: this change identifies spurious issues with packet-generator such as: CliFailedCommandError: packet-generator capture: pcap file '/tmp/vpp-unittest-Test6RD-v09RPA/pg0_out.pcap' does not exist. These issues resolve themselves on remaining test passes. Change-Id: Iecbd09daee954d892306d11baff3864a43c5b603 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r--test/vpp_papi_provider.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index 291a904dd6f..ad6d6bcf574 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -170,6 +170,14 @@ defaultmapping = {
}
+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 """
pass
@@ -366,6 +374,10 @@ class VppPapiProvider(object):
cli += '\n'
r = self.papi.cli_inband(cmd=cli)
self.hook.after_cli(cli)
+ if r.retval == -156:
+ raise CliSyntaxError(r.reply)
+ if r.retval != 0:
+ raise CliFailedCommandError(r.reply)
if hasattr(r, 'reply'):
return r.reply