-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix and re-enable Zephyr native tests #37333
base: master
Are you sure you want to change the base?
Conversation
* Don't dereference address pointed by lfp in for loop expression as it may be a nullptr. * Add simple test that registers and deregisters single error formatter. * Deregister all formatters at the end of CheckRegisterDeregisterErrorFormatter. Signed-off-by: Adrian Gielniewski <[email protected]>
* Add function to deregister CHIP layer error formatter. * Deregister CHIP error formatter at the end of TestSystemErrorStr to not interfere with other tests. Signed-off-by: Adrian Gielniewski <[email protected]>
Add temporary workaround for Zephyr native link issue. This will be fixed with the next NCS release. Signed-off-by: Adrian Gielniewski <[email protected]>
Signed-off-by: Adrian Gielniewski <[email protected]>
Signed-off-by: Adrian Gielniewski <[email protected]>
Signed-off-by: Adrian Gielniewski <[email protected]>
Wipe all key slots during each test case SetUp to avoid reusing slot previously used by other tests. This affects heap memory usage calculation as when the slot is reused it frees the memory. Signed-off-by: Adrian Gielniewski <[email protected]>
PR #37333: Size comparison from 3044eeb to e3e10cf Full report (82 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
void ValidateHmac128(const Crypto::Hmac128KeyHandle & saved, const Crypto::Hmac128KeyHandle & loaded) | ||
{ | ||
#if CHIP_CRYPTO_PSA | ||
EXPECT_NE(memcmp(saved.As<Crypto::Symmetric128BitsKeyByteArray>(), loaded.As<Crypto::Symmetric128BitsKeyByteArray>(), |
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.
You shouldn't cast the handles to Symmetric128BitsKeyByteArray
if they are actually psa_key_id_t
s. Should this be EXPECT_EQ(saved.As<psa_key_id_t>(), loaded.As<psa_key_id_t>())
? If both keys are already persisted, I would expect the same ID after loading the entry.
#if CHIP_CRYPTO_PSA | ||
psa_crypto_init(); | ||
psa_wipe_all_key_slots(); |
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.
Is this needed to support multiple runs when using the flash simulator which lefts flash.bin
behind? Note that you can just run zephyr.exe
with --flash_rm
to remove the file automatically after the test run.
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.
Without this change it fails on first run. We have some slots used by other tests, then some of them have to be resused and as a result we free the memory allocated before HeapChecker is constructed.
EXPECT_EQ(loopHandler.trace, std::string("1AP2HP3R4")); | ||
#else | ||
EXPECT_EQ(loopHandler.trace, std::string("1APHP2HPHP3R4")); |
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.
Can you comment where the difference comes from? Is this expected?
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.
There is a difference in how WakeEvent
is handled:
https://github.com/project-chip/connectedhomeip/blob/master/src/system/SystemLayerImplSelect.cpp#L142-L150
In Zephyr Notify
is called and loop has to spin one more time to process the event.
Maybe it would be better to use CHIP_SYSTEM_CONFIG_POSIX_LOCKING
instead of CHIP_SYSTEM_CONFIG_USE_POSIX_PIPE
.
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 changed the define and updated commit description.
Expect correct sequence for different LayerImplSelect::Signal implementations. When CHIP_SYSTEM_CONFIG_POSIX_LOCKING is not defined, WakeEvent::Notify is called and loop has to spin one more time to process the event. Signed-off-by: Adrian Gielniewski <[email protected]>
e3e10cf
to
72ca79e
Compare
PR #37333: Size comparison from 4f956ec to 72ca79e Full report (83 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
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.
Seems like this includes all of #37254
Would be better to get that one merged, then update this PR so it's clear what's actually changing here.
This PR:
Testing
Tested using automated tests.