qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests/acceptance: Print expected message on wait_for_console_pattern
@ 2021-03-09 15:35 Wainer dos Santos Moschetta
  2021-03-09 22:49 ` Joel Stanley
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wainer dos Santos Moschetta @ 2021-03-09 15:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: willianr, philmd, crosa

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.

 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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tests/acceptance: Print expected message on wait_for_console_pattern
  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
  2021-03-16 17:00 ` Willian Rampazzo
  2021-03-17  1:03 ` Cleber Rosa
  2 siblings, 0 replies; 4+ messages in thread
From: Joel Stanley @ 2021-03-09 22:49 UTC (permalink / raw)
  To: Wainer dos Santos Moschetta
  Cc: willianr, Philippe Mathieu-Daudé, QEMU Developers, Cleber Rosa

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
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tests/acceptance: Print expected message on wait_for_console_pattern
  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
@ 2021-03-16 17:00 ` Willian Rampazzo
  2021-03-17  1:03 ` Cleber Rosa
  2 siblings, 0 replies; 4+ messages in thread
From: Willian Rampazzo @ 2021-03-16 17:00 UTC (permalink / raw)
  To: Wainer dos Santos Moschetta
  Cc: Willian Rampazzo, Philippe Mathieu Daude, qemu-devel, Cleber Rosa Junior

On Tue, Mar 9, 2021 at 12:36 PM 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.
>
>  tests/acceptance/avocado_qemu/__init__.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>

> 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
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tests/acceptance: Print expected message on wait_for_console_pattern
  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
  2021-03-16 17:00 ` Willian Rampazzo
@ 2021-03-17  1:03 ` Cleber Rosa
  2 siblings, 0 replies; 4+ messages in thread
From: Cleber Rosa @ 2021-03-17  1:03 UTC (permalink / raw)
  To: Wainer dos Santos Moschetta; +Cc: willianr, philmd, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

On Tue, Mar 09, 2021 at 12:35:07PM -0300, Wainer dos Santos Moschetta 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.
> 
>  tests/acceptance/avocado_qemu/__init__.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-17  1:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-03-16 17:00 ` Willian Rampazzo
2021-03-17  1:03 ` Cleber Rosa

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).