Skip to content

Separate reporting of storage format and ABI stability tests#10451

Closed
bensze01 wants to merge 2 commits into
Mbed-TLS:developmentfrom
bensze01:storage
Closed

Separate reporting of storage format and ABI stability tests#10451
bensze01 wants to merge 2 commits into
Mbed-TLS:developmentfrom
bensze01:storage

Conversation

@bensze01

Copy link
Copy Markdown
Contributor

Description

Quick fix to distinguish failures in the storare tests from ABI tests.
A follow-up PR will refactor abi_check.py and move it to the framework directory.

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

  • changelog provided | not required because:
  • development PR provided # | not required because:
  • TF-PSA-Crypto PR provided # | not required because:
  • framework PR provided Mbed-TLS/mbedtls-framework# | not required
  • 3.6 PR provided # | not required because:
  • tests provided | not required because:

Argparse generally uses a return code of 2 for these situations.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
@bensze01 bensze01 added enhancement needs-review Every commit must be reviewed by at least two team members, needs-ci Needs to pass CI tests needs-reviewer This PR needs someone to pick it up for review component-psa PSA keystore/dispatch layer (storage, drivers, …) size-xs Estimated task size: extra small (a few hours at most) labels Oct 14, 2025
Treat the return code of abi_check.py as a bitfield.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>

@gilles-peskine-arm gilles-peskine-arm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I had expected that we'd run the script separately for API/ABI and for storage, but ok, this is a bit weird but has better performance. Please document the unusual convention, though.

Comment thread scripts/abi_check.py

EXIT_CODE_SUCCESS = 0
EXIT_CODE_BIT_ABI_ERROR = 1
EXIT_CODE_BIT_INVALID_ARGUMENTS = 2 # Matches argparse's convention

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The argparse default is based on the convention that 0 = success, 1 = negative result (e.g. search found 0 occurrences) and 2 = operational error (e.g. file not found or invalid command line arguments). Having it in the middle of a bit-field doesn't really make sense, and doesn't align with the general idea that larger error codes are worse errors. So I think it should be something like

  • mask 1 = API + ABI
  • mask 2 = reserved for when we can distinguish API from ABI
  • mask 4 = storage
  • value 120 = unhandled exception
  • value 121 = command line error

Comment thread scripts/abi_check.py
Comment on lines 709 to 711
# status 2, not 1.
traceback.print_exc()
sys.exit(2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An unhandled exception shouldn't land in the bit-mask zone.

Suggested change
# status 120, not 1.
traceback.print_exc()
sys.exit(120)

Comment thread scripts/abi_check.py
* It's ok if the same test data is present, but its presentation has changed,
for example if a test function is renamed or has different parameters.
* It's ok if redundant tests are removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The return codes will be a contract between this script and the Groovy code. Please state this at least in a comment, and document the return codes in the docstring (at least: this bit for ABI/API, this bit for storage, this set of values for other errors; the contract doesn't need to distinguish between the various other errors).

@bensze01

Copy link
Copy Markdown
Contributor Author

I've reworked the mbedtls-test side of this fix so as not to require any changes on the mbedtls side, so I'll be closing this PR.

See: Mbed-TLS/mbedtls-test#224

@bensze01 bensze01 closed this Oct 20, 2025
@bensze01 bensze01 changed the title Storage Separate reporting of storage format and ABI stability tests Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component-psa PSA keystore/dispatch layer (storage, drivers, …) enhancement needs-ci Needs to pass CI tests 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 size-xs Estimated task size: extra small (a few hours at most)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants