[v2,16/17] testsuite: make sbuild-flavor test standalone

Message ID 20251219131923.1504046-17-felix.moessbauer@siemens.com
State Under Review
Headers show
Series Various improvements to the testsuite | expand

Commit Message

Felix Moessbauer Dec. 19, 2025, 1:19 p.m. UTC
As the hello-isar recipe acts as an example for the SBUILD_FLAVOR
feature, we also pull in a dedicated chroot into almost all tests. This
is very costly and does not add much value. We change this by setting
the SBUILD_FLAVOR of hello-isar to none in the CI layer and add a
dedicated test that just tests the SBUILD_FLAVOR feature.

This only slightly reduces the test coverage, but it significantly
speeds up the test execution.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 .../hello-isar/hello-isar.bbappend            |  3 +++
 .../recipes-app/libhello/libhello.bbappend    |  5 +++++
 testsuite/citest.py                           | 21 +++++++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 meta-test/recipes-app/libhello/libhello.bbappend

Patch

diff --git a/meta-test/recipes-app/hello-isar/hello-isar.bbappend b/meta-test/recipes-app/hello-isar/hello-isar.bbappend
index 44686458..27212262 100644
--- a/meta-test/recipes-app/hello-isar/hello-isar.bbappend
+++ b/meta-test/recipes-app/hello-isar/hello-isar.bbappend
@@ -15,3 +15,6 @@  SRC_URI:append = " \
 "
 SRC_URI:remove = "file://nonexist-file"
 SRC_URI:remove = "git://nonexist-git"
+
+# avoid creating a dedicated sbuild chroot
+SBUILD_FLAVOR = ""
diff --git a/meta-test/recipes-app/libhello/libhello.bbappend b/meta-test/recipes-app/libhello/libhello.bbappend
new file mode 100644
index 00000000..3c88a741
--- /dev/null
+++ b/meta-test/recipes-app/libhello/libhello.bbappend
@@ -0,0 +1,5 @@ 
+# This software is a part of ISAR.
+# Copyright (C) Siemens
+
+# avoid creating a dedicated sbuild chroot
+SBUILD_FLAVOR = ""
diff --git a/testsuite/citest.py b/testsuite/citest.py
index d908f9bc..49fcdec0 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -131,6 +131,27 @@  class CompatTest(CIBaseTest):
         self.perform_build_test(targets, compat_arch=True)
 
 
+class SbuildFlavor(CIBaseTest):
+    """
+    Test package build with a custom sbuild chroot.
+    :avocado: tags=sbuildflavor,fast
+    """
+
+    def test_sbuild_flavor(self):
+        targets = [
+            'mc:qemuamd64-trixie:hello-isar',
+            'mc:qemuarm64-trixie:hello-isar',
+        ]
+
+        lines = [
+            'SBUILD_FLAVOR:hello-isar = "db2m"',
+            'SBUILD_FLAVOR:libhello = "db2m"'
+        ]
+
+        self.init()
+        self.perform_build_test(targets, lines=lines)
+
+
 class ReproTest(CIBaseTest):
 
     """