summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/mactime/test/test_mactime.py7
-rw-r--r--test/vpp_papi_provider.py15
2 files changed, 19 insertions, 3 deletions
diff --git a/src/plugins/mactime/test/test_mactime.py b/src/plugins/mactime/test/test_mactime.py
index ab3d5371815..892ae02cf22 100644
--- a/src/plugins/mactime/test/test_mactime.py
+++ b/src/plugins/mactime/test/test_mactime.py
@@ -149,7 +149,12 @@ class TestMactime(VppTestCase):
"show error"]
for cmd in cmds:
- self.logger.info(self.vapi.cli(cmd))
+ r = self.vapi.cli_return_response(cmd)
+ if r.retval != 0:
+ if hasattr(r, 'reply'):
+ self.logger.info(cmd + " FAIL reply " + r.reply)
+ else:
+ self.logger.info(cmd + " FAIL retval " + str(r.retval))
if __name__ == '__main__':
unittest.main(testRunner=VppTestRunner)
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index 8cb7c971758..12dcf1081ab 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -334,17 +334,28 @@ class VppPapiProvider(object):
self.hook.after_api(api_fn.__name__, api_args)
return reply
- def cli(self, cli):
+ def cli_return_response(self, cli):
""" Execute a CLI, calling the before/after hooks appropriately.
+ Return the reply without examining it
:param cli: CLI to execute
- :returns: CLI output
+ :returns: response object
"""
self.hook.before_cli(cli)
cli += '\n'
r = self.papi.cli_inband(cmd=cli)
self.hook.after_cli(cli)
+ return r
+
+ def cli(self, cli):
+ """ Execute a CLI, calling the before/after hooks appropriately.
+
+ :param cli: CLI to execute
+ :returns: CLI output
+
+ """
+ r = self.cli_return_response(cli)
if r.retval == -156:
raise CliSyntaxError(r.reply)
if r.retval != 0: