Skip to contentSkip to conversation

tests/tracetool: Honor the Python interpreter that "configure" detected

PATCH Applied Thomas Huth 3 participants 3 messages Jan 15 – Jan 19

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests/tracetool: Honor the Python interpreter that "configure" detected

From: Thomas Huth <[email protected]>

The tracetool tests currently fail if the host installation does not have a "python3" binary (and you compiled QEMU by selecting a different one during the "configure" step). This happens because tracetool-test.py executes scripts/tracetool.py directly, so that this script is run via its shebang line. To fix the issue, use the same Python interpreter to run scripts/tracetool.py as we are using to run the tracetool-test.py script.

---
v2: Use sys.executable instead of passing the Python interpreter around
via a PYTHON environment variable.

 tests/tracetool/tracetool-test.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/tracetool/tracetool-test.py +2 -1
index 30006a99190..59e9ab3d6ef 100755
@@ -36,7 +36,8 @@ def test_tracetool_one(tracetool, backend, fmt, src_dir, build_dir):
     actual_file = Path(build_dir, rel_filename)
     expect_file = Path(src_dir, rel_filename)
 
-    args = [tracetool, f"--format={fmt}", f"--backends={backend}", "--group=testsuite"]
+    args = [sys.executable, tracetool,
+            f"--format={fmt}", f"--backends={backend}", "--group=testsuite"]
 
     if fmt.find("stap") != -1:
         args += ["--binary=qemu", "--probe-prefix=qemu"]
Signature · 1 line
2.52.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Thomas Huth

From: Thomas Huth <[email protected]>

The tracetool tests currently fail if the host installation does not have a "python3" binary (and you compiled QEMU by selecting a different one during the "configure" step). This happens because tracetool-test.py executes scripts/tracetool.py directly, so that this script is run via its shebang line. To fix the issue, use the same Python interpreter to run scripts/tracetool.py as we are using to run the tracetool-test.py script.

Quoted 8 lines

---
v2: Use sys.executable instead of passing the Python interpreter around
via a PYTHON environment variable.

 tests/tracetool/tracetool-test.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

With regards,
Daniel

Signature · 3 lines
|: 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 :|
#2 lore raw
In reply to Thomas Huth
Quoted 10 lines · Thomas Huth

From: Thomas Huth <[email protected]>

The tracetool tests currently fail if the host installation does not have a "python3" binary (and you compiled QEMU by selecting a different one during the "configure" step). This happens because tracetool-test.py executes scripts/tracetool.py directly, so that this script is run via its shebang line. To fix the issue, use the same Python interpreter to run scripts/tracetool.py as we are using to run the tracetool-test.py script.

Quoted 8 lines

---
v2: Use sys.executable instead of passing the Python interpreter around
via a PYTHON environment variable.

 tests/tracetool/tracetool-test.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Thanks, applied to my tracing tree:
https://gitlab.com/stefanha/qemu/commits/tracing

Stefan