Skip to content

Commit 9c67086

Browse files
committed
support host test mode, align to chip-tool
1 parent 411482b commit 9c67086

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/controller/python/chip/clusters/attribute.cpp

+15-4
Original file line numberDiff line numberDiff line change
@@ -577,11 +577,22 @@ PyChipError pychip_ReadClient_Read(void * appContext, ReadClient ** pReadClient,
577577
params.mKeepSubscriptions = pyParams.keepSubscriptions;
578578
callback->SetAutoResubscribe(pyParams.autoResubscribe);
579579

580-
dataVersionFilters.release();
581-
attributePaths.release();
582-
eventPaths.release();
580+
#if CONFIG_BUILD_FOR_HOST_UNIT_TEST
581+
if (!pyParams.autoResubscribe)
582+
{
583+
// We want to allow certain kinds of spec-invalid subscriptions so we
584+
// can test how the server reacts to them.
585+
err = readClient->SendSubscribeRequestWithoutValidation(params);
586+
}
587+
else
588+
#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST
589+
{
590+
dataVersionFilters.release();
591+
attributePaths.release();
592+
eventPaths.release();
583593

584-
err = readClient->SendAutoResubscribeRequest(std::move(params));
594+
err = readClient->SendAutoResubscribeRequest(std::move(params));
595+
}
585596
SuccessOrExit(err);
586597
}
587598
else

0 commit comments

Comments
 (0)