[v3,16/16] testsuite: add parameter to run tests in rootless mode

Message ID 20260407142310.2327696-17-felix.moessbauer@siemens.com
State New
Headers show
Series add support to build isar unprivileged | expand

Commit Message

Felix Moessbauer April 7, 2026, 2:23 p.m. UTC
While the build mode (schroot or unshare) should be transparent for the
user, we need to test both cases. For that, we add a parameter to the
testsuite to select which mode to test. Later on, more fine-grained
control over which tests run in which mode can be introduced. For now it
is important to get an overview at which things break and where code or
tests need to be adjusted.

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

Patch

diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index f9cca0c7..bdfcbeed 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -128,6 +128,7 @@  class CIBuilder(Test):
         customizations=None,
         generate_sbom=False,
         lines=None,
+        rootless=False,
         **kwargs,
     ):
         # write configuration file and set bitbake_args
@@ -140,6 +141,9 @@  class CIBuilder(Test):
         if not sstate:
             sstate = bool(int(self.params.get('sstate', default=0)))
 
+        if not rootless:
+            rootless = bool(int(self.params.get('rootless', default=0)))
+
         # set those to "" to not set dir value but use system default
         if dl_dir is None:
             dl_dir = os.getenv('DL_DIR')
@@ -279,6 +283,8 @@  class CIBuilder(Test):
                 )
             if generate_sbom is False:
                 f.write('ROOTFS_FEATURES:remove = "generate-sbom"\n')
+            if rootless:
+                f.write('ISAR_ROOTLESS = "1"')
             if lines is not None:
                 f.writelines((line + '\n' if not line.endswith('\n') else line) for line in lines)