-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSA return status coverage script #117
PSA return status coverage script #117
Conversation
fc7e674
to
63a82cd
Compare
5e19ec0
to
569874e
Compare
This may conflict with #213 I like the idea of checking that return codes are documented. I think the API is stable enough now that having that capability will be a help and not a hindrance. Is it possible to continue work on this? |
I'll rebase this on top of #213 if we decide to adopt it. Are you ok with the current design? It was good enough for my goal at the time, which was to compare reachable errors with documented errors and is still relevant. But it isn't very well integrated into Mbed Crypto. The script I have for the other side, to collect documented errors, works from the PSA spec (private link: https://github.com/ARMmbed/psa-crypto/pull/227). |
It's a bit funky in that its a mix of shell in a Makefile and some Python, but it's beneficial as is. We can refactor into something better as needed. |
569874e
to
cf36377
Compare
Add infrastructure to run unit tests and collect the return values for every PSA API function that returns psa_status_t. ./tests/scripts/psa_collect_statuses.py >statuses.txt
cf36377
to
be06133
Compare
I rebased the changes on top of current |
Since it needs a slightly different build, even if that's only for the tests, make it its own component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
component_test_psa_collect_statuses () { | ||
msg "build+test: psa_collect_statuses" # ~30s | ||
scripts/config.pl full | ||
scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # slow and irrelevant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may not need to add unset MBEDTLS_MEMORY_BUFFER_ALLOC_C
if we sideport the removal of MBEDTLS_MEMORY_BUFFER_ALLOC_C from full config. Necessary for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely should sideport that change. I'd expect it to come around the next time we sync from mbedtls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's a bit "funky", but all the tools make sense on their own, which makes them fine by me. I made a comment regarding the build logs. If the internal build fails on a remote machine, it may be difficult to learn the failure reason. I had such a failure locally, and had to manually call make test
to see, what was wrong. Otherwise, LGTM.
Add infrastructure to run unit tests and collect the return values for every PSA API function that returns psa_status_t.
Status: runs ok but not very well documented and the build script is not very robust.