From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
"Thomas Huth" <thuth@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>,
"Phil Mathieu-Daudé" <philmd@linaro.org>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"John Snow" <jsnow@redhat.com>
Subject: Re: what is the right way for an avocado test to do "wait for text that doesn't end in newline" ?
Date: Tue, 01 Oct 2024 17:21:44 +0100 [thread overview]
Message-ID: <875xqboktj.fsf@draig.linaro.org> (raw)
In-Reply-To: <CAFEAcA8N8NoaPMKQN=_Ph1mmgE1DEn=7kDOuOVMUX4zBEaBmug@mail.gmail.com> (Peter Maydell's message of "Tue, 1 Oct 2024 13:43:47 +0100")
Peter Maydell <peter.maydell@linaro.org> writes:
> One common thing to want to do in an avocado test is log into
> the guest. The obvious way to do that would seem to be:
>
> self.wait_for_console_pattern('login:')
> exec_command(self, 'root')
> self.wait_for_console_pattern('Password:')
> exec_command(self, "passw0rd")
>
> This doesn't work; Thomas tells me that's because the
> wait_for_console_pattern function requires that the guest outputs
> a newline, but the 'login:' and 'Password:' prompt lines don't
> have a newline after them.
>
> What is the right way to do this common thing?
Well the easiest way (which I do on some of my test images) is to enable
autologin so you get a shell prompt at the start.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2024-10-01 16:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-01 12:43 what is the right way for an avocado test to do "wait for text that doesn't end in newline" ? Peter Maydell
2024-10-01 16:21 ` Alex Bennée [this message]
2024-10-01 16:29 ` Daniel P. Berrangé
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=875xqboktj.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=crosa@redhat.com \
--cc=jsnow@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=wainersm@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.