Skip to content

Conversation

gilles-peskine-arm
Copy link
Contributor

A collection of improvements in psa_compliance.py:

Merge order:

  1. Cleanups in psa_compliance.py #221
  2. Fix crash in compliance tests TF-PSA-Crypto#495
  3. fix for test_psa_compliance.py doesn't detect if psa-arch-tests crashes #220

PR checklist

Signed-off-by: Gilles Peskine <[email protected]>
If given a non-empty ref, check out that ref and apply patches.
If given an empty ref, keep whatever is there in the psa-arch-tests
directory, without doing a checkout or applying patches.

Signed-off-by: Gilles Peskine <[email protected]>
Use sets to track membership rather than lists. It's more natural.

In test_compliance, don't overwrite the mutable list passed by the caller.
It's rude.

This commit fixes a bug whereby an expected failure would lead to code that
raised a `ValueError`, with an exception handler that expected this
condition to raise `KeyError`.

Signed-off-by: Gilles Peskine <[email protected]>
Normally there's nothing on stderr, but if there is something (e.g. an
assertion failure from libc or a sanitizer), it will be read and printed in
order with respect to normal output. This will make errors easier to debug.

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm gilles-peskine-arm added bug Something isn't working size-s Estimated task size: small (~2d) priority-high High priority - will be reviewed soon labels Oct 3, 2025
@gilles-peskine-arm gilles-peskine-arm added needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review labels Oct 4, 2025
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty good to me, just one docstring issue (plus a question and an optional nit).

@gilles-peskine-arm gilles-peskine-arm requested a review from mpg October 6, 2025 10:07
This is useful when testing different versions or different build options,
or to point to an existing set of worktrees.

Signed-off-by: Gilles Peskine <[email protected]>
PSA_ARCH_TESTS_REPO = 'https://github.com/ARM-software/psa-arch-tests.git'

#pylint: disable=too-many-branches,too-many-statements,too-many-locals
#pylint: disable=too-many-arguments,too-many-branches,too-many-statements,too-many-locals
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should arguably be split into smaller pieces. But I don't think it's that bad, and it wouldn't solve too-many-arguments which is the only one that became necessary because of my changes. So I don't plan to break it up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: if/when we break it up, I think the body of the try os.chdir() ... finally block would be a good candidate for a separate function, if only to reduce the level of indentation.

Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review priority-high High priority - will be reviewed soon size-s Estimated task size: small (~2d)

Projects

Development

Successfully merging this pull request may close these issues.

2 participants