From: chris.larson@siemens.com
To: isar-users@googlegroups.com
Cc: Christopher Larson <chris.larson@siemens.com>
Subject: [PATCH 8/9] testsuite: add perform_signature_lint method
Date: Fri, 5 Apr 2024 16:31:34 +0000 [thread overview]
Message-ID: <20240405163135.2987489-9-chris.larson@siemens.com> (raw)
In-Reply-To: <20240405163135.2987489-1-chris.larson@siemens.com>
From: Christopher Larson <chris.larson@siemens.com>
This method is provided to generate signature data for specified target
or targets and check for cachability issues without having to complete a
build.
Submitted at https://groups.google.com/g/isar-users/c/2NB-PXyswq8/m/42BMya5TAQAJ.
Signed-off-by: Christopher Larson <chris.larson@siemens.com>
---
testsuite/cibase.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/testsuite/cibase.py b/testsuite/cibase.py
index 90591f32..349a79f0 100755
--- a/testsuite/cibase.py
+++ b/testsuite/cibase.py
@@ -125,6 +125,25 @@ def perform_sstate_populate(self, image_target, **kwargs):
# Remove isar configuration so the the following test creates a new one
self.delete_from_build_dir('conf')
+ def perform_signature_lint(self, targets, verbose=False, sources_dir=isar_root,
+ excluded_tasks=None, **kwargs):
+ """Generate signature data for target(s) and check for cachability issues."""
+ self.configure(**kwargs)
+ self.move_in_build_dir("tmp", "tmp_before_sstate")
+ self.bitbake(targets, sig_handler="none")
+
+ verbose_arg = "--verbose" if verbose else ""
+ excluded_arg = f"--excluded-tasks {','.join(excluded_tasks)}" if excluded_tasks else ""
+ cmd = f"{isar_root}/scripts/isar-sstate lint --lint-stamps {self.build_dir}/tmp/stamps " \
+ f"--build-dir {self.build_dir} --sources-dir {sources_dir} {verbose_arg} {excluded_arg}"
+ self.log.info(f"Running: {cmd}")
+ exit_status, output = process.getstatusoutput(cmd, ignore_status=True)
+ if exit_status > 0:
+ ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
+ for line in output.splitlines():
+ self.log.error(ansi_escape.sub('', line))
+ self.fail("Detected cachability issues")
+
def perform_sstate_test(self, image_target, package_target, **kwargs):
def check_executed_tasks(target, expected):
taskorder_file = glob.glob(f'{self.build_dir}/tmp/work/*/{target}/*/temp/log.task_order')
--
2.39.2
next prev parent reply other threads:[~2024-04-05 16:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 16:31 [PATCHv2 0/9] Add more signature cachability tests to the testsuite chris.larson
2024-04-05 16:31 ` [PATCH 1/9] isar-bootstrap: avoid forced early expansion of key vars chris.larson
2024-04-05 16:33 ` Larson, Chris
2024-04-05 16:31 ` [PATCH 2/9] isar-ci-ssh-setup: avoid abs path in signatures chris.larson
2024-04-05 16:31 ` [PATCH 3/9] isar-sstate: lint: check for absolute paths in SRC_URI chris.larson
2024-04-05 16:31 ` [PATCH 4/9] isar-sstate: lint: add support for checking stamps chris.larson
2024-04-05 16:31 ` [PATCH 5/9] isar-sstate: add --excluded-tasks argument chris.larson
2024-04-05 16:31 ` [PATCH 6/9] isar-sstate: fix failures if a variable is set to just whitespace chris.larson
2024-04-05 16:31 ` [PATCH 7/9] cibuilder.py: add -S support to the bitbake method chris.larson
2024-04-05 16:31 ` chris.larson [this message]
2024-04-05 16:31 ` [PATCH 9/9] testsuite: add signature cachability checks chris.larson
2024-04-11 16:10 ` [PATCHv2 0/9] Add more signature cachability tests to the testsuite Larson, Chris
2024-04-14 12:39 ` MOESSBAUER, Felix
2024-04-15 9:27 ` Uladzimir Bely
-- strict thread matches above, loose matches on Subject: below --
2024-04-02 17:28 [PATCH " kergoth
2024-04-02 17:28 ` [PATCH 8/9] testsuite: add perform_signature_lint method kergoth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240405163135.2987489-9-chris.larson@siemens.com \
--to=chris.larson@siemens.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox