From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 2/2] tests: test-hmp: print command execution result
Date: Thu, 14 Dec 2017 12:48:17 +0000 [thread overview]
Message-ID: <20171214124817.2567-3-dgilbert@redhat.com> (raw)
In-Reply-To: <20171214124817.2567-1-dgilbert@redhat.com>
From: Vadim Galitsyn <vadim.galitsyn@profitbricks.com>
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>
---
tests/test-hmp.c | 7 +++++--
1 file 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);
}
--
2.14.3
next prev parent reply other threads:[~2017-12-14 12:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 12:48 [Qemu-devel] [PULL 0/2] hmp queue Dr. David Alan Gilbert (git)
2017-12-14 12:48 ` [Qemu-devel] [PULL 1/2] hmp-commands: Remove the deprecated usb_add and usb_del Dr. David Alan Gilbert (git)
2017-12-14 12:48 ` Dr. David Alan Gilbert (git) [this message]
2017-12-14 16:39 ` [Qemu-devel] [PULL 0/2] hmp queue Peter Maydell
2017-12-14 16:56 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171214124817.2567-3-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).