[3/4] testsuite: emit output filenames in generate_dependency_graph

Message ID 20260731144345.1560688-4-felix.moessbauer@siemens.com
State New
Headers show
Series Fix kernel build and propagation of linux-libc-dev | expand

Commit Message

Felix Moessbauer July 31, 2026, 2:43 p.m. UTC
Emit the filenames of the buildlist and dot output, so consumers can
directly use that for further analysis (instead of guessing the path).
For that, we also need to sanitize the filename to ensure it does not
contain a path seperator.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 testsuite/cibase.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Patch

diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index 52748004..033b3b19 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -29,7 +29,10 @@  class CIBaseTest(CIBuilder):
                                   should_fail=False,
                                   reconfigure=True,
                                   **kwargs):
-        """Debug helper to better understand test task graphs."""
+        """
+        Debug helper to better understand test task graphs.
+        Returns a path pair (buildlist, task-depends.dot)
+        """
         if reconfigure:
             self.configure(targets=targets, **kwargs)
 
@@ -37,8 +40,14 @@  class CIBaseTest(CIBuilder):
 
         self.bitbake(targets, should_fail=should_fail,
                      bitbake_extra_args=["-g"], **kwargs)
-        self.move_in_build_dir('task-depends.dot', f"task-depends-{self.name}.dot")
-        self.move_in_build_dir('pn-buildlist', f"pn-buildlist-{self.name}")
+        # self.name may contain path separators and colons
+        name = re.sub(r'[^\w.-]', '_', str(self.name))
+        self.move_in_build_dir('task-depends.dot', f"task-depends-{name}.dot")
+        self.move_in_build_dir('pn-buildlist', f"pn-buildlist-{name}")
+        return (
+            f"{self.build_dir}/pn-buildlist-{name}",
+            f"{self.build_dir}/task-depends-{name}.dot"
+        )
 
     def perform_wic_partition_test(self, targets, wic_deploy_parts, **kwargs):
         self.configure(targets=targets, wic_deploy_parts=wic_deploy_parts, **kwargs)