Skip to content

Commit 54c1141

Browse files
doublemis1austina-csa
authored andcommittedJul 10, 2024
chip-repl runner: support missing features needed to yaml tests (project-chip#34130)
* 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 b20e72d commit 54c1141

File tree

2 files changed

+10
-41
lines changed

2 files changed

+10
-41
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-8
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,11 @@
3131
from chip.exceptions import ChipStackError
3232
from chip.yaml.data_model_lookup import DataModelLookup
3333
from chip.yaml.errors import ActionCreationError, UnexpectedActionCreationError
34-
from matter_yamltests.pseudo_clusters.clusters.delay_commands import DelayCommands
35-
from matter_yamltests.pseudo_clusters.clusters.log_commands import LogCommands
36-
from matter_yamltests.pseudo_clusters.clusters.system_commands import SystemCommands
37-
from matter_yamltests.pseudo_clusters.pseudo_clusters import PseudoClusters
34+
from matter_yamltests.pseudo_clusters.pseudo_clusters import get_default_pseudo_clusters
3835

3936
from .data_model_lookup import PreDefinedDataModelLookup
4037

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

4441

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

131128
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)
129+
response = await _PSEUDO_CLUSTERS.execute(self._test_step)
130+
return _ActionResult(status=_ActionStatus.SUCCESS, response=response[0])
134131

135132

136133
class InvokeAction(BaseAction):
@@ -884,8 +881,12 @@ def decode(self, result: _ActionResult):
884881
response = result.response
885882

886883
decoded_response = {}
884+
if isinstance(response, dict):
885+
return response
886+
887887
if isinstance(response, chip.interaction_model.InteractionModelError):
888888
decoded_response['error'] = stringcase.snakecase(response.status.name).upper()
889+
decoded_response['clusterError'] = response.clusterStatus
889890
return decoded_response
890891

891892
if isinstance(response, chip.interaction_model.Status):
@@ -939,12 +940,13 @@ def decode(self, result: _ActionResult):
939940
cluster_id = event.Header.ClusterId
940941
cluster_name = self._test_spec_definition.get_cluster_name(cluster_id)
941942
event_id = event.Header.EventId
943+
event_number = event.Header.EventNumber
942944
event_name = self._test_spec_definition.get_event_name(cluster_id, event_id)
943945
event_definition = self._test_spec_definition.get_event_by_name(cluster_name, event_name)
944946
is_fabric_scoped = bool(event_definition.is_fabric_sensitive)
945947
decoded_event = Converter.from_data_model_to_test_definition(
946948
self._test_spec_definition, cluster_name, event_definition.fields, event.Data, is_fabric_scoped)
947-
decoded_response.append({'value': decoded_event})
949+
decoded_response.append({'value': decoded_event, 'eventNumber': event_number})
948950
return decoded_response
949951

950952
if isinstance(response, ChipStackError):

0 commit comments

Comments
 (0)