From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>,
Fabiano Rosas <farosas@suse.de>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: Zhao Liu <zhao1.liu@intel.com>
Subject: [PATCH] tests/functional/x86_64: Use the right Python interpreter & fix format string
Date: Wed, 14 Jan 2026 11:11:01 +0100 [thread overview]
Message-ID: <20260114101101.36225-1-thuth@redhat.com> (raw)
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
next reply other threads:[~2026-01-14 10:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 10:11 Thomas Huth [this message]
2026-01-14 10:20 ` [PATCH] tests/functional/x86_64: Use the right Python interpreter & fix format string Daniel P. Berrangé
2026-01-14 12:00 ` Fabiano Rosas
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=20260114101101.36225-1-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=farosas@suse.de \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhao1.liu@intel.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.