qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Willian Rampazzo <wrampazz@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>,
	dovgaluk@ispras.ru, pavel.dovgaluk@ispras.ru,
	Cleber Rosa Junior <crosa@redhat.com>,
	pbonzini@redhat.com, Philippe Mathieu Daude <philmd@redhat.com>
Subject: Re: [PATCH v2 01/11] tests/acceptance: allow console interaction with specific VMs
Date: Wed, 27 May 2020 11:42:09 -0300	[thread overview]
Message-ID: <CAKJDGDZWVjvA3L6Vxsgkv=4bmFtH4Pupm9CCUu7=+DR664amfw@mail.gmail.com> (raw)
In-Reply-To: <874ks1794a.fsf@linaro.org>

On Wed, May 27, 2020 at 11:20 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
>
> Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com> writes:
>
> > Console interaction in avocado scripts was possible only with single
> > default VM.
> > This patch modifies the function parameters to allow passing a specific
> > VM as a parameter to interact with it.
> >
> > Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> > Reviewed-by: Willian Rampazzo <willianr@redhat.com>
> > ---
> >  0 files changed
> >
> > diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> > index 59e7b4f763..77d1c1d9ff 100644
> > --- a/tests/acceptance/avocado_qemu/__init__.py
> > +++ b/tests/acceptance/avocado_qemu/__init__.py
> > @@ -69,13 +69,15 @@ def pick_default_qemu_bin(arch=None):
> >
> >
> >  def _console_interaction(test, success_message, failure_message,
> > -                         send_string, keep_sending=False):
> > +                         send_string, keep_sending=False, vm=None):
>
> is it not possible to make vm=test.vm to avoid having...

This will cause a NameError as `test` is also a parameter here.

>
> >      assert not keep_sending or send_string
> > -    console = test.vm.console_socket.makefile()
> > +    if vm is None:
> > +        vm = test.vm
>
> to do this here?
>
> > +    console = vm.console_socket.makefile()
> >      console_logger = logging.getLogger('console')
> >      while True:
> >          if send_string:
> > -            test.vm.console_socket.sendall(send_string.encode())
> > +            vm.console_socket.sendall(send_string.encode())
> >              if not keep_sending:
> >                  send_string = None # send only once
> >          msg = console.readline().strip()
> > @@ -115,7 +117,8 @@ def interrupt_interactive_console_until_pattern(test, success_message,
> >      _console_interaction(test, success_message, failure_message,
> >                           interrupt_string, True)
> >
> > -def wait_for_console_pattern(test, success_message, failure_message=None):
> > +def wait_for_console_pattern(test, success_message, failure_message=None,
> > +                             vm=None):
> >      """
> >      Waits for messages to appear on the console, while logging the content
> >
> > @@ -125,7 +128,7 @@ def wait_for_console_pattern(test, success_message, failure_message=None):
> >      :param success_message: if this message appears, test succeeds
> >      :param failure_message: if this message appears, test fails
> >      """
> > -    _console_interaction(test, success_message, failure_message, None)
> > +    _console_interaction(test, success_message, failure_message, None, vm=vm)
> >
> >  def exec_command_and_wait_for_pattern(test, command,
> >                                        success_message, failure_message=None):
>
> Otherwise:
>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>
> --
> Alex Bennée
>



  reply	other threads:[~2020-05-27 14:43 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 10:30 [PATCH v2 00/11] Record/replay acceptance tests Pavel Dovgalyuk
2020-05-27 10:30 ` [PATCH v2 01/11] tests/acceptance: allow console interaction with specific VMs Pavel Dovgalyuk
2020-05-27 14:20   ` Alex Bennée
2020-05-27 14:42     ` Willian Rampazzo [this message]
2020-05-27 10:30 ` [PATCH v2 02/11] tests/acceptance: refactor boot_linux_console test to allow code reuse Pavel Dovgalyuk
2020-05-27 14:31   ` Alex Bennée
2020-05-27 10:30 ` [PATCH v2 03/11] tests/acceptance: add base class record/replay kernel tests Pavel Dovgalyuk
2020-05-27 14:41   ` Philippe Mathieu-Daudé
2020-05-27 15:20   ` Alex Bennée
2020-05-28  7:19     ` Pavel Dovgalyuk
2020-05-28  8:28       ` Alex Bennée
2020-05-29  5:58         ` Pavel Dovgalyuk
2020-05-27 10:31 ` [PATCH v2 04/11] tests/acceptance: add kernel record/replay test for x86_64 Pavel Dovgalyuk
2020-05-27 14:53   ` Philippe Mathieu-Daudé
2020-05-28  7:12     ` Pavel Dovgalyuk
2020-05-28  8:38       ` Philippe Mathieu-Daudé
2020-05-28 11:07         ` Alex Bennée
2020-05-28 11:32           ` Philippe Mathieu-Daudé
2020-05-27 15:40   ` Alex Bennée
2020-05-27 16:20     ` Alex Bennée
2020-05-28  7:26       ` Pavel Dovgalyuk
2020-05-27 15:41   ` Alex Bennée
2020-05-28  6:12     ` Pavel Dovgalyuk
2020-05-28 13:26       ` Alex Bennée
2020-05-29  5:56         ` Pavel Dovgalyuk
2020-05-29  9:20           ` Alex Bennée
2020-05-27 10:31 ` [PATCH v2 05/11] tests/acceptance: add record/replay test for aarch64 Pavel Dovgalyuk
2020-05-27 14:44   ` Philippe Mathieu-Daudé
2020-05-27 10:31 ` [PATCH v2 06/11] tests/acceptance: add record/replay test for arm Pavel Dovgalyuk
2020-05-27 10:31 ` [PATCH v2 07/11] tests/acceptance: add record/replay test for ppc64 Pavel Dovgalyuk
2020-05-27 10:31 ` [PATCH v2 08/11] tests/acceptance: add record/replay test for m68k Pavel Dovgalyuk
2020-05-27 10:31 ` [PATCH v2 09/11] tests/acceptance: record/replay tests with advcal images Pavel Dovgalyuk
2020-05-27 10:31 ` [PATCH v2 10/11] tests/acceptance: refactor boot_linux to allow code reuse Pavel Dovgalyuk
2020-05-27 10:31 ` [PATCH v2 11/11] tests/acceptance: Linux boot test for record/replay Pavel Dovgalyuk
2020-05-27 16:44   ` Alex Bennée
2020-05-28  6:17     ` Pavel Dovgalyuk
2020-05-27 13:41 ` [PATCH v2 00/11] Record/replay acceptance tests no-reply
2020-05-27 14:53   ` Philippe Mathieu-Daudé

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='CAKJDGDZWVjvA3L6Vxsgkv=4bmFtH4Pupm9CCUu7=+DR664amfw@mail.gmail.com' \
    --to=wrampazz@redhat.com \
    --cc=Pavel.Dovgaluk@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=crosa@redhat.com \
    --cc=dovgaluk@ispras.ru \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=philmd@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).