[v3,3/8] CI: Pass ISAR_FAIL_ON_CLEANUP from environment to bitbake

Message ID 20241011100050.322686-4-amikan@ilbers.de
State Accepted, archived
Headers show
Series Hanging mount fixes | expand

Commit Message

Anton Mikanovich Oct. 11, 2024, 10 a.m. UTC
Setting the variable to 1 in the CI environment would make the job
fail if any mounts are left behind after building.

To test:

$ ISAR_FAIL_ON_CLEANUP=1 ../scripts/ci_build.sh -T dev

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 testsuite/cibuilder.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index 0d0de99e..9fa3d86c 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -129,6 +129,7 @@  class CIBuilder(Test):
 
         # get parameters from environment
         distro_apt_premir = os.getenv('DISTRO_APT_PREMIRRORS')
+        fail_on_cleanup = os.getenv('ISAR_FAIL_ON_CLEANUP')
 
         self.log.info(
             f"===================================================\n"
@@ -204,7 +205,9 @@  class CIBuilder(Test):
             if sstate_dir:
                 f.write('SSTATE_DIR = "%s"\n' % sstate_dir)
             if image_install is not None:
-                f.write('IMAGE_INSTALL = "%s"' % image_install)
+                f.write('IMAGE_INSTALL = "%s"\n' % image_install)
+            if fail_on_cleanup == '1':
+                f.write('ISAR_FAIL_ON_CLEANUP = "1"\n')
 
         # include ci_build.conf in local.conf
         with open(self.build_dir + '/conf/local.conf', 'r+') as f: