Skip to content

Commit 7155335

Browse files
committed
chip-repl runner: support missing features needed to yaml tests
* Add support to capture and use eventNumber parameter from read event response (needed for e.g. ACL-2.6) * Add support for current implemented pseduo cluster - most crucial EqualityCommands (needed for e.g. DGGEN-2.3) * Add possibility to gather cluster-specific error in InteractionDataModelError (needed for e.g. DRLK-2.8) Signed-off-by: Michał Szablowski <michal.szablowski@nordicsemi.no>
1 parent d71a363 commit 7155335

File tree

2 files changed

+10
-38
lines changed

2 files changed

+10
-38
lines changed

scripts/tests/chiptest/__init__.py

-33
Original file line numberDiff line numberDiff line change
@@ -226,50 +226,17 @@ def _GetChipReplUnsupportedTests() -> Set[str]:
226226
return {
227227
"Test_AddNewFabricFromExistingFabric.yaml", # chip-repl does not support GetCommissionerRootCertificate and IssueNocChain command
228228
"Test_TC_OPCREDS_3_7.yaml", # chip-repl does not support GetCommissionerRootCertificate and IssueNocChain command
229-
"TestEqualities.yaml", # chip-repl does not support pseudo-cluster commands that return a value
230229
"TestExampleCluster.yaml", # chip-repl does not load custom pseudo clusters
231230
"TestAttributesById.yaml", # chip-repl does not support AnyCommands (06/06/2023)
232231
"TestCommandsById.yaml", # chip-repl does not support AnyCommands (06/06/2023)
233232
"TestEventsById.yaml", # chip-repl does not support AnyCommands (06/06/2023)
234233
"TestReadNoneSubscribeNone.yaml", # chip-repl does not support AnyCommands (07/27/2023)
235-
"Test_TC_DRLK_2_8.yaml", # Test fails only in chip-repl: Refer--> https://github.com/project-chip/connectedhomeip/pull/27011#issuecomment-1593339855
236-
"Test_TC_ACE_1_6.yaml", # Test fails only in chip-repl: Refer--> https://github.com/project-chip/connectedhomeip/pull/27910#issuecomment-1632485584
237234
"Test_TC_IDM_1_2.yaml", # chip-repl does not support AnyCommands (19/07/2023)
238-
"TestGroupKeyManagementCluster.yaml", # chip-repl does not support EqualityCommands (2023-08-04)
239235
"TestIcdManagementCluster.yaml", # TODO(#30430): add ICD registration support in chip-repl
240236
"Test_TC_ICDM_3_4.yaml", # chip-repl does not support ICD registration
241-
"Test_TC_S_2_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
242-
"Test_TC_MOD_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
243-
"Test_TC_MOD_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
244-
"Test_TC_MOD_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
245-
"Test_TC_MOD_3_4.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
246-
"Test_TC_BRBINFO_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
247-
"Test_TC_DGGEN_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
248-
"Test_TC_DGGEN_2_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
249-
"Test_TC_LWM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
250-
"Test_TC_LWM_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
251-
"Test_TC_LWM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
252-
"Test_TC_OTCCM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
253-
"Test_TC_OTCCM_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
254-
"Test_TC_OTCCM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
255-
"Test_TC_G_2_4.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
256-
"Test_TC_RVCRUNM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
257-
"Test_TC_RVCCLEANM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
258-
"Test_TC_TCCM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
259-
"Test_TC_TCCM_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
260-
"Test_TC_TCCM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
261-
"Test_TC_TCTL_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
262237
# chip-repl and chip-tool disagree on what the YAML here should look like: https://github.com/project-chip/connectedhomeip/issues/29110
263238
"TestClusterMultiFabric.yaml",
264-
"Test_TC_ACL_2_5.yaml", # chip-repl does not support LastReceivedEventNumber : https://github.com/project-chip/connectedhomeip/issues/28884
265-
"Test_TC_ACL_2_6.yaml", # chip-repl does not support LastReceivedEventNumber : https://github.com/project-chip/connectedhomeip/issues/28884
266-
"Test_TC_RVCCLEANM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
267-
"Test_TC_BINFO_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
268239
"TestDiagnosticLogs.yaml", # chip-repl does not implement a BDXTransferServerDelegate
269-
"Test_TC_EEVSEM_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
270-
"Test_TC_EEVSEM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
271-
"Test_TC_EEVSEM_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
272-
"Test_TC_EEVSEM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
273240
"TestDiagnosticLogsDownloadCommand.yaml", # chip-repl does not implement the bdx download command
274241
}
275242

src/controller/python/chip/yaml/runner.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
from matter_yamltests.pseudo_clusters.clusters.delay_commands import DelayCommands
3535
from matter_yamltests.pseudo_clusters.clusters.log_commands import LogCommands
3636
from matter_yamltests.pseudo_clusters.clusters.system_commands import SystemCommands
37-
from matter_yamltests.pseudo_clusters.pseudo_clusters import PseudoClusters
37+
from matter_yamltests.pseudo_clusters.pseudo_clusters import get_default_pseudo_clusters
3838

3939
from .data_model_lookup import PreDefinedDataModelLookup
4040

41-
_PSEUDO_CLUSTERS = PseudoClusters([DelayCommands(), LogCommands(), SystemCommands()])
41+
_PSEUDO_CLUSTERS = get_default_pseudo_clusters()
4242
logger = logging.getLogger('YamlParser')
4343

4444

@@ -129,8 +129,8 @@ def __init__(self, test_step):
129129
raise ActionCreationError(f'Default cluster {test_step.cluster} {test_step.command}, not supported')
130130

131131
async def run_action(self, dev_ctrl: ChipDeviceController) -> _ActionResult:
132-
_ = await _PSEUDO_CLUSTERS.execute(self._test_step)
133-
return _ActionResult(status=_ActionStatus.SUCCESS, response=None)
132+
response = await _PSEUDO_CLUSTERS.execute(self._test_step)
133+
return _ActionResult(status=_ActionStatus.SUCCESS, response=response[0])
134134

135135

136136
class InvokeAction(BaseAction):
@@ -884,8 +884,12 @@ def decode(self, result: _ActionResult):
884884
response = result.response
885885

886886
decoded_response = {}
887+
if isinstance(response, dict):
888+
return response
889+
887890
if isinstance(response, chip.interaction_model.InteractionModelError):
888891
decoded_response['error'] = stringcase.snakecase(response.status.name).upper()
892+
decoded_response['clusterError'] = response.clusterStatus
889893
return decoded_response
890894

891895
if isinstance(response, chip.interaction_model.Status):
@@ -939,12 +943,13 @@ def decode(self, result: _ActionResult):
939943
cluster_id = event.Header.ClusterId
940944
cluster_name = self._test_spec_definition.get_cluster_name(cluster_id)
941945
event_id = event.Header.EventId
946+
event_number = event.Header.EventNumber
942947
event_name = self._test_spec_definition.get_event_name(cluster_id, event_id)
943948
event_definition = self._test_spec_definition.get_event_by_name(cluster_name, event_name)
944949
is_fabric_scoped = bool(event_definition.is_fabric_sensitive)
945950
decoded_event = Converter.from_data_model_to_test_definition(
946951
self._test_spec_definition, cluster_name, event_definition.fields, event.Data, is_fabric_scoped)
947-
decoded_response.append({'value': decoded_event})
952+
decoded_response.append({'value': decoded_event, 'eventNumber': event_number})
948953
return decoded_response
949954

950955
if isinstance(response, ChipStackError):

0 commit comments

Comments
 (0)