diff --git a/src/app/EventLogging.h b/src/app/EventLogging.h index b2ce7667ab2364..f9fa56837f07e9 100644 --- a/src/app/EventLogging.h +++ b/src/app/EventLogging.h @@ -73,7 +73,7 @@ CHIP_ERROR LogEvent(const T & aEventData, EndpointId aEndpoint, EventNumber & aE eventOptions.mPriority = aEventData.GetPriorityLevel(); eventOptions.mFabricIndex = aEventData.GetFabricIndex(); // this skips logging the event if it's fabric-scoped but no fabric association exists yet. - VerifyOrReturnError(eventOptions.mFabricIndex != kUndefinedFabricIndex, CHIP_NO_ERROR); + VerifyOrReturnError(eventOptions.mFabricIndex != kUndefinedFabricIndex, CHIP_ERROR_INVALID_FABRIC_INDEX); // // Unlike attributes which have a different 'EncodeForRead' for fabric-scoped structs, diff --git a/src/controller/python/test/test_scripts/cluster_objects.py b/src/controller/python/test/test_scripts/cluster_objects.py index deae10c2cd6962..d86d25646ddd2f 100644 --- a/src/controller/python/test/test_scripts/cluster_objects.py +++ b/src/controller/python/test/test_scripts/cluster_objects.py @@ -335,11 +335,14 @@ async def TriggerAndWaitForEvents(cls, devCtrl, req): @base.test_case async def TestGenerateUndefinedFabricScopedEventRequests(cls, devCtrl): logger.info("Running TestGenerateUndefinedFabricScopedEventRequests") - await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestFabricScopedEventRequest(arg1=0)) + res = await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestFabricScopedEventRequest(arg1=0)) + logger.info(f"command return result is {res}") res = await devCtrl.ReadEvent(nodeid=NODE_ID, events=[ - (1, Clusters.TestCluster.Events.TestEvent, 0), + (1, Clusters.TestCluster.Events.TestFabricScopedEvent, 0), ]) logger.info(f"return result is {res}") + if until(res): + raise AssertionError("failure: not expect to reeive fabric-scoped event when fabric is undefined") @classmethod @base.test_case