Skip to content

Commit

Permalink
[matter_yamltests] Allow endpoint, cluster, command, attribute, event…
Browse files Browse the repository at this point in the history
… to use a variable
  • Loading branch information
vivien-apple committed May 19, 2023
1 parent e75e729 commit 2b79d33
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
10 changes: 10 additions & 0 deletions scripts/py_matter_yamltests/matter_yamltests/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,16 @@ def __init__(self, test: _TestStepWithPlaceholders, step_index: int, runtime_con
self._test.run_if)
self._test.event_number = self._config_variable_substitution(
self._test.event_number)
self._test.cluster = self._config_variable_substitution(
self._test.cluster)
self._test.command = self._config_variable_substitution(
self._test.command)
self._test.attribute = self._config_variable_substitution(
self._test.attribute)
self._test.event = self._config_variable_substitution(
self._test.event)
self._test.endpoint = self._config_variable_substitution(
self._test.endpoint)
test.update_arguments(self.arguments)
test.update_responses(self.responses)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __check_test_step(self, content):
'nodeId': int,
'runIf': str, # Should be a variable.
'groupId': int,
'endpoint': int,
'endpoint': (int, str), # Can be a variable
'cluster': str,
'attribute': str,
'command': str,
Expand Down
16 changes: 8 additions & 8 deletions src/app/tests/suites/certification/Test_TC_DGETH_2_2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,35 +136,35 @@ tests:
command: "readAttribute"
attribute: "PacketRxCount"
response:
saveAs: PacketRxCount
saveAs: PacketRxCountValue

- label: "TH reads PacketTxCount attribute value from DUT"
PICS: DGETH.S.A0003
command: "readAttribute"
attribute: "PacketTxCount"
response:
saveAs: PacketTxCount
saveAs: PacketTxCountValue

- label: "TH reads TxErrCount attribute value from DUT"
PICS: DGETH.S.A0004
command: "readAttribute"
attribute: "TxErrCount"
response:
saveAs: TxErrCount
saveAs: TxErrCountValue

- label: "TH reads CollisionCount attribute value from DUT"
PICS: DGETH.S.A0005
command: "readAttribute"
attribute: "CollisionCount"
response:
saveAs: CollisionCount
saveAs: CollisionCountValue

- label: "TH reads OverrunCount attribute value from DUT"
PICS: DGETH.S.A0006
command: "readAttribute"
attribute: "OverrunCount"
response:
saveAs: OverrunCount
saveAs: OverrunCountValue

#issue #13648
- label: "Sends ResetCounts command"
Expand Down Expand Up @@ -215,20 +215,20 @@ tests:
attribute: "TxErrCount"
response:
constraints:
maxValue: TxErrCount
maxValue: TxErrCountValue

- label: "TH reads CollisionCount attribute value from DUT"
PICS: DGETH.S.A0005
command: "readAttribute"
attribute: "CollisionCount"
response:
constraints:
maxValue: CollisionCount
maxValue: CollisionCountValue

- label: "TH reads OverrunCount attribute value from DUT"
PICS: DGETH.S.A0006
command: "readAttribute"
attribute: "OverrunCount"
response:
constraints:
maxValue: OverrunCount
maxValue: OverrunCountValue

0 comments on commit 2b79d33

Please sign in to comment.