qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Joel Stanley <joel@jms.id.au>
To: Wainer dos Santos Moschetta <wainersm@redhat.com>
Cc: willianr@redhat.com, "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Cleber Rosa" <crosa@redhat.com>
Subject: Re: [PATCH] tests/acceptance: Print expected message on wait_for_console_pattern
Date: Tue, 9 Mar 2021 22:49:49 +0000	[thread overview]
Message-ID: <CACPK8XftT1enddLKnj8+9p+Wd3O9C6w-FqgnNR2yBFx62GuBRg@mail.gmail.com> (raw)
In-Reply-To: <20210309153507.1905682-1-wainersm@redhat.com>

On Tue, 9 Mar 2021 at 16:00, Wainer dos Santos Moschetta
<wainersm@redhat.com> wrote:
>
> For the sake of improve debuggability of tests which use the
> wait_for_console_pattern(), this changed the _console_interaction() so that
> the expected message is printed if the test fail.
>
> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
> ---
> While I was testing  "[PATCH v2 2/2] tests/acceptance: Test ast2600 machine"
> I could not clearly determine which of the called wait_for_console_pattern()
> was failing. So this patch improves debuggability in such as situations.

Nice!

Reviewed-by: Joel Stanley <joel@jms.id.au>

>
>  tests/acceptance/avocado_qemu/__init__.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index df167b142c..ed338caaba 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -97,7 +97,8 @@ def _console_interaction(test, success_message, failure_message,
>              break
>          if failure_message and failure_message in msg:
>              console.close()
> -            fail = 'Failure message found in console: %s' % failure_message
> +            fail = 'Failure message found in console: "%s". Expected: "%s"' % \
> +                    (failure_message, success_message)
>              test.fail(fail)
>
>  def interrupt_interactive_console_until_pattern(test, success_message,
> --
> 2.29.2
>
>


  reply	other threads:[~2021-03-09 22:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 15:35 [PATCH] tests/acceptance: Print expected message on wait_for_console_pattern Wainer dos Santos Moschetta
2021-03-09 22:49 ` Joel Stanley [this message]
2021-03-16 17:00 ` Willian Rampazzo
2021-03-17  1:03 ` Cleber Rosa

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=CACPK8XftT1enddLKnj8+9p+Wd3O9C6w-FqgnNR2yBFx62GuBRg@mail.gmail.com \
    --to=joel@jms.id.au \
    --cc=crosa@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    --cc=willianr@redhat.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).