aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-10-09 17:28:04 -0400
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-11-28 09:19:08 +0000
commit64d744350ea3890d202a9bd8ac67e5d20fd2d4a5 (patch)
treea81654597c7d981dcd11e9684285d962b3e79988 /test
parentc2b4b3b610e8de94c4b64bab0324e5da3019b920 (diff)
tests: add cli_return_response to vpp_papi_provider
To improve gcov/lcov code coverage stats, it's necessary to send incorrect debug CLI commands; to force vpp into debug CLI error paths. cli_return_response() sends commands and returns the response object, so test vectors can handle failures. Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I4fab591c9d2e30c996f016e18e4fd69b9c5bed06 (cherry picked from commit 5932ce17e128c096fcc56eb04b27e780da3cf255)
Diffstat (limited to 'test')
-rw-r--r--test/vpp_papi_provider.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index a3da1ae3db4..7c634d912d0 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -338,17 +338,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: