From 82c8a0a5fc82a440e25037531580cb4053e059e6 Mon Sep 17 00:00:00 2001 From: kowsisoundhar12 <57476670+kowsisoundhar12@users.noreply.github.com> Date: Thu, 28 Apr 2022 06:11:11 +0530 Subject: [PATCH] Added User prompt scripts-Test_Added_Apr19 (#17523) * Added user promot scripts * Added Auto generated files * Restyled by whitespace * Restyled by prettier-yaml * PR comments addressed. * Restyled by prettier-yaml Co-authored-by: Restyled.io Co-authored-by: kvikrambhat --- src/app/tests/suites/certification/PICS.yaml | 3 + .../certification/Test_TC_BOOL_1_1.yaml | 44 +- .../suites/certification/Test_TC_CC_1_1.yaml | 77 +- .../suites/certification/Test_TC_FLW_1_1.yaml | 57 +- .../suites/certification/Test_TC_ILL_1_1.yaml | 46 +- .../suites/certification/Test_TC_I_1_1.yaml | 46 +- .../suites/certification/Test_TC_LVL_1_1.yaml | 73 +- .../suites/certification/Test_TC_OCC_1_1.yaml | 50 +- .../suites/certification/Test_TC_PRS_1_1.yaml | 167 +-- .../suites/certification/Test_TC_PS_1_1.yaml | 38 +- .../tests/suites/certification/ci-pics-values | 1 + .../Framework/CHIP/templates/tests/tests.js | 9 - .../Framework/CHIPTests/CHIPClustersTests.m | 975 +----------- .../zap-generated/test/Commands.h | 1327 +++++++++++++---- .../chip-tool/zap-generated/test/Commands.h | 815 ++++++++-- 15 files changed, 2068 insertions(+), 1660 deletions(-) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index ff16126e6c3998..872ccf446bbebd 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -312,3 +312,6 @@ PICS: - label: "Prompts user for input. Unable to run in CI" id: PICS_USER_PROMPT + + - label: "Skip sample app" + id: PICS_SKIP_SAMPLE_APP 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 22d0f995647186..af3e1c20f0905d 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 @@ -34,7 +34,7 @@ tests: response: value: 1 - - label: "Read the global attribute constraints: ClusterRevision" + - label: "Read the global attribute constraints : ClusterRevision" command: "readAttribute" attribute: "ClusterRevision" response: @@ -45,22 +45,31 @@ tests: command: "readAttribute" attribute: "AttributeList" response: + value: [0, 65528, 65529, 65531, 65533] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [] constraints: type: list @@ -68,5 +77,22 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list + + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates FeatureMap attribute has the value 0" + verification: | + ./chip-tool booleanstate read feature-map 1 1(Not implemented in SDK) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 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 3326292a2c1b93..90985a2acaffce 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 @@ -29,11 +29,10 @@ tests: value: nodeId - label: "read the global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: - value: 4 + value: 5 - label: "Read the global attribute constraints : ClusterRevision" command: "readAttribute" @@ -48,16 +47,15 @@ tests: command: "writeAttribute" attribute: "ClusterRevision" arguments: - value: 4 + value: 5 response: error: UNSUPPORTED_WRITE - label: "reads back global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: - value: 4 + value: 5 - label: "Read the global attribute: AttributeList" command: "readAttribute" @@ -66,17 +64,23 @@ tests: constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -84,41 +88,24 @@ tests: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: constraints: type: list - #Disabled due to issue #13442 - - label: "read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - 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" - attribute: "FeatureMap" + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates FeatureMap attribute has the value 0" + verification: | + Not implemented in SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 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 e359a19fe3ca0c..4f9a0b86f9dd61 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 @@ -28,13 +28,11 @@ tests: - name: "nodeId" value: nodeId - #issue #12190 as per spec default value is 3 but expecting 1 - label: "read the global attribute: ClusterRevision" command: "readAttribute" - disabled: true attribute: "ClusterRevision" response: - value: 2 + value: 3 - label: "Read the global attribute constraints: ClusterRevision" command: "readAttribute" @@ -49,16 +47,15 @@ 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 global attribute: AttributeList" command: "readAttribute" @@ -67,17 +64,23 @@ tests: constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -85,18 +88,24 @@ tests: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: constraints: type: list - #Disabled due to issue #13442 - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates FeatureMap attribute has the value 0" + verification: | + Not implemented in SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 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 50544be9e7a145..cf007bb4226457 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 @@ -28,15 +28,13 @@ tests: - name: "nodeId" value: nodeId - #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: 3 - - label: "Read the global attribute constraints: ClusterRevision" + - label: "Read the global attribute constraints : ClusterRevision" command: "readAttribute" attribute: "ClusterRevision" response: @@ -47,22 +45,31 @@ tests: command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 2, 3, 4, 65528, 65529, 65531, 65533] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [] constraints: type: list @@ -70,5 +77,22 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list + + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates FeatureMap attribute has the value 0" + verification: | + Not implemented in SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml index 36de49ee4fac4b..f0928b6c2d9e01 100644 --- a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml @@ -28,15 +28,13 @@ tests: - name: "nodeId" value: nodeId - #issue #12190 as per spec default value is 4 but expecting 2 - label: "TH reads the ClusterRevision attribute from the DUT" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: value: 4 - - label: "Reads constraints of ClusterRevision attribute" + - label: "Read the global attribute constraints : ClusterRevision" command: "readAttribute" attribute: "ClusterRevision" response: @@ -47,6 +45,7 @@ tests: command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 65528, 65529, 65531, 65533] constraints: type: list @@ -54,6 +53,7 @@ tests: command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [0, 1, 64] constraints: type: list @@ -61,14 +61,38 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [0] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response indicates FeatureMap attribute has the value 0" + verification: | + Not implemented in SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 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 5a12491b2ef7fb..3d0fba4fa0fa2b 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 @@ -34,56 +34,43 @@ tests: response: value: 5 - - label: "Read the global attribute constraints: ClusterRevision" + - 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" - command: "writeAttribute" - attribute: "ClusterRevision" - arguments: - value: 4 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back global attribute: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 5 - - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "AttributeList" response: + value: [0, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16384] constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: - constraints: - type: list - - - label: "Read the global attribute: GeneratedCommandList" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: + value: [0, 1, 2, 3, 4, 5, 6, 7] constraints: type: list @@ -92,25 +79,3 @@ tests: attribute: "FeatureMap" response: value: 3 - - - 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" - arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back optional global attribute: FeatureMap" - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 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 1d65733754c8cb..b10a243d0926e3 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 @@ -28,9 +28,7 @@ tests: - name: "nodeId" value: nodeId - #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: @@ -54,7 +52,6 @@ tests: error: UNSUPPORTED_WRITE - label: "reads back global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: @@ -67,17 +64,23 @@ tests: constraints: type: list - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + #issue #15011 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -85,17 +88,24 @@ tests: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: constraints: type: list - - label: "Read the optional global attribute : FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response" + verification: | + Not implemented in SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 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 cf4b51fcdbe449..797f90deeeba53 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 @@ -28,9 +28,7 @@ tests: - name: "nodeId" value: nodeId - #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: @@ -54,118 +52,89 @@ tests: error: UNSUPPORTED_WRITE - label: "Reads back global attribute: ClusterRevision" - disabled: true command: "readAttribute" attribute: "ClusterRevision" response: value: 3 - - label: "Read the mandatory global attribute: AttributeList" - disabled: true - command: "readAttribute" - attribute: "AttributeList" - response: - value: 0 - - - label: "Read the global attribute constraints: AttributeList" + - label: "Read the global mandatory attribute constraints: AttributeList" command: "readAttribute" attribute: "AttributeList" response: constraints: type: list + #issue #15011 - label: - "Write the default values to mandatory global attribute: AttributeList" - disabled: true - command: "writeAttribute" - attribute: "AttributeList" + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "Reads back mandatory global attribute: AttributeList" - disabled: true - command: "readAttribute" - attribute: "AttributeList" - response: - value: 0 - - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the mandatory global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - value: 0 - - - label: "Read the global attribute constraints: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Write the default values to mandatory global attribute: EventList" - disabled: true - command: "writeAttribute" - attribute: "EventList" + #issue #17484 + - label: + "Read AcceptedCommandList attribute from the DUT and Verify that the + DUT response" + verification: | + ./chip-tool pressuremeasurement read accepted-command-list 1 1 + + Verify response: + [1650367843.973086][4114:4119] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0403 Attribute 0x0000_FFF9 DataVersion: 2248280323 + [1650367843.973242][4114:4119] CHIP:TOO: AcceptedCommandList: 0 entries + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "Reads back mandatory global attribute: EventList" - disabled: true - command: "readAttribute" - attribute: "EventList" - response: - value: 0 - - - label: "Read the global attribute: AcceptedCommandList" - disabled: true - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - - - label: "Read the global attribute: GeneratedCommandList" - disabled: true - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - - - label: "Read the optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - - - label: "Read the optional global attribute constraints: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: map32 + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Write the default values to optional global attribute: FeatureMap" - disabled: true - command: "writeAttribute" - attribute: "FeatureMap" + - label: + "Read GeneratedCommandList attribute from the DUT and Verify that the + DUT response" + verification: | + ./chip-tool pressuremeasurement read generated-command-list 1 1 + + Verify response: + [1650367913.285053][4120:4125] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0403 Attribute 0x0000_FFF8 DataVersion: 2248280323 + [1650367913.285193][4120:4125] CHIP:TOO: GeneratedCommandList: 0 entries + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Reads back optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 + #issue #17483 + - label: + "Read FeatureMap attribute from the DUT and Verify that the DUT + response" + verification: | + ./chip-tool pressuremeasurement read feature-map 1 1 + Verify response: + cluster id: 0x0403 + Attribute: 0xFFFC + PressureMeasurement.FeatureMap response: 0 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter '0' for success" + - name: "expectedValue" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml index bcb6f0990f6b8e..7272dfde8e463e 100644 --- a/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml @@ -34,26 +34,43 @@ tests: response: value: 1 - - label: "Read the global attribute: AttributeList" + - label: "Read the global attribute constraints: ClusterRevision" command: "readAttribute" - attribute: "AttributeList" + attribute: "ClusterRevision" response: constraints: - type: list + type: uint16 - #issue #11053 disabled steps below Global attributes missing from YAML framework - - label: "Read the global attribute: EventList" - disabled: true + - label: "Read the global attribute: AttributeList" + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "EventList" + attribute: "AttributeList" response: + value: [0, 1, 2, 5, 11, 12, 13, 14, 15, 16, 19, 26, 28, 25] constraints: type: list + #issue #11053 + - label: + "Read EventList attribute from the DUT and Verify that the DUT + response provides a list of supported events." + verification: | + Not implemented in chip-tool + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: + value: [] constraints: type: list @@ -61,5 +78,12 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: + value: [] constraints: type: list + + - label: "read the optional global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index e1fc672fc6f74a..b2560457a98292 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -83,3 +83,4 @@ RI_KEY=1 PH_KEY=1 PI_KEY=1 PICS_USER_PROMPT=0 +PICS_SKIP_SAMPLE_APP=0 diff --git a/src/darwin/Framework/CHIP/templates/tests/tests.js b/src/darwin/Framework/CHIP/templates/tests/tests.js index c2bc15fe291f1b..a05cbde60eae2d 100644 --- a/src/darwin/Framework/CHIP/templates/tests/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests/tests.js @@ -33,7 +33,6 @@ function getTests() ]; const BooleanState = [ - 'Test_TC_BOOL_1_1', 'Test_TC_BOOL_2_1', ]; @@ -42,7 +41,6 @@ function getTests() ]; const ColorControl = [ - 'Test_TC_CC_1_1', 'Test_TC_CC_2_1', 'Test_TC_CC_3_1', 'Test_TC_CC_3_2', @@ -94,7 +92,6 @@ function getTests() ]; const FlowMeasurement = [ - 'Test_TC_FLW_1_1', 'Test_TC_FLW_2_1', 'Test_TC_FLW_2_2', ]; @@ -104,24 +101,20 @@ function getTests() ]; const Identify = [ - 'Test_TC_I_1_1', 'Test_TC_I_2_1', 'Test_TC_I_2_3', ]; const IlluminanceMeasurement = [ - 'Test_TC_ILL_1_1', 'Test_TC_ILL_2_1', ]; const OccupancySensing = [ - 'Test_TC_OCC_1_1', 'Test_TC_OCC_2_1', 'Test_TC_OCC_2_2', ]; const LevelControl = [ - 'Test_TC_LVL_1_1', 'Test_TC_LVL_2_1', 'Test_TC_LVL_2_2', 'Test_TC_LVL_3_1', @@ -179,12 +172,10 @@ function getTests() ]; const PowerSource = [ - 'Test_TC_PS_1_1', 'Test_TC_PS_2_1', ]; const PressureMeasurement = [ - 'Test_TC_PRS_1_1', 'Test_TC_PRS_2_1', ]; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 1bdb545620108c..f1ba031228ddbd 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -2084,115 +2084,6 @@ - (void)testSendClusterTest_TC_BI_2_2_000008_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_BOOL_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BOOL_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: 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: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (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_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BOOL_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_BOOL_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_BOOL_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -2355,76 +2246,6 @@ - (void)testSendClusterTest_TC_BRAC_1_1_000005_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (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"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:4U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_CC_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -12970,76 +12791,6 @@ - (void)testSendClusterTest_TC_ETHDIAG_2_1_000000_WaitForCommissionee [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_FLW_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (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"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:2U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_FLW_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_FLW_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -13544,7 +13295,7 @@ - (void)testSendClusterTest_TC_GC_1_1_000005_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_I_1_1_000000_WaitForCommissionee +- (void)testSendClusterTest_TC_I_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -13552,17 +13303,17 @@ - (void)testSendClusterTest_TC_I_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue, 305414945); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_I_1_1_000001_ReadAttribute +- (void)testSendClusterTest_TC_I_2_1_000001_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of ClusterRevision attribute"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyTime attribute from the DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of ClusterRevision attribute Error: %@", err); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -13571,102 +13322,17 @@ - (void)testSendClusterTest_TC_I_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_I_1_1_000002_ReadAttribute +- (void)testSendClusterTest_TC_I_2_1_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyType attribute from the DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_I_2_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyTime attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_I_2_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyType attribute from the DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); + [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -14050,99 +13716,6 @@ - (void)testSendClusterTest_TC_I_2_3_000020_UserPrompt [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_ILL_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_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(); - 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_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_ILL_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -14221,291 +13794,51 @@ - (void)testSendClusterTest_TC_ILL_2_1_000002_ReadAttribute } - (void)testSendClusterTest_TC_ILL_2_1_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads Tolerance attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); - } - } - { - id actualValue = value; - if (actualValue != nil) { - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U); - } - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_ILL_2_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads LightSensorType attribute from DUT"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTest_TC_LVL_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: 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: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 5U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_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(); - 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_000003_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(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:4U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: 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(@"reads back global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 5U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000005_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000006_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000007_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000008_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the optional global attribute: FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl 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); - - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedIntValue], 3UL); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_LVL_1_1_000009_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the optional global attribute : FeatureMap"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl 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_LVL_1_1_000010_WriteAttribute -{ - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to optional global attribute: FeatureMap"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads Tolerance attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - id featureMapArgument; - featureMapArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2048U); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_LVL_1_1_000011_ReadAttribute +- (void)testSendClusterTest_TC_ILL_2_1_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back optional global attribute: FeatureMap"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads LightSensorType attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -18021,76 +17354,6 @@ - (void)testSendClusterTest_TC_MOD_1_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_OCC_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_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(); - 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_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(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_OCC_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_OCC_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -20134,96 +19397,6 @@ - (void)testSendClusterTest_TC_OO_2_3_000046_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PS_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_1_1_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource 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], 1U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_1_1_000002_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PS_1_1_000004_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_PS_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -20462,76 +19635,6 @@ - (void)testSendClusterTest_TC_PS_2_1_000009_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PRS_1_1_000000_WaitForCommissionee -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - - dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, 305414945); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_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(); - 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 constraints: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_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(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_PRS_1_1_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: AttributeList"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: AttributeList Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTest_TC_PRS_2_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index 9c3389089f74e6..d66d76477ebde2 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -2505,7 +2505,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: @@ -2513,12 +2513,32 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7(); break; } @@ -2535,7 +2555,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -2577,7 +2597,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -2599,6 +2619,16 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -2606,7 +2636,13 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -2617,6 +2653,11 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -2624,7 +2665,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestBooleanState * cluster = [[CHIPTestBooleanState alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -2635,12 +2676,23 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_BOOL_2_1 : public TestCommandBridge { @@ -2990,17 +3042,53 @@ class Test_TC_CC_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints : ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + 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 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_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; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_9(); break; } @@ -3017,7 +3105,7 @@ class Test_TC_CC_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -3030,7 +3118,29 @@ class Test_TC_CC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -3048,14 +3158,14 @@ class Test_TC_CC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:4U]; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:5U]; [cluster writeAttributeClusterRevisionWithValue:clusterRevisionArgument completionHandler:^(NSError * _Nullable err) { @@ -3069,7 +3179,29 @@ class Test_TC_CC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -3086,6 +3218,54 @@ class Test_TC_CC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_9() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_CC_2_1 : public TestCommandBridge { @@ -16551,17 +16731,53 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + 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 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_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; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_9(); break; } @@ -16578,7 +16794,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -16591,7 +16807,29 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -16609,14 +16847,14 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:2U]; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; [cluster writeAttributeClusterRevisionWithValue:clusterRevisionArgument completionHandler:^(NSError * _Nullable err) { @@ -16630,27 +16868,97 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_FLW_2_1 : public TestCommandBridge { -public: + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestFlowMeasurement * cluster = [[CHIPTestFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_9() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLW_2_1 : public TestCommandBridge { +public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced Test_TC_FLW_2_1() : TestCommandBridge("Test_TC_FLW_2_1") @@ -17416,20 +17724,44 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7(); break; } @@ -17446,7 +17778,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -17459,7 +17791,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device @@ -17468,7 +17800,31 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -17479,7 +17835,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device @@ -17492,6 +17848,20 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(9))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -17499,7 +17869,13 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_3() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device @@ -17512,6 +17888,11 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -17519,7 +17900,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIlluminanceMeasurement * cluster = [[CHIPTestIlluminanceMeasurement alloc] initWithDevice:device @@ -17532,12 +17913,23 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_ILL_2_1 : public TestCommandBridge { @@ -17771,20 +18163,44 @@ class Test_TC_I_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads constraints of ClusterRevision attribute\n"); - err = TestReadsConstraintsOfClusterRevisionAttribute_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); + err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap " + "attribute has the value 0\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7(); break; } @@ -17801,7 +18217,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -17814,14 +18230,36 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfClusterRevisionAttribute_1() + CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of ClusterRevision attribute Error: %@", err); + NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -17832,7 +18270,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -17843,6 +18281,17 @@ class Test_TC_I_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -17850,7 +18299,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_3() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -17861,6 +18310,14 @@ class Test_TC_I_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 64UL)); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -17868,7 +18325,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -17879,12 +18336,30 @@ class Test_TC_I_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponseIndicatesFeatureMapAttributeHasTheValue0_7() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_I_2_1 : public TestCommandBridge { @@ -18529,45 +19004,34 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + 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(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional global attribute : FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : write the default values to optional global attribute: FeatureMap\n"); - err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : reads back optional global attribute: FeatureMap\n"); - err = TestReadsBackOptionalGlobalAttributeFeatureMap_11(); + ChipLogProgress(chipTool, " ***** Test Step 6 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_6(); break; } @@ -18577,95 +19041,34 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { } } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:4U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 7; - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -18680,131 +19083,114 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints : ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(14))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 10UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 16384UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_7() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); - NextTest(); - }]; - + UserPrompt(@"Please enter 'y' for success", @"y"); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_8() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 3UL)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(8))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 4UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 6UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 7UL)); } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_9() + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional global attribute : FeatureMap Error: %@", err); + NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_10() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id featureMapArgument; - featureMapArgument = [NSNumber numberWithUnsignedInt:0UL]; - [cluster writeAttributeFeatureMapWithValue:featureMapArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to optional global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_11() - { - CHIPDevice * device = GetConnectedDevice(); - CHIPTestLevelControl * cluster = [[CHIPTestLevelControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back optional global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 3UL)); + } - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; @@ -25415,17 +25801,52 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + 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 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_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; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9(); break; } @@ -25440,22 +25861,113 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id clusterRevisionArgument; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device @@ -25463,19 +25975,25 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() { CHIPDevice * device = GetConnectedDevice(); CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device @@ -25483,22 +26001,19 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() { CHIPDevice * device = GetConnectedDevice(); CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device @@ -25506,17 +26021,23 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_OCC_2_1 : public TestCommandBridge { @@ -28351,16 +28872,38 @@ class Test_TC_PS_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_7(); break; } @@ -28377,7 +28920,7 @@ class Test_TC_PS_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -28412,7 +28955,25 @@ class Test_TC_PS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -28423,6 +28984,25 @@ class Test_TC_PS_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(14))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 5UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 11UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 12UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 13UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 14UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 15UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 16UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 19UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 26UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 28UL)); + VerifyOrReturn(CheckValue("", actualValue[13], 25UL)); + } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; @@ -28430,7 +29010,13 @@ class Test_TC_PS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_3() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_4() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -28441,6 +29027,11 @@ class Test_TC_PS_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; @@ -28448,7 +29039,7 @@ class Test_TC_PS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -28459,12 +29050,39 @@ class Test_TC_PS_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_PS_2_1 : public TestCommandBridge { @@ -28807,17 +29425,62 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + 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 : Read the global attribute constraints: AttributeList\n"); - err = TestReadTheGlobalAttributeConstraintsAttributeList_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; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global mandatory attribute constraints: AttributeList\n"); + err = TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read AcceptedCommandList attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Read GeneratedCommandList attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9(); break; } @@ -28834,7 +29497,7 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -28847,7 +29510,31 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device @@ -28867,7 +29554,7 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device @@ -28890,7 +29577,31 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsAttributeList_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device @@ -28899,7 +29610,7 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: AttributeList Error: %@", err); + NSLog(@"Read the global mandatory attribute constraints: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -28909,6 +29620,30 @@ class Test_TC_PRS_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8() + { + UserPrompt(@"Please enter 'y' for success", @"y"); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9() + { + UserPrompt(@"Please enter '0' for success", @"0"); + return CHIP_NO_ERROR; + } }; class Test_TC_PRS_2_1 : public TestCommandBridge { diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index f3b50b8207868e..f8817ac66e4116 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -1871,7 +1871,7 @@ class Test_TC_BI_2_2Suite : public TestCommand class Test_TC_BOOL_1_1Suite : public TestCommand { public: - Test_TC_BOOL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_1_1", 6, credsIssuerConfig) + Test_TC_BOOL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_1_1", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -1929,25 +1929,55 @@ class Test_TC_BOOL_1_1Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 5)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 5: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -1973,7 +2003,7 @@ class Test_TC_BOOL_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute constraints: ClusterRevision"); + LogStep(2, "Read the global attribute constraints : ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::ClusterRevision::Id); } case 3: { @@ -1981,15 +2011,30 @@ class Test_TC_BOOL_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::AttributeList::Id); } case 4: { - LogStep(4, "Read the global attribute: AcceptedCommandList"); + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::AcceptedCommandList::Id); } - case 5: { - LogStep(5, "Read the global attribute: GeneratedCommandList"); + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::GeneratedCommandList::Id); } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap attribute has " + "the value 0"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -2216,7 +2261,7 @@ class Test_TC_BRAC_1_1Suite : public TestCommand class Test_TC_CC_1_1Suite : public TestCommand { public: - Test_TC_CC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_1_1", 4, credsIssuerConfig) + Test_TC_CC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_1_1", 10, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -2258,13 +2303,29 @@ class Test_TC_CC_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 5U)); } break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 5U)); + } + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -2272,6 +2333,30 @@ class Test_TC_CC_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -2293,20 +2378,53 @@ class Test_TC_CC_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints : ClusterRevision"); + LogStep(1, "read the global attribute: ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "write the default values to mandatory global attribute: ClusterRevision"); + LogStep(2, "Read the global attribute constraints : ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ClusterRevision::Id); + } + case 3: { + LogStep(3, "write the default values to mandatory global attribute: ClusterRevision"); uint16_t value; - value = 4U; + value = 5U; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ClusterRevision::Id, value); } - case 3: { - LogStep(3, "Read the global attribute: AttributeList"); + case 4: { + LogStep(4, "reads back global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ClusterRevision::Id); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::AttributeList::Id); } + case 6: { + LogStep(6, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::AcceptedCommandList::Id); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::GeneratedCommandList::Id); + } + case 9: { + LogStep(9, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap attribute has " + "the value 0"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -9357,7 +9475,7 @@ class Test_TC_ETHDIAG_2_1Suite : public TestCommand class Test_TC_FLW_1_1Suite : public TestCommand { public: - Test_TC_FLW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_1_1", 4, credsIssuerConfig) + Test_TC_FLW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_1_1", 10, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -9399,13 +9517,29 @@ class Test_TC_FLW_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); } break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + } + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -9413,6 +9547,30 @@ class Test_TC_FLW_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -9434,22 +9592,57 @@ class Test_TC_FLW_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); + LogStep(1, "read the global attribute: ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, FlowMeasurement::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "write the default values to mandatory global attribute: ClusterRevision"); + LogStep(2, "Read the global attribute constraints: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::ClusterRevision::Id); + } + case 3: { + LogStep(3, "write the default values to mandatory global attribute: ClusterRevision"); uint16_t value; - value = 2U; + value = 3U; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, FlowMeasurement::Attributes::ClusterRevision::Id, value); } - case 3: { - LogStep(3, "Read the global attribute: AttributeList"); + case 4: { + LogStep(4, "reads back global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::ClusterRevision::Id); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, FlowMeasurement::Attributes::AttributeList::Id); } + case 6: { + LogStep(6, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::AcceptedCommandList::Id); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FlowMeasurement::Id, + FlowMeasurement::Attributes::GeneratedCommandList::Id); + } + case 9: { + LogStep(9, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap attribute has " + "the value 0"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -9914,7 +10107,7 @@ class Test_TC_GC_1_1Suite : public TestCommand class Test_TC_I_1_1Suite : public TestCommand { public: - Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 5, credsIssuerConfig) + Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -9956,33 +10149,81 @@ class Test_TC_I_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 4U)); } break; case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } + break; + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 6)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 3: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 64UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 3)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 4: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -10004,21 +10245,40 @@ class Test_TC_I_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Reads constraints of ClusterRevision attribute"); + LogStep(1, "TH reads the ClusterRevision attribute from the DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AttributeList::Id); + LogStep(2, "Read the global attribute constraints : ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::ClusterRevision::Id); } case 3: { - LogStep(3, "Read the global attribute: AcceptedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id); + LogStep(3, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AttributeList::Id); } case 4: { - LogStep(4, "Read the global attribute: GeneratedCommandList"); + LogStep(4, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id); + } + case 5: { + LogStep(5, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::GeneratedCommandList::Id); } + case 6: { + LogStep(6, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap attribute has " + "the value 0"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -10393,7 +10653,7 @@ class Test_TC_I_2_3Suite : public TestCommand class Test_TC_ILL_1_1Suite : public TestCommand { public: - Test_TC_ILL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_1_1", 5, credsIssuerConfig) + Test_TC_ILL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ILL_1_1", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -10435,33 +10695,79 @@ class Test_TC_ILL_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 9)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -10483,25 +10789,45 @@ class Test_TC_ILL_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); + LogStep(1, "read the global attribute: ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, IlluminanceMeasurement::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute: AttributeList"); + LogStep(2, "Read the global attribute constraints : ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, - IlluminanceMeasurement::Attributes::AttributeList::Id); + IlluminanceMeasurement::Attributes::ClusterRevision::Id); } case 3: { - LogStep(3, "Read the global attribute: AcceptedCommandList"); + LogStep(3, "Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, - IlluminanceMeasurement::Attributes::AcceptedCommandList::Id); + IlluminanceMeasurement::Attributes::AttributeList::Id); } case 4: { - LogStep(4, "Read the global attribute: GeneratedCommandList"); + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, + IlluminanceMeasurement::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IlluminanceMeasurement::Id, IlluminanceMeasurement::Attributes::GeneratedCommandList::Id); } + case 7: { + LogStep(7, + "Read FeatureMap attribute from the DUT and Verify that the DUT response indicates FeatureMap attribute has " + "the value 0"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -10633,7 +10959,7 @@ class Test_TC_ILL_2_1Suite : public TestCommand class Test_TC_LVL_1_1Suite : public TestCommand { public: - Test_TC_LVL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_1_1", 12, credsIssuerConfig) + Test_TC_LVL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_1_1", 7, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -10687,41 +11013,78 @@ class Test_TC_LVL_1_1Suite : public TestCommand } break; case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("clusterRevision", value, 5U)); - } - break; - case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 10UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 11UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 9)); + VerifyOrReturn(CheckValue("attributeList[9]", iter_0.GetValue(), 12UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 10)); + VerifyOrReturn(CheckValue("attributeList[10]", iter_0.GetValue(), 13UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 11)); + VerifyOrReturn(CheckValue("attributeList[11]", iter_0.GetValue(), 14UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 12)); + VerifyOrReturn(CheckValue("attributeList[12]", iter_0.GetValue(), 15UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 13)); + VerifyOrReturn(CheckValue("attributeList[13]", iter_0.GetValue(), 16384UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 14)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 6: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "list")); - } + shouldContinue = true; break; - case 7: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); + VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); + VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 3)); + VerifyOrReturn(CheckValue("acceptedCommandList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 4)); + VerifyOrReturn(CheckValue("acceptedCommandList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 5)); + VerifyOrReturn(CheckValue("acceptedCommandList[5]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 6)); + VerifyOrReturn(CheckValue("acceptedCommandList[6]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 7)); + VerifyOrReturn(CheckValue("acceptedCommandList[7]", iter_0.GetValue(), 7UL)); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 8)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 8: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -10729,25 +11092,6 @@ class Test_TC_LVL_1_1Suite : public TestCommand VerifyOrReturn(CheckValue("featureMap", value, 3UL)); } break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint32_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "map32")); - } - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint32_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "map32")); - } - break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -10773,51 +11117,28 @@ class Test_TC_LVL_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute constraints: ClusterRevision"); + LogStep(2, "Read the global attribute constraints : ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::ClusterRevision::Id); } case 3: { - LogStep(3, "write the default values to mandatory global attribute: ClusterRevision"); - uint16_t value; - value = 4U; - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::ClusterRevision::Id, - value); + LogStep(3, "Read the global attribute: AttributeList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id); } case 4: { - LogStep(4, "reads back global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::ClusterRevision::Id); + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); } case 5: { - LogStep(5, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AttributeList::Id); - } - case 6: { - LogStep(6, "Read the global attribute: AcceptedCommandList"); + LogStep(5, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::AcceptedCommandList::Id); } - case 7: { - LogStep(7, "Read the global attribute: GeneratedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, - LevelControl::Attributes::GeneratedCommandList::Id); - } - case 8: { - LogStep(8, "read the optional global attribute: FeatureMap"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id); - } - case 9: { - LogStep(9, "Read the optional global attribute : FeatureMap"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id); - } - case 10: { - LogStep(10, "write the default values to optional global attribute: FeatureMap"); - uint32_t value; - value = 0UL; - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id, - value); - } - case 11: { - LogStep(11, "reads back optional global attribute: FeatureMap"); + case 6: { + LogStep(6, "read the optional global attribute: FeatureMap"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::FeatureMap::Id); } } @@ -16841,7 +17162,7 @@ class Test_TC_MF_1_15Suite : public TestCommand class Test_TC_OCC_1_1Suite : public TestCommand { public: - Test_TC_OCC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_1_1", 4, credsIssuerConfig) + Test_TC_OCC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_1_1", 10, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -16883,13 +17204,29 @@ class Test_TC_OCC_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); } break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + } + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -16897,6 +17234,30 @@ class Test_TC_OCC_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -16918,22 +17279,55 @@ class Test_TC_OCC_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); + LogStep(1, "read the global attribute: ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "write the default values to mandatory global attribute: ClusterRevision"); + LogStep(2, "Read the global attribute constraints: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::ClusterRevision::Id); + } + case 3: { + LogStep(3, "write the default values to mandatory global attribute: ClusterRevision"); uint16_t value; value = 3U; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::ClusterRevision::Id, value); } - case 3: { - LogStep(3, "Read the global attribute: AttributeList"); + case 4: { + LogStep(4, "reads back global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::ClusterRevision::Id); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, OccupancySensing::Attributes::AttributeList::Id); } + case 6: { + LogStep(6, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::AcceptedCommandList::Id); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OccupancySensing::Id, + OccupancySensing::Attributes::GeneratedCommandList::Id); + } + case 9: { + LogStep(9, "Read FeatureMap attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; } @@ -18708,7 +19102,7 @@ class Test_TC_OO_2_4Suite : public TestCommand class Test_TC_PS_1_1Suite : public TestCommand { public: - Test_TC_PS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_1_1", 5, credsIssuerConfig) + Test_TC_PS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_1_1", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -18754,29 +19148,89 @@ class Test_TC_PS_1_1Suite : public TestCommand } break; case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } + break; + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 11UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 12UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 13UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 14UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 15UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 9)); + VerifyOrReturn(CheckValue("attributeList[9]", iter_0.GetValue(), 16UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 10)); + VerifyOrReturn(CheckValue("attributeList[10]", iter_0.GetValue(), 19UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 11)); + VerifyOrReturn(CheckValue("attributeList[11]", iter_0.GetValue(), 26UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 12)); + VerifyOrReturn(CheckValue("attributeList[12]", iter_0.GetValue(), 28UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 13)); + VerifyOrReturn(CheckValue("attributeList[13]", iter_0.GetValue(), 25UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 14)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 3: + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 4: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -18802,18 +19256,34 @@ class Test_TC_PS_1_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AttributeList::Id); + LogStep(2, "Read the global attribute constraints: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::ClusterRevision::Id); } case 3: { - LogStep(3, "Read the global attribute: AcceptedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AcceptedCommandList::Id); + LogStep(3, "Read the global attribute: AttributeList"); + VerifyOrdo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AttributeList::Id); } case 4: { - LogStep(4, "Read the global attribute: GeneratedCommandList"); + LogStep(4, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 5: { + LogStep(5, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::AcceptedCommandList::Id); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::GeneratedCommandList::Id); } + case 7: { + LogStep(7, "read the optional global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::FeatureMap::Id); + } } return CHIP_NO_ERROR; } @@ -19005,7 +19475,7 @@ class Test_TC_PS_2_1Suite : public TestCommand class Test_TC_PRS_1_1Suite : public TestCommand { public: - Test_TC_PRS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_1_1", 4, credsIssuerConfig) + Test_TC_PRS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_1_1", 10, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -19047,13 +19517,29 @@ class Test_TC_PRS_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); } break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + } + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -19061,6 +19547,22 @@ class Test_TC_PRS_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -19082,22 +19584,57 @@ class Test_TC_PRS_1_1Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } case 1: { - LogStep(1, "Read the global attribute constraints: ClusterRevision"); + LogStep(1, "Read the global attribute: ClusterRevision"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, PressureMeasurement::Attributes::ClusterRevision::Id); } case 2: { - LogStep(2, "Write the default values to mandatory global attribute: ClusterRevision"); + LogStep(2, "Read the global attribute constraints: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::ClusterRevision::Id); + } + case 3: { + LogStep(3, "Write the default values to mandatory global attribute: ClusterRevision"); uint16_t value; value = 3U; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, PressureMeasurement::Attributes::ClusterRevision::Id, value); } - case 3: { - LogStep(3, "Read the global attribute constraints: AttributeList"); + case 4: { + LogStep(4, "Reads back global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, + PressureMeasurement::Attributes::ClusterRevision::Id); + } + case 5: { + LogStep(5, "Read the global mandatory attribute constraints: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PressureMeasurement::Id, PressureMeasurement::Attributes::AttributeList::Id); } + case 6: { + LogStep(6, + "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 7: { + LogStep(7, "Read AcceptedCommandList attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 8: { + LogStep(8, "Read GeneratedCommandList attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter 'y' for success", "y"); + } + case 9: { + LogStep(9, "Read FeatureMap attribute from the DUT and Verify that the DUT response"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + SetIdentity(kIdentityAlpha); + return UserPrompt("Please enter '0' for success", "0"); + } } return CHIP_NO_ERROR; }