[1/5] testsuite: make test_libc_dev_deploy KERNEL_NAME agnostic

Message ID 20260813164500.3092151-2-felix.moessbauer@siemens.com
State Under Review
Headers show
Series Fix single-name single-content rule for kernel packages | expand

Commit Message

MOESSBAUER, Felix Aug. 13, 2026, 4:44 p.m. UTC
We currently hard-code the relation between these targets and the
expected recipes that are built. As a preparation to use target specific
kernel names, we generalize the test to read the actual KERNEL_NAME from
the bitbake vars.

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

Patch

diff --git a/testsuite/citest.py b/testsuite/citest.py
index fc0c7106..b50b3bc0 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -636,6 +636,10 @@  class KernelTests(CIBaseTest):
 
     def test_libc_dev_deploy(self):
         """Test that the linux-libc-dev packages are deployed (parse only)."""
+        def kernel_recipe(target):
+            kernel_name = CIUtils.getVars('KERNEL_NAME', target=target)
+            return f'linux-{kernel_name}'
+
         targets = [
             'mc:hikey-bookworm:isar-image-ci',
             'mc:hikey-trixie:isar-image-ci'
@@ -646,23 +650,28 @@  class KernelTests(CIBaseTest):
         self.init()
         buildlist, _ = self.generate_dependency_graph(targets, lines=lines)
 
+        bookworm_kernel = kernel_recipe('mc:hikey-bookworm:isar-image-ci')
+        trixie_kernel = kernel_recipe('mc:hikey-trixie:isar-image-ci')
+
         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)")
+            f'mc:hikey-trixie:{trixie_kernel}-libctarget', built,
+            f"trixie: {trixie_kernel}-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)")
+            f'mc:hikey-bookworm:{bookworm_kernel}', built,
+            f"bookworm: {bookworm_kernel} (linux-libc-dev is not built)")
         self.assertNotIn(
-            'mc:hikey-bookworm:linux-mainline-libctarget', built,
-            "bookworm: unexpected -libctarget variant is built")
+            f'mc:hikey-bookworm:{bookworm_kernel}-libctarget', built,
+            f"bookworm: unexpected {bookworm_kernel}-libctarget "
+            "variant is built")
 
         # The unrelated cip kernel must not be pulled in as libc-dev provider.
         for target in built: