diff options
author | Vadim Galitsyn <vadim.galitsyn@profitbricks.com> | 2017-10-23 17:13:10 +0200 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2017-12-14 11:09:42 +0000 |
commit | 0eaf3b824745cacebfc321aef6787528d33d58fe (patch) | |
tree | d2447f01a1ef02fd5b0001a95a58bcbd1ad842b2 /tests/test-hmp.c | |
parent | 81950da6819bbe77f38835724cc4643f19677554 (diff) |
tests: test-hmp: print command execution result
Provide HMP monitor command execution result as it would be seen
by user who established an HMP monitor session.
Currently many commands may silently fail without any sign of that.
This patch let this info to be printed once test is running in
verbose mode.
For the future it might be useful to fail the test if command has
failed, however it would require a bit of rework inside test
engine itself.
A simple example of silent failure without reporting it would to
add some non-existent HMP command into 'hmp_cmds' list. In this case
test will report it successfully passed without error.
Signed-off-by: Vadim Galitsyn <vadim.galitsyn@profitbricks.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org
Message-Id: <20171023151310.6462-5-vadim.galitsyn@profitbricks.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tests/test-hmp.c')
-rw-r--r-- | tests/test-hmp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test-hmp.c b/tests/test-hmp.c index 5677fbf775..5b7e447b6a 100644 --- a/tests/test-hmp.c +++ b/tests/test-hmp.c @@ -78,10 +78,13 @@ static void test_commands(void) int i; for (i = 0; hmp_cmds[i] != NULL; i++) { + response = hmp("%s", hmp_cmds[i]); if (verbose) { - fprintf(stderr, "\t%s\n", hmp_cmds[i]); + fprintf(stderr, + "\texecute HMP command: %s\n" + "\tresult : %s\n", + hmp_cmds[i], response); } - response = hmp("%s", hmp_cmds[i]); g_free(response); } |