diff --git a/examples/lighting-app/bouffalolab/bl602/BUILD.gn b/examples/lighting-app/bouffalolab/bl602/BUILD.gn index b9511c8d4408e9..b10c61a93dd9e2 100644 --- a/examples/lighting-app/bouffalolab/bl602/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl602/BUILD.gn @@ -196,7 +196,6 @@ bl602_executable("lighting_app") { sources += [ "${examples_plat_common_dir}/plat/OTAConfig.cpp" ] } - print(defines) ldscript = "${examples_plat_dir}/ldscripts/flash_rom.ld" ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 68aabd7463dda8..0a5ce254e1128a 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -47,7 +47,6 @@ template("chip_data_model") { # Assume that IDL name is the same as the zap file name, but instead of # '.zap' use '.matter' as extension. This is currently the case in the # sample apps, but may change in the future - print("AUTO-DETECTING input matter IDL file.") _idl = string_replace(invoker.zap_file, ".zap", ".matter") } diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index ddc3b7219b2834..778502ecbd2750 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -1731,7 +1731,7 @@ void TestReadInteraction::TestSubscribeAttributeTimeout(nlTestSuite * apSuite, v void TestReadInteraction::TestReadHandler_MultipleSubscriptions(nlTestSuite * apSuite, void * apContext) { TestContext & ctx = *static_cast(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( - &ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb, 0, 20, - onSubscriptionEstablishedCb, nullptr, false, true) == CHIP_NO_ERROR); + Controller::detail::ReportAttributeParams + 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( + &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 dataVersion(1); for (size_t i = 0; i < (app::InteractionModelEngine::kReadHandlerPoolSize + 1); i++) { - NL_TEST_ASSERT(apSuite, - Controller::SubscribeAttribute( - &ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb, 0, 10, - onSubscriptionEstablishedCb, nullptr, false, true, dataVersion) == CHIP_NO_ERROR); + Controller::detail::ReportAttributeParams + 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( + &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); }); diff --git a/src/credentials/tests/BUILD.gn b/src/credentials/tests/BUILD.gn index 041d26e20e3138..16b8a18e3c4360 100644 --- a/src/credentials/tests/BUILD.gn +++ b/src/credentials/tests/BUILD.gn @@ -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,7 +47,6 @@ chip_test_suite("tests") { test_sources = [ "TestCertificationDeclaration.cpp", "TestChipCert.cpp", - "TestCommissionerDUTVectors.cpp", "TestDeviceAttestationConstruction.cpp", "TestDeviceAttestationCredentials.cpp", "TestFabricTable.cpp", @@ -54,6 +54,13 @@ chip_test_suite("tests") { "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" ] + } + cflags = [ "-Wconversion" ] public_deps = [ diff --git a/src/transport/tests/TestSessionManager.cpp b/src/transport/tests/TestSessionManager.cpp index fcc4d7621b3af9..7be44016d9ea67 100644 --- a/src/transport/tests/TestSessionManager.cpp +++ b/src/transport/tests/TestSessionManager.cpp @@ -765,10 +765,19 @@ void SessionAllocationTest(nlTestSuite * inSuite, void * inContext) handle.Value()->AsSecureSession()->MarkForEviction(); } +#if CHIP_CONFIG_MEMORY_DEBUG_DMALLOC + // 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, diff --git a/third_party/nxp/k32w0_sdk/k32w0_sdk.gni b/third_party/nxp/k32w0_sdk/k32w0_sdk.gni index 0f48c70daffeaf..60f4b8da55cd16 100644 --- a/third_party/nxp/k32w0_sdk/k32w0_sdk.gni +++ b/third_party/nxp/k32w0_sdk/k32w0_sdk.gni @@ -114,10 +114,10 @@ template("k32w0_sdk") { chip_with_high_power = 0 } - print("device:", device) - print("board:", board) - print("ntag:", chip_with_ntag) - print("high power:", chip_with_high_power) + # print("device:", device) + # print("board:", board) + # print("ntag:", chip_with_ntag) + # print("high power:", chip_with_high_power) device_lowercase = string_replace(board, "dk6", "") sdk_target_name = target_name