]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
integration-test: check tools distribution rather than image distribution main
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 15 Dec 2025 06:06:08 +0000 (15:06 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 15 Dec 2025 14:11:47 +0000 (23:11 +0900)
The tools and image distributions may be different.

This also fixes invalid escape sequence.

Follow-up for 9b42cc3b12c17a4b02d713b2ad499a74acecea1f.

test/integration-tests/integration-test-wrapper.py

index 738fe60681b16f0ca014426cec3d7098104bbb0b..c65a77f3bb131e2d7aa5b2077055d3acac2125e3 100755 (executable)
@@ -75,6 +75,18 @@ class Summary:
         )
 
 
         )
 
 
+def tools_os_release(field: str) -> str:
+    return subprocess.run(
+        [
+            'bash',
+            '-c',
+            f'set -eu; . /etc/os-release; echo ${field}',
+        ],
+        stdout=subprocess.PIPE,
+        text=True,
+    ).stdout.rstrip()
+
+
 def process_coredumps(args: argparse.Namespace, journal_file: Path) -> bool:
     # Collect executable paths of all coredumps and filter out the expected ones.
 
 def process_coredumps(args: argparse.Namespace, journal_file: Path) -> bool:
     # Collect executable paths of all coredumps and filter out the expected ones.
 
@@ -618,11 +630,11 @@ def main() -> None:
     # XXX: debug for https://github.com/systemd/systemd/issues/38240
     if vm:
         # Tracing is not supported in centos/fedora qemu builds
     # XXX: debug for https://github.com/systemd/systemd/issues/38240
     if vm:
         # Tracing is not supported in centos/fedora qemu builds
-        if summary.distribution in ('centos', 'fedora'):
+        if tools_os_release('ID') in ('centos', 'fedora'):
             cmd += ['--qemu-args=-d cpu_reset,guest_errors -D /dev/stderr']
         else:
             cmd += [
             cmd += ['--qemu-args=-d cpu_reset,guest_errors -D /dev/stderr']
         else:
             cmd += [
-                '--qemu-args=-d cpu_reset,guest_errors,trace:kvm_run_exit_system_event,trace:qemu_system_\*_request -D /dev/stderr'  # noqa: E501
+                '--qemu-args=-d cpu_reset,guest_errors,trace:kvm_run_exit_system_event,trace:qemu_system_*_request -D /dev/stderr'  # noqa: E501
             ]
 
     try:
             ]
 
     try: