Skip to content

Commit

Permalink
Allow using symbolic error names in YAML. (project-chip#12340)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored Nov 30, 2021
1 parent b2f981e commit 677d87e
Show file tree
Hide file tree
Showing 40 changed files with 588 additions and 538 deletions.
44 changes: 22 additions & 22 deletions src/app/tests/suites/TestCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tests:
- label: "Send Test Not Handled Command"
command: "testNotHandled"
response:
error: 0x85 # INVALID_COMMAND
error: INVALID_COMMAND

- label: "Send Test Specific Command"
command: "testSpecific"
Expand Down Expand Up @@ -56,7 +56,7 @@ tests:
- name: "arg2"
value: 6
response:
error: 0x85 # INVALID_COMMAND
error: INVALID_COMMAND

# Tests for Boolean attribute

Expand Down Expand Up @@ -624,7 +624,7 @@ tests:
arguments:
value: "TestValueLongerThan10"
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute OCTET_STRING"
command: "readAttribute"
Expand Down Expand Up @@ -690,7 +690,7 @@ tests:
arguments:
value: "☉TestValueLongerThan10☉"
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute CHAR_STRING"
command: "readAttribute"
Expand Down Expand Up @@ -816,15 +816,15 @@ tests:
response:
# No such endpoint, so expect an error.
# SDK returning wrong error code here so far.
errorWrongValue: 0x7F # UNSUPPORTED_ENDPOINT
errorWrongValue: UNSUPPORTED_ENDPOINT

- label: "Send Test Command to unsupported cluster"
command: "test"
endpoint: 0
response:
# No TestCluster on that, so expect an error.
# SDK returning wrong error code here so far.
errorWrongValue: 0xC3 # UNSUPPORTED_CLUSTER
errorWrongValue: UNSUPPORTED_CLUSTER

# Tests for vendor id

Expand Down Expand Up @@ -1474,7 +1474,7 @@ tests:
arguments:
value: 255
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_BITMAP8 unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1514,7 +1514,7 @@ tests:
arguments:
value: 65535
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_BITMAP16 unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1554,7 +1554,7 @@ tests:
arguments:
value: 4294967295
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_BITMAP32 unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1594,7 +1594,7 @@ tests:
arguments:
value: "18446744073709551615"
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_BITMAP64 unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1634,7 +1634,7 @@ tests:
arguments:
value: 255
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_INT8U unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1674,7 +1674,7 @@ tests:
arguments:
value: 65535
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_INT16U unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1714,7 +1714,7 @@ tests:
arguments:
value: 4294967295
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_INT32U unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1754,7 +1754,7 @@ tests:
arguments:
value: "18446744073709551615"
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_INT64U unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1794,7 +1794,7 @@ tests:
arguments:
value: -128
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_INT8S unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1834,7 +1834,7 @@ tests:
arguments:
value: -32768
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_INT16S unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1874,7 +1874,7 @@ tests:
arguments:
value: -2147483648
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_INT32S unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1917,7 +1917,7 @@ tests:
# work around that.
value: "-9223372036854775807LL - 1"
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_INT64S unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1957,7 +1957,7 @@ tests:
arguments:
value: 255
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_ENUM8 unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -1997,7 +1997,7 @@ tests:
arguments:
value: 65535
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR

- label: "Read attribute NULLABLE_ENUM16 unchanged Value"
command: "readAttribute"
Expand Down Expand Up @@ -2111,12 +2111,12 @@ tests:
attribute: "list_int8u"
response:
# SDK returning wrong error code here so far.
errorWrongValue: 0x7F # UNSUPPORTED_ENDPOINT
errorWrongValue: UNSUPPORTED_ENDPOINT

- label: "Read attribute from nonexistent cluster."
endpoint: 0
command: "readAttribute"
attribute: "list_int8u"
response:
# SDK returning wrong error code here so far.
errorWrongValue: 0xC3 # UNSUPPORTED_CLUSTER
errorWrongValue: UNSUPPORTED_CLUSTER
2 changes: 0 additions & 2 deletions src/app/tests/suites/TestGroupsCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ tests:

- label: "Remove All"
command: "RemoveAllGroups"
response:
error: 0x00

- label: "View Group 1 (removed)"
command: "ViewGroup"
Expand Down
4 changes: 1 addition & 3 deletions src/app/tests/suites/TestModeSelectCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ tests:
values:
- name: "NewMode"
value: 4
response:
error: 0

- label: "Verify Current Mode Change"
command: "readAttribute"
Expand All @@ -80,4 +78,4 @@ tests:
- name: "NewMode"
value: 2
response:
error: 0x87 # CONSTRAINT_ERROR
error: CONSTRAINT_ERROR
2 changes: 1 addition & 1 deletion src/app/tests/suites/certification/Test_TC_BI_1_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tests:
arguments:
value: 1
response:
error: 0x88 # UNSUPPORTED_WRITE
error: UNSUPPORTED_WRITE

- label: "reads back global attribute: ClusterRevision"
command: "readAttribute"
Expand Down
6 changes: 3 additions & 3 deletions src/app/tests/suites/certification/Test_TC_BI_2_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ tests:
arguments:
value: 0
response:
error: 0x88 # UNSUPPORTED_WRITE
error: UNSUPPORTED_WRITE

- label: "Reads back the mandatory non-global attribute: StatusFlags"
command: "readAttribute"
Expand Down Expand Up @@ -214,7 +214,7 @@ tests:
arguments:
value: 0
response:
error: 0x88 # UNSUPPORTED_WRITE
error: UNSUPPORTED_WRITE

- label: "Reads back the optional non-global attribute: Polarity"
disabled: true
Expand Down Expand Up @@ -273,7 +273,7 @@ tests:
arguments:
value: 0
response:
error: 0x88 # UNSUPPORTED_WRITE
error: UNSUPPORTED_WRITE

- label: "Reads back the optional non-global attribute: ApplicationType"
disabled: true
Expand Down
2 changes: 1 addition & 1 deletion src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tests:
arguments:
value: 1
response:
error: 0x88 # UNSUPPORTED_WRITE
error: UNSUPPORTED_WRITE

- label: "reads back global attribute: ClusterRevision"
command: "readAttribute"
Expand Down
2 changes: 1 addition & 1 deletion src/app/tests/suites/certification/Test_TC_BOOL_2_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tests:
arguments:
value: 1
response:
error: 0x88 # UNSUPPORTED_WRITE
error: UNSUPPORTED_WRITE

- label: "Reads back the mandatory non-global attribute: StateValue"
command: "readAttribute"
Expand Down
4 changes: 2 additions & 2 deletions src/app/tests/suites/certification/Test_TC_CC_1_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tests:
arguments:
value: 4
response:
error: 0x88 # UNSUPPORTED_WRITE
error: UNSUPPORTED_WRITE

- label: "reads back global attribute: ClusterRevision"
disabled: true
Expand All @@ -57,7 +57,7 @@ tests:
arguments:
value: 0
response:
error: 0x88 # UNSUPPORTED_WRITE
error: UNSUPPORTED_WRITE

- label: "reads back optional global attribute: FeatureMap"
disabled: true
Expand Down
Loading

0 comments on commit 677d87e

Please sign in to comment.