* [PATCH] tests/functional/x86_64: Use the right Python interpreter & fix format string
@ 2026-01-14 10:11 Thomas Huth
2026-01-14 10:20 ` Daniel P. Berrangé
2026-01-14 12:00 ` Fabiano Rosas
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2026-01-14 10:11 UTC (permalink / raw)
To: qemu-devel, Peter Xu, Fabiano Rosas, Paolo Bonzini; +Cc: Zhao Liu
From: Thomas Huth <thuth@redhat.com>
The bad_vmstate test currently fails if the host does not have a "python3"
binary in $PATH because the vmstate-static-checker.py script is executed
directly, so that it gets run via its shebang line. Use the right Python
interpreter from sys.executable to fix this problem.
Additionally, there was another bug with the formatting of the error
message in case of failures: The "+" operator can only concatenate strings,
but not strings with integers. Use a proper format string here instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/functional/x86_64/test_bad_vmstate.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/functional/x86_64/test_bad_vmstate.py b/tests/functional/x86_64/test_bad_vmstate.py
index 40098a8490b..71a1c0cf638 100755
--- a/tests/functional/x86_64/test_bad_vmstate.py
+++ b/tests/functional/x86_64/test_bad_vmstate.py
@@ -5,6 +5,7 @@
'''Test whether the vmstate-static-checker script detects problems correctly'''
import subprocess
+import sys
from qemu_test import QemuBaseTest
@@ -41,12 +42,13 @@ def test_checker(self):
'vmstate-static-checker.py')
self.log.info('Comparing %s with %s', src_json, dst_json)
- cp = subprocess.run([checkerscript, '-s', src_json, '-d', dst_json],
+ cp = subprocess.run([sys.executable, checkerscript,
+ '-s', src_json, '-d', dst_json],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True, check=False)
if cp.returncode != 13:
- self.fail('Unexpected return code of vmstate-static-checker: ' +
+ self.fail('Unexpected return code of vmstate-static-checker: %d' %
cp.returncode)
if cp.stdout != EXPECTED_OUTPUT:
self.log.info('vmstate-static-checker output:\n%s', cp.stdout)
--
2.52.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] tests/functional/x86_64: Use the right Python interpreter & fix format string
2026-01-14 10:11 [PATCH] tests/functional/x86_64: Use the right Python interpreter & fix format string Thomas Huth
@ 2026-01-14 10:20 ` Daniel P. Berrangé
2026-01-14 12:00 ` Fabiano Rosas
1 sibling, 0 replies; 3+ messages in thread
From: Daniel P. Berrangé @ 2026-01-14 10:20 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, Peter Xu, Fabiano Rosas, Paolo Bonzini, Zhao Liu
On Wed, Jan 14, 2026 at 11:11:01AM +0100, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
>
> The bad_vmstate test currently fails if the host does not have a "python3"
> binary in $PATH because the vmstate-static-checker.py script is executed
> directly, so that it gets run via its shebang line. Use the right Python
> interpreter from sys.executable to fix this problem.
>
> Additionally, there was another bug with the formatting of the error
> message in case of failures: The "+" operator can only concatenate strings,
> but not strings with integers. Use a proper format string here instead.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> tests/functional/x86_64/test_bad_vmstate.py | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tests/functional/x86_64: Use the right Python interpreter & fix format string
2026-01-14 10:11 [PATCH] tests/functional/x86_64: Use the right Python interpreter & fix format string Thomas Huth
2026-01-14 10:20 ` Daniel P. Berrangé
@ 2026-01-14 12:00 ` Fabiano Rosas
1 sibling, 0 replies; 3+ messages in thread
From: Fabiano Rosas @ 2026-01-14 12:00 UTC (permalink / raw)
To: Thomas Huth, qemu-devel, Peter Xu, Paolo Bonzini; +Cc: Zhao Liu
Thomas Huth <thuth@redhat.com> writes:
> From: Thomas Huth <thuth@redhat.com>
>
> The bad_vmstate test currently fails if the host does not have a "python3"
> binary in $PATH because the vmstate-static-checker.py script is executed
> directly, so that it gets run via its shebang line. Use the right Python
> interpreter from sys.executable to fix this problem.
>
> Additionally, there was another bug with the formatting of the error
> message in case of failures: The "+" operator can only concatenate strings,
> but not strings with integers. Use a proper format string here instead.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> tests/functional/x86_64/test_bad_vmstate.py | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tests/functional/x86_64/test_bad_vmstate.py b/tests/functional/x86_64/test_bad_vmstate.py
> index 40098a8490b..71a1c0cf638 100755
> --- a/tests/functional/x86_64/test_bad_vmstate.py
> +++ b/tests/functional/x86_64/test_bad_vmstate.py
> @@ -5,6 +5,7 @@
> '''Test whether the vmstate-static-checker script detects problems correctly'''
>
> import subprocess
> +import sys
>
> from qemu_test import QemuBaseTest
>
> @@ -41,12 +42,13 @@ def test_checker(self):
> 'vmstate-static-checker.py')
>
> self.log.info('Comparing %s with %s', src_json, dst_json)
> - cp = subprocess.run([checkerscript, '-s', src_json, '-d', dst_json],
> + cp = subprocess.run([sys.executable, checkerscript,
> + '-s', src_json, '-d', dst_json],
> stdout=subprocess.PIPE,
> stderr=subprocess.STDOUT,
> text=True, check=False)
> if cp.returncode != 13:
> - self.fail('Unexpected return code of vmstate-static-checker: ' +
> + self.fail('Unexpected return code of vmstate-static-checker: %d' %
> cp.returncode)
> if cp.stdout != EXPECTED_OUTPUT:
> self.log.info('vmstate-static-checker output:\n%s', cp.stdout)
Acked-by: Fabiano Rosas <farosas@suse.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-14 12:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-14 10:11 [PATCH] tests/functional/x86_64: Use the right Python interpreter & fix format string Thomas Huth
2026-01-14 10:20 ` Daniel P. Berrangé
2026-01-14 12:00 ` Fabiano Rosas
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.