[3/3] testsuite: make sbuild-flavor test standalone

Message ID 20251218155347.9929-3-felix.moessbauer@siemens.com
State Superseded, archived
Headers show
Series [1/3] testsuite: add rootfs target for rootfs only tests | expand

Commit Message

MOESSBAUER, Felix Dec. 18, 2025, 3:53 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 +++
 testsuite/citest.py                           | 20 +++++++++++++++++++
 2 files changed, 23 insertions(+)

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/testsuite/citest.py b/testsuite/citest.py
index 2b3efa4a..3ec5e824 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -131,6 +131,26 @@  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"'
+        ]
+
+        self.init()
+        self.perform_build_test(targets, lines=lines)
+
+
 class ReproTest(CIBaseTest):
 
     """