From 1878441640e323b9a885ec897b8be40a989a92fc Mon Sep 17 00:00:00 2001 From: manjunathambiger23 Date: Fri, 3 Dec 2021 00:32:20 +0530 Subject: [PATCH] Modified YAML Test Scripts - Dec 1st (#12397) * Modified Test Scripts 1. TC-BI-1.1 2. TC-BOOL-1.1 3. TC-CC-1.1 4. TC-CC-4.2 5. TC-DIAGTH-1.1 6. TC-EMR-1.1 7. TC-FLW-1.1 8. TC-ILL-1.1 9. TC-LVL-1.1 10. TC-MC-1.1 11. TC-OCC-1.1 12. TC-OO-1.1 13. TC-PCC-1.1 14. TC-PRS-1.1 15. TC-RH-1.1 16. TC-TM-1.1 17. TC-TSTAT-1.1 18. TC-TSUIC-1.1 19. TC-WNCV-1.1 * Adding auto generated files --- .../suites/certification/Test_TC_BI_1_1.yaml | 56 + .../certification/Test_TC_BOOL_1_1.yaml | 56 + .../suites/certification/Test_TC_CC_1_1.yaml | 56 + .../suites/certification/Test_TC_CC_4_2.yaml | 87 ++ .../certification/Test_TC_DIAGTH_1_1.yaml | 56 + .../suites/certification/Test_TC_EMR_1_1.yaml | 56 + .../suites/certification/Test_TC_FLW_1_1.yaml | 57 + .../suites/certification/Test_TC_ILL_1_1.yaml | 56 + .../suites/certification/Test_TC_LVL_1_1.yaml | 57 + .../suites/certification/Test_TC_MC_1_1.yaml | 58 +- .../suites/certification/Test_TC_OCC_1_1.yaml | 57 + .../suites/certification/Test_TC_OO_1_1.yaml | 55 + .../suites/certification/Test_TC_PCC_1_1.yaml | 56 + .../suites/certification/Test_TC_PRS_1_1.yaml | 25 +- .../suites/certification/Test_TC_RH_1_1.yaml | 58 + .../suites/certification/Test_TC_TM_1_1.yaml | 57 + .../certification/Test_TC_TSTAT_1_1.yaml | 57 + .../certification/Test_TC_TSUIC_1_1.yaml | 57 + .../certification/Test_TC_WNCV_1_1.yaml | 41 + .../Framework/CHIPTests/CHIPClustersTests.m | 587 ++++++- .../chip-tool/zap-generated/test/Commands.h | 1386 ++++++++++++----- 21 files changed, 2596 insertions(+), 435 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_BI_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BI_1_1.yaml index 70b1ffd892af39..dafd409227e00a 100644 --- a/src/app/tests/suites/certification/Test_TC_BI_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BI_1_1.yaml @@ -29,6 +29,13 @@ tests: response: value: 1 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -44,3 +51,52 @@ tests: attribute: "ClusterRevision" response: value: 1 + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml index 1089f773962028..976f41915bc919 100644 --- a/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml @@ -29,6 +29,13 @@ tests: response: value: 1 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -44,3 +51,52 @@ tests: attribute: "ClusterRevision" response: value: 1 + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml index 82b2091501ba12..d350ae3990e901 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml @@ -30,6 +30,13 @@ tests: response: value: 4 + - label: "Read the global attribute constraints : ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -47,6 +54,47 @@ tests: response: value: 4 + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + - label: "read the optional global attribute: FeatureMap" disabled: true command: "readAttribute" @@ -54,6 +102,14 @@ tests: response: value: 0 + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 + - label: "write the default values to optional global attribute: FeatureMap" disabled: true command: "writeAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml index 3e7b8a8e2511a3..0c3809d0699420 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml @@ -78,6 +78,93 @@ tests: - name: "optionsOverride" value: 0 + - label: "Read CurrentSaturation attribute from DUT several times" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 0 + + - label: "Move saturation up command" + command: "MoveSaturation" + arguments: + values: + - name: "moveMode" + value: 1 + - name: "rate" + value: 5 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Read CurrentSaturation attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 0 + + - label: "Move saturation stop command" + command: "MoveSaturation" + arguments: + values: + - name: "moveMode" + value: 0 + - name: "rate" + value: 5 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Read CurrentSaturation attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 0 + + - label: "Move saturation down command" + command: "MoveSaturation" + arguments: + values: + - name: "moveMode" + value: 3 + - name: "rate" + value: 5 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Read CurrentSaturation attribute from DUT several times" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 0 + + - label: "Move saturation stop command" + command: "MoveSaturation" + arguments: + values: + - name: "moveMode" + value: 0 + - name: "rate" + value: 5 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Read CurrentSaturation attribute from DUT" + disabled: true + command: "readAttribute" + attribute: "current saturation" + response: + value: 0 + - label: "Turn off light that we turned on" cluster: "On/Off" command: "off" diff --git a/src/app/tests/suites/certification/Test_TC_DIAGTH_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DIAGTH_1_1.yaml index 6a9869cb127f13..d6af3992b7494d 100644 --- a/src/app/tests/suites/certification/Test_TC_DIAGTH_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DIAGTH_1_1.yaml @@ -29,6 +29,13 @@ tests: response: value: 1 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -45,6 +52,47 @@ tests: response: value: 1 + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + - label: "read the optional global attribute: FeatureMap" disabled: true command: "readAttribute" @@ -52,6 +100,14 @@ tests: response: value: 0 + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 + - label: "write the default values to optional global attribute: FeatureMap" disabled: true command: "writeAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_EMR_1_1.yaml b/src/app/tests/suites/certification/Test_TC_EMR_1_1.yaml index ade63388a88833..170c70b65e6cd7 100644 --- a/src/app/tests/suites/certification/Test_TC_EMR_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_EMR_1_1.yaml @@ -29,6 +29,13 @@ tests: response: value: 3 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -44,3 +51,52 @@ tests: attribute: "ClusterRevision" response: value: 3 + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml index 68118f2dca26b5..0192b71a15239d 100644 --- a/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml @@ -23,6 +23,7 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" + #issue #12190 as per spec default value is 3 but expecting 1 - label: "read the global attribute: ClusterRevision" command: "readAttribute" disabled: true @@ -30,6 +31,13 @@ tests: response: value: 2 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -46,3 +54,52 @@ tests: attribute: "ClusterRevision" response: value: 2 + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml index 4702b9c4cccf0e..bce51db4601b08 100644 --- a/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml @@ -29,6 +29,13 @@ tests: response: value: 2 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -44,3 +51,52 @@ tests: attribute: "ClusterRevision" response: value: 2 + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml index 4dfa43011ca16e..111317c8d9a82b 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml @@ -23,6 +23,7 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" + #issue #12190 as per spec default value is 5 but expecting 3 - label: "read the global attribute: ClusterRevision" disabled: true command: "readAttribute" @@ -30,6 +31,13 @@ tests: response: value: 4 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -47,6 +55,47 @@ tests: response: value: 4 + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + - label: "read the optional global attribute: FeatureMap" disabled: true command: "readAttribute" @@ -54,6 +103,14 @@ tests: response: value: 0 + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 + - label: "write the default values to optional global attribute: FeatureMap" disabled: true command: "writeAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml index 039e9834a7a3c9..03e9de6ef6cbe6 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml @@ -15,7 +15,7 @@ name: 15.1.1. [TC-MC-1.1] Global attributes with server as DUT config: - cluster: "Relative Humidity Measurement" + cluster: "Media Input" endpoint: 1 tests: @@ -30,6 +30,13 @@ tests: response: value: 1 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -47,6 +54,47 @@ tests: response: value: 1 + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + - label: "read the optional global attribute: FeatureMap" disabled: true command: "readAttribute" @@ -54,6 +102,14 @@ tests: response: value: 0 + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 + - label: "write the default values to optional global attribute: FeatureMap" disabled: true command: "writeAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml index 3fd6cd4e728c26..3df2b155ab4d2e 100644 --- a/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml @@ -23,12 +23,20 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" + #issue #12190 as per spec default value is 3 but expecting 2 - label: "read the global attribute: ClusterRevision" command: "readAttribute" attribute: "ClusterRevision" response: value: 2 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -45,3 +53,52 @@ tests: attribute: "ClusterRevision" response: value: 2 + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml index 0e9fac8680af70..dec3c9eb057196 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml @@ -33,6 +33,13 @@ tests: response: value: 4 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -49,12 +56,60 @@ tests: response: value: 4 + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + - label: "read the optional global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" response: value: 0 + - label: "Read the optional global attribute : FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 + - label: "write the default values to optional global attribute: FeatureMap" command: "writeAttribute" attribute: "FeatureMap" diff --git a/src/app/tests/suites/certification/Test_TC_PCC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PCC_1_1.yaml index 5d164d23b8a017..7732dbb19bc83b 100644 --- a/src/app/tests/suites/certification/Test_TC_PCC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PCC_1_1.yaml @@ -23,6 +23,7 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" + #issue #12190 as per spec default value is 3 but expecting 1 - label: "read the global attribute: ClusterRevision" disabled: true command: "readAttribute" @@ -30,6 +31,13 @@ tests: response: value: 3 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -47,6 +55,47 @@ tests: response: value: 1 + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + - label: "read the optional global attribute: FeatureMap" disabled: true command: "readAttribute" @@ -54,6 +103,13 @@ tests: response: value: 0 + - label: "read the optional global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 + - label: "write the default values to optional global attribute: FeatureMap" disabled: true command: "writeAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml index 64d3475f8ba7b5..093d1760b6049c 100644 --- a/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml @@ -23,11 +23,13 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" + #issue #12190 as per spec default value is 3 but expecting 2 - label: "Read the global attribute: ClusterRevision" + disabled: true command: "readAttribute" attribute: "ClusterRevision" response: - value: 2 + value: 3 - label: "Read the global attribute constraints: ClusterRevision" command: "readAttribute" @@ -42,15 +44,16 @@ tests: command: "writeAttribute" attribute: "ClusterRevision" arguments: - value: 2 + value: 3 response: error: UNSUPPORTED_WRITE - label: "Reads back global attribute: ClusterRevision" + disabled: true command: "readAttribute" attribute: "ClusterRevision" response: - value: 2 + value: 3 - label: "Read the mandatory global attribute: AttributeList" disabled: true @@ -147,6 +150,22 @@ tests: response: value: 0 + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + - label: "Read the optional global attribute: FeatureMap" disabled: true command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml index 6b6c1fdf54c50b..abdb31ab30773a 100644 --- a/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml @@ -23,6 +23,8 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" + #issue #12190 as per spec default value is 3 but expecting 2 + #refering default value of Water Content Measurement - label: "read the global attribute: ClusterRevision" disabled: true command: "readAttribute" @@ -30,6 +32,13 @@ tests: response: value: 1 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -47,6 +56,47 @@ tests: response: value: 1 + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + - label: "read the optional global attribute: FeatureMap" disabled: true command: "readAttribute" @@ -54,6 +104,14 @@ tests: response: value: 0 + - label: "Read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 + - label: "write the default values to optional global attribute: FeatureMap" disabled: true command: "writeAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_TM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TM_1_1.yaml index 451dd52777f662..177c8448577261 100644 --- a/src/app/tests/suites/certification/Test_TC_TM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TM_1_1.yaml @@ -23,12 +23,20 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" + #issue #12190 as per spec default value is 4 but expecting 3 - label: "read the global attribute: ClusterRevision" command: "readAttribute" attribute: "ClusterRevision" response: value: 3 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -44,3 +52,52 @@ tests: attribute: "ClusterRevision" response: value: 3 + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml index f19caa4ecd8b9d..077bd90cced592 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml @@ -23,6 +23,7 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" + #issue #12190 as per spec default value is 5 but expecting 3 - label: "read the global attribute: ClusterRevision" disabled: true command: "readAttribute" @@ -30,6 +31,13 @@ tests: response: value: 5 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -47,6 +55,48 @@ tests: response: value: 1 + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + #issue #12089 Value mismatch for FeatureMap attribute expecting 11 - label: "read the optional global attribute: FeatureMap" disabled: true command: "readAttribute" @@ -54,6 +104,13 @@ tests: response: value: 0 + - label: "Read the optional global attribute constraints: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 + - label: "write the default values to optional global attribute: FeatureMap" disabled: true command: "writeAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml index afb9e851aaeccd..70c0697d7da6a8 100644 --- a/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml @@ -23,6 +23,7 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" + #issue #12190 as per spec default value is 2 but expecting 1 - label: "read the global attribute: ClusterRevision" disabled: true command: "readAttribute" @@ -30,6 +31,13 @@ tests: response: value: 2 + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + - label: "write the default values to mandatory global attribute: ClusterRevision" @@ -47,6 +55,47 @@ tests: response: value: 1 + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + - label: "read the optional global attribute: FeatureMap" disabled: true command: "readAttribute" @@ -54,6 +103,14 @@ tests: response: value: 0 + - label: "Read the optional global attribute constraints: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 + - label: "write the default values to optional global attribute: FeatureMap" disabled: true command: "writeAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_1_1.yaml index c7279e812b4288..d5bac68efb56d1 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_1_1.yaml @@ -52,6 +52,47 @@ tests: type: uint16 notValue: 201 + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: AttributeList" + disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: CommandList" + disabled: true + command: "readAttribute" + attribute: "CommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + ### Attribute[0xFFFC]: FeatureMap ======================================= - label: "2: read the global attribute: FeatureMap" command: "readAttribute" diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index b676d9e2d68b39..ef8aefdf9c7a60 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -243,7 +243,26 @@ - (void)testSendClusterTest_TC_BI_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BI_1_1_000002_WriteAttribute +- (void)testSendClusterTest_TC_BI_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_BI_1_1_000003_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -266,7 +285,7 @@ - (void)testSendClusterTest_TC_BI_1_1_000002_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BI_1_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_BI_1_1_000004_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; @@ -791,7 +810,26 @@ - (void)testSendClusterTest_TC_BOOL_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BOOL_1_1_000002_WriteAttribute +- (void)testSendClusterTest_TC_BOOL_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_BOOL_1_1_000003_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -814,7 +852,7 @@ - (void)testSendClusterTest_TC_BOOL_1_1_000002_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BOOL_1_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_BOOL_1_1_000004_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; @@ -947,7 +985,26 @@ - (void)testSendClusterTest_TC_CC_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_CC_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints : ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_1_1_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -5088,7 +5145,107 @@ - (void)testSendClusterTest_TC_CC_4_2_000004_MoveSaturation [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_2_000005_Off +- (void)testSendClusterTest_TC_CC_4_2_000005_MoveSaturation +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation up command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation up command Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_2_000006_MoveSaturation +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation stop command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation stop command Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_2_000007_MoveSaturation +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation down command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:3]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation down command Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_2_000008_MoveSaturation +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move saturation stop command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation stop command Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_4_2_000009_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; @@ -5107,7 +5264,7 @@ - (void)testSendClusterTest_TC_CC_4_2_000005_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_4_2_000006_ReadAttribute +- (void)testSendClusterTest_TC_CC_4_2_000010_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; @@ -9377,7 +9534,26 @@ - (void)testSendClusterTest_TC_EMR_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_EMR_1_1_000002_WriteAttribute +- (void)testSendClusterTest_TC_EMR_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestElectricalMeasurement * cluster = [[CHIPTestElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_EMR_1_1_000003_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -9400,7 +9576,7 @@ - (void)testSendClusterTest_TC_EMR_1_1_000002_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_EMR_1_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_EMR_1_1_000004_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; @@ -9433,7 +9609,26 @@ - (void)testSendClusterTest_TC_FLW_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_FLW_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_FLW_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_FLW_1_1_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -9707,7 +9902,28 @@ - (void)testSendClusterTest_TC_ILL_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_ILL_1_1_000002_WriteAttribute +- (void)testSendClusterTest_TC_ILL_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_ILL_1_1_000003_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -9732,7 +9948,7 @@ - (void)testSendClusterTest_TC_ILL_1_1_000002_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_ILL_1_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_ILL_1_1_000004_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; @@ -9767,7 +9983,26 @@ - (void)testSendClusterTest_TC_LVL_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_LVL_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_LVL_1_1_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -10717,16 +10952,33 @@ - (void)testSendClusterTest_TC_MC_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_MC_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_MC_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_1_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); id clusterRevisionArgument; @@ -10902,7 +11154,26 @@ - (void)testSendClusterTest_TC_OCC_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OCC_1_1_000002_WriteAttribute +- (void)testSendClusterTest_TC_OCC_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OCC_1_1_000003_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -11245,7 +11516,26 @@ - (void)testSendClusterTest_TC_OO_1_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000003_WriteAttribute +- (void)testSendClusterTest_TC_OO_1_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OO_1_1_000004_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -11268,7 +11558,7 @@ - (void)testSendClusterTest_TC_OO_1_1_000003_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_OO_1_1_000005_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; @@ -11292,7 +11582,7 @@ - (void)testSendClusterTest_TC_OO_1_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000005_ReadAttribute +- (void)testSendClusterTest_TC_OO_1_1_000006_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"]; @@ -11316,7 +11606,26 @@ - (void)testSendClusterTest_TC_OO_1_1_000005_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000006_WriteAttribute +- (void)testSendClusterTest_TC_OO_1_1_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional global attribute : FeatureMap"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional global attribute : FeatureMap Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OO_1_1_000008_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to optional global attribute: FeatureMap"]; @@ -11338,7 +11647,7 @@ - (void)testSendClusterTest_TC_OO_1_1_000006_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OO_1_1_000007_ReadAttribute +- (void)testSendClusterTest_TC_OO_1_1_000009_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"reads back optional global attribute: FeatureMap"]; @@ -12990,30 +13299,6 @@ - (void)testSendClusterTest_TC_PRS_1_1_000000_WaitForCommissionee [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTest_TC_PRS_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 2U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_1_1_000002_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; @@ -13032,7 +13317,7 @@ - (void)testSendClusterTest_TC_PRS_1_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PRS_1_1_000003_WriteAttribute +- (void)testSendClusterTest_TC_PRS_1_1_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write the default values to mandatory global attribute: ClusterRevision"]; @@ -13043,7 +13328,7 @@ - (void)testSendClusterTest_TC_PRS_1_1_000003_WriteAttribute XCTAssertNotNil(cluster); id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:2U]; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; [cluster writeAttributeClusterRevisionWithValue:clusterRevisionArgument completionHandler:^(NSError * _Nullable err) { @@ -13055,30 +13340,6 @@ - (void)testSendClusterTest_TC_PRS_1_1_000003_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PRS_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 2U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - (void)testSendClusterTest_TC_PRS_2_1_000000_WaitForCommissionee { @@ -13297,7 +13558,28 @@ - (void)testSendClusterTest_TC_PCC_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_PCC_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_1_1_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -13322,6 +13604,27 @@ - (void)testSendClusterTest_TC_PCC_1_1_000001_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_PCC_1_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_PCC_2_1_000000_WaitForCommissionee { @@ -13651,7 +13954,28 @@ - (void)testSendClusterTest_TC_RH_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_RH_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_RH_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_RH_1_1_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -13818,7 +14142,28 @@ - (void)testSendClusterTest_TC_TM_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_1_1_000002_WriteAttribute +- (void)testSendClusterTest_TC_TM_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TM_1_1_000003_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -13843,7 +14188,7 @@ - (void)testSendClusterTest_TC_TM_1_1_000002_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TM_1_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_TM_1_1_000004_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; @@ -13959,7 +14304,26 @@ - (void)testSendClusterTest_TC_TSTAT_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSTAT_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_TSTAT_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSTAT_1_1_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -13982,6 +14346,26 @@ - (void)testSendClusterTest_TC_TSTAT_1_1_000001_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_TSTAT_1_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Read the optional global attribute constraints: FeatureMap"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional global attribute constraints: FeatureMap Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_TSTAT_2_1_000000_WaitForCommissionee { @@ -16736,7 +17120,27 @@ - (void)testSendClusterTest_TC_TSUIC_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_TSUIC_1_1_000001_WriteAttribute +- (void)testSendClusterTest_TC_TSUIC_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_1_1_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -17403,7 +17807,28 @@ - (void)testSendClusterTest_TC_DIAGTH_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DIAGTH_1_1_000002_WriteAttribute +- (void)testSendClusterTest_TC_DIAGTH_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DIAGTH_1_1_000003_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; @@ -17428,7 +17853,7 @@ - (void)testSendClusterTest_TC_DIAGTH_1_1_000002_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_DIAGTH_1_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_DIAGTH_1_1_000004_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 9d3e0dbe6406db..42522606504846 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -189,13 +189,17 @@ class Test_TC_BI_1_1 : public TestCommand err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); break; } @@ -208,7 +212,7 @@ class Test_TC_BI_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 5; static void OnFailureCallback_1(void * context, EmberAfStatus status) { @@ -225,16 +229,26 @@ class Test_TC_BI_1_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } static void OnFailureCallback_3(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); } - static void OnSuccessCallback_3(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_4(chip::to_underlying(status)); + } + + static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_3(clusterRevision); + (static_cast(context))->OnSuccessResponse_4(clusterRevision); } // @@ -266,7 +280,26 @@ class Test_TC_BI_1_1 : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::BinaryInputBasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; @@ -276,30 +309,30 @@ class Test_TC_BI_1_1 : public TestCommand clusterRevisionArgument = 1U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); + clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3); } - void OnFailureResponse_2(uint8_t status) + void OnFailureResponse_3(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_3() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BinaryInputBasicClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); return cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3); + this, OnSuccessCallback_4, OnFailureCallback_4); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t clusterRevision) + void OnSuccessResponse_4(uint16_t clusterRevision) { VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); @@ -1082,13 +1115,17 @@ class Test_TC_BOOL_1_1 : public TestCommand err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); break; } @@ -1101,7 +1138,7 @@ class Test_TC_BOOL_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 5; static void OnFailureCallback_1(void * context, EmberAfStatus status) { @@ -1118,16 +1155,26 @@ class Test_TC_BOOL_1_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } static void OnFailureCallback_3(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); } - static void OnSuccessCallback_3(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_4(chip::to_underlying(status)); + } + + static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_3(clusterRevision); + (static_cast(context))->OnSuccessResponse_4(clusterRevision); } // @@ -1159,7 +1206,26 @@ class Test_TC_BOOL_1_1 : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::BooleanStateClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BooleanStateClusterTest cluster; @@ -1169,30 +1235,30 @@ class Test_TC_BOOL_1_1 : public TestCommand clusterRevisionArgument = 1U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); + clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3); } - void OnFailureResponse_2(uint8_t status) + void OnFailureResponse_3(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_3() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::BooleanStateClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); return cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3); + this, OnSuccessCallback_4, OnFailureCallback_4); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t clusterRevision) + void OnSuccessResponse_4(uint16_t clusterRevision) { VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); @@ -1425,9 +1491,13 @@ class Test_TC_CC_1_1 : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints : ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); break; } @@ -1440,14 +1510,24 @@ class Test_TC_CC_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 3; static void OnFailureCallback_1(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_1(chip::to_underlying(status)); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } // // Tests methods @@ -1459,7 +1539,26 @@ class Test_TC_CC_1_1 : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ColorControlClusterTest cluster; @@ -1469,16 +1568,16 @@ class Test_TC_CC_1_1 : public TestCommand clusterRevisionArgument = 4U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_1, OnFailureCallback_1); + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); } - void OnFailureResponse_1(uint8_t status) + void OnFailureResponse_2(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_1() { ThrowSuccessResponse(); } + void OnSuccessResponse_2() { ThrowSuccessResponse(); } }; class Test_TC_CC_2_1 : public TestCommand @@ -7398,12 +7497,28 @@ class Test_TC_CC_4_2 : public TestCommand err = TestMoveSaturationDownCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Move saturation up command\n"); + err = TestMoveSaturationUpCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Move saturation stop command\n"); + err = TestMoveSaturationStopCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Move saturation down command\n"); + err = TestMoveSaturationDownCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Move saturation stop command\n"); + err = TestMoveSaturationStopCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); break; } @@ -7416,7 +7531,7 @@ class Test_TC_CC_4_2 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 11; static void OnFailureCallback_2(void * context, EmberAfStatus status) { @@ -7428,14 +7543,14 @@ class Test_TC_CC_4_2 : public TestCommand (static_cast(context))->OnSuccessResponse_2(onOff); } - static void OnFailureCallback_6(void * context, EmberAfStatus status) + static void OnFailureCallback_10(void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(chip::to_underlying(status)); + (static_cast(context))->OnFailureResponse_10(chip::to_underlying(status)); } - static void OnSuccessCallback_6(void * context, bool onOff) + static void OnSuccessCallback_10(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_6(onOff); + (static_cast(context))->OnSuccessResponse_10(onOff); } // @@ -7544,12 +7659,16 @@ class Test_TC_CC_4_2 : public TestCommand void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestMoveSaturationUpCommand_5() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; RequestType request; + request.moveMode = static_cast(1); + request.rate = 5; + request.optionsMask = 0; + request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { (static_cast(context))->OnSuccessResponse_5(); @@ -7567,57 +7686,161 @@ class Test_TC_CC_4_2 : public TestCommand void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestMoveSaturationStopCommand_6() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; - return cluster.ReadAttribute(this, OnSuccessCallback_6, - OnFailureCallback_6); + RequestType request; + request.moveMode = static_cast(0); + request.rate = 5; + request.optionsMask = 0; + request.optionsOverride = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_6(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_6(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; } void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6(bool onOff) + void OnSuccessResponse_6() { NextTest(); } + + CHIP_ERROR TestMoveSaturationDownCommand_7() { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; - NextTest(); + RequestType request; + request.moveMode = static_cast(3); + request.rate = 5; + request.optionsMask = 0; + request.optionsOverride = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_7(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_7(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; } -}; -class Test_TC_CC_4_3 : public TestCommand -{ -public: - Test_TC_CC_4_3() : TestCommand("Test_TC_CC_4_3"), mTestIndex(0) {} + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - /////////// TestCommand Interface ///////// - void NextTest() override + void OnSuccessResponse_7() { NextTest(); } + + CHIP_ERROR TestMoveSaturationStopCommand_8() { - CHIP_ERROR err = CHIP_NO_ERROR; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type; - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_3\n"); - } + RequestType request; + request.moveMode = static_cast(0); + request.rate = 5; + request.optionsMask = 0; + request.optionsOverride = 0; - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_8(); + }; - Wait(); + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_8(status); + }; - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_9() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_9(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_9(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute(this, OnSuccessCallback_10, + OnFailureCallback_10); + } + + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_10(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + + NextTest(); + } +}; + +class Test_TC_CC_4_3 : public TestCommand +{ +public: + Test_TC_CC_4_3() : TestCommand("Test_TC_CC_4_3"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_3\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; @@ -14276,13 +14499,17 @@ class Test_TC_EMR_1_1 : public TestCommand err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); break; } @@ -14295,7 +14522,7 @@ class Test_TC_EMR_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 5; static void OnFailureCallback_1(void * context, EmberAfStatus status) { @@ -14312,16 +14539,26 @@ class Test_TC_EMR_1_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } static void OnFailureCallback_3(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); } - static void OnSuccessCallback_3(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_4(chip::to_underlying(status)); + } + + static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_3(clusterRevision); + (static_cast(context))->OnSuccessResponse_4(clusterRevision); } // @@ -14353,7 +14590,26 @@ class Test_TC_EMR_1_1 : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::ElectricalMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ElectricalMeasurementClusterTest cluster; @@ -14363,30 +14619,30 @@ class Test_TC_EMR_1_1 : public TestCommand clusterRevisionArgument = 1U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); + clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3); } - void OnFailureResponse_2(uint8_t status) + void OnFailureResponse_3(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_3() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ElectricalMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); return cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3); + this, OnSuccessCallback_4, OnFailureCallback_4); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t clusterRevision) + void OnSuccessResponse_4(uint16_t clusterRevision) { VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); @@ -14429,9 +14685,13 @@ class Test_TC_FLW_1_1 : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); break; } @@ -14444,14 +14704,24 @@ class Test_TC_FLW_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 3; static void OnFailureCallback_1(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_1(chip::to_underlying(status)); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } // // Tests methods @@ -14463,7 +14733,26 @@ class Test_TC_FLW_1_1 : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::FlowMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::FlowMeasurementClusterTest cluster; @@ -14473,16 +14762,16 @@ class Test_TC_FLW_1_1 : public TestCommand clusterRevisionArgument = 2U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_1, OnFailureCallback_1); + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); } - void OnFailureResponse_1(uint8_t status) + void OnFailureResponse_2(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_1() { ThrowSuccessResponse(); } + void OnSuccessResponse_2() { ThrowSuccessResponse(); } }; class Test_TC_FLW_2_1 : public TestCommand @@ -14968,13 +15257,17 @@ class Test_TC_ILL_1_1 : public TestCommand err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); break; } @@ -14987,7 +15280,7 @@ class Test_TC_ILL_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 5; static void OnFailureCallback_1(void * context, EmberAfStatus status) { @@ -15004,16 +15297,26 @@ class Test_TC_ILL_1_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } static void OnFailureCallback_3(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); } - static void OnSuccessCallback_3(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, EmberAfStatus status) { - (static_cast(context))->OnSuccessResponse_3(clusterRevision); + (static_cast(context))->OnFailureResponse_4(chip::to_underlying(status)); + } + + static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_4(clusterRevision); } // @@ -15045,7 +15348,26 @@ class Test_TC_ILL_1_1 : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::IlluminanceMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::IlluminanceMeasurementClusterTest cluster; @@ -15055,30 +15377,30 @@ class Test_TC_ILL_1_1 : public TestCommand clusterRevisionArgument = 1U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); + clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3); } - void OnFailureResponse_2(uint8_t status) + void OnFailureResponse_3(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_3() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::IlluminanceMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); return cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3); + this, OnSuccessCallback_4, OnFailureCallback_4); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t clusterRevision) + void OnSuccessResponse_4(uint16_t clusterRevision) { VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); @@ -15121,9 +15443,13 @@ class Test_TC_LVL_1_1 : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); break; } @@ -15136,14 +15462,24 @@ class Test_TC_LVL_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 3; static void OnFailureCallback_1(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_1(chip::to_underlying(status)); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } // // Tests methods @@ -15155,26 +15491,45 @@ class Test_TC_LVL_1_1 : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::LevelControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 4U; - - return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_1, OnFailureCallback_1); + return cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1); } - void OnFailureResponse_1(uint8_t status) + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); } - void OnSuccessResponse_1() { ThrowSuccessResponse(); } + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::LevelControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint16_t clusterRevisionArgument; + clusterRevisionArgument = 4U; + + return cluster.WriteAttribute( + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); + } + + void OnFailureResponse_2(uint8_t status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + } + + void OnSuccessResponse_2() { ThrowSuccessResponse(); } }; class Test_TC_LVL_2_1 : public TestCommand @@ -16601,9 +16956,13 @@ class Test_TC_MC_1_1 : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); break; } @@ -16616,14 +16975,24 @@ class Test_TC_MC_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 3; static void OnFailureCallback_1(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_1(chip::to_underlying(status)); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } // // Tests methods @@ -16635,26 +17004,45 @@ class Test_TC_MC_1_1 : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + chip::Controller::MediaInputClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::MediaInputClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); uint16_t clusterRevisionArgument; clusterRevisionArgument = 1U; - return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_1, OnFailureCallback_1); + return cluster.WriteAttribute( + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); } - void OnFailureResponse_1(uint8_t status) + void OnFailureResponse_2(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_1() { ThrowSuccessResponse(); } + void OnSuccessResponse_2() { ThrowSuccessResponse(); } }; class Test_TC_MC_2_1 : public TestCommand @@ -17419,9 +17807,13 @@ class Test_TC_OCC_1_1 : public TestCommand err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); break; } @@ -17434,7 +17826,7 @@ class Test_TC_OCC_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 4; static void OnFailureCallback_1(void * context, EmberAfStatus status) { @@ -17451,7 +17843,17 @@ class Test_TC_OCC_1_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } // // Tests methods @@ -17482,7 +17884,26 @@ class Test_TC_OCC_1_1 : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::OccupancySensingClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OccupancySensingClusterTest cluster; @@ -17492,16 +17913,16 @@ class Test_TC_OCC_1_1 : public TestCommand clusterRevisionArgument = 2U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); + clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3); } - void OnFailureResponse_2(uint8_t status) + void OnFailureResponse_3(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_3() { ThrowSuccessResponse(); } }; class Test_TC_OCC_2_1 : public TestCommand @@ -18031,25 +18452,33 @@ class Test_TC_OO_1_1 : public TestCommand err = TestReadTheGlobalAttributeClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : write the default values to optional global attribute: FeatureMap\n"); - err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : reads back optional global attribute: FeatureMap\n"); - err = TestReadsBackOptionalGlobalAttributeFeatureMap_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional global attribute : FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : write the default values to optional global attribute: FeatureMap\n"); + err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : reads back optional global attribute: FeatureMap\n"); + err = TestReadsBackOptionalGlobalAttributeFeatureMap_9(); break; } @@ -18062,7 +18491,7 @@ class Test_TC_OO_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 10; static void OnFailureCallback_2(void * context, EmberAfStatus status) { @@ -18079,26 +18508,26 @@ class Test_TC_OO_1_1 : public TestCommand (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + static void OnSuccessCallback_3(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_3(clusterRevision); + } static void OnFailureCallback_4(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_4(chip::to_underlying(status)); } - static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_4(clusterRevision); - } + static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } static void OnFailureCallback_5(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_5(chip::to_underlying(status)); } - static void OnSuccessCallback_5(void * context, uint32_t featureMap) + static void OnSuccessCallback_5(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_5(featureMap); + (static_cast(context))->OnSuccessResponse_5(clusterRevision); } static void OnFailureCallback_6(void * context, EmberAfStatus status) @@ -18106,7 +18535,10 @@ class Test_TC_OO_1_1 : public TestCommand (static_cast(context))->OnFailureResponse_6(chip::to_underlying(status)); } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + static void OnSuccessCallback_6(void * context, uint32_t featureMap) + { + (static_cast(context))->OnSuccessResponse_6(featureMap); + } static void OnFailureCallback_7(void * context, EmberAfStatus status) { @@ -18118,6 +18550,23 @@ class Test_TC_OO_1_1 : public TestCommand (static_cast(context))->OnSuccessResponse_7(featureMap); } + static void OnFailureCallback_8(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_8(chip::to_underlying(status)); + } + + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + + static void OnFailureCallback_9(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_9(chip::to_underlying(status)); + } + + static void OnSuccessCallback_9(void * context, uint32_t featureMap) + { + (static_cast(context))->OnSuccessResponse_9(featureMap); + } + // // Tests methods // @@ -18153,7 +18602,26 @@ class Test_TC_OO_1_1 : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_3() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute(this, OnSuccessCallback_3, + OnFailureCallback_3); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; @@ -18163,56 +18631,75 @@ class Test_TC_OO_1_1 : public TestCommand clusterRevisionArgument = 3U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3); + clusterRevisionArgument, this, OnSuccessCallback_4, OnFailureCallback_4); } - void OnFailureResponse_3(uint8_t status) + void OnFailureResponse_4(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_3() { ThrowSuccessResponse(); } + void OnSuccessResponse_4() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_5() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - return cluster.ReadAttribute(this, OnSuccessCallback_4, - OnFailureCallback_4); + return cluster.ReadAttribute(this, OnSuccessCallback_5, + OnFailureCallback_5); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(uint16_t clusterRevision) + void OnSuccessResponse_5(uint16_t clusterRevision) { VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 4U)); NextTest(); } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_5() + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - return cluster.ReadAttribute(this, OnSuccessCallback_5, - OnFailureCallback_5); + return cluster.ReadAttribute(this, OnSuccessCallback_6, + OnFailureCallback_6); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(uint32_t featureMap) + void OnSuccessResponse_6(uint32_t featureMap) { VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_6() + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_7() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute(this, OnSuccessCallback_7, + OnFailureCallback_7); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(uint32_t featureMap) + { + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_8() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; @@ -18222,30 +18709,30 @@ class Test_TC_OO_1_1 : public TestCommand featureMapArgument = 0UL; return cluster.WriteAttribute( - featureMapArgument, this, OnSuccessCallback_6, OnFailureCallback_6); + featureMapArgument, this, OnSuccessCallback_8, OnFailureCallback_8); } - void OnFailureResponse_6(uint8_t status) + void OnFailureResponse_8(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_6() { ThrowSuccessResponse(); } + void OnSuccessResponse_8() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_7() + CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_9() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - return cluster.ReadAttribute(this, OnSuccessCallback_7, - OnFailureCallback_7); + return cluster.ReadAttribute(this, OnSuccessCallback_9, + OnFailureCallback_9); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(uint32_t featureMap) + void OnSuccessResponse_9(uint32_t featureMap) { VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); @@ -20652,21 +21139,13 @@ class Test_TC_PRS_1_1 : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); - break; - case 3: ChipLogProgress(chipTool, - " ***** Test Step 3 : Write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_4(); + " ***** Test Step 2 : Write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); break; } @@ -20679,7 +21158,7 @@ class Test_TC_PRS_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 3; static void OnFailureCallback_1(void * context, EmberAfStatus status) { @@ -20696,27 +21175,7 @@ class Test_TC_PRS_1_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); } - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(chip::to_underlying(status)); - } - - static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_4(clusterRevision); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } // // Tests methods @@ -20728,7 +21187,7 @@ class Test_TC_PRS_1_1 : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; @@ -20741,70 +21200,32 @@ class Test_TC_PRS_1_1 : public TestCommand void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } void OnSuccessResponse_1(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); - - NextTest(); - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - return cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2); - } - - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PressureMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); uint16_t clusterRevisionArgument; - clusterRevisionArgument = 2U; + clusterRevisionArgument = 3U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3); + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); } - void OnFailureResponse_3(uint8_t status) + void OnFailureResponse_2(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_3() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::PressureMeasurementClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - return cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4); - } - - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); - - NextTest(); - } + void OnSuccessResponse_2() { ThrowSuccessResponse(); } }; class Test_TC_PRS_2_1 : public TestCommand @@ -21194,9 +21615,17 @@ class Test_TC_PCC_1_1 : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_3(); break; } @@ -21209,14 +21638,34 @@ class Test_TC_PCC_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 4; static void OnFailureCallback_1(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_1(chip::to_underlying(status)); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); + } + + static void OnSuccessCallback_3(void * context, uint32_t featureMap) + { + (static_cast(context))->OnSuccessResponse_3(featureMap); + } // // Tests methods @@ -21228,7 +21677,26 @@ class Test_TC_PCC_1_1 : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -21237,17 +21705,36 @@ class Test_TC_PCC_1_1 : public TestCommand uint16_t clusterRevisionArgument; clusterRevisionArgument = 3U; - return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_1, OnFailureCallback_1); + return cluster.WriteAttribute( + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); + } + + void OnFailureResponse_2(uint8_t status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + } + + void OnSuccessResponse_2() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_3() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3); } - void OnFailureResponse_1(uint8_t status) + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint32_t featureMap) { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + NextTest(); } - - void OnSuccessResponse_1() { ThrowSuccessResponse(); } }; class Test_TC_PCC_2_1 : public TestCommand @@ -21871,9 +22358,13 @@ class Test_TC_RH_1_1 : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); break; } @@ -21886,14 +22377,24 @@ class Test_TC_RH_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 3; static void OnFailureCallback_1(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_1(chip::to_underlying(status)); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } // // Tests methods @@ -21905,7 +22406,26 @@ class Test_TC_RH_1_1 : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::RelativeHumidityMeasurementClusterTest cluster; @@ -21915,16 +22435,16 @@ class Test_TC_RH_1_1 : public TestCommand clusterRevisionArgument = 1U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_1, OnFailureCallback_1); + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); } - void OnFailureResponse_1(uint8_t status) + void OnFailureResponse_2(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_1() { ThrowSuccessResponse(); } + void OnSuccessResponse_2() { ThrowSuccessResponse(); } }; class Test_TC_RH_2_1 : public TestCommand @@ -22215,13 +22735,17 @@ class Test_TC_TM_1_1 : public TestCommand err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); break; } @@ -22234,7 +22758,7 @@ class Test_TC_TM_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 5; static void OnFailureCallback_1(void * context, EmberAfStatus status) { @@ -22251,16 +22775,26 @@ class Test_TC_TM_1_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } static void OnFailureCallback_3(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); } - static void OnSuccessCallback_3(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, EmberAfStatus status) { - (static_cast(context))->OnSuccessResponse_3(clusterRevision); + (static_cast(context))->OnFailureResponse_4(chip::to_underlying(status)); + } + + static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_4(clusterRevision); } // @@ -22292,7 +22826,26 @@ class Test_TC_TM_1_1 : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TemperatureMeasurementClusterTest cluster; @@ -22302,30 +22855,30 @@ class Test_TC_TM_1_1 : public TestCommand clusterRevisionArgument = 3U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); + clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3); } - void OnFailureResponse_2(uint8_t status) + void OnFailureResponse_3(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_3() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TemperatureMeasurementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); return cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3); + this, OnSuccessCallback_4, OnFailureCallback_4); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t clusterRevision) + void OnSuccessResponse_4(uint16_t clusterRevision) { VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 3U)); @@ -22583,9 +23136,17 @@ class Test_TC_TSTAT_1_1 : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the optional global attribute constraints: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_3(); break; } @@ -22598,14 +23159,34 @@ class Test_TC_TSTAT_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 4; static void OnFailureCallback_1(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_1(chip::to_underlying(status)); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); + } + + static void OnSuccessCallback_3(void * context, uint32_t featureMap) + { + (static_cast(context))->OnSuccessResponse_3(featureMap); + } // // Tests methods @@ -22617,7 +23198,26 @@ class Test_TC_TSTAT_1_1 : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatClusterTest cluster; @@ -22627,16 +23227,35 @@ class Test_TC_TSTAT_1_1 : public TestCommand clusterRevisionArgument = 5U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_1, OnFailureCallback_1); + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); } - void OnFailureResponse_1(uint8_t status) + void OnFailureResponse_2(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_1() { ThrowSuccessResponse(); } + void OnSuccessResponse_2() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_3() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::ThermostatClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute(this, OnSuccessCallback_3, + OnFailureCallback_3); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint32_t featureMap) + { + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + + NextTest(); + } }; class Test_TC_TSTAT_2_1 : public TestCommand @@ -26297,9 +26916,13 @@ class Test_TC_TSUIC_1_1 : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); break; } @@ -26312,14 +26935,24 @@ class Test_TC_TSUIC_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 3; static void OnFailureCallback_1(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_1(chip::to_underlying(status)); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } // // Tests methods @@ -26331,7 +26964,27 @@ class Test_TC_TSUIC_1_1 : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster + .ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; @@ -26342,16 +26995,16 @@ class Test_TC_TSUIC_1_1 : public TestCommand return cluster .WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_1, OnFailureCallback_1); + clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); } - void OnFailureResponse_1(uint8_t status) + void OnFailureResponse_2(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_1() { ThrowSuccessResponse(); } + void OnSuccessResponse_2() { ThrowSuccessResponse(); } }; class Test_TC_TSUIC_2_1 : public TestCommand @@ -27296,13 +27949,17 @@ class Test_TC_DIAGTH_1_1 : public TestCommand err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_3(); + ChipLogProgress(chipTool, + " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); break; } @@ -27315,7 +27972,7 @@ class Test_TC_DIAGTH_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 5; static void OnFailureCallback_1(void * context, EmberAfStatus status) { @@ -27332,16 +27989,26 @@ class Test_TC_DIAGTH_1_1 : public TestCommand (static_cast(context))->OnFailureResponse_2(chip::to_underlying(status)); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } static void OnFailureCallback_3(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_3(chip::to_underlying(status)); } - static void OnSuccessCallback_3(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_4(chip::to_underlying(status)); + } + + static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_3(clusterRevision); + (static_cast(context))->OnSuccessResponse_4(clusterRevision); } // @@ -27373,7 +28040,26 @@ class Test_TC_DIAGTH_1_1 : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; + chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + return cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; @@ -27383,30 +28069,30 @@ class Test_TC_DIAGTH_1_1 : public TestCommand clusterRevisionArgument = 1U; return cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_2, OnFailureCallback_2); + clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3); } - void OnFailureResponse_2(uint8_t status) + void OnFailureResponse_3(uint8_t status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); NextTest(); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } + void OnSuccessResponse_3() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::ThreadNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); return cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3); + this, OnSuccessCallback_4, OnFailureCallback_4); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t clusterRevision) + void OnSuccessResponse_4(uint16_t clusterRevision) { VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U));