-
Notifications
You must be signed in to change notification settings - Fork 2k
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
tests/pbkdf2: de-flaky-fy test [backport 2022.10] #18941
Merged
maribu
merged 2 commits into
RIOT-OS:2022.10-branch
from
maribu:backport/2022.10/sys/hashes/pbkdf2
Nov 22, 2022
Merged
tests/pbkdf2: de-flaky-fy test [backport 2022.10] #18941
maribu
merged 2 commits into
RIOT-OS:2022.10-branch
from
maribu:backport/2022.10/sys/hashes/pbkdf2
Nov 22, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Having to cast a password provided as `const char *` to `const uint8_t *` is a needless pain in the ass when using the API. Hence, fix it by accepting passwords and salts as `const void *` instead. (cherry picked from commit e92a716)
maribu
added
Area: sys
Area: System
Area: tests
Area: tests and testing framework
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
CI: run tests
If set, CI server will run tests on hardware for the labeled PR
Process: release backport
Integration Process: The PR is a release backport of a change previously provided to master
labels
Nov 21, 2022
maribu
requested review from
miri64,
smlng,
leandrolanzieri,
aabadie,
MichelRottleuthner and
fjmolinas
as code owners
November 21, 2022 11:21
Murdock results✔️ PASSED 2f6dd98 tests/pbkdf2: de-flanky-fy test
ArtifactsThis only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now. |
seems to choke on the moved macro includes. |
Previously, the test vectors were encoded into the python test scripts, converted to base64, and send over to the device under test via stdio. The application sent back the output after converting it to base64 first, which was read back in by the test script and decoded. Finally, the test script compared the result with the expected result. This made the test complex, slow and, flanky, as stdio on interfaces such as UART has a high bit error rate and some quirks (e.g. the EDBG UART bridge e.g. in the samr21-xpro dropping bytes when bursts of more than 64 bytes at a time are send). This basically rewrites the test to embed the test vectors in the firmware and do the comparison on the devices. This fixes test failures on the samr21-xpro, the nRF52840-DK and likely many others. Also, it is now fast.
maribu
force-pushed
the
backport/2022.10/sys/hashes/pbkdf2
branch
from
November 21, 2022 15:41
5c580da
to
2f6dd98
Compare
maribu
added
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
and removed
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
CI: run tests
If set, CI server will run tests on hardware for the labeled PR
labels
Nov 21, 2022
maribu
changed the title
tests/pbkdf2: de-flanky-fy test [backport 2022.10]
tests/pbkdf2: de-flaky-fy test [backport 2022.10]
Nov 22, 2022
kaspar030
added
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
and removed
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
labels
Nov 22, 2022
benpicco
approved these changes
Nov 22, 2022
Thx :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: sys
Area: System
Area: tests
Area: tests and testing framework
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Process: release backport
Integration Process: The PR is a release backport of a change previously provided to master
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #18932
Contribution description
Previously, the test vectors were encoded into the python test scripts, converted to base64, and send over to the device under test via stdio. The application sent back the output after converting it to base64 first, which was read back in by the test script and decoded. Finally, the test script compared the result with the expected result.
This made the test complex, slow and, flanky, as stdio on interfaces such as UART has a high bit error rate and some quirks (e.g. the EDBG UART bridge e.g. in the samr21-xpro dropping bytes when bursts of more than 64 bytes at a time are send).
This basically rewrites the test to embed the test vectors in the firmware and do the comparison on the devices. This fixes test failures on the samr21-xpro, the nRF52840-DK and likely many others. Also, it is now fast.
Beware: This sneaks in a non-API-change-API-change: The password and salt is now passed as
const void *
rather than asconst uint8_t *
, as having to cast c-strings toconst uint8_t *
is a needles pain in the ass.Testing procedure
should pass. Changing one bit in the expected digest in one of the test vectors should result in the test to no longer pass.
Issues/PRs references
None