public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 0/9] Add more signature cachability tests to the testsuite
@ 2024-04-02 17:28 kergoth
  2024-04-02 17:28 ` [PATCH 1/9] isar-bootstrap: avoid forced early expansion of key vars kergoth
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: kergoth @ 2024-04-02 17:28 UTC (permalink / raw)
  To: isar-users; +Cc: Christopher Larson

From: Christopher Larson <chris.larson@siemens.com>

This series improves isar-sstate's lint command to support checking sigdata in tmp/stamps and to check for absolute paths in SRC_URI, and adds an additional test to the testsuite to exercise this capability. The new test checks for signature cachability issues much more quickly, as it does so without a full build, so it checks more target configurations. This uses bitbake's `-S none` option to avoid building anything, and then runs isar-sstate lint on the resulting sigdata in tmp/stamps.

This test will accept a verbose parameter on the command-line to pass --verbose to isar-sstate lint, which will show the "other" absolute paths found, not just source and build directory. This series also fixes two of the failures which were identified by the new test.

Here we can see the issues identified by the new test, which are fixed in this series:
```
$ avocado run testsuite/citest.py -t signatures --max-parallel-tasks=1
JOB ID     : 3a3308967946663d9b239f638b030502fa80ef0a
JOB LOG    : /builder/avocado/job-results/job-2024-03-29T19.24-3a33089/job.log
 (1/1) testsuite/citest.py:SignatureTest.test_signature_lint: STARTED
 (1/1) testsuite/citest.py:SignatureTest.test_signature_lint: FAIL: Detected cachability issues (42.93 s)
RESULTS    : PASS 0 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME   : 44.63 s

Test summary:
1-testsuite/citest.py:SignatureTest.test_signature_lint: FAIL
```

Applicable section of the avocado full.log:
```
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| ==== issues found in ubuntu-focal-amd64:isar-bootstrap-target:unpack (95af4581) ====
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| -> path in sources-dir: SRC_URI entry "file:///home/kergoth/Code/industrial/signatures/isar/meta-isar/conf/distro/ubuntu.public.key;sha256sum=36a38199a4bf4eae1e7f574891f7dfcb79b91b87a33a499383265e1224b5e989"
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| ==== issues found in ubuntu-focal-amd64:isar-bootstrap-target:fetch (e8249cb2) ====
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| -> path in sources-dir: SRC_URI entry "file:///home/kergoth/Code/industrial/signatures/isar/meta-isar/conf/distro/ubuntu.public.key;sha256sum=36a38199a4bf4eae1e7f574891f7dfcb79b91b87a33a499383265e1224b5e989"
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| ==== issues found in debian-bullseye-amd64:isar-ci-ssh-setup:install (1c0a8b21) ====
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| -> path in sources-dir: TESTSUITEDIR = "/home/kergoth/Code/industrial/signatures/isar/testsuite"
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| found cachability issues (scanned 602 signatures)
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| -> absolute paths: sources-dir 3, build-dir 0, other 184
```

If we strip off the prefix for legibility:
```
ERROR| ==== issues found in ubuntu-focal-amd64:isar-bootstrap-target:unpack (95af4581) ====
ERROR| -> path in sources-dir: SRC_URI entry "file:///home/kergoth/Code/industrial/signatures/isar/meta-isar/conf/distro/ubuntu.public.key;sha256sum=36a38199a4bf4eae1e7f574891f7dfcb79b91b87a33a499383265e1224b5e989"
ERROR| ==== issues found in ubuntu-focal-amd64:isar-bootstrap-target:fetch (e8249cb2) ====
ERROR| -> path in sources-dir: SRC_URI entry "file:///home/kergoth/Code/industrial/signatures/isar/meta-isar/conf/distro/ubuntu.public.key;sha256sum=36a38199a4bf4eae1e7f574891f7dfcb79b91b87a33a499383265e1224b5e989"
ERROR| ==== issues found in debian-bullseye-amd64:isar-ci-ssh-setup:install (1c0a8b21) ====
ERROR| -> path in sources-dir: TESTSUITEDIR = "/home/kergoth/Code/industrial/signatures/isar/testsuite"
ERROR| found cachability issues (scanned 602 signatures)
ERROR| -> absolute paths: sources-dir 3, build-dir 0, other 184
```

The sstate/signatures tests were run for each commit in this series using `git rebase -x` to ensure it does not break a bisect.

I welcome any and all feedback on this. In particular I don't love extending the hardcoded list of image tasks being ignored in isar-sstate lint, but it's a start. I'm open to suggestions.

Christopher Larson (9):
  isar-bootstrap: avoid forced early expansion of key vars
  isar-ci-ssh-setup: avoid abs path in signatures
  isar-sstate: lint: check for absolute paths in SRC_URI
  isar-sstate: lint: add support for checking stamps
  isar-sstate: lint: ignore more image tasks
  isar-sstate: add --excluded-tasks argument
  cibuilder.py: add -S support to the bitbake method
  testsuite: add perform_signature_lint method
  testsuite: add signature cachability checks

 .../isar-ci-ssh-setup_0.1.bb                  |  3 +
 .../isar-bootstrap/isar-bootstrap.inc         |  8 ++-
 scripts/isar-sstate                           | 60 +++++++++++++++----
 testsuite/cibase.py                           | 19 ++++++
 testsuite/cibuilder.py                        |  5 +-
 testsuite/citest.py                           | 22 ++++++-
 6 files changed, 100 insertions(+), 17 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 24+ messages in thread
* [PATCHv2 0/9] Add more signature cachability tests to the testsuite
@ 2024-04-05 16:31 chris.larson
  2024-04-05 16:31 ` [PATCH 8/9] testsuite: add perform_signature_lint method chris.larson
  0 siblings, 1 reply; 24+ messages in thread
From: chris.larson @ 2024-04-05 16:31 UTC (permalink / raw)
  To: isar-users; +Cc: Christopher Larson

From: Christopher Larson <chris.larson@siemens.com>

This series improves isar-sstate's lint command to support checking sigdata in tmp/stamps and to check for absolute paths in SRC_URI, and adds an additional test to the testsuite to exercise this capability. The new test checks for signature cachability issues much more quickly, as it does so without a full build, so it checks more target configurations. This uses bitbake's `-S none` option to avoid building anything, and then runs isar-sstate lint on the resulting sigdata in tmp/stamps.

This test will accept a verbose parameter on the command-line to pass --verbose to isar-sstate lint, which will show the "other" absolute paths found, not just source and build directory. This series also fixes two of the failures which were identified by the new test.

Here we can see the issues identified by the new test, which are fixed in this series:
```
$ avocado run testsuite/citest.py -t signatures --max-parallel-tasks=1
JOB ID     : 3a3308967946663d9b239f638b030502fa80ef0a
JOB LOG    : /builder/avocado/job-results/job-2024-03-29T19.24-3a33089/job.log
 (1/1) testsuite/citest.py:SignatureTest.test_signature_lint: STARTED
 (1/1) testsuite/citest.py:SignatureTest.test_signature_lint: FAIL: Detected cachability issues (42.93 s)
RESULTS    : PASS 0 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME   : 44.63 s

Test summary:
1-testsuite/citest.py:SignatureTest.test_signature_lint: FAIL
```

Applicable section of the avocado full.log:
```
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| ==== issues found in ubuntu-focal-amd64:isar-bootstrap-target:unpack (95af4581) ====
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| -> path in sources-dir: SRC_URI entry "file:///home/kergoth/Code/industrial/signatures/isar/meta-isar/conf/distro/ubuntu.public.key;sha256sum=36a38199a4bf4eae1e7f574891f7dfcb79b91b87a33a499383265e1224b5e989"
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| ==== issues found in ubuntu-focal-amd64:isar-bootstrap-target:fetch (e8249cb2) ====
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| -> path in sources-dir: SRC_URI entry "file:///home/kergoth/Code/industrial/signatures/isar/meta-isar/conf/distro/ubuntu.public.key;sha256sum=36a38199a4bf4eae1e7f574891f7dfcb79b91b87a33a499383265e1224b5e989"
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| ==== issues found in debian-bullseye-amd64:isar-ci-ssh-setup:install (1c0a8b21) ====
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| -> path in sources-dir: TESTSUITEDIR = "/home/kergoth/Code/industrial/signatures/isar/testsuite"
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| found cachability issues (scanned 602 signatures)
1-testsuite/citest.py:SignatureTest.test_signature_lint: 2024-03-29 19:25:10,818 avocado.test cibase           L0142 ERROR| -> absolute paths: sources-dir 3, build-dir 0, other 184
```

If we strip off the prefix for legibility:
```
ERROR| ==== issues found in ubuntu-focal-amd64:isar-bootstrap-target:unpack (95af4581) ====
ERROR| -> path in sources-dir: SRC_URI entry "file:///home/kergoth/Code/industrial/signatures/isar/meta-isar/conf/distro/ubuntu.public.key;sha256sum=36a38199a4bf4eae1e7f574891f7dfcb79b91b87a33a499383265e1224b5e989"
ERROR| ==== issues found in ubuntu-focal-amd64:isar-bootstrap-target:fetch (e8249cb2) ====
ERROR| -> path in sources-dir: SRC_URI entry "file:///home/kergoth/Code/industrial/signatures/isar/meta-isar/conf/distro/ubuntu.public.key;sha256sum=36a38199a4bf4eae1e7f574891f7dfcb79b91b87a33a499383265e1224b5e989"
ERROR| ==== issues found in debian-bullseye-amd64:isar-ci-ssh-setup:install (1c0a8b21) ====
ERROR| -> path in sources-dir: TESTSUITEDIR = "/home/kergoth/Code/industrial/signatures/isar/testsuite"
ERROR| found cachability issues (scanned 602 signatures)
ERROR| -> absolute paths: sources-dir 3, build-dir 0, other 184
```

The sstate/signatures tests were run for each commit in this series using `git rebase -x` to ensure it does not break a bisect.

I welcome any and all feedback on this.

v2 updates:
- Explain the use of --dump-signatures in the docs on the lint command in isar-sstate
- Explain the stamps regex the way the sstate regex is explained, for consistency
- Support wildcards for the --excluded-tasks argument and default exclusions
- Drop the additional default task exclusions, as this should be revisited
- Fix a lint traceback if a variable's value is only whitespacxe

Christopher Larson (9):
  isar-bootstrap: avoid forced early expansion of key vars
  isar-ci-ssh-setup: avoid abs path in signatures
  isar-sstate: lint: check for absolute paths in SRC_URI
  isar-sstate: lint: add support for checking stamps
  isar-sstate: add --excluded-tasks argument
  isar-sstate: fix failures if a variable is set to just whitespace
  cibuilder.py: add -S support to the bitbake method
  testsuite: add perform_signature_lint method
  testsuite: add signature cachability checks

 .../isar-ci-ssh-setup_0.1.bb                  |  3 +
 .../isar-bootstrap/isar-bootstrap.inc         |  8 +-
 scripts/isar-sstate                           | 85 +++++++++++++++----
 testsuite/cibase.py                           | 19 +++++
 testsuite/cibuilder.py                        |  5 +-
 testsuite/citest.py                           | 22 ++++-
 6 files changed, 121 insertions(+), 21 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-04-05 16:32 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 17:28 [PATCH 0/9] Add more signature cachability tests to the testsuite kergoth
2024-04-02 17:28 ` [PATCH 1/9] isar-bootstrap: avoid forced early expansion of key vars kergoth
2024-04-03  6:54   ` MOESSBAUER, Felix
2024-04-03 21:42     ` Larson, Chris
2024-04-04  6:26       ` MOESSBAUER, Felix
2024-04-02 17:28 ` [PATCH 2/9] isar-ci-ssh-setup: avoid abs path in signatures kergoth
2024-04-02 17:28 ` [PATCH 3/9] isar-sstate: lint: check for absolute paths in SRC_URI kergoth
2024-04-03  6:56   ` MOESSBAUER, Felix
2024-04-02 17:28 ` [PATCH 4/9] isar-sstate: lint: add support for checking stamps kergoth
2024-04-03  7:02   ` MOESSBAUER, Felix
2024-04-03 21:42     ` Larson, Chris
2024-04-02 17:28 ` [PATCH 5/9] isar-sstate: lint: ignore more image tasks kergoth
2024-04-03  7:08   ` MOESSBAUER, Felix
2024-04-02 17:28 ` [PATCH 6/9] isar-sstate: add --excluded-tasks argument kergoth
2024-04-03  7:10   ` MOESSBAUER, Felix
2024-04-03 21:41     ` Larson, Chris
2024-04-03 21:44     ` Larson, Chris
2024-04-04  6:28       ` MOESSBAUER, Felix
2024-04-02 17:28 ` [PATCH 7/9] cibuilder.py: add -S support to the bitbake method kergoth
2024-04-03  7:12   ` MOESSBAUER, Felix
2024-04-03 21:41     ` Larson, Chris
2024-04-02 17:28 ` [PATCH 8/9] testsuite: add perform_signature_lint method kergoth
2024-04-02 17:28 ` [PATCH 9/9] testsuite: add signature cachability checks kergoth
2024-04-05 16:31 [PATCHv2 0/9] Add more signature cachability tests to the testsuite chris.larson
2024-04-05 16:31 ` [PATCH 8/9] testsuite: add perform_signature_lint method chris.larson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox