-
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
Remove verbose text during building #23687
Changes from all commits
08cd017
db42469
e604c44
26b5e37
e5ef9de
e3f6628
46a45b5
9d81b83
283ae48
53504a4
67e1207
0f893d1
d76928c
c7fc506
64dcb64
85843fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1731,7 +1731,7 @@ void TestReadInteraction::TestSubscribeAttributeTimeout(nlTestSuite * apSuite, v | |
void TestReadInteraction::TestReadHandler_MultipleSubscriptions(nlTestSuite * apSuite, void * apContext) | ||
{ | ||
TestContext & ctx = *static_cast<TestContext *>(apContext); | ||
auto sessionHandle = ctx.GetSessionBobToAlice(); | ||
SessionHandle sessionHandle = ctx.GetSessionBobToAlice(); | ||
uint32_t numSuccessCalls = 0; | ||
uint32_t numSubscriptionEstablishedCalls = 0; | ||
|
||
|
@@ -1769,10 +1769,31 @@ void TestReadInteraction::TestReadHandler_MultipleSubscriptions(nlTestSuite * ap | |
// | ||
for (size_t i = 0; i < (app::InteractionModelEngine::kReadHandlerPoolSize + 1); i++) | ||
{ | ||
NL_TEST_ASSERT(apSuite, | ||
Controller::SubscribeAttribute<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo>( | ||
&ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb, 0, 20, | ||
onSubscriptionEstablishedCb, nullptr, false, true) == CHIP_NO_ERROR); | ||
Controller::detail::ReportAttributeParams<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::DecodableType> | ||
params(sessionHandle); | ||
|
||
params.mOnReportCb = onSuccessCb; | ||
params.mOnErrorCb = onFailureCb; | ||
params.mOnSubscriptionEstablishedCb = onSubscriptionEstablishedCb; | ||
params.mOnResubscriptionAttemptCb = nullptr; | ||
params.mOnDoneCb = nullptr; | ||
params.mMinIntervalFloorSeconds = 0; | ||
params.mMaxIntervalCeilingSeconds = 20; | ||
params.mReportType = app::ReadClient::InteractionType::Subscribe; | ||
params.mKeepSubscriptions = true; | ||
params.mIsFabricFiltered = false; | ||
|
||
// Increase timeout, so that slow versions (specifically gcc_debug) does not time out. | ||
params.mTimeout = chip::System::Clock::Seconds16(15); | ||
|
||
CHIP_ERROR err = | ||
Controller::detail::ReportAttribute<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::DecodableType>( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should not be using "detail" APIs here. There are public APIs for all this; please use them. |
||
&ctx.GetExchangeManager(), kTestEndpointId, | ||
Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::GetClusterId(), | ||
Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::GetAttributeId(), std::move(params), | ||
NullOptional); | ||
|
||
NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); | ||
} | ||
|
||
// There are too many messages and the test (gcc_debug, which includes many sanity checks) will be quite slow. Note: report | ||
|
@@ -2678,15 +2699,36 @@ void TestReadInteraction::TestReadHandler_MultipleSubscriptionsWithDataVersionFi | |
chip::Optional<chip::DataVersion> dataVersion(1); | ||
for (size_t i = 0; i < (app::InteractionModelEngine::kReadHandlerPoolSize + 1); i++) | ||
{ | ||
NL_TEST_ASSERT(apSuite, | ||
Controller::SubscribeAttribute<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo>( | ||
&ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb, 0, 10, | ||
onSubscriptionEstablishedCb, nullptr, false, true, dataVersion) == CHIP_NO_ERROR); | ||
Controller::detail::ReportAttributeParams<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::DecodableType> | ||
params(sessionHandle); | ||
|
||
params.mOnReportCb = onSuccessCb; | ||
params.mOnErrorCb = onFailureCb; | ||
params.mOnSubscriptionEstablishedCb = onSubscriptionEstablishedCb; | ||
params.mOnResubscriptionAttemptCb = nullptr; | ||
params.mOnDoneCb = nullptr; | ||
params.mMinIntervalFloorSeconds = 0; | ||
params.mMaxIntervalCeilingSeconds = 10; | ||
params.mReportType = app::ReadClient::InteractionType::Subscribe; | ||
params.mKeepSubscriptions = true; | ||
params.mIsFabricFiltered = false; | ||
|
||
// Increase timeout, so that slow versions (specifically gcc_debug) does not time out. | ||
params.mTimeout = chip::System::Clock::Seconds16(15); | ||
|
||
CHIP_ERROR err = | ||
Controller::detail::ReportAttribute<Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::DecodableType>( | ||
&ctx.GetExchangeManager(), kTestEndpointId, | ||
Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::GetClusterId(), | ||
Clusters::UnitTesting::Attributes::ListStructOctetString::TypeInfo::GetAttributeId(), std::move(params), | ||
dataVersion); | ||
|
||
NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); | ||
} | ||
|
||
// There are too many messages and the test (gcc_debug, which includes many sanity checks) will be quite slow. Note: report | ||
// engine is using ScheduleWork which cannot be handled by DrainAndServiceIO correctly. | ||
ctx.GetIOContext().DriveIOUntil(System::Clock::Seconds16(30), [&]() { | ||
ctx.GetIOContext().DriveIOUntil(System::Clock::Seconds16(60), [&]() { | ||
return numSubscriptionEstablishedCalls == (app::InteractionModelEngine::kReadHandlerPoolSize + 1) && | ||
numSuccessCalls == (app::InteractionModelEngine::kReadHandlerPoolSize + 1); | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ import("//build_overrides/nlunit_test.gni") | |
|
||
import("${chip_root}/build/chip/chip_test_suite.gni") | ||
import("${chip_root}/build/chip/fuzz_test.gni") | ||
import("${chip_root}/src/lib/core/core.gni") | ||
|
||
static_library("cert_test_vectors") { | ||
output_name = "libCertTestVectors" | ||
|
@@ -46,14 +47,20 @@ chip_test_suite("tests") { | |
test_sources = [ | ||
"TestCertificationDeclaration.cpp", | ||
"TestChipCert.cpp", | ||
"TestCommissionerDUTVectors.cpp", | ||
"TestDeviceAttestationConstruction.cpp", | ||
"TestDeviceAttestationCredentials.cpp", | ||
"TestFabricTable.cpp", | ||
"TestGroupDataProvider.cpp", | ||
"TestPersistentStorageOpCertStore.cpp", | ||
] | ||
|
||
if (!chip_config_memory_debug_dmalloc) { | ||
# We have many DUT vectors and dmalloc requires a lot of time to validate | ||
# heap operations for large crypto processing. Skip this test for | ||
# dmalloc. | ||
test_sources += [ "TestCommissionerDUTVectors.cpp" ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this change needed for a logging change? |
||
} | ||
|
||
cflags = [ "-Wconversion" ] | ||
|
||
public_deps = [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -765,10 +765,19 @@ void SessionAllocationTest(nlTestSuite * inSuite, void * inContext) | |
handle.Value()->AsSecureSession()->MarkForEviction(); | ||
} | ||
|
||
#if CHIP_CONFIG_MEMORY_DEBUG_DMALLOC | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed for a logging change? |
||
// DMalloc can be very slow to allocate/free crypto keys. Lower the amount | ||
// of iterations. | ||
constexpr uint32_t kAllocateTestLowerBound = UINT16_MAX - 100; | ||
#else | ||
constexpr uint32_t kAllocateTestLowerBound = 0; | ||
#endif | ||
constexpr uint32_t kAllocateTestHighBound = UINT16_MAX + 10; | ||
|
||
// Verify that we increment session ID by 1 for each allocation (except for | ||
// the wraparound case where we skip session ID 0), even when allocated | ||
// sessions are immediately freed. | ||
for (uint32_t i = 0; i < UINT16_MAX + 10; ++i) | ||
for (uint32_t i = kAllocateTestLowerBound; i < kAllocateTestHighBound; ++i) | ||
{ | ||
auto handle = sessionManager.AllocateSession( | ||
Transport::SecureSession::Type::kPASE, | ||
|
@@ -807,9 +816,18 @@ void SessionAllocationTest(nlTestSuite * inSuite, void * inContext) | |
NL_TEST_ASSERT(inSuite, sessionIds[h] != sessionIds[(h + 1) % numHandles]); | ||
} | ||
|
||
#if CHIP_CONFIG_MEMORY_DEBUG_DMALLOC | ||
// DMalloc can be very slow to allocate/free crypto keys. Lower the amount | ||
// of iterations. | ||
constexpr uint32_t kCollisionTestLowerBound = UINT16_MAX - 100; | ||
#else | ||
constexpr uint32_t kCollisionTestLowerBound = 0; | ||
#endif | ||
constexpr uint32_t kCollisionTestUpperBound = UINT16_MAX; | ||
|
||
// Allocate through the entire session ID space and verify that none of | ||
// these collide either. | ||
for (int j = 0; j < UINT16_MAX; ++j) | ||
for (uint32_t j = kCollisionTestLowerBound; j < kCollisionTestUpperBound; ++j) | ||
{ | ||
auto handle = sessionManager.AllocateSession( | ||
Transport::SecureSession::Type::kPASE, | ||
|
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.
Why is this change needed? Why are things fine without this change before but not fine after?