qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Otubo <otubo@redhat.com>
To: Vadim Galitsyn <vadim.galitsyn@profitbricks.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/4] tests: test-hmp: print command execution result
Date: Wed, 25 Oct 2017 14:03:23 +0200	[thread overview]
Message-ID: <20171025120323.GB10290@vader> (raw)
In-Reply-To: <20171023151310.6462-5-vadim.galitsyn@profitbricks.com>

On Mon, Oct 23, 2017 at 05:13:10PM +0200, Vadim Galitsyn wrote:
> 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
> ---
>  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 8e21eee61c..1fd8e44eff 100644
> --- a/tests/test-hmp.c
> +++ b/tests/test-hmp.c
> @@ -79,10 +79,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.13.1.394.g41dd433
> 
> 

Reviewed-by: Eduardo Otubo <otubo@redhat.com>

-- 
Eduardo Otubo

  reply	other threads:[~2017-10-25 12:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 15:13 [Qemu-devel] QMP, HMP: introduce 'writeconfig' command Vadim Galitsyn
2017-10-23 15:13 ` [Qemu-devel] [PATCH 1/4] qmp: " Vadim Galitsyn
2017-10-25 12:02   ` Eduardo Otubo
2017-10-26 11:37   ` Marc-André Lureau
2017-10-23 15:13 ` [Qemu-devel] [PATCH 2/4] hmp: " Vadim Galitsyn
2017-10-24 10:41   ` Dr. David Alan Gilbert
2017-10-25 12:04   ` Eduardo Otubo
2017-10-23 15:13 ` [Qemu-devel] [PATCH 3/4] tests: test-hmp: extend with " Vadim Galitsyn
2017-10-25 12:04   ` Eduardo Otubo
2017-10-23 15:13 ` [Qemu-devel] [PATCH 4/4] tests: test-hmp: print command execution result Vadim Galitsyn
2017-10-25 12:03   ` Eduardo Otubo [this message]
2017-12-14 11:00   ` Dr. David Alan Gilbert
2017-10-24 10:45 ` [Qemu-devel] QMP, HMP: introduce 'writeconfig' command Dr. David Alan Gilbert
2017-11-13 12:36   ` Markus Armbruster
2017-12-14 17:03 ` Eric Blake

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=20171025120323.GB10290@vader \
    --to=otubo@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vadim.galitsyn@profitbricks.com \
    /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).