[v2,7/7] testsuite: add cachability analysis to sstate test

Message ID 20220509101604.3249558-8-adriaan.schmidt@siemens.com
State Accepted, archived
Headers show
Series Sstate maintenance script | expand

Commit Message

Schmidt, Adriaan May 9, 2022, 2:16 a.m. UTC
Call `isar-sstate lint` on the populated sstate cache to ensure
that no undesired absolute paths make it into the sstate signatures.

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
---
 testsuite/cibase.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch

diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index a1494ce6..2ffb8191 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -6,7 +6,7 @@  import re
 import tempfile
 import time
 
-from cibuilder import CIBuilder
+from cibuilder import CIBuilder, isar_root
 from avocado.utils import process
 
 class CIBaseTest(CIBuilder):
@@ -103,6 +103,12 @@  class CIBaseTest(CIBuilder):
         # Populate cache
         self.bitbake(image_target, **kwargs)
 
+        # Check signature files for cachability issues like absolute paths in signatures
+        result = process.run(f'{isar_root}/scripts/isar-sstate lint {self.build_dir}/sstate-cache '
+                             f'--build-dir {self.build_dir} --sources-dir {isar_root}')
+        if result.exit_status > 0:
+            self.fail("Detected cachability issues")
+
         # Save contents of image deploy dir
         expected_files = set(glob.glob(f'{self.build_dir}/tmp/deploy/images/*/*'))