* [PATCH 0/4] testing: some minor QoL changes for functional tests
@ 2026-06-14 10:08 Alex Bennée
2026-06-14 10:08 ` [PATCH 1/4] python/qemu: split arg between base and harness lists Alex Bennée
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Alex Bennée @ 2026-06-14 10:08 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Philippe Mathieu-Daudé, Daniel P. Berrangé,
John Snow, Thomas Huth, Alex Bennée
I spend a lot of time trying to recreate functional test failures on
the command line where I can add gdbstub or run under rr. Invariably
this involves running the test with "env QEMU_TEST_KEEP_SCRATCH=1" and
then extracting the command line and tweaking it.
I finally got annoyed enough to look at the command line code and see
if I could do this a better way. Ideally I could just do something
like:
./pyvenv/bin/meson test --suite thorough func-arm-aspeed_anacapa --cmdline
but for now I'll stick with copy and pasting a line from the logs and
saving a few seconds removing all the QMP and console sockets.
I've also included the pylint change which is now reviewed and can be
picked up. If not I'll grab it next time I do a testing/next sweep.
Alex.
Alex Bennée (4):
python/qemu: split arg between base and harness lists
python/qemu: split console from harness args
python/qemu: dump a developer friendly version of cmdline to logs
tests/functional: tell pylint not to check c-modules
python/qemu/machine/machine.py | 29 ++++++++++++++++++++++++-----
tests/functional/pylintrc | 1 +
2 files changed, 25 insertions(+), 5 deletions(-)
--
2.47.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/4] python/qemu: split arg between base and harness lists
2026-06-14 10:08 [PATCH 0/4] testing: some minor QoL changes for functional tests Alex Bennée
@ 2026-06-14 10:08 ` Alex Bennée
2026-06-15 10:36 ` Philippe Mathieu-Daudé
2026-06-14 10:09 ` [PATCH 2/4] python/qemu: split console from harness args Alex Bennée
` (4 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Alex Bennée @ 2026-06-14 10:08 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Philippe Mathieu-Daudé, Daniel P. Berrangé,
John Snow, Thomas Huth, Alex Bennée
There are argument we add because we want the test harness to control
QEMU and arguments we default for handling the display and machine
type. Split the obvious ones between base_args and a new list called
harness_args.
We will leave the complexity of the serial ports for now.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
python/qemu/machine/machine.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index ebb58d5b68c..e8973a87394 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -292,8 +292,8 @@ def _load_io_log(self) -> None:
self._iolog = iolog.read()
@property
- def _base_args(self) -> List[str]:
- args = ['-display', 'none', '-vga', 'none']
+ def _harness_args(self) -> List[str]:
+ args: List[str] = []
if self._qmp_set:
if self._sock_pair:
@@ -307,8 +307,6 @@ def _base_args(self) -> List[str]:
args.extend(['-chardev', moncdev, '-mon',
'chardev=mon,mode=control'])
- if self._machine is not None:
- args.extend(['-machine', self._machine])
for _ in range(self._console_index):
args.extend(['-serial', 'null'])
if self._console_set:
@@ -323,6 +321,13 @@ def _base_args(self) -> List[str]:
args.extend(['-device', device])
return args
+ @property
+ def _base_args(self) -> List[str]:
+ args: List[str] = ['-display', 'none', '-vga', 'none']
+ if self._machine is not None:
+ args.extend(['-machine', self._machine])
+ return args
+
@property
def args(self) -> List[str]:
"""Returns the list of arguments given to the QEMU binary."""
@@ -366,6 +371,7 @@ def _pre_launch(self) -> None:
self._qemu_full_args = tuple(chain(
self._wrapper,
[self._binary],
+ self._harness_args,
self._base_args,
self._args
))
--
2.47.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/4] python/qemu: split console from harness args
2026-06-14 10:08 [PATCH 0/4] testing: some minor QoL changes for functional tests Alex Bennée
2026-06-14 10:08 ` [PATCH 1/4] python/qemu: split arg between base and harness lists Alex Bennée
@ 2026-06-14 10:09 ` Alex Bennée
2026-06-15 10:37 ` Philippe Mathieu-Daudé
2026-06-14 10:09 ` [PATCH 3/4] python/qemu: dump a developer friendly version of cmdline to logs Alex Bennée
` (3 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Alex Bennée @ 2026-06-14 10:09 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Philippe Mathieu-Daudé, Daniel P. Berrangé,
John Snow, Thomas Huth, Alex Bennée
Before we mess with the console output lets create a new helper just
for that.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
python/qemu/machine/machine.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index e8973a87394..18ee5ec0147 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -306,7 +306,11 @@ def _harness_args(self) -> List[str]:
moncdev = f"socket,id=mon,path={self._monitor_address}"
args.extend(['-chardev', moncdev, '-mon',
'chardev=mon,mode=control'])
+ return args
+ @property
+ def _console_args(self) -> List[str]:
+ args: List[str] = []
for _ in range(self._console_index):
args.extend(['-serial', 'null'])
if self._console_set:
@@ -372,6 +376,7 @@ def _pre_launch(self) -> None:
self._wrapper,
[self._binary],
self._harness_args,
+ self._console_args,
self._base_args,
self._args
))
--
2.47.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/4] python/qemu: dump a developer friendly version of cmdline to logs
2026-06-14 10:08 [PATCH 0/4] testing: some minor QoL changes for functional tests Alex Bennée
2026-06-14 10:08 ` [PATCH 1/4] python/qemu: split arg between base and harness lists Alex Bennée
2026-06-14 10:09 ` [PATCH 2/4] python/qemu: split console from harness args Alex Bennée
@ 2026-06-14 10:09 ` Alex Bennée
2026-06-15 10:37 ` Philippe Mathieu-Daudé
2026-06-14 10:09 ` [PATCH 4/4] tests/functional: tell pylint not to check c-modules Alex Bennée
` (2 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Alex Bennée @ 2026-06-14 10:09 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Philippe Mathieu-Daudé, Daniel P. Berrangé,
John Snow, Thomas Huth, Alex Bennée
Now we have the arguments nicely split up we can make _console_args a
function call and present a slightly different version to the logs to
save developers manually hacking the command line up.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
python/qemu/machine/machine.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 18ee5ec0147..26a7bf5948f 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -308,12 +308,15 @@ def _harness_args(self) -> List[str]:
'chardev=mon,mode=control'])
return args
- @property
- def _console_args(self) -> List[str]:
+ def _console_args(self, interactive=False) -> List[str]:
args: List[str] = []
+ # redirect pre_console_index serials to null
for _ in range(self._console_index):
args.extend(['-serial', 'null'])
- if self._console_set:
+
+ if interactive:
+ args.extend(['-serial', 'mon:stdio'])
+ elif self._console_set:
assert self._cons_sock_pair is not None
fd = self._cons_sock_pair[0].fileno()
chardev = f"socket,id=console,fd={fd}"
@@ -376,7 +379,7 @@ def _pre_launch(self) -> None:
self._wrapper,
[self._binary],
self._harness_args,
- self._console_args,
+ self._console_args(),
self._base_args,
self._args
))
@@ -485,6 +488,11 @@ def _launch(self) -> None:
"""
self._pre_launch()
LOG.debug('VM launch command: %r', ' '.join(self._qemu_full_args))
+ # Log a simplified, developer-runnable command:
+ # Exclude harness-managed infrastructure args (harness_args)
+ # and wrapper.
+ debug_cmd = [self._binary] + self._console_args(interactive=True) + self._base_args + self._args
+ LOG.debug('Developer-runnable command: %r', ' '.join(debug_cmd))
# Cleaning up of this subprocess is guaranteed by _do_shutdown.
# pylint: disable=consider-using-with
--
2.47.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/4] tests/functional: tell pylint not to check c-modules
2026-06-14 10:08 [PATCH 0/4] testing: some minor QoL changes for functional tests Alex Bennée
` (2 preceding siblings ...)
2026-06-14 10:09 ` [PATCH 3/4] python/qemu: dump a developer friendly version of cmdline to logs Alex Bennée
@ 2026-06-14 10:09 ` Alex Bennée
2026-06-16 11:09 ` [PATCH 0/4] testing: some minor QoL changes for functional tests Thomas Huth
2026-06-19 13:35 ` Alex Bennée
5 siblings, 0 replies; 10+ messages in thread
From: Alex Bennée @ 2026-06-14 10:09 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Philippe Mathieu-Daudé, Daniel P. Berrangé,
John Snow, Thomas Huth, Alex Bennée
To fix:
qemu-test.test_pylint "/home/alex/lsrc/qemu.git/tests/functional/arm/test_integratorcp.py:83: I1101: Module 'cv2' has no 'imread' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)"
Manually running python3 showed I could indeed import cv2 and call
those functions. Rather than allowing pylint to introspect lets just
tell it to skip c modules.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20260612140531.3530387-1-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/functional/pylintrc | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/functional/pylintrc b/tests/functional/pylintrc
index 049c3e76f12..949bea611fe 100644
--- a/tests/functional/pylintrc
+++ b/tests/functional/pylintrc
@@ -58,6 +58,7 @@ confidence=HIGH,
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=bad-inline-option,
+ c-extension-no-member,
consider-using-f-string,
file-ignored,
fixme,
--
2.47.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] python/qemu: split arg between base and harness lists
2026-06-14 10:08 ` [PATCH 1/4] python/qemu: split arg between base and harness lists Alex Bennée
@ 2026-06-15 10:36 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-06-15 10:36 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Cleber Rosa, Daniel P. Berrangé, John Snow, Thomas Huth
On 14/6/26 12:08, Alex Bennée wrote:
> There are argument we add because we want the test harness to control
> QEMU and arguments we default for handling the display and machine
> type. Split the obvious ones between base_args and a new list called
> harness_args.
>
> We will leave the complexity of the serial ports for now.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> python/qemu/machine/machine.py | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/4] python/qemu: split console from harness args
2026-06-14 10:09 ` [PATCH 2/4] python/qemu: split console from harness args Alex Bennée
@ 2026-06-15 10:37 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-06-15 10:37 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Cleber Rosa, Daniel P. Berrangé, John Snow, Thomas Huth
On 14/6/26 12:09, Alex Bennée wrote:
> Before we mess with the console output lets create a new helper just
> for that.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> python/qemu/machine/machine.py | 5 +++++
> 1 file changed, 5 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] python/qemu: dump a developer friendly version of cmdline to logs
2026-06-14 10:09 ` [PATCH 3/4] python/qemu: dump a developer friendly version of cmdline to logs Alex Bennée
@ 2026-06-15 10:37 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-06-15 10:37 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Cleber Rosa, Daniel P. Berrangé, John Snow, Thomas Huth
On 14/6/26 12:09, Alex Bennée wrote:
> Now we have the arguments nicely split up we can make _console_args a
> function call and present a slightly different version to the logs to
> save developers manually hacking the command line up.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> python/qemu/machine/machine.py | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/4] testing: some minor QoL changes for functional tests
2026-06-14 10:08 [PATCH 0/4] testing: some minor QoL changes for functional tests Alex Bennée
` (3 preceding siblings ...)
2026-06-14 10:09 ` [PATCH 4/4] tests/functional: tell pylint not to check c-modules Alex Bennée
@ 2026-06-16 11:09 ` Thomas Huth
2026-06-19 13:35 ` Alex Bennée
5 siblings, 0 replies; 10+ messages in thread
From: Thomas Huth @ 2026-06-16 11:09 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Philippe Mathieu-Daudé, Daniel P. Berrangé, John Snow,
Thomas Huth
On 14/06/2026 12.08, Alex Bennée wrote:
> I spend a lot of time trying to recreate functional test failures on
> the command line where I can add gdbstub or run under rr. Invariably
> this involves running the test with "env QEMU_TEST_KEEP_SCRATCH=1" and
> then extracting the command line and tweaking it.
>
> I finally got annoyed enough to look at the command line code and see
> if I could do this a better way. Ideally I could just do something
> like:
>
> ./pyvenv/bin/meson test --suite thorough func-arm-aspeed_anacapa --cmdline
>
> but for now I'll stick with copy and pasting a line from the logs and
> saving a few seconds removing all the QMP and console sockets.
>
> I've also included the pylint change which is now reviewed and can be
> picked up. If not I'll grab it next time I do a testing/next sweep.
Series
Reviewed-by: Thomas Huth <thuth@redhat.com>
Feel free to pick it up through your testing tree, I don't have much other
things currently pending that would justify a pull request from my side
right now.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/4] testing: some minor QoL changes for functional tests
2026-06-14 10:08 [PATCH 0/4] testing: some minor QoL changes for functional tests Alex Bennée
` (4 preceding siblings ...)
2026-06-16 11:09 ` [PATCH 0/4] testing: some minor QoL changes for functional tests Thomas Huth
@ 2026-06-19 13:35 ` Alex Bennée
5 siblings, 0 replies; 10+ messages in thread
From: Alex Bennée @ 2026-06-19 13:35 UTC (permalink / raw)
To: qemu-devel
Cc: Cleber Rosa, Philippe Mathieu-Daudé, Daniel P. Berrangé,
John Snow, Thomas Huth
Alex Bennée <alex.bennee@linaro.org> writes:
> I spend a lot of time trying to recreate functional test failures on
> the command line where I can add gdbstub or run under rr. Invariably
> this involves running the test with "env QEMU_TEST_KEEP_SCRATCH=1" and
> then extracting the command line and tweaking it.
>
> I finally got annoyed enough to look at the command line code and see
> if I could do this a better way. Ideally I could just do something
> like:
>
> ./pyvenv/bin/meson test --suite thorough func-arm-aspeed_anacapa --cmdline
>
> but for now I'll stick with copy and pasting a line from the logs and
> saving a few seconds removing all the QMP and console sockets.
>
> I've also included the pylint change which is now reviewed and can be
> picked up. If not I'll grab it next time I do a testing/next sweep.
>
Queued to testing/next, thanks.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-06-19 13:35 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-14 10:08 [PATCH 0/4] testing: some minor QoL changes for functional tests Alex Bennée
2026-06-14 10:08 ` [PATCH 1/4] python/qemu: split arg between base and harness lists Alex Bennée
2026-06-15 10:36 ` Philippe Mathieu-Daudé
2026-06-14 10:09 ` [PATCH 2/4] python/qemu: split console from harness args Alex Bennée
2026-06-15 10:37 ` Philippe Mathieu-Daudé
2026-06-14 10:09 ` [PATCH 3/4] python/qemu: dump a developer friendly version of cmdline to logs Alex Bennée
2026-06-15 10:37 ` Philippe Mathieu-Daudé
2026-06-14 10:09 ` [PATCH 4/4] tests/functional: tell pylint not to check c-modules Alex Bennée
2026-06-16 11:09 ` [PATCH 0/4] testing: some minor QoL changes for functional tests Thomas Huth
2026-06-19 13:35 ` Alex Bennée
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.