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
IOTSTOR-978: Bugfixes to TDBStore and SecureStore #11918
Conversation
ddbf13e
to
8bbc4c3
Compare
Test run: FAILEDSummary: 4 of 4 test jobs failed Failed test jobs:
|
@SeppoTakalo, thank you for your changes. |
Test run: FAILEDSummary: 1 of 4 test jobs failed Failed test jobs:
|
8bbc4c3
to
d855e90
Compare
Rebased on top of master to fix unittest failure |
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.
Looks good to me
@AnttiKauppila Can you review the |
features/storage/internal/utils.h
Outdated
|
||
#include <stdint.h> | ||
|
||
uint32_t align_up(uint64_t val, uint64_t size); |
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.
these should at least contain short doxygen docs eventhough its internal
Test run: FAILEDSummary: 1 of 11 test jobs failed Failed test jobs:
|
74ed7e6
to
a02db39
Compare
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.
If I want to knit-pick, EmulatedSD is not a stubbed class; but anyway it is just test code
Test run: FAILEDSummary: 1 of 11 test jobs failed Failed test jobs:
|
Test failures look related, please review Is this targeting 5.15 ? We should label and needs to pass CI within this week. |
I believe I have managed to find a bug in F411 FlashIAP implementation by introducing new test case.
I'll remove the testcase from this PR and submit as a new bugreport. |
Can we get it in 5.15? |
a02db39
to
11589ab
Compare
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
CI was restarted |
After adding ac99126 commit to the branch, there's a conflict with master |
9eef874
to
1be11f8
Compare
CI started |
Test run: FAILEDSummary: 2 of 4 test jobs failed Failed test jobs:
|
The unittest failures might be related to the crc that was reverted yesterday and somehow its still on this branch or?
|
Ah wait, this PR is adding crc functionality to unittests, is it based on what was on master (and was reverted for 5.15) ? Please review failures |
In case our are contains data from previous reset() or reset_area(), we might end up in the situation where free space contains valid key headers, but we have not erased that area yet. This can cause failures if the deinit() and init() because new scan of that area would continue as long as keys are found. This causes keys on the not-yet-erased area to be included in the new instance of TDBStore. To prevent this failure, check after each key-write that our free space does not contain valid key headers. Also make sure that we erase one program unit sector over the master record. If we erased just the master record,first key might is still there, causing next init() to find it. Extend erase area by one program unit, so that build_ram_table() won't find any keys.
At least with LPC55S69's default TDBStore configuration it's impossible to run storage Greentea tests without exhausting the memory reserved for storing keys. Fixes an issue where number of keys were removed based on number of threads which didn't have anything to do with the test case. Fixes an issue where number of keys were assumed to be constant but variable number was used for configuration.
Wait.. I'll rework this PR into smaller chunks because it has grown too big to review. |
Previously Greentea tests was not initialising its storage before asking for bd->get_program_size(), causing FlashBlockDevice to return zero. This caused both TDBStorage's to use zero for both parameter to SlicingBlockDevice(bd, 0, 0), effetivaly both then used same addresses for slice. This caused SecureStore tests to fail, because writes to internal RBP storage overwrote keys from external storage. Fine-tune TDBStore sizes, so that all tests can fit into storage.
1be11f8
to
abbb248
Compare
Test run: FAILEDSummary: 4 of 4 test jobs failed Failed test jobs:
|
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@0xc0170 This is now ready. Should be able to merge into 5.15.. can go to patch release. |
Description
Summary of change
This is list of changes leading up to the bug fix. Many of the tests were done when exploring the issue #11862, so they logically deserve to be in this same PR.
Fixes #11862
Documentation
Need to update the documentation to remove limitation from TDBStore. It no longer requires Flash storage.
Pull request type
Test results
Reviewers
@VeijoPesonen
Release Notes
Summary of changes
Impact of changes
Migration actions required