From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Brandon Maier via buildroot <buildroot@buildroot.org>
Cc: Julien Olivain <ju.o@free.fr>,
Ricardo Martincoski <ricardo.martincoski@datacom.com.br>,
Brandon Maier <brandon.maier@collins.com>
Subject: Re: [Buildroot] [PATCH v2] support/testing/infra/emulator.py: fix qemu prompt detection
Date: Mon, 22 Jul 2024 15:11:54 +0200 [thread overview]
Message-ID: <20240722151154.0bb0fbf5@windsurf> (raw)
In-Reply-To: <20240712-pytest-qemu-prompt-detection-v2-1-273b85382796@collins.com>
On Fri, 12 Jul 2024 19:31:04 +0000
Brandon Maier via buildroot <buildroot@buildroot.org> wrote:
> From: Brandon Maier via buildroot <buildroot@buildroot.org>
>
> The qemu.run() method can break when a command happens to output the
> string "# " to stdout. This is because qemu.run() detects when a command
> has completed by searching for the shell prompt, which by default is
> "# ". It then captures everything before the "# " as the commands
> output, causing the rest of output to be lost.
>
> Instead use the pexpect libraries REPLWrapper to handle running
> commands. It has hooks to set a custom prompt and avoid some other
> pitfalls of wrapping a shell.
>
> Signed-off-by: Brandon Maier <brandon.maier@collins.com>
> ---
> I tested this against a couple tests and test_bash.py which Yann noticed
> is special in Julian patch series. I am running a full test run but
> that will take awhile, so sending this in the meantime for review.
It seems like this change has broken one test:
https://gitlab.com/buildroot.org/buildroot/-/jobs/7391792869
Traceback (most recent call last):
File "/builds/buildroot.org/buildroot/support/testing/tests/init/test_none.py", line 26, in test_run
out, exit_code = self.emulator.run("sh -c 'echo $PPID'")
File "/builds/buildroot.org/buildroot/support/testing/infra/emulator.py", line 153, in run
output = self.repl.run_command(cmd, timeout=timeout)
AttributeError: 'NoneType' object has no attribute 'run_command'
Could you have a look perhaps?
Thanks a lot!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2024-07-22 13:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 19:31 [Buildroot] [PATCH v2] support/testing/infra/emulator.py: fix qemu prompt detection Brandon Maier via buildroot
2024-07-14 11:19 ` Arnout Vandecappelle via buildroot
2024-07-22 13:11 ` Thomas Petazzoni via buildroot [this message]
2024-07-22 17:26 ` Brandon Maier via buildroot
2024-07-22 19:50 ` Thomas Petazzoni via buildroot
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=20240722151154.0bb0fbf5@windsurf \
--to=buildroot@buildroot.org \
--cc=brandon.maier@collins.com \
--cc=ju.o@free.fr \
--cc=ricardo.martincoski@datacom.com.br \
--cc=thomas.petazzoni@bootlin.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