[4/4] testsuite: add test for KERNEL_LIBC_DEV_DEPLOY

Message ID 20260731144345.1560688-5-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
Enabling KERNEL_LIBC_DEV_DEPLOY=1 results in a complex dependency chain
that is built, also depending on the distro version. We add a fast
parser check to ensure the expected targets are attracted / built.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 testsuite/cibase.py | 27 +++++++++++++++++++++++++++
 testsuite/citest.py | 12 ++++++++++++
 2 files changed, 39 insertions(+)

Patch

diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index 033b3b19..cfa2df5e 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -431,3 +431,30 @@  class CIBaseTest(CIBuilder):
                         self.fail("Source packages are equal")
         finally:
             self.cleanup_tmp_layer(tmp_layer_dir)
+
+    def perform_deploy_linux_libc_parse_test(self, targets, **kwargs):
+        buildlist, _ = self.generate_dependency_graph(targets, **kwargs)
+
+        with open(buildlist, 'r') as f:
+            built = set(line.strip() for line in f if line.strip())
+
+        # trixie produces arch=all linux-libc-dev packages, which are built by
+        # the dedicated -libctarget variant.
+        self.assertIn(
+            'mc:hikey-trixie:linux-mainline-libctarget', built,
+            "trixie: linux-mainline-libctarget (linux-libc-dev is not built)")
+
+        # bookworm produces an arch-specific linux-libc-dev, built by the base
+        # recipe itself; no -libctarget variant is needed.
+        self.assertIn(
+            'mc:hikey-bookworm:linux-mainline', built,
+            "bookworm: linux-mainline (linux-libc-dev is not built)")
+        self.assertNotIn(
+            'mc:hikey-bookworm:linux-mainline-libctarget', built,
+            "bookworm: unexpected -libctarget variant is built")
+
+        # The unrelated cip kernel must not be pulled in as libc-dev provider.
+        for target in built:
+            self.assertNotIn(
+                'linux-cip', target,
+                f"unexpected linux-cip provider pulled in: {target}")
diff --git a/testsuite/citest.py b/testsuite/citest.py
index a4f15d04..2747039a 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -616,6 +616,18 @@  class KernelTests(CIBaseTest):
         self.init()
         self.perform_build_test(targets, image_install=' '.join(modules), lines=lines)
 
+    def test_libc_dev_deploy(self):
+        """Test that the linux-libc-dev packages are deployed (parse only)."""
+        targets = [
+            'mc:hikey-bookworm:isar-image-ci',
+            'mc:hikey-trixie:isar-image-ci'
+        ]
+        lines = [
+            "KERNEL_LIBC_DEV_DEPLOY = '1'",
+        ]
+        self.init()
+        self.perform_deploy_linux_libc_parse_test(targets, lines=lines)
+
 
 class InitRdBaseTest(CIBaseTest):
     """