diff --git a/examples/darwin-framework-tool/templates/tests/tests.js b/examples/darwin-framework-tool/templates/tests/tests.js index a0f19c7b187c7f..13c3a062d1c9ab 100644 --- a/examples/darwin-framework-tool/templates/tests/tests.js +++ b/examples/darwin-framework-tool/templates/tests/tests.js @@ -61,6 +61,15 @@ function getTests() { // work right in the darwin tests. tests.disable('Test_TC_CC_7_2'); + // TODO: Test_TC_CC_6_2 does not work on Darwin(no ble asan) for now. + tests.disable('Test_TC_CC_6_2'); + + // TODO: Test_TC_CC_6_3 does not work on Darwin(no ble asan) for now. + tests.disable('Test_TC_CC_6_3'); + + // TODO: Test_TC_CC_8_1 does not work on Darwin(no ble asan) for now. + tests.disable('Test_TC_CC_8_1'); + // TODO: Test_TC_CC_9_1 does not work on Darwin for now. // But is disabled in CI, so we can't disable it here. //tests.disable('Test_TC_CC_9_1'); diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index a5a2192ba532ea..f8c913f271fea4 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -592,7 +592,10 @@ PICS: attribute?" id: TSUIC.S.A0002 - # Software Diagnostics cluster + # Software Diagnostics cluster + - label: "The metrics for high watermark related to memory consumption." + id: DGSW.S.F00 + - label: "Does the device implement the SoftwareFault event?" id: DGSW.S.E00 @@ -3277,6 +3280,17 @@ PICS: - label: "Does the device implement the CarrierDetect attribute?" id: DGETH.S.A0008 + #Features + - label: + "Counts for the number of received and transmitted packets on the + ethernet interface" + id: DGETH.S.F00 + + - label: + "Counts for the number of errors during the reception and transmission + of packets on the ethernet interface." + id: DGETH.S.F01 + #Wi-Fi Network Diagnostics Cluster - label: "Counts for the number of received and transmitted packets on the @@ -3489,6 +3503,28 @@ PICS: id: PSCFG.S.A0000 #Thread Network Diagnostics Cluster + #Features + - label: + "Does the DUT(server) support the Server supports the counts for the + number of received and transmitted packets feature?" + id: DGTHREAD.S.F00 + + - label: + "Does the DUT(server) support the Server supports the counts for the + number of errors that have occurred during the reception and + transmission feature?" + id: DGTHREAD.S.F01 + + - label: + "Does the DUT(server) support the Server supports the counts for + various MLE layer happenings feature?" + id: DGTHREAD.S.F02 + + - label: + "Does the DUT(server) support the Server supports the counts for + various MAC layer happenings feature?" + id: DGTHREAD.S.F03 + #server attributes - label: "Does the DUT-server support the channel attribute?" id: DGTHREAD.S.A0000 diff --git a/src/app/tests/suites/certification/Test_TC_ACL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACL_1_1.yaml index 1ddb6c2d5d7cb1..95ac110e222ffa 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_1_1.yaml @@ -11,120 +11,77 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 132.1.1. [TC-ACL-1.1] Global attributes +name: 133.1.1. [TC-ACL-1.1] Global attributes PICS: - ACL.S config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Access Control" endpoint: 0 tests: - - label: "TH1 commissions DUT using admin node ID N1" - verification: | - verification step to be updated. - disabled: true - - - label: - "TH1 reads DUT Endpoint 0 AccessControl cluster ClusterRevision - attribute" - verification: | - ./chip-tool accesscontrol read cluster-revision 1 0 - - Verify Successfully" ClusterRevision " on the TH(Chip-tool) Log: - - [1656335651.726036][4621:4626] CHIP:DMG: SuppressResponse = true, - [1656335651.726074][4621:4626] CHIP:DMG: InteractionModelRevision = 1 - [1656335651.726109][4621:4626] CHIP:DMG: } - [1656335651.726296][4621:4626] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFD DataVersion: 2658161222 - [1656335651.726376][4621:4626] CHIP:TOO: ClusterRevision: 1 - [1656335651.726479][4621:4626] CHIP:EM: Sending Standalone Ack for MessageCounter:42748782 on exchange 27808i - disabled: true - - - label: - "TH1 reads DUT Endpoint 0 AccessControl cluster FeatureMap attribute" - verification: | - ./chip-tool accesscontrol read feature-map 1 0 - - Verify Successfully " FeatureMap attribute " on the TH(Chip-tool) Log: - - [1656335839.955385][4637:4642] CHIP:DMG: - [1656335839.955419][4637:4642] CHIP:DMG: SuppressResponse = true, - [1656335839.955453][4637:4642] CHIP:DMG: InteractionModelRevision = 1 - [1656335839.955485][4637:4642] CHIP:DMG: } - [1656335839.955653][4637:4642] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFC DataVersion: 2658161222 - [1656335839.955723][4637:4642] CHIP:TOO: FeatureMap: 0 - [1656335839.955817][4637:4642] CHIP:EM: Sending Standalone Ack for MessageCounter:69406683 on exchange 34373i - disabled: true - - - label: - "TH1 reads DUT Endpoint 0 AccessControl cluster AttributeList - attribute" - verification: | - ./chip-tool accesscontrol read attribute-list 1 0 - - Verify Successfully"AttributeList attribute " on the TH(Chip-tool) Log:. - - [1655960990.225266][2516:2521] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFB DataVersion: 477297741 - [1655960990.225364][2516:2521] CHIP:TOO: AttributeList: 10 entries - [1655960990.225406][2516:2521] CHIP:TOO: [1]: 0 - [1655960990.225441][2516:2521] CHIP:TOO: [2]: 1 - [1655960990.225474][2516:2521] CHIP:TOO: [3]: 2 - [1655960990.225507][2516:2521] CHIP:TOO: [4]: 3 - [1655960990.225540][2516:2521] CHIP:TOO: [5]: 4 - [1655960990.225575][2516:2521] CHIP:TOO: [6]: 65528 - [1655960990.225609][2516:2521] CHIP:TOO: [7]: 65529 - [1655960990.225643][2516:2521] CHIP:TOO: [8]: 65531 - [1655960990.225677][2516:2521] CHIP:TOO: [9]: 65532 - [1655960990.225710][2516:2521] CHIP:TOO: [10]: 65533 - disabled: true - - - label: - "TH1 reads DUT Endpoint 0 AccessControl cluster EventList attribute" - verification: | - Out of scope for V1.0 - disabled: true - - - label: - "TH1 reads DUT Endpoint 0 AccessControl cluster AcceptedCommandList - attribute" - verification: | - ./chip-tool accesscontrol read accepted-command-list 1 0 - Verify Successfully" AcceptedCommandList attribute " on the TH(Chip-tool) Log: - - [[1656478328.210742][2458:2463] CHIP:DMG: - [1656478328.210767][2458:2463] CHIP:DMG: ], - [1656478328.210799][2458:2463] CHIP:DMG: - [1656478328.210826][2458:2463] CHIP:DMG: SuppressResponse = true, - [1656478328.210853][2458:2463] CHIP:DMG: InteractionModelRevision = 1 - [1656478328.210877][2458:2463] CHIP:DMG: } - [1656478328.211032][2458:2463] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFF9 DataVersion: 3457122350 - [1656478328.211099][2458:2463] CHIP:TOO: AcceptedCommandList: 0 entries - [1656478328.211245][2458:2463] CHIP:EM: Sending Standalone Ack for MessageCounter:163659373 on exchange 15270i - [1656478328.211313][2458:2463] CHIP:IN: Prepared secure message 0xffff8a2e3958 to 0x0000000000000001 (1) of type 0x10 and protocolId (0, 0) on exchange 15270i with MessageCounter:229380798. - disabled: true - - - label: - "TH1 reads DUT Endpoint 0 AccessControl cluster GeneratedCommandList - attribute" - verification: | - ./chip-tool accesscontrol read generated-command-list 1 0 - - Verify Successfully" GeneratedCommandList attribute " on the TH(Chip-tool) Log: - - [[1656478396.324314][2467:2472] CHIP:DMG: - [1656478396.324346][2467:2472] CHIP:DMG: ], - [1656478396.324386][2467:2472] CHIP:DMG: - [1656478396.324419][2467:2472] CHIP:DMG: SuppressResponse = true, - [1656478396.324453][2467:2472] CHIP:DMG: InteractionModelRevision = 1 - [1656478396.324484][2467:2472] CHIP:DMG: } - [1656478396.324673][2467:2472] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFF8 DataVersion: 3457122350 - [1656478396.324752][2467:2472] CHIP:TOO: GeneratedCommandList: 0 entries - [1656478396.324843][2467:2472] CHIP:EM: Sending Standalone Ack for MessageCounter:73836177 on exchange 65471i - [1656478396.324920][2467:2472] CHIP:IN: Prepared secure message 0xffffab7ed958 to 0x0000000000000001 (1) of type 0x10 and protocolId (0, 0) on exchange 65471i with MessageCounter:243106706. - [1656478396.324967][2467:2472] CHIP:IN: Sending encrypted msg 0xffffab7ed958 with MessageCounter:243106706 t - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads ClusterRevision attribute from DUT" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + - label: "TH reads FeatureMap attribute from DUT" + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "TH reads AttributeList attribute from DUT" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533] + + - label: "TH reads AcceptedCommandList attribute from DUT" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads GeneratedCommandList attribute from DUT" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + #Commenting out the step EventList attribute which is out of scope for matter V1.0 + #- 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" diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_1.yaml index 2f857cc1365f20..26cb3b4cb2fa61 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_1.yaml @@ -20,171 +20,44 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Access Control" endpoint: 0 tests: - - label: "TH1 commissions DUT using admin node ID N1" - verification: | - verification step to be updated. - disabled: true - - - label: - "TH1 reads DUT Endpoint 0 AccessControl cluster - SubjectsPerAccessControlEntry attribute" + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads SubjectsPerAccessControlEntry attribute from DUT" PICS: ACL.S.A0002 - verification: | - ./chip-tool accesscontrol read subjects-per-access-control-entry 1 0 - On TH(Chiptool), verify with value 4 or greater as subjects-per-access-control-entry. - [1656409485.639551][2769:2774] CHIP:DMG: ], - [1656409485.639582][2769:2774] CHIP:DMG: - [1656409485.639608][2769:2774] CHIP:DMG: SuppressResponse = true, - [1656409485.639635][2769:2774] CHIP:DMG: InteractionModelRevision = 1 - [1656409485.639659][2769:2774] CHIP:DMG: } - [1656409485.639821][2769:2774] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0002 DataVersion: 317167335 - [1656409485.639880][2769:2774] CHIP:TOO: SubjectsPerAccessControlEntry: 4 - [1656409485.639957][2769:2774] CHIP:EM: Sending Standalone Ack for MessageCounter:137518483 on exchange 39758i - [1656409485.640080][2769:2774] CHIP:IN: Prepared secure message 0xffffaf7ed958 to 0x0000000000000001 (1) of type 0x10 and prot - disabled: true - - - label: - "TH1 reads DUT Endpoint 0 AccessControl cluster - TargetsPerAccessControlEntry attribute" + command: "readAttribute" + attribute: "SubjectsPerAccessControlEntry" + response: + constraints: + type: int16u + minValue: 4 + maxValue: 65535 + + - label: "TH reads TargetsPerAccessControlEntry attribute from DUT" PICS: ACL.S.A0003 - verification: | - ./chip-tool accesscontrol read targets-per-access-control-entry 1 0 - On TH(Chiptool), verify with value 3 or greater as Targets-per-access-control-entry. - - [1656409746.779627][2799:2804] CHIP:DMG: }, - [1656409746.779672][2799:2804] CHIP:DMG: - [1656409746.779707][2799:2804] CHIP:DMG: ], - [1656409746.779751][2799:2804] CHIP:DMG: - [1656409746.779788][2799:2804] CHIP:DMG: SuppressResponse = true, - [1656409746.779826][2799:2804] CHIP:DMG: InteractionModelRevision = 1 - [1656409746.779861][2799:2804] CHIP:DMG: } - [1656409746.780073][2799:2804] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0003 DataVersion: 262648338 - [1656409746.780156][2799:2804] CHIP:TOO: TargetsPerAccessControlEntry: 3 - [1656409746.780257][2799:2804] CHIP:EM: Sending Standalone Ack for MessageCounter:133466432 on exchange 34792i - disabled: true - - - label: - "TH1 reads DUT Endpoint 0 AccessControl cluster - AccessControlEntriesPerFabric attribute" - PICS: ACL.S.A0004 - verification: | - ./chip-tool accesscontrol read access-control-entries-per-fabric 1 0 - On TH(Chiptool), verify with value 3 or greater as AccessControlEntriesPerFabric. - - [1656409955.865361][2822:2827] CHIP:DMG: - [1656409955.865393][2822:2827] CHIP:DMG: ], - [1656409955.865431][2822:2827] CHIP:DMG: - [1656409955.865456][2822:2827] CHIP:DMG: SuppressResponse = true, - [1656409955.865481][2822:2827] CHIP:DMG: InteractionModelRevision = 1 - [1656409955.865504][2822:2827] CHIP:DMG: } - [1656409955.865632][2822:2827] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0004 DataVersion: 317167335 - [1656409955.865691][2822:2827] CHIP:TOO: AccessControlEntriesPerFabric: 3 - [1656409955.865765][2822:2827] CHIP:EM: Sending Standalone Ack for MessageCounter:204634557 on exchange 23676i - disabled: true - - - label: "TH1 commissions DUT using admin node ID N1" - verification: | - verification step to be updated. - disabled: true - - - label: - "TH1 reads DUT Descriptor cluster ServerList attribute from Endpoint 0" - verification: | - ./chip-tool descriptor read server-list 1 0 - On TH(Chiptool) ,Verify the serverList attribute of Descriptor Cluster with an element of 31( 0x001F) - - [1658323282.743614][2301:2306] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 680928677 - [1658323282.743771][2301:2306] CHIP:TOO: server list: 26 entries - [1658323282.743807][2301:2306] CHIP:TOO: [1]: 3 - [1658323282.743836][2301:2306] CHIP:TOO: [2]: 4 - [1658323282.743863][2301:2306] CHIP:TOO: [3]: 29 - [1658323282.743890][2301:2306] CHIP:TOO: [4]: 30 - [1658323282.743917][2301:2306] CHIP:TOO: [5]: 31 - [1658323282.743944][2301:2306] CHIP:TOO: [6]: 40 - [1658323282.743971][2301:2306] CHIP:TOO: [7]: 42 - [1658323282.743997][2301:2306] CHIP:TOO: [8]: 43 - [1658323282.744024][2301:2306] CHIP:TOO: [9]: 44 - [1658323282.744051][2301:2306] CHIP:TOO: [10]: 45 - [1658323282.744078][2301:2306] CHIP:TOO: [11]: 46 - [1658323282.744104][2301:2306] CHIP:TOO: [12]: 47 - [1658323282.744132][2301:2306] CHIP:TOO: [13]: 48 - [1658323282.744158][2301:2306] CHIP:TOO: [14]: 49 - [1658323282.744185][2301:2306] CHIP:TOO: [15]: 50 - [1658323282.744211][2301:2306] CHIP:TOO: [16]: 51 - [1658323282.744238][2301:2306] CHIP:TOO: [17]: 52 - [1658323282.744265][2301:2306] CHIP:TOO: [18]: 53 - [1658323282.744291][2301:2306] CHIP:TOO: [19]: 54 - [1658323282.744318][2301:2306] CHIP:TOO: [20]: 55 - [1658323282.744345][2301:2306] CHIP:TOO: [21]: 60 - [1658323282.744372][2301:2306] CHIP:TOO: [22]: 62 - [1658323282.744399][2301:2306] CHIP:TOO: [23]: 63 - [1658323282.744426][2301:2306] CHIP:TOO: [24]: 64 - [1658323282.744453][2301:2306] CHIP:TOO: [25]: 65 - [1658323282.744480][2301:2306] CHIP:TOO: [26]: 1029 - [1658323282.744662][2301:2306] CHIP:EM: Sending Standalone Ack for MessageCounter:40924717 on exchange 12145ip - disabled: true - - - label: - "TH1 reads DUT Descriptor cluster ServerList attribute from every - Endpoint except 0" - verification: | - ./chip-tool descriptor read server-list 1 1 - - - On TH(Chiptool) ,Verify the serverList attribute of Descriptor Cluster without an element of 31( 0x001F) - - [1656412927.698026][3383:3388] CHIP:DMG: SuppressResponse = true, - [1656412927.698052][3383:3388] CHIP:DMG: InteractionModelRevision = 1 - [1656412927.698076][3383:3388] CHIP:DMG: } - [1656412927.698852][3383:3388] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 239898735 - [1656412927.698963][3383:3388] CHIP:TOO: server list: 44 entries - [1656412927.698997][3383:3388] CHIP:TOO: [1]: 3 - [1656412927.699023][3383:3388] CHIP:TOO: [2]: 4 - [1656412927.699050][3383:3388] CHIP:TOO: [3]: 5 - [1656412927.699075][3383:3388] CHIP:TOO: [4]: 6 - [1656412927.699101][3383:3388] CHIP:TOO: [5]: 7 - [1656412927.699127][3383:3388] CHIP:TOO: [6]: 8 - [1656412927.699153][3383:3388] CHIP:TOO: [7]: 15 - [1656412927.699179][3383:3388] CHIP:TOO: [8]: 29 - [1656412927.699205][3383:3388] CHIP:TOO: [9]: 30 - [1656412927.699231][3383:3388] CHIP:TOO: [10]: 37 - [1656412927.699258][3383:3388] CHIP:TOO: [11]: 47 - [1656412927.699284][3383:3388] CHIP:TOO: [12]: 59 - [1656412927.699310][3383:3388] CHIP:TOO: [13]: 64 - [1656412927.699336][3383:3388] CHIP:TOO: [14]: 65 - [1656412927.699361][3383:3388] CHIP:TOO: [15]: 69 - [1656412927.699387][3383:3388] CHIP:TOO: [16]: 80 - [1656412927.699414][3383:3388] CHIP:TOO: [17]: 257 - [1656412927.699440][3383:3388] CHIP:TOO: [18]: 258 - [1656412927.699466][3383:3388] CHIP:TOO: [19]: 259 - [1656412927.699492][3383:3388] CHIP:TOO: [20]: 512 - [1656412927.699518][3383:3388] CHIP:TOO: [21]: 513 - [1656412927.699544][3383:3388] CHIP:TOO: [22]: 514 - [1656412927.699571][3383:3388] CHIP:TOO: [23]: 516 - [1656412927.699596][3383:3388] CHIP:TOO: [24]: 768 - [1656412927.699623][3383:3388] CHIP:TOO: [25]: 1024 - [1656412927.699649][3383:3388] CHIP:TOO: [26]: 1026 - [1656412927.699675][3383:3388] CHIP:TOO: [27]: 1027 - [1656412927.699701][3383:3388] CHIP:TOO: [28]: 1028 - [1656412927.699727][3383:3388] CHIP:TOO: [29]: 1029 - [1656412927.699754][3383:3388] CHIP:TOO: [30]: 1030 - [1656412927.699780][3383:3388] CHIP:TOO: [31]: 1283 - [1656412927.699806][3383:3388] CHIP:TOO: [32]: 1284 - [1656412927.699832][3383:3388] CHIP:TOO: [33]: 1285 - [1656412927.699858][3383:3388] CHIP:TOO: [34]: 1286 - [1656412927.699884][3383:3388] CHIP:TOO: [35]: 1287 - [1656412927.699911][3383:3388] CHIP:TOO: [36]: 1288 - [1656412927.699937][3383:3388] CHIP:TOO: [37]: 1289 - [1656412927.699963][3383:3388] CHIP:TOO: [38]: 1290 - [1656412927.700002][3383:3388] CHIP:TOO: [39]: 1291 - [1656412927.700029][3383:3388] CHIP:TOO: [40]: 1292 - [1656412927.700056][3383:3388] CHIP:TOO: [41]: 1293 - [1656412927.700082][3383:3388] CHIP:TOO: [42]: 1294 - [1656412927.700108][3383:3388] CHIP:TOO: [43]: 2820 - [1656412927.700134][3383:3388] CHIP:TOO: [44]: 4294048773 - [1656412927.700251][3383:3388] CHIP:EM: Sending Standalone Ack for MessageCounter:186152197 on exchange 39489i - disabled: true + command: "readAttribute" + attribute: "TargetsPerAccessControlEntry" + response: + constraints: + type: int16u + minValue: 3 + maxValue: 65535 + + - label: "TH reads AccessControlEntriesPerFabric attribute from DUT" + PICS: ACL.S.A0002 + command: "readAttribute" + attribute: "AccessControlEntriesPerFabric" + response: + constraints: + type: int16u + minValue: 3 + maxValue: 65535 diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_2.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_2.yaml index e5e0dbc4da9a83..9b920c931eb9cb 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_2.yaml @@ -13,112 +13,43 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 129.2.2. [TC-ACL-2.2] Cluster endpoint +name: 127.2.2. [TC-ACL-2.2] Cluster endpoint PICS: - ACL.S config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Access Control" endpoint: 0 tests: - - label: "TH1 commissions DUT using admin node ID N1" - verification: | - - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH1 reads DUT Descriptor cluster ServerList attribute from Endpoint 0" - verification: | - ./chip-tool descriptor read server-list 1 0 - On TH ,Verify DUT responds to serverList attribute of Descriptor Cluster with an element of 31( 0x001F) - - [1657628454.970510][2304:2309] CHIP:DMG: } - [1657628454.971842][2304:2309] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 3813084914 - [1657628454.971930][2304:2309] CHIP:TOO: server list: 21 entries - [1657628454.971961][2304:2309] CHIP:TOO: [1]: 29 - [1657628454.971985][2304:2309] CHIP:TOO: [2]: 31 - [1657628454.972010][2304:2309] CHIP:TOO: [3]: 40 - [1657628454.972034][2304:2309] CHIP:TOO: [4]: 42 - [1657628454.972058][2304:2309] CHIP:TOO: [5]: 43 - [1657628454.972081][2304:2309] CHIP:TOO: [6]: 44 - [1657628454.972105][2304:2309] CHIP:TOO: [7]: 46 - [1657628454.972129][2304:2309] CHIP:TOO: [8]: 47 - [1657628454.972153][2304:2309] CHIP:TOO: [9]: 48 - [1657628454.972177][2304:2309] CHIP:TOO: [10]: 49 - [1657628454.972200][2304:2309] CHIP:TOO: [11]: 50 - [1657628454.972224][2304:2309] CHIP:TOO: [12]: 51 - [1657628454.972248][2304:2309] CHIP:TOO: [13]: 52 - [1657628454.972272][2304:2309] CHIP:TOO: [14]: 53 - [1657628454.972296][2304:2309] CHIP:TOO: [15]: 54 - [1657628454.972320][2304:2309] CHIP:TOO: [16]: 55 - [1657628454.972344][2304:2309] CHIP:TOO: [17]: 60 - [1657628454.972368][2304:2309] CHIP:TOO: [18]: 62 - [1657628454.972391][2304:2309] CHIP:TOO: [19]: 63 - [1657628454.972415][2304:2309] CHIP:TOO: [20]: 64 - [1657628454.972439][2304:2309] CHIP:TOO: [21]: 65 - [1657628454.972587][2304:2309] CHIP:EM: Sending Standalone Ack for MessageCounter:152415595 on exchange 40115i - disabled: true + command: "readAttribute" + cluster: "Descriptor" + attribute: "server list" + response: + constraints: + type: list + contains: [31] - label: "TH1 reads DUT Descriptor cluster ServerList attribute from every Endpoint except 0" - verification: | - ./chip-tool descriptor read server-list 1 1 - - - On TH ,Verify DUT responds to serverList attribute of Descriptor Cluster without an element of 31( 0x001F) - - [1656412927.698026][3383:3388] CHIP:DMG: SuppressResponse = true, - [1656412927.698052][3383:3388] CHIP:DMG: InteractionModelRevision = 1 - [1656412927.698076][3383:3388] CHIP:DMG: } - [1656412927.698852][3383:3388] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 239898735 - [1656412927.698963][3383:3388] CHIP:TOO: server list: 44 entries - [1656412927.698997][3383:3388] CHIP:TOO: [1]: 3 - [1656412927.699023][3383:3388] CHIP:TOO: [2]: 4 - [1656412927.699050][3383:3388] CHIP:TOO: [3]: 5 - [1656412927.699075][3383:3388] CHIP:TOO: [4]: 6 - [1656412927.699101][3383:3388] CHIP:TOO: [5]: 7 - [1656412927.699127][3383:3388] CHIP:TOO: [6]: 8 - [1656412927.699153][3383:3388] CHIP:TOO: [7]: 15 - [1656412927.699179][3383:3388] CHIP:TOO: [8]: 29 - [1656412927.699205][3383:3388] CHIP:TOO: [9]: 30 - [1656412927.699231][3383:3388] CHIP:TOO: [10]: 37 - [1656412927.699258][3383:3388] CHIP:TOO: [11]: 47 - [1656412927.699284][3383:3388] CHIP:TOO: [12]: 59 - [1656412927.699310][3383:3388] CHIP:TOO: [13]: 64 - [1656412927.699336][3383:3388] CHIP:TOO: [14]: 65 - [1656412927.699361][3383:3388] CHIP:TOO: [15]: 69 - [1656412927.699387][3383:3388] CHIP:TOO: [16]: 80 - [1656412927.699414][3383:3388] CHIP:TOO: [17]: 257 - [1656412927.699440][3383:3388] CHIP:TOO: [18]: 258 - [1656412927.699466][3383:3388] CHIP:TOO: [19]: 259 - [1656412927.699492][3383:3388] CHIP:TOO: [20]: 512 - [1656412927.699518][3383:3388] CHIP:TOO: [21]: 513 - [1656412927.699544][3383:3388] CHIP:TOO: [22]: 514 - [1656412927.699571][3383:3388] CHIP:TOO: [23]: 516 - [1656412927.699596][3383:3388] CHIP:TOO: [24]: 768 - [1656412927.699623][3383:3388] CHIP:TOO: [25]: 1024 - [1656412927.699649][3383:3388] CHIP:TOO: [26]: 1026 - [1656412927.699675][3383:3388] CHIP:TOO: [27]: 1027 - [1656412927.699701][3383:3388] CHIP:TOO: [28]: 1028 - [1656412927.699727][3383:3388] CHIP:TOO: [29]: 1029 - [1656412927.699754][3383:3388] CHIP:TOO: [30]: 1030 - [1656412927.699780][3383:3388] CHIP:TOO: [31]: 1283 - [1656412927.699806][3383:3388] CHIP:TOO: [32]: 1284 - [1656412927.699832][3383:3388] CHIP:TOO: [33]: 1285 - [1656412927.699858][3383:3388] CHIP:TOO: [34]: 1286 - [1656412927.699884][3383:3388] CHIP:TOO: [35]: 1287 - [1656412927.699911][3383:3388] CHIP:TOO: [36]: 1288 - [1656412927.699937][3383:3388] CHIP:TOO: [37]: 1289 - [1656412927.699963][3383:3388] CHIP:TOO: [38]: 1290 - [1656412927.700002][3383:3388] CHIP:TOO: [39]: 1291 - [1656412927.700029][3383:3388] CHIP:TOO: [40]: 1292 - [1656412927.700056][3383:3388] CHIP:TOO: [41]: 1293 - [1656412927.700082][3383:3388] CHIP:TOO: [42]: 1294 - [1656412927.700108][3383:3388] CHIP:TOO: [43]: 2820 - [1656412927.700134][3383:3388] CHIP:TOO: [44]: 4294048773 - [1656412927.700251][3383:3388] CHIP:EM: Sending Standalone Ack for MessageCounter:186152197 on exchange 39489i - disabled: true + command: "readAttribute" + cluster: "Descriptor" + endpoint: 1 + attribute: "server list" + response: + constraints: + type: list + excludes: [31] diff --git a/src/app/tests/suites/certification/Test_TC_BIND_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BIND_1_1.yaml index bb8cae62fed3f4..b8370f8312d0a9 100644 --- a/src/app/tests/suites/certification/Test_TC_BIND_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BIND_1_1.yaml @@ -11,401 +11,77 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 120.1.1. [TC-BIND-1.1] Global Attributes [DUT-Controllee] +name: 116.1.1. [TC-BIND-1.1] Global Attributes [DUT-Controllee] PICS: - BIND.S config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Binding" + endpoint: 1 tests: - - label: "Commission DUT to TH1" - verification: | - verification step to be updated. - disabled: true - - - label: "TH1 reads the ClusterRevision from DUT" - verification: | - ./chip-tool binding read cluster-revision 1 1 - - Verify " ClusterRevision " on the TH(Chip-tool) Log: - - [1649417989.863435][3040:3045] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_FFFD DataVersion: 1411817517 - [1649417989.863557][3040:3045] CHIP:TOO: ClusterRevision: 1 - disabled: true - - - label: "TH1 reads the FeatureMap from DUT" - verification: | - ./chip-tool binding read feature-map 1 1 - - Verify " Featuremap " on the TH(Chip-tool) Log: - - [1653560808.265422][3439:3444] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_FFFC DataVersion: 2519252823 - [1653560808.265507][3439:3444] CHIP:TOO: FeatureMap: 0 - disabled: true - - - label: "TH1 reads AttributeList from DUT" - verification: | - ./chip-tool binding read attribute-list 1 1 - - Verify " AttributeList " on the TH(Chip-tool) Log: - - [1653560826.815841][3445:3450] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_FFFB DataVersion: 2519252823 - [1653560826.816170][3445:3450] CHIP:TOO: AttributeList: 6 entries - [1653560826.816239][3445:3450] CHIP:TOO: [1]: 0 - [1653560826.816279][3445:3450] CHIP:TOO: [2]: 65528 - [1653560826.816316][3445:3450] CHIP:TOO: [3]: 65529 - [1653560826.816352][3445:3450] CHIP:TOO: [4]: 65531 - [1653560826.816388][3445:3450] CHIP:TOO: [5]: 65532 - [1653560826.816424][3445:3450] CHIP:TOO: [6]: 65533 - disabled: true - - - label: "TH1 reads EventList from DUT" - verification: | - Out of scope for V1.0 - disabled: true - - - label: "TH1 reads AcceptedCommandList from DUT" - verification: | - ./chip-tool binding read accepted-command-list 1 1 - - Verify " AcceptedCommandList " on the TH(Chip-tool) Log: - - [1653560851.890988][3451:3456] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_FFF9 DataVersion: 2519252823 - [1653560851.891077][3451:3456] CHIP:TOO: AcceptedCommandList: 0 entries - disabled: true - - - label: "TH1 reads GeneratedCommandList from DUT" - verification: | - ./chip-tool binding read generated-command-list 1 1 - - Verify " GeneratedCommandList " on the TH(Chip-tool) Log: - - [1653560872.884952][3458:3463] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_FFF8 DataVersion: 2519252823 - [1653560872.885073][3458:3463] CHIP:TOO: GeneratedCommandList: 0 entries - disabled: true - - - label: "Factory Reset DUT" - verification: | - Vendor specific action, for chip-tool run - rm -rf /tmp/chip* - disabled: true - - - label: "Commission DUT to TH1s fabric" - verification: | - ./chip-tool pairing onnetwork 1 20202021 - disabled: true - - - label: "Commission TH2 to TH1s fabric (Node ID = 2)" - verification: | - ./chip-tool pairing ble-wifi 2 chipsetup4 matter123 20202021 3840 - disabled: true - - - label: "Commission TH3 to TH1s fabric (Node ID = 3)" - verification: | - ./chip-tool pairing ble-wifi 3 chipsetup4 matter123 20202021 3841 - disabled: true - - - label: - "TH1 writes Binding entries into DUT on the endpoint with the On/Off - client with Entry 1: Node = 2 Cluster = 0x0006(onoff) Endpoint = 1 - Entry 2: Node = 3 Cluster = 0x0006(onoff) Endpoint = 2 Note: Node 2 - corresponds to TH2s Node ID Node 3 corresponds to TH3s Node ID" - verification: | - ./chip-tool binding write binding "[{"node" : 2 , "cluster" : "0x0006" , "endpoint" : 1 }, { "node" : 3 , "cluster" : "0x0006" , "endpoint" : 2 }]" 1 1 - - On TH(Chip-tool), Verify the success response for binding entries - - - [1657797710.456056][3796:3801] CHIP:DMG: status = 0x00 (SUCCESS), - MG: status = 0x00 (SUCCESS), - [1657797710.457093][3796:3801] CHIP:DMG: }, - [1657797710.457171][3796:3801] CHIP:DMG: - [1657797710.457232][3796:3801] CHIP:DMG: }, - [1657797710.457318][3796:3801] CHIP:DMG: - [1 StatusIB = - [1657797710.458209][3796:3801] CHIP:DMG: { - [1657797710.458286][3796:3801] CHIP:DMG: status = 0x00 (SUCCESS), - [1657797710.458369][3796:3801] CHIP:DMG: }, - [1657797710.458444][3796:3801] CHIP:DMG: - pted msg 0xffff7e7cd9d8 with MessageCounter:161235290 to 0x0000000000000001 (1) at monotonic time: 000000000071D1BB msec - [1657797710.459711][3796:3801] CHIP:EM: Flushed pending ack for MessageCounter:23683634 on exchange 26818i - disabled: true - - - label: "TH1 enables DUT as Controller" - verification: | - verification step to be updated. - disabled: true - - - label: "DUT is triggered to send On command to its binding node entries" - PICS: OO.C.C01.Tx - verification: | - ./chip-tool accesscontrol write acl "[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [1], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}]}]" 2 0 - - on TH (Chip-tool), Verify the on command receives success response - - [1652330385.328196][3240:3245] CHIP:DMG: StatusIB = - [1652330385.328229][3240:3245] CHIP:DMG: { - [1652330385.328264][3240:3245] CHIP:DMG: status = 0x00 (SUCCESS), - [1652330385.328298][3240:3245] CHIP:DMG: }, - - - ./chip-tool accesscontrol write acl "[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [1], "targets": [{"cluster": 6, "endpoint": 2, "deviceType": null}]}]" 3 0 - - on TH(Chip-tool), Verify the on command receives success response - - [1650610345.847274][2626:2631] CHIP:DMG: StatusIB = - [1650610345.847317][2626:2631] CHIP:DMG: { - [1650610345.847383][2626:2631] CHIP:DMG: status = 0x00 (SUCCESS), - [1650610345.847429][2626:2631] CHIP:DMG: }, - - NOTE: - Every DUT should have their own mechanism to trigger on/off mechanism ,this for raspi platform - - DUT sends on command in the shell - - > switch on - [1658837711.917557][4764:4764] CHIP:DMG: ICR moving to [AddingComm] - [1658837711.917653][4764:4764] CHIP:DMG: ICR moving to [AddedComma] - [1658837711.917869][4764:4764] CHIP:IN: Prepared secure message 0xaaaaf8a908f8 to 0x0000000000000046 (1) of type 0x8 and protocolId (0, 1) on exchange 5086i with MessageCounter:188042572. - [1658837711.917966][4764:4764] CHIP:IN: Sending encrypted msg 0xaaaaf8a908f8 with MessageCounter:188042572 to 0x0000000000000046 (1) at monotonic time: 0000000001828F3D msec - [1658837711.918320][4764:4764] CHIP:DMG: ICR moving to [CommandSen] - [1658837711.918428][4764:4764] CHIP:DMG: ICR moving to [AddingComm] - [1658837711.918496][4764:4764] CHIP:DMG: ICR moving to [AddedComma] - [1658837711.918633][4764:4764] CHIP:IN: Prepared secure message 0xaaaaf8a733a8 to 0x0000000000000258 (1) of type 0x8 and protocolId (0, 1) on exchange 5087i with MessageCounter:70524918. - [1658837711.918720][4764:4764] CHIP:IN: Sending encrypted msg 0xaaaaf8a733a8 with MessageCounter:70524918 to 0x0000000000000258 (1) at monotonic time: 0000000001828F3E msec - [1658837711.919011][4764:4764] CHIP:DMG: ICR moving to [CommandSen] - Done - > [1658837711.920333][4764:4764] CHIP:EM: Received message of type 0x9 with protocolId (0, 1) and MessageCounter:225570715 on exchange 5086i - [1658837711.920409][4764:4764] CHIP:EM: Found matching exchange: 5086i, Delegate: 0xaaaaf8a90220 - [1658837711.920490][4764:4764] CHIP:EM: Rxd Ack; Removing MessageCounter:188042572 from Retrans Table on exchange 5086i - [1658837711.920598][4764:4764] CHIP:EM: Removed CHIP MessageCounter:188042572 from RetransTable on exchange 5086i - [1658837711.920673][4764:4764] CHIP:DMG: ICR moving to [ResponseRe] - [1658837711.920777][4764:4764] CHIP:DMG: InvokeResponseMessage = - [1658837711.920837][4764:4764] CHIP:DMG: { - [1658837711.920894][4764:4764] CHIP:DMG: suppressResponse = false, - [1658837711.920954][4764:4764] CHIP:DMG: InvokeResponseIBs = - [1658837711.921030][4764:4764] CHIP:DMG: [ - [1658837711.921089][4764:4764] CHIP:DMG: InvokeResponseIB = - [1658837711.921166][4764:4764] CHIP:DMG: { - [1658837711.921229][4764:4764] CHIP:DMG: CommandStatusIB = - [1658837711.921309][4764:4764] CHIP:DMG: { - [1658837711.921380][4764:4764] CHIP:DMG: CommandPathIB = - [1658837711.921462][4764:4764] CHIP:DMG: { - [1658837711.921543][4764:4764] CHIP:DMG: EndpointId = 0x1, - [1658837711.921630][4764:4764] CHIP:DMG: ClusterId = 0x6, - [1658837711.921714][4764:4764] CHIP:DMG: CommandId = 0x1, - [1658837711.921801][4764:4764] CHIP:DMG: }, - [1658837711.921889][4764:4764] CHIP:DMG: - [1658837711.921961][4764:4764] CHIP:DMG: StatusIB = - [1658837711.922050][4764:4764] CHIP:DMG: { - [1658837711.922139][4764:4764] CHIP:DMG: status = 0x00 (SUCCESS), - [1658837711.922222][4764:4764] CHIP:DMG: }, - [1658837711.922301][4764:4764] CHIP:DMG: - [1658837711.922374][4764:4764] CHIP:DMG: }, - [1658837711.922456][4764:4764] CHIP:DMG: - [1658837711.922522][4764:4764] CHIP:DMG: }, - [1658837711.922596][4764:4764] CHIP:DMG: - [1658837711.922654][4764:4764] CHIP:DMG: ], - [1658837711.922726][4764:4764] CHIP:DMG: - [1658837711.922786][4764:4764] CHIP:DMG: InteractionModelRevision = 1 - [1658837711.922844][4764:4764] CHIP:DMG: }, - [1658837711.922978][4764:4764] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0001 Status=0x0 - [1658837711.923042][4764:4764] CHIP:-: OnOff command succeeds - [1658837711.923125][4764:4764] CHIP:DMG: ICR moving to [AwaitingDe] - [1658837711.923188][4764:4764] CHIP:EM: Sending Standalone Ack for MessageCounter:225570715 on exchange 5086i - [1658837711.923300][4764:4764] CHIP:IN: Prepared secure message 0xffffc33c53d8 to 0x0000000000000046 (1) of type 0x10 and protocolId (0, 0) on exchange 5086i with MessageCounter:188042573. - [1658837711.923385][4764:4764] CHIP:IN: Sending encrypted msg 0xffffc33c53d8 with MessageCounter:188042573 to 0x0000000000000046 (1) at monotonic time: 0000000001828F42 msec - [1658837711.923572][4764:4764] CHIP:EM: Flushed pending ack for MessageCounter:225570715 on exchange 5086i - [1658837711.926330][4764:4764] CHIP:EM: Received message of type 0x9 with protocolId (0, 1) and MessageCounter:32223638 on exchange 5087i - [1658837711.926404][4764:4764] CHIP:EM: Found matching exchange: 5087i, Delegate: 0xaaaaf8a8bb70 - [1658837711.926475][4764:4764] CHIP:EM: Rxd Ack; Removing MessageCounter:70524918 from Retrans Table on exchange 5087i - [1658837711.926534][4764:4764] CHIP:EM: Removed CHIP MessageCounter:70524918 from RetransTable on exchange 5087i - [1658837711.926599][4764:4764] CHIP:DMG: ICR moving to [ResponseRe] - [1658837711.926687][4764:4764] CHIP:DMG: InvokeResponseMessage = - [1658837711.926744][4764:4764] CHIP:DMG: { - [1658837711.926800][4764:4764] CHIP:DMG: suppressResponse = false, - [1658837711.926859][4764:4764] CHIP:DMG: InvokeResponseIBs = - [1658837711.926932][4764:4764] CHIP:DMG: [ - [1658837711.926991][4764:4764] CHIP:DMG: InvokeResponseIB = - [1658837711.927066][4764:4764] CHIP:DMG: { - [1658837711.927128][4764:4764] CHIP:DMG: CommandStatusIB = - [1658837711.927310][4764:4764] CHIP:DMG: { - [1658837711.927388][4764:4764] CHIP:DMG: CommandPathIB = - [1658837711.927469][4764:4764] CHIP:DMG: { - [1658837711.927551][4764:4764] CHIP:DMG: EndpointId = 0x1, - [1658837711.927638][4764:4764] CHIP:DMG: ClusterId = 0x6, - [1658837711.927722][4764:4764] CHIP:DMG: CommandId = 0x1, - [1658837711.927802][4764:4764] CHIP:DMG: }, - [1658837711.927897][4764:4764] CHIP:DMG: - [1658837711.927970][4764:4764] CHIP:DMG: StatusIB = - [1658837711.928057][4764:4764] CHIP:DMG: { - [1658837711.928145][4764:4764] CHIP:DMG: status = 0x00 (SUCCESS), - [1658837711.928222][4764:4764] CHIP:DMG: }, - [1658837711.928303][4764:4764] CHIP:DMG: - [1658837711.928373][4764:4764] CHIP:DMG: }, - [1658837711.928453][4764:4764] CHIP:DMG: - [1658837711.928515][4764:4764] CHIP:DMG: }, - [1658837711.928625][4764:4764] CHIP:DMG: - [1658837711.928686][4764:4764] CHIP:DMG: ], - [1658837711.928757][4764:4764] CHIP:DMG: - [1658837711.928816][4764:4764] CHIP:DMG: InteractionModelRevision = 1 - [1658837711.928873][4764:4764] CHIP:DMG: }, - [1658837711.928983][4764:4764] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0001 Status=0x0 - [1658837711.929015][4764:4764] CHIP:-: OnOff command succeeds - [1658837711.929055][4764:4764] CHIP:DMG: ICR moving to [AwaitingDe] - [1658837711.929134][4764:4764] CHIP:EM: Sending Standalone Ack for MessageCounter:32223638 on exchange 5087i - [1658837711.929198][4764:4764] CHIP:IN: Prepared secure message 0xffffc33c53d8 to 0x0000000000000258 (1) of type 0x10 and protocolId (0, 0) on exchange 5087i with MessageCounter:70524919. - [1658837711.929241][4764:4764] CHIP:IN: Sending encrypted msg 0xffffc33c53d8 with MessageCounter:70524919 to 0x0000000000000258 (1) at monotonic time: 0000000001828F48 msec - [1658837711.929336][4764:4764] CHIP:EM: Flushed pending ack for MessageCounter:32223638 on exchange 5087i - disabled: true - - - label: "TH1 reads OnOff attribute from TH2 (Endpoint 1)" - PICS: OO.C.C01.Tx - verification: | - ./chip-tool onoff read on-off 2 1 - - Verify on TH (Chip-tool),the onoff value is set to ON - - [1657798291.396477][3835:3841] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0006 Attribute 0x0000_0000 DataVersion: 4260513117 - [1657798291.396514][3835:3841] CHIP:TOO: OnOff: TRUE - - ./chip-tool onoff read on-off 3 2 - - Verify on TH(Chip-tool) ,the onoff value is set to ON - - [1657798691.194894][3869:3874] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0006 Attribute 0x0000_0000 DataVersion: 470320746 - [1657798691.194948][3869:3874] CHIP:TOO: OnOff: TRUE - disabled: true - - - label: "TH1 removes second binding entry corresponding to TH3 from DUT" - verification: | - ./chip-tool binding write binding "[{"node" : 2 , "cluster" : "0x0006" , "endpoint" : 1 }]" 1 1 - - Verify on TH(Chip-tool) ,binding entry receives success response - - [1657800844.739833][4000:4006] CHIP:EM: Removed CHIP MessageCounter:244702117 from RetransTable on exchange 12653i - [1657800844.739867][4000:4006] CHIP:DMG: WriteClient moving to [ResponseRe] - [1657800844.739922][4000:4006] CHIP:DMG: WriteResponseMessage = - [1657800844.739949][4000:4006] CHIP:DMG: { - [1657800844.739990][4000:4006] CHIP:DMG: AttributeStatusIBs = - [1657800844.740021][4000:4006] CHIP:DMG: [ - [1657800844.740057][4000:4006] CHIP:DMG: AttributeStatusIB = - [1657800844.740111][4000:4006] CHIP:DMG: { - [1657800844.740150][4000:4006] CHIP:DMG: AttributePathIB = - [1657800844.740195][4000:4006] CHIP:DMG: { - [1657800844.740230][4000:4006] CHIP:DMG: Endpoint = 0x0, - [1657800844.740275][4000:4006] CHIP:DMG: Cluster = 0x1e, - [1657800844.740322][4000:4006] CHIP:DMG: Attribute = 0x0000_0000, - [1657800844.740359][4000:4006] CHIP:DMG: } - [1657800844.740405][4000:4006] CHIP:DMG: - [1657800844.740444][4000:4006] CHIP:DMG: StatusIB = - [1657800844.740477][4000:4006] CHIP:DMG: { - [1657800844.740516][4000:4006] CHIP:DMG: status = 0x00 (SUCCESS), - [1657800844.740548][4000:4006] CHIP:DMG: }, - [1657800844.740584][4000:4006] CHIP:DMG: - [1657800844.740607][4000:4006] CHIP:DMG: }, - [1657800844.740653][4000:4006] CHIP:DMG: - [1657800844.740687][4000:4006] CHIP:DMG: AttributeStatusIB = - [1657800844.740714][4000:4006] CHIP:DMG: { - [1657800844.740748][4000:4006] CHIP:DMG: AttributePathIB = - [1657800844.740781][4000:4006] CHIP:DMG: { - [1657800844.740820][4000:4006] CHIP:DMG: Endpoint = 0x0, - [1657800844.740858][4000:4006] CHIP:DMG: Cluster = 0x1e, - [1657800844.740905][4000:4006] CHIP:DMG: Attribute = 0x0000_0000, - [1657800844.740946][4000:4006] CHIP:DMG: ListIndex = Null, - [1657800844.740981][4000:4006] CHIP:DMG: } - [1657800844.741025][4000:4006] CHIP:DMG: - [1657800844.741063][4000:4006] CHIP:DMG: StatusIB = - [1657800844.741094][4000:4006] CHIP:DMG: { - [1657800844.741133][4000:4006] CHIP:DMG: status = 0x00 (SUCCESS), - [1657800844.741168][4000:4006] CHIP:DMG: }, - [1657800844.741208][4000:4006] CHIP:DMG: - [1657800844.741241][4000:4006] CHIP:DMG: }, - [1657800844.741272][4000:4006] CHIP:DMG: - [1657800844.741295][4000:4006] CHIP:DMG: ], - [1657800844.741336][4000:4006] CHIP:DMG: - [1657800844.741369][4000:4006] CHIP:DMG: InteractionModelRevision = 1 - [1657800844.741392][4000:4006] CHIP:DMG: } - [1657800844.741511][4000:4006] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657800844.741591][4000:4006] CHIP:EM: Sending Standalone Ack for MessageCounter:142199059 on exchange 12653i - disabled: true - - - label: "DUT is triggered to send off command to its binding entries" - PICS: OO.C.C00.Tx - verification: | - DUT sends off command in the shell - - > switch off - [1658838896.810567][4764:4764] CHIP:DMG: ICR moving to [AddingComm] - [1658838896.810692][4764:4764] CHIP:DMG: ICR moving to [AddedComma] - [1658838896.810911][4764:4764] CHIP:IN: Prepared secure message 0xaaaaf8a8c0e8 to 0x0000000000000046 (1) of type 0x8 and protocolId (0, 1) on exchange 5088i with MessageCounter:188042574. - [1658838896.811035][4764:4764] CHIP:IN: Sending encrypted msg 0xaaaaf8a8c0e8 with MessageCounter:188042574 to 0x0000000000000046 (1) at monotonic time: 000000000194A3BA msec - [1658838896.811427][4764:4764] CHIP:DMG: ICR moving to [CommandSen] - Done - > [1658838896.817922][4764:4764] CHIP:EM: Received message of type 0x9 with protocolId (0, 1) and MessageCounter:225570716 on exchange 5088i - [1658838896.817984][4764:4764] CHIP:EM: Found matching exchange: 5088i, Delegate: 0xaaaaf8a90220 - [1658838896.818042][4764:4764] CHIP:EM: Rxd Ack; Removing MessageCounter:188042574 from Retrans Table on exchange 5088i - [1658838896.818087][4764:4764] CHIP:EM: Removed CHIP MessageCounter:188042574 from RetransTable on exchange 5088i - [1658838896.818140][4764:4764] CHIP:DMG: ICR moving to [ResponseRe] - [1658838896.818241][4764:4764] CHIP:DMG: InvokeResponseMessage = - [1658838896.818287][4764:4764] CHIP:DMG: { - [1658838896.818344][4764:4764] CHIP:DMG: suppressResponse = false, - [1658838896.818391][4764:4764] CHIP:DMG: InvokeResponseIBs = - [1658838896.818463][4764:4764] CHIP:DMG: [ - [1658838896.818508][4764:4764] CHIP:DMG: InvokeResponseIB = - [1658838896.818581][4764:4764] CHIP:DMG: { - [1658838896.818629][4764:4764] CHIP:DMG: CommandStatusIB = - [1658838896.818699][4764:4764] CHIP:DMG: { - [1658838896.818759][4764:4764] CHIP:DMG: CommandPathIB = - [1658838896.818836][4764:4764] CHIP:DMG: { - [1658838896.818915][4764:4764] CHIP:DMG: EndpointId = 0x1, - [1658838896.819001][4764:4764] CHIP:DMG: ClusterId = 0x6, - [1658838896.819068][4764:4764] CHIP:DMG: CommandId = 0x0, - [1658838896.819144][4764:4764] CHIP:DMG: }, - [1658838896.819227][4764:4764] CHIP:DMG: - [1658838896.819285][4764:4764] CHIP:DMG: StatusIB = - [1658838896.819347][4764:4764] CHIP:DMG: { - [1658838896.819408][4764:4764] CHIP:DMG: status = 0x00 (SUCCESS), - [1658838896.819474][4764:4764] CHIP:DMG: }, - [1658838896.819535][4764:4764] CHIP:DMG: - [1658838896.819588][4764:4764] CHIP:DMG: }, - [1658838896.819650][4764:4764] CHIP:DMG: - [1658838896.819700][4764:4764] CHIP:DMG: }, - [1658838896.819759][4764:4764] CHIP:DMG: - [1658838896.819803][4764:4764] CHIP:DMG: ], - [1658838896.819856][4764:4764] CHIP:DMG: - [1658838896.819900][4764:4764] CHIP:DMG: InteractionModelRevision = 1 - [1658838896.819943][4764:4764] CHIP:DMG: }, - [1658838896.820047][4764:4764] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0000 Status=0x0 - [1658838896.820095][4764:4764] CHIP:-: OnOff command succeeds - disabled: true - - - label: "TH1 reads OnOff attribute from TH2 (Endpoint 1)" - PICS: OO.C.C00.Tx - verification: | - ./chip-tool onoff read on-off 2 1 - - Verify on TH (Chip-tool),the onoff value is set to OFF - - [1657803168.769564][4272:4277] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0006 Attribute 0x0000_0000 DataVersion: 1968648540 - - [1657803168.769598][4272:4277] CHIP:TOO: OnOff: FALSE - disabled: true - - - label: "TH1 reads OnOff attribute from TH3 (Endpoint 2)" - PICS: OO.C.C01.Tx - verification: | - ./chip-tool onoff read on-off 3 2 - - Verify on TH(Chip-tool) ,the onoff value is set to ON - - [1657803609.731464][4333:4339] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0006 Attribute 0x0000_0000 DataVersion: 3914456390 - - [1657803609.731521][4333:4339] CHIP:TOO: OnOff: TRUE - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads the ClusterRevision from DUT" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + - label: "TH reads the FeatureMap from DUT" + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "TH reads AttributeList from DUT" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 65528, 65529, 65531, 65532, 65533] + + - label: "TH reads AcceptedCommandList from DUT" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads GeneratedCommandList from DUT" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + #Commenting out the step EventList attribute which is out of scope for matter V1.0 + #- 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" diff --git a/src/app/tests/suites/certification/Test_TC_BINFO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BINFO_1_1.yaml index 2033d362e93861..b515d49a865771 100644 --- a/src/app/tests/suites/certification/Test_TC_BINFO_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BINFO_1_1.yaml @@ -26,87 +26,156 @@ config: endpoint: 0 tests: - - label: "Commission DUT to TH" - verification: | - verification step to be updated. - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH reads the ClusterRevision from DUT" - verification: | - ./chip-tool basic read cluster-revision 1 0 - Verify " ClusterRevision " on the TH(Chip-tool) Log: - - [1651214669.313397][2666:2671] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_FFFD DataVersion: 158558310 - [1651214669.313472][2666:2671] CHIP:TOO: ClusterRevision: 1 - disabled: true - - - label: "TH reads the FeatureMap from DUTF" - verification: | - ./chip-tool basic read feature-map 1 0 - - Verify " Featuremap " on the TH(Chip-tool) Log: - - [1653459580.065669][29174:29179] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_FFFC DataVersion: 46104872 - [1653459580.065758][29174:29179] CHIP:TOO: FeatureMap: 0 - [1653459580.065936][29174:29179] CHIP:EM: Sending Standalone Ack for MessageCounter:14961519 on exchange 31457i - disabled: true + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + - label: "TH reads the FeatureMap from DUT" + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 - label: "TH reads AttributeList from DUT" - verification: | - ./chip-tool basic read attribute-list 1 0 - - Verify " AttributeList " on the TH(Chip-tool) Log: - - [1657021528.885544][7089:7094] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_FFFB DataVersion: 1869107664 - [1657021528.885637][7089:7094] CHIP:TOO: AttributeList: 25 entries - [1657021528.885669][7089:7094] CHIP:TOO: [1]: 0 - [1657021528.885695][7089:7094] CHIP:TOO: [2]: 1 - [1657021528.885720][7089:7094] CHIP:TOO: [3]: 2 - [1657021528.885744][7089:7094] CHIP:TOO: [4]: 3 - [1657021528.885768][7089:7094] CHIP:TOO: [5]: 4 - [1657021528.885793][7089:7094] CHIP:TOO: [6]: 5 - [1657021528.885817][7089:7094] CHIP:TOO: [7]: 6 - [1657021528.885841][7089:7094] CHIP:TOO: [8]: 7 - [1657021528.885865][7089:7094] CHIP:TOO: [9]: 8 - [1657021528.885890][7089:7094] CHIP:TOO: [10]: 9 - [1657021528.885915][7089:7094] CHIP:TOO: [11]: 10 - [1657021528.885939][7089:7094] CHIP:TOO: [12]: 11 - [1657021528.885964][7089:7094] CHIP:TOO: [13]: 12 - [1657021528.885988][7089:7094] CHIP:TOO: [14]: 13 - [1657021528.886013][7089:7094] CHIP:TOO: [15]: 14 - [1657021528.886037][7089:7094] CHIP:TOO: [16]: 15 - [1657021528.886062][7089:7094] CHIP:TOO: [17]: 16 - [1657021528.886086][7089:7094] CHIP:TOO: [18]: 17 - [1657021528.886111][7089:7094] CHIP:TOO: [19]: 18 - [1657021528.886135][7089:7094] CHIP:TOO: [20]: 19 - [1657021528.886160][7089:7094] CHIP:TOO: [21]: 65528 - [1657021528.886184][7089:7094] CHIP:TOO: [22]: 65529 - [1657021528.886209][7089:7094] CHIP:TOO: [23]: 65531 - [1657021528.886234][7089:7094] CHIP:TOO: [24]: 65532 - [1657021528.886258][7089:7094] CHIP:TOO: [25]: 65533 - disabled: true - - - label: "TH reads EventList from DUT" - verification: | - out of scope for V1.0 - disabled: true - - - label: "TH reads AcceptedCommandList from DUT" - verification: | - ./chip-tool basic read accepted-command-list 1 0 - - Verify " AcceptedCommandList " on the TH(Chip-tool) Log: - - [1651214820.355561][2695:2700] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_FFF9 DataVersion: 158558310 - [1651214820.355673][2695:2700] CHIP:TOO: AcceptedCommandList: 0 entries - disabled: true - - - label: "TH reads GeneratedCommandList from DUT" - verification: | - ./chip-tool basic read generated-command-list 1 0 - - Verify " GeneratedCommandList " on the TH(Chip-tool) Log: - - [1651214861.208575][2702:2707] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_FFF8 DataVersion: 158558310 - [1651214861.208682][2702:2707] CHIP:TOO: GeneratedCommandList: 0 entries - disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 19, + 65528, + 65529, + 65531, + 65532, + 65533, + ] + + - label: "TH reads optional attribute(ManufacturingDate) in attributeList" + PICS: BINFO.S.A000b + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [11] + + - label: "TH reads optional attribute(PartNumber) in attributeList" + PICS: BINFO.S.A000c + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [12] + + - label: "TH reads optional attribute(ProductURL) in attributeList" + PICS: BINFO.S.A000d + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [13] + + - label: "TH reads optional attribute(ProductLabel) in attributeList" + PICS: BINFO.S.A000e + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [14] + + - label: "TH reads optional attribute(SerialNumber) in attributeList" + PICS: BINFO.S.A000f + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [15] + + - label: "TH reads optional attribute(LocalConfigDisabled) in attributeList" + PICS: BINFO.S.A0010 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [16] + + - label: "TH reads optional attribute(Reachable) in attributeList" + PICS: BINFO.S.A0011 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [17] + + - label: "TH reads optional attribute(UniqueID) in attributeList" + PICS: BINFO.S.A0012 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [18] + + - label: "TH1 reads AcceptedCommandList from DUT" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH1 reads GeneratedCommandList from DUT" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + #Commenting out the step EventList attribute which is out of scope for matter V1.0 + #- 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" diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml index 6a045f54a04452..c8271e1df685fb 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml @@ -184,7 +184,7 @@ tests: value: 250 - label: "TH reads ColorMode attribute from DUT" - PICS: CC.S.F00 && CC.S.A0008 + PICS: CC.S.F04 && CC.S.A0008 command: "readAttribute" attribute: "ColorMode" response: @@ -193,7 +193,7 @@ tests: maxValue: 2 - label: "TH reads EnhancedColorMode attribute from DUT" - PICS: CC.S.F00 && CC.S.A4001 + PICS: CC.S.F04 && CC.S.A4001 command: "readAttribute" attribute: "ColorMode" response: diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml index b889a4cc1b567c..f15456a2053583 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml @@ -80,301 +80,281 @@ tests: "TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds=(ColorTempPhysicalMinMireds + ColorTempPhysicalMaxMireds)/2 and TransitionTime=0 (immediately)." - PICS: CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol move-to-color-temperature 32639 0 0 0 1 1 - - Verify in TH(chip-tool) Log: - [1649666592.559286][9065:9070] CHIP:DMG: StatusIB = - [1649666592.559322][9065:9070] CHIP:DMG: { - [1649666592.559357][9065:9070] CHIP:DMG: status = 0x00 (SUCCESS), - [1649666592.559391][9065:9070] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + PICS: CC.S.F04 && CC.S.C0a.Rsp + command: "MoveToColorTemperature" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "colorTemperature" + value: + ( ColorTempPhysicalMinMiredsValue + + ColorTempPhysicalMaxMiredsValue ) / 2 + - name: "TransitionTime" + value: 0 + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 - label: "TH sends MoveColorTemperature command to DUT with MoveMode = 0x01 (up), Rate = (ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/40" - PICS: CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol move-color-temperature 1 16319 0 65279 0 0 1 1 - - Verify in TH(chip-tool) Log: - [1649666643.381403][9085:9090] CHIP:DMG: StatusIB = - [1649666643.381465][9085:9090] CHIP:DMG: { - [1649666643.381530][9085:9090] CHIP:DMG: status = 0x00 (SUCCESS), - [1649666643.381582][9085:9090] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + PICS: CC.S.F04 && CC.S.C4b.Rsp + command: MoveColorTemperature arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649666635.306093][9078:9083] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087364802 - [1649666635.306184][9078:9083] CHIP:TOO: ColorTemperature: 16000 (value can vary) - [1649666635.306298][9078:9083] CHIP:EM: Sending Standalone Ack for MessageCounter:2077197 on exchange 1795i - cluster: "LogCommands" - command: "UserPrompt" + - name: "MoveMode" + value: 1 + - name: "Rate" + value: + ( ColorTempPhysicalMaxMiredsValue - + ColorTempPhysicalMinMiredsValue ) / 40 + - name: "ColorTemperatureMinimumMireds" + value: ColorTempPhysicalMinMiredsValue + - name: "ColorTemperatureMaximumMireds" + value: ColorTempPhysicalMaxMiredsValue + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 10000 - - label: - "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649666635.306093][9078:9083] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087364802 - [1649666635.306184][9078:9083] CHIP:TOO: ColorTemperature: 16500 (value can vary) - [1649666635.306298][9078:9083] CHIP:EM: Sending Standalone Ack for MessageCounter:2077197 on exchange 1795i - cluster: "LogCommands" - command: "UserPrompt" + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + saveAs: ColorTemperatureMiredsStep2c + constraints: + minValue: + ( ColorTempPhysicalMinMiredsValue + + ColorTempPhysicalMaxMiredsValue ) / 2 + maxValue: ColorTempPhysicalMaxMiredsValue + + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 10000 - - label: - "After another 5 seconds, TH reads ColorTemperatureMireds attribute - from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649666635.306093][9078:9083] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087364802 - [1649666635.306184][9078:9083] CHIP:TOO: ColorTemperature: 16500 (value can vary) - [1649666635.306298][9078:9083] CHIP:EM: Sending Standalone Ack for MessageCounter:2077197 on exchange 1795i - cluster: "LogCommands" - command: "UserPrompt" + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + saveAs: ColorTemperatureMiredsStep2d + constraints: + minValue: ColorTemperatureMiredsStep2c + maxValue: ColorTempPhysicalMaxMiredsValue + + - label: "Wait 5s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 5000 + + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + constraints: + minValue: ColorTemperatureMiredsStep2d + maxValue: ColorTempPhysicalMaxMiredsValue - label: "TH sends MoveColorTemperature command to DUT with MoveMode = 0x03(down), Rate = (ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20" - PICS: CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol move-color-temperature 3 32369 0 65279 0 0 1 1 - - Verify in TH(chip-tool) Log: - [1649666643.381403][9085:9090] CHIP:DMG: StatusIB = - [1649666643.381465][9085:9090] CHIP:DMG: { - [1649666643.381530][9085:9090] CHIP:DMG: status = 0x00 (SUCCESS), - [1649666643.381582][9085:9090] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + PICS: CC.S.F04 && CC.S.C4b.Rsp + command: MoveColorTemperature arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649666665.611446][9091:9096] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087365394 - [1649666665.611577][9091:9096] CHIP:TOO: ColorTemperature: 15500 (value can vary) - [1649666665.611685][9091:9096] CHIP:EM: Sending Standalone Ack for MessageCounter:8367884 on exchange 32174i - cluster: "LogCommands" - command: "UserPrompt" + - name: "MoveMode" + value: 3 + - name: "Rate" + value: + ( ColorTempPhysicalMaxMiredsValue - + ColorTempPhysicalMinMiredsValue ) / 20 + - name: "ColorTemperatureMinimumMireds" + value: ColorTempPhysicalMinMiredsValue + - name: "ColorTemperatureMaximumMireds" + value: ColorTempPhysicalMaxMiredsValue + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 10000 - - label: - "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649666665.611446][9091:9096] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087365394 - [1649666665.611577][9091:9096] CHIP:TOO: ColorTemperature: 14000 (value can vary) - [1649666665.611685][9091:9096] CHIP:EM: Sending Standalone Ack for MessageCounter:8367884 on exchange 32174i - cluster: "LogCommands" - command: "UserPrompt" + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + saveAs: ColorTemperatureMiredsStep3b + constraints: + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTempPhysicalMaxMiredsValue + + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 10000 - - label: - "After another 5 seconds, TH reads ColorTemperatureMireds attribute - from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649666665.611446][9091:9096] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087365394 - [1649666665.611577][9091:9096] CHIP:TOO: ColorTemperature: 14000 (value can vary) - [1649666665.611685][9091:9096] CHIP:EM: Sending Standalone Ack for MessageCounter:8367884 on exchange 32174i - cluster: "LogCommands" - command: "UserPrompt" + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + saveAs: ColorTemperatureMiredsStep3c + constraints: + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTemperatureMiredsStep3b + + - label: "Wait 5s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 5000 + + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + constraints: + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTemperatureMiredsStep3c - label: "TH sends MoveColorTemperature command to DUT with MoveMode = 0x01(up), Rate = (ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20" - PICS: CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol move-color-temperature 1 32369 0 65279 0 0 1 1 - - Verify in TH(chip-tool) Log: - [1649666683.278957][9097:9102] CHIP:DMG: StatusIB = - [1649666683.279020][9097:9102] CHIP:DMG: { - [1649666683.279087][9097:9102] CHIP:DMG: status = 0x00 (SUCCESS), - [1649666683.279146][9097:9102] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + PICS: CC.S.F04 && CC.S.C4b.Rsp + command: MoveColorTemperature + arguments: + values: + - name: "MoveMode" + value: 1 + - name: "Rate" + value: + ( ColorTempPhysicalMaxMiredsValue - + ColorTempPhysicalMinMiredsValue ) / 20 + - name: "ColorTemperatureMinimumMireds" + value: ColorTempPhysicalMinMiredsValue + - name: "ColorTemperatureMaximumMireds" + value: ColorTempPhysicalMaxMiredsValue + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 10000 - label: "After 10 seconds, TH sends MoveColorTemperature command to DUT with MoveMode = 0x00(stop), Rate = (ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20" - PICS: CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol move-color-temperature 0 32369 0 65279 0 0 1 1 - - Verify in TH(chip-tool) Log: - [1649666683.278957][9097:9102] CHIP:DMG: StatusIB = - [1649666683.279020][9097:9102] CHIP:DMG: { - [1649666683.279087][9097:9102] CHIP:DMG: status = 0x00 (SUCCESS), - [1649666683.279146][9097:9102] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + PICS: CC.S.F04 && CC.S.C4b.Rsp + command: MoveColorTemperature arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "MoveMode" + value: 0 + - name: "Rate" + value: + ( ColorTempPhysicalMaxMiredsValue - + ColorTempPhysicalMinMiredsValue ) / 20 + - name: "ColorTemperatureMinimumMireds" + value: ColorTempPhysicalMinMiredsValue + - name: "ColorTemperatureMaximumMireds" + value: ColorTempPhysicalMaxMiredsValue + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 - label: "TH reads ColorTemperatureMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649666800.459923][9128:9133] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087368020 - [1649666800.460008][9128:9133] CHIP:TOO: ColorTemperature: 12500 (value can vary) - [1649666800.460160][9128:9133] CHIP:EM: Sending Standalone Ack for MessageCounter:363494 on exchange 55194i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + saveAs: ColorTemperatureMiredsStep4c + constraints: + minValue: + ( ColorTempPhysicalMaxMiredsValue - + ColorTempPhysicalMinMiredsValue ) / 20 + maxValue: ColorTempPhysicalMaxMiredsValue - - label: - "After another 2 seconds, TH reads ColorTemperatureMireds attribute - from DUT" - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649666800.459923][9128:9133] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087368020 - [1649666800.460008][9128:9133] CHIP:TOO: ColorTemperature: 12500 (value can very) - [1649666800.460160][9128:9133] CHIP:EM: Sending Standalone Ack for MessageCounter:363494 on exchange 55194i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "TH reads ColorMode attribute from DUT." - PICS: CC.S.F04 && CC.S.A0008 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-mode 1 1 - - Verify in TH(chip-tool) Log: - [1659712688.315752][5086:5091] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0008 DataVersion: 468119348 - [1659712688.315831][5086:5091] CHIP:TOO: ColorMode: 2 - [1659712688.315957][5086:5091] CHIP:EM: Sending Standalone Ack for MessageCounter:240585607 on exchange 4537i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "TH reads EnhancedColorMode attribute from DUT." - PICS: CC.S.F04 && CC.S.A4001 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read enhanced-color-mode 1 1 - - Verify in TH(chip-tool) Log: - [1659712734.529238][5094:5099] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_4001 DataVersion: 468119348 - [1659712734.529360][5094:5099] CHIP:TOO: EnhancedColorMode: 2 - [1659712734.529552][5094:5099] CHIP:EM: Sending Standalone Ack for MessageCounter:39175367 on exchange 3560i - cluster: "LogCommands" - command: "UserPrompt" + - label: "Wait 2s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 2000 + + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + value: ColorTemperatureMiredsStep4c + + - label: "TH reads ColorMode attribute from DUT" + PICS: CC.S.F04 && CC.S.A0008 + command: "readAttribute" + attribute: "ColorMode" + response: + constraints: + minValue: 0 + maxValue: 2 + + - label: "TH reads EnhancedColorMode attribute from DUT" + PICS: CC.S.F04 && CC.S.A4001 + command: "readAttribute" + attribute: "ColorMode" + response: + constraints: + minValue: 0 + maxValue: 3 - label: "Turn off light that we turned on" PICS: OO.S.C00.Rsp diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml index 037aa84675a92b..7a6236647b0019 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml @@ -80,219 +80,204 @@ tests: "TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds=(ColorTempPhysicalMinMireds + ColorTempPhysicalMaxMireds)/2 and TransitionTime=0 (immediately)." - PICS: CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol move-to-color-temperature 32639 0 0 0 1 1 - - Verify in TH(chip-tool) Log: - [1649666592.559286][9065:9070] CHIP:DMG: StatusIB = - [1649666592.559322][9065:9070] CHIP:DMG: { - [1649666592.559357][9065:9070] CHIP:DMG: status = 0x00 (SUCCESS), - [1649666592.559391][9065:9070] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + PICS: CC.S.F04 && CC.S.C0a.Rsp + command: "MoveToColorTemperature" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "colorTemperature" + value: + ( ColorTempPhysicalMinMiredsValue + + ColorTempPhysicalMaxMiredsValue ) / 2 + - name: "TransitionTime" + value: 0 + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 - label: "TH sends StepColorTemperature command to DUT with StepMode = 0x01 (up), StepSize = (ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/2 and TransitionTime = 200 (20s)." - PICS: CC.S.F04 && CC.S.C4c.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol step-color-temperature 1 32639 200 0 65279 0 0 1 1 - - Verify in TH(chip-tool) Log: - [1649667424.918523][9183:9188] CHIP:DMG: StatusIB = - [1649667424.918601][9183:9188] CHIP:DMG: { - [1649667424.918678][9183:9188] CHIP:DMG: status = 0x00 (SUCCESS), - [1649667424.918741][9183:9188] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + PICS: CC.S.F04 && CC.S.C4c.Rsp + command: "StepColorTemperature" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649667419.577304][9177:9182] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087380060 - [1649667419.577405][9177:9182] CHIP:TOO: ColorTemperature: 22000 (value can vary) - [1649667419.577532][9177:9182] CHIP:EM: Sending Standalone Ack for MessageCounter:15518191 on exchange 14182i - cluster: "LogCommands" - command: "UserPrompt" + - name: "StepMode" + value: 1 + - name: "StepSize" + value: + ( ColorTempPhysicalMinMiredsValue + + ColorTempPhysicalMaxMiredsValue ) / 2 + - name: "ColorTemperatureMinimumMireds" + value: ColorTempPhysicalMinMiredsValue + - name: "ColorTemperatureMaximumMireds" + value: ColorTempPhysicalMaxMiredsValue + - name: "TransitionTime" + value: 200 + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 10000 - - label: - "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + saveAs: ColorTemperatureMiredsStep2c + constraints: + minValue: + ( ColorTempPhysicalMinMiredsValue + + ColorTempPhysicalMaxMiredsValue ) / 2 + maxValue: ColorTempPhysicalMaxMiredsValue - Verify in TH(chip-tool) Log: - [1649667419.577304][9177:9182] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087380060 - [1649667419.577405][9177:9182] CHIP:TOO: ColorTemperature: 25000 (value can vary) - [1649667419.577532][9177:9182] CHIP:EM: Sending Standalone Ack for MessageCounter:15518191 on exchange 14182i - cluster: "LogCommands" - command: "UserPrompt" + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 10000 - - label: - "After another 5 seconds, TH reads ColorTemperatureMireds attribute - from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + saveAs: ColorTemperatureMiredsStep2d + constraints: + minValue: ColorTemperatureMiredsStep2c + maxValue: ColorTempPhysicalMaxMiredsValue - Verify in TH(chip-tool) Log: - [1649667419.577304][9177:9182] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087380060 - [1649667419.577405][9177:9182] CHIP:TOO: ColorTemperature: 25000 (value can vary) - [1649667419.577532][9177:9182] CHIP:EM: Sending Standalone Ack for MessageCounter:15518191 on exchange 14182i - cluster: "LogCommands" - command: "UserPrompt" + - label: "Wait 5s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 5000 + + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + constraints: + minValue: ColorTemperatureMiredsStep2d + maxValue: ColorTempPhysicalMaxMiredsValue - label: "TH sends StepColorTemperature command to DUT with StepMode = 0x03 (down), StepSize = (ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds) and TransitionTime = 200 (20s)." - PICS: CC.S.F04 && CC.S.C4c.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol step-color-temperature 3 65279 200 0 65279 0 0 1 1 - - Verify in TH(chip-tool) Log: - [1649667424.918523][9183:9188] CHIP:DMG: StatusIB = - [1649667424.918601][9183:9188] CHIP:DMG: { - [1649667424.918678][9183:9188] CHIP:DMG: status = 0x00 (SUCCESS), - [1649667424.918741][9183:9188] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + PICS: CC.S.F04 && CC.S.C4c.Rsp + command: "StepColorTemperature" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649667431.007143][9189:9194] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087380282 - [1649667431.007227][9189:9194] CHIP:TOO: ColorTemperature: 55000 (value can vary) - [1649667431.007331][9189:9194] CHIP:EM: Sending Standalone Ack for MessageCounter:16519125 on exchange 51144i - cluster: "LogCommands" - command: "UserPrompt" + - name: "StepMode" + value: 3 + - name: "StepSize" + value: + ColorTempPhysicalMaxMiredsValue - + ColorTempPhysicalMinMiredsValue + - name: "ColorTemperatureMinimumMireds" + value: ColorTempPhysicalMinMiredsValue + - name: "ColorTemperatureMaximumMireds" + value: ColorTempPhysicalMaxMiredsValue + - name: "TransitionTime" + value: 200 + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 10000 - - label: - "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + saveAs: ColorTemperatureMiredsStep3b + constraints: + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTempPhysicalMaxMiredsValue - Verify in TH(chip-tool) Log: - [1649667431.007143][9189:9194] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087380282 - [1649667431.007227][9189:9194] CHIP:TOO: ColorTemperature: 52300 (value can vary) - [1649667431.007331][9189:9194] CHIP:EM: Sending Standalone Ack for MessageCounter:16519125 on exchange 51144i - cluster: "LogCommands" - command: "UserPrompt" + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 10000 - - label: - "After another 5 seconds, TH reads ColorTemperatureMireds attribute - from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + saveAs: ColorTemperatureMiredsStep3c + constraints: + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTemperatureMiredsStep3b - Verify in TH(chip-tool) Log: - [1649667479.607750][9202:9207] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087381226 - [1649667479.607822][9202:9207] CHIP:TOO: ColorTemperature: 52300 (value can vary) - [1649667479.607915][9202:9207] CHIP:EM: Sending Standalone Ack for MessageCounter:10286581 on exchange 17774i - cluster: "LogCommands" - command: "UserPrompt" + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "TH reads ColorMode attribute from DUT." - PICS: CC.S.F04 && CC.S.A0008 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-mode 1 1 + - name: "ms" + value: 10000 - Verify in TH(chip-tool) Log: - [1659712688.315752][5086:5091] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0008 DataVersion: 468119348 - [1659712688.315831][5086:5091] CHIP:TOO: ColorMode: 2 - [1659712688.315957][5086:5091] CHIP:EM: Sending Standalone Ack for MessageCounter:240585607 on exchange 4537i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + constraints: + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTemperatureMiredsStep3c - - label: "TH reads EnhancedColorMode attribute from DUT." - PICS: CC.S.F04 && CC.S.A4001 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read enhanced-color-mode 1 1 + - label: "TH reads ColorMode attribute from DUT" + PICS: CC.S.F04 && CC.S.A0008 + command: "readAttribute" + attribute: "ColorMode" + response: + constraints: + minValue: 0 + maxValue: 2 - Verify in TH(chip-tool) Log: - [1659712734.529238][5094:5099] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_4001 DataVersion: 468119348 - [1659712734.529360][5094:5099] CHIP:TOO: EnhancedColorMode: 2 - [1659712734.529552][5094:5099] CHIP:EM: Sending Standalone Ack for MessageCounter:39175367 on exchange 3560i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "TH reads EnhancedColorMode attribute from DUT" + PICS: CC.S.F04 && CC.S.A4001 + command: "readAttribute" + attribute: "ColorMode" + response: + constraints: + minValue: 0 + maxValue: 3 - label: "Turn Off light that we turned on" PICS: OO.S.C00.Rsp diff --git a/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml index 48000cd533c82a..4efdcf2f096dc9 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml @@ -46,7 +46,7 @@ tests: - label: "TH sends MoveToHue command to DUT with Hue=200, Direction=0x00 (shortest distance) and TransitionTime=0 (immediately)." - PICS: CC.S.F00 && CC.S.C00.Rsp + PICS: CC.S.C00.Rsp command: "MoveToHue" arguments: values: @@ -72,7 +72,7 @@ tests: - label: "TH sends MoveHue command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)" - PICS: CC.S.C01.Rsp && CC.S.F00 + PICS: CC.S.C01.Rsp command: "MoveHue" arguments: values: @@ -94,7 +94,7 @@ tests: value: 10000 - label: "TH sends StopMoveStep command to DUT" - PICS: CC.S.C47.Rsp && CC.S.F00 + PICS: CC.S.C47.Rsp command: "StopMoveStep" arguments: values: @@ -104,7 +104,7 @@ tests: value: 0 - label: "TH reads CurrentHue attribute from DUT" - PICS: CC.S.A0000 && CC.S.C01.Rsp && CC.S.F00 + PICS: CC.S.A0000 && CC.S.C01.Rsp command: "readAttribute" attribute: "CurrentHue" response: @@ -121,7 +121,7 @@ tests: value: 2000 - label: "TH reads CurrentHue attribute from DUT" - PICS: CC.S.A0000 && CC.S.C01.Rsp && CC.S.F00 + PICS: CC.S.A0000 && CC.S.C01.Rsp command: "readAttribute" attribute: "CurrentHue" response: @@ -132,7 +132,7 @@ tests: - label: "TH sends MoveToSaturation command to DUT with Saturation=150 and TransitionTime=0 (immediately)" - PICS: CC.S.F00 && CC.S.C03.Rsp + PICS: CC.S.C03.Rsp command: "MoveToSaturation" arguments: values: @@ -157,7 +157,7 @@ tests: "TH sends MoveSaturation command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)" command: "MoveSaturation" - PICS: CC.S.F00 && CC.S.C04.Rsp + PICS: CC.S.C04.Rsp arguments: values: - name: "MoveMode" @@ -178,7 +178,7 @@ tests: value: 10000 - label: "TH sends StopMoveStep command to DUT" - PICS: CC.S.C47.Rsp && CC.S.F00 + PICS: CC.S.C47.Rsp command: "StopMoveStep" arguments: values: @@ -188,7 +188,7 @@ tests: value: 0 - label: "TH reads CurrentSaturation attribute from DUT" - PICS: CC.S.F00 && CC.S.A0001 + PICS: CC.S.A0001 command: "readAttribute" attribute: "CurrentSaturation" response: @@ -206,7 +206,7 @@ tests: value: 2000 - label: "TH reads CurrentSaturation attribute from DUT" - PICS: CC.S.F00 && CC.S.A0001 + PICS: CC.S.A0001 command: "readAttribute" attribute: "CurrentSaturation" response: @@ -215,7 +215,7 @@ tests: maxValue: 230 - label: "TH reads ColorTempPhysicalMinMireds attribute from DUT" - PICS: CC.S.F04 && CC.S.A400b + PICS: CC.S.A400b command: "readAttribute" attribute: "ColorTempPhysicalMinMireds" response: @@ -226,7 +226,7 @@ tests: maxValue: 65279 - label: "TH reads ColorTempPhysicalMaxMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A400c + PICS: CC.S.A400c command: "readAttribute" attribute: "ColorTempPhysicalMaxMireds" response: @@ -240,106 +240,101 @@ tests: "TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds= ColorTempPhysicalMaxMireds / 2 and TransitionTime=0 (immediately)." - PICS: CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol move-to-color-temperature 32639 0 0 0 1 1 - - Verify in TH(chip-tool) Log: - [1649666592.559286][9065:9070] CHIP:DMG: StatusIB = - [1649666592.559322][9065:9070] CHIP:DMG: { - [1649666592.559357][9065:9070] CHIP:DMG: status = 0x00 (SUCCESS), - [1649666592.559391][9065:9070] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + PICS: CC.S.C0a.Rsp + command: "MoveToColorTemperature" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "colorTemperature" + value: + ( ColorTempPhysicalMinMireds + ColorTempPhysicalMaxMireds ) + / 2 + - name: "TransitionTime" + value: 0 + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 - label: "TH sends MoveColorTemperature command to DUT with MoveMode = 0x01 - (up), Rate = ColorTempPhysicalMaxMireds / 40" - PICS: CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol move-color-temperature 1 16319 0 65279 0 0 1 1 - - Verify in TH(chip-tool) Log: - [1649666643.381403][9085:9090] CHIP:DMG: StatusIB = - [1649666643.381465][9085:9090] CHIP:DMG: { - [1649666643.381530][9085:9090] CHIP:DMG: status = 0x00 (SUCCESS), - [1649666643.381582][9085:9090] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + (up), Rate = (ColorTempPhysicalMaxMireds - + ColorTempPhysicalMinMireds)/40" + PICS: CC.S.C4b.Rsp + command: MoveColorTemperature arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "After 10 seconds, TH sends StopMoveStep command to DUT." - PICS: CC.S.F04 && CC.S.C47.Rsp && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol stop-move-step 0 0 1 1 - - Verify in TH(chip-tool) log: - StatusIB = - [1652253588.380407][14229:14234] CHIP:DMG: { - [1652253588.380489][14229:14234] CHIP:DMG: status = 0x00 (SUCCESS), - [1652253588.380573][14229:14234] CHIP:DMG: }, - cluster: "LogCommands" - command: "UserPrompt" + - name: "MoveMode" + value: 1 + - name: "Rate" + value: + ( ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds ) + / 40 + - name: "ColorTemperatureMinimumMireds" + value: ColorTempPhysicalMinMireds + - name: "ColorTemperatureMaximumMireds" + value: ColorTempPhysicalMaxMireds + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 + + - label: "Wait 10s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 10000 - - label: "TH reads ColorTemperatureMireds attribute from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649666635.306093][9078:9083] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087364802 - [1649666635.306184][9078:9083] CHIP:TOO: ColorTemperature: 16000 (value can vary) - [1649666635.306298][9078:9083] CHIP:EM: Sending Standalone Ack for MessageCounter:2077197 on exchange 1795i - cluster: "LogCommands" - command: "UserPrompt" + - label: "TH sends StopMoveStep command to DUT" + PICS: CC.S.C4b.Rsp && CC.S.C47.Rsp + command: StopMoveStep arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 - - label: - "After another 2 seconds, TH reads ColorTemperatureMireds attribute - from DUT." - PICS: CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT - verification: | - ./chip-tool colorcontrol read color-temperature 1 1 - - Verify in TH(chip-tool) Log: - [1649666635.306093][9078:9083] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0007 DataVersion: 4087364802 - [1649666635.306184][9078:9083] CHIP:TOO: ColorTemperature: 16000 (value can vary) - [1649666635.306298][9078:9083] CHIP:EM: Sending Standalone Ack for MessageCounter:2077197 on exchange 1795i - cluster: "LogCommands" - command: "UserPrompt" + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.A0007 && CC.S.C4b.Rsp && CC.S.C47.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + saveAs: ColorTemperatureMiredsStep4f + constraints: + minValue: + ( ColorTempPhysicalMaxMireds + ColorTempPhysicalMinMireds ) / + 2 + maxValue: ColorTempPhysicalMaxMireds + + - label: "Wait 2s" + cluster: "DelayCommands" + command: "WaitForMs" arguments: values: - - name: "message" - value: "please enter 'y' for success" - - name: "expectedValue" - value: "y" + - name: "ms" + value: 2000 + + - label: "TH reads ColorTemperatureMireds attribute from DUT." + PICS: CC.S.A0007 && CC.S.C4b.Rsp && CC.S.C47.Rsp + command: "readAttribute" + attribute: "ColorTemperature" + response: + value: ColorTemperatureMiredsStep4f - label: "TH sends EnhancedMoveToHue command to DUT with EnhancedHue=20000, Direction=0x00 (shortest distance) and TransitionTime=0 (immediately)." - PICS: CC.S.F01 && CC.S.C40.Rsp + PICS: CC.S.C40.Rsp command: "EnhancedMoveToHue" arguments: values: @@ -365,7 +360,7 @@ tests: - label: "TH sends EnhancedMoveHue command to DUT with MoveMode=0x01 (up) and Rate=500 (units/s)" - PICS: CC.S.F01 && CC.S.C41.Rsp + PICS: CC.S.C41.Rsp command: "EnhancedMoveHue" arguments: values: diff --git a/src/app/tests/suites/certification/Test_TC_DGETH_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGETH_1_1.yaml index 4be61d1c00511c..ee795cf0cfdb43 100644 --- a/src/app/tests/suites/certification/Test_TC_DGETH_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGETH_1_1.yaml @@ -13,89 +13,87 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 3.1.1. [TC-DGETH-1.1] Global Attributes [{DUT_Server}] +name: 47.1.1. [TC-DGETH-1.1] Global Attributes [DUT as Server] PICS: - DGETH.S config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Ethernet Network Diagnostics" endpoint: 0 tests: - - label: "Commission DUT to TH" - verification: | - ./chip-tool pairing ble-wifi NODEID SSID PASSWD 20202021 3840 (commissioner side) - disabled: true - - - label: "TH reads the ClusterRevision from DUT." - verification: | - ./chip-tool ethernetnetworkdiagnostics read cluster-revision 1 0 - - Verify cluster revision value is 1 in TH(chip-tool) log: - - [1653911336.371533][3567:3572] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_FFFD DataVersion: 2944003194 - [1653911336.371751][3567:3572] CHIP:TOO: ClusterRevision: 1 - [1653911336.371940][3567:3572] CHIP:EM: Sending Standalone Ack for MessageCounter:13743333 on exchange 10337i - disabled: true - - - label: "TH reads the FeatureMap from DUT." - verification: | - ./chip-tool ethernetnetworkdiagnostics read feature-map 1 0 - - Verify featuremap value is 3 in TH(chip-tool) log: - - [1651786827.582555][240914:240920] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_FFFC DataVersion: 2811403040 - [1651786827.582608][240914:240920] CHIP:TOO: FeatureMap: 3 - disabled: true - - - label: "TH reads AttribubteList from DUT." - verification: | - ./chip-tool ethernetnetworkdiagnostics read attribute-list 1 0 - - Verify list of supported attributes in TH(chip-tool) log: - - [1651786900.043572][240929:240934] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_FFFB DataVersion: 2811403040 - [1651786900.043655][240929:240934] CHIP:TOO: AttributeList: 14 entries - [1651786900.043689][240929:240934] CHIP:TOO: [1]: 0 - [1651786900.043710][240929:240934] CHIP:TOO: [2]: 1 - [1651786900.043730][240929:240934] CHIP:TOO: [3]: 2 - [1651786900.043744][240929:240934] CHIP:TOO: [4]: 3 - [1651786900.043757][240929:240934] CHIP:TOO: [5]: 4 - [1651786900.043775][240929:240934] CHIP:TOO: [6]: 5 - [1651786900.043796][240929:240934] CHIP:TOO: [7]: 6 - [1651786900.043817][240929:240934] CHIP:TOO: [8]: 7 - [1651786900.043838][240929:240934] CHIP:TOO: [9]: 8 - [1651786900.043862][240929:240934] CHIP:TOO: [10]: 65528 - [1651786900.043884][240929:240934] CHIP:TOO: [11]: 65529 - [1651786900.043907][240929:240934] CHIP:TOO: [12]: 65531 - [1651786900.043930][240929:240934] CHIP:TOO: [13]: 65532 - [1651786900.043952][240929:240934] CHIP:TOO: [14]: 65533 - disabled: true - - - label: "TH reads AcceptedCommandList from DUT." - verification: | - ./chip-tool ethernetnetworkdiagnostics read accepted-command-list 1 0 - - Verify list of Acccepted Command in TH(chip-tool) log: - - [1651786971.201258][240944:240949] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_FFF9 DataVersion: 2811403040 - [1651786971.201322][240944:240949] CHIP:TOO: AcceptedCommandList: 1 entries - [1651786971.201347][240944:240949] CHIP:TOO: [1]: 0 - disabled: true - - - label: "TH reads GeneratedCommandList from DUT." - verification: | - ./chip-tool ethernetnetworkdiagnostics read generated-command-list 1 0 - - Verify list of Generated Command, this list SHALL have zero entry in TH(chip-tool) log: - - [1651787190.403639][240971:240976] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_FFF8 DataVersion: 2811403040 - [1651787190.403729][240971:240976] CHIP:TOO: GeneratedCommandList: 0 entries - disabled: true - - - label: "TH reads EventList from DUT." - verification: | - Out of scope v1.0 - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads the ClusterRevision from DUT" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + - label: "TH reads the FeatureMap from DUT" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + minValue: 0 + maxValue: 3 + + - label: "TH reads AttributeList from DUT" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [65528, 65529, 65531, 65532, 65533] + + - label: "TH reads AcceptedCommandList from DUT" + PICS: DGETH.S.F00 || DGETH.S.F01 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + + - label: "TH reads AcceptedCommandList from DUT" + PICS: " !DGETH.S.F00 && !DGETH.S.F01 " + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads GeneratedCommandList from DUT" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + #Commenting out the step EventList attribute which is out of scope for matter V1.0 + #- 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" diff --git a/src/app/tests/suites/certification/Test_TC_DGSW_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGSW_1_1.yaml index ed474bb8089f5e..451db3abc570d5 100644 --- a/src/app/tests/suites/certification/Test_TC_DGSW_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGSW_1_1.yaml @@ -13,83 +13,125 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 3.1.1. [TC-DGSW-1.1] Global Attributes [{DUT_Sever}] +name: 44.1.1. [TC-DGSW-1.1] Global Attributes [DUT_Sever] PICS: - DGSW.S config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Software Diagnostics" endpoint: 0 tests: - - label: "Commission DUT to TH" - verification: | - ./chip-tool pairing ble-wifi NODEID SSID PASSWD 20202021 3840 (commissioner side) - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH reads the ClusterRevision from DUT" - verification: | - ./chip-tool softwarediagnostics read cluster-revision 1 0 - - Verify ClusterRevision attribute is of uint16, in this case it should be 1 in TH(chip-tool) Log - - [1651787699.397201][241075:241080] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0034 Attribute 0x0000_FFFD DataVersion: 1343666373 - [1651787699.397254][241075:241080] CHIP:TOO: ClusterRevision: 1 - disabled: true - - - label: "TH reads the FeatureMap from DUT." - verification: | - ./chip-tool softwarediagnostics read feature-map 1 0 - - Verify the featuremap value is 1 in TH(chip-tool) Log - - [1651787772.992060][241090:241095] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0034 Attribute 0x0000_FFFC DataVersion: 1343666373 - [1651787772.992110][241090:241095] CHIP:TOO: FeatureMap: 1 - disabled: true - - - label: "TH reads AttributeList from DUT." - verification: | - ./chip-tool softwarediagnostics read attribute-list 1 0 - - Verify a list of supported attributes in TH(chip-tool) Log - - [1651787823.737029][241102:241107] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0034 Attribute 0x0000_FFFB DataVersion: 1343666373 - [1651787823.737115][241102:241107] CHIP:TOO: AttributeList: 9 entries - [1651787823.737139][241102:241107] CHIP:TOO: [1]: 0 - [1651787823.737157][241102:241107] CHIP:TOO: [2]: 1 - [1651787823.737174][241102:241107] CHIP:TOO: [3]: 2 - [1651787823.737190][241102:241107] CHIP:TOO: [4]: 3 - [1651787823.737212][241102:241107] CHIP:TOO: [5]: 65528 - [1651787823.737229][241102:241107] CHIP:TOO: [6]: 65529 - [1651787823.737245][241102:241107] CHIP:TOO: [7]: 65531 - [1651787823.737261][241102:241107] CHIP:TOO: [8]: 65532 - [1651787823.737277][241102:241107] CHIP:TOO: [9]: 65533 - disabled: true - - - label: "TH reads AcceptedCommandList from DUT." - verification: | - ./chip-tool softwarediagnostics read accepted-command-list 1 0 - - Verify a list of Accepted Command that DUT implemented as mandatory or optional or features supported on TH(chip-tool) Log - - [1651787861.534707][241117:241122] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0034 Attribute 0x0000_FFF9 DataVersion: 1343666373 - [1651787861.534769][241117:241122] CHIP:TOO: AcceptedCommandList: 1 entries - [1651787861.534793][241117:241122] CHIP:TOO: [1]: 0 - disabled: true - - - label: "TH reads GeneratedCommandList from DUT." - verification: | - ./chip-tool softwarediagnostics read generated-command-list 1 0 - - Verify a list of Generated Command, this list should be empty in TH(chip-tool) Log - - [1651787918.020673][241128:241133] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0034 Attribute 0x0000_FFF8 DataVersion: 1343666373 - [1651787918.020734][241128:241133] CHIP:TOO: GeneratedCommandList: 0 entries - disabled: true - - - label: "TH reads EventList from DUT." - verification: | - Out of scope v1.0 - disabled: true + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + - label: "TH reads the FeatureMap from DUT" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + minValue: 0 + maxValue: 1 + + - label: "TH reads AttributeList from DUT" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [65528, 65529, 65531, 65532, 65533] + + - label: "TH reads optional attribute(ThreadMetrics) in AttributeList" + PICS: DGSW.S.A0000 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0] + + - label: "TH reads optional attribute(CurrentHeapFree) in AttributeList" + PICS: DGSW.S.A0001 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [1] + + - label: "TH reads optional attribute(CurrentHeapUsed) in AttributeList" + PICS: DGSW.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] + + - label: + "TH reads Feature dependent attribute(CurrentHeapHighWatermark) in + AttributeList" + PICS: DGSW.S.F00 || DGSW.S.A0003 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + + - label: "TH reads AcceptedCommandList from DUT" + PICS: DGSW.S.F00 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + + - label: "TH reads AcceptedCommandList from DUT" + PICS: " !DGSW.S.F00 " + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads GeneratedCommandList from DUT" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + #Commenting out the step EventList attribute which is out of scope for matter V1.0 + #- 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" diff --git a/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml index 222d0e6cd0366f..5f8fee8d8262a9 100644 --- a/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml @@ -20,150 +20,95 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Thread Network Diagnostics" endpoint: 0 tests: - - label: "Commission DUT to TH" - verification: | - - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH reads the ClusterRevision from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read cluster-revision 54 0 - - Verify ClusterRevision: 1 on the TH Log: - - [1649747941.607337][9541:9546] CHIP:DMG: SuppressResponse = true, - [1649747941.607399][9541:9546] CHIP:DMG: InteractionModelRevision = 1 - [1649747941.607455][9541:9546] CHIP:DMG: } - [1649747941.607752][9541:9546] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_FFFD DataVersion: 1406212801 - [1649747941.607906][9541:9546] CHIP:TOO: ClusterRevision: 1 - disabled: true + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u - label: "TH reads the FeatureMap from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read feature-map 54 0 - - Verify FeatureMap: 15 on the TH Log: - - [1649747973.385016][9548:9553] CHIP:DMG: SuppressResponse = true, - [1649747973.385080][9548:9553] CHIP:DMG: InteractionModelRevision = 1 - [1649747973.385138][9548:9553] CHIP:DMG: } - [1649747973.385437][9548:9553] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_FFFC DataVersion: 1406212801 - [1649747973.385572][9548:9553] CHIP:TOO: FeatureMap: 15 - disabled: true + PICS: DGTHREAD.S.F00 || DGTHREAD.S.F01 || DGTHREAD.S.F02 || DGTHREAD.S.F03 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + minValue: 0 + maxValue: 31 - label: "TH reads AttributeList from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read attribute-list 54 0 - - Verify AttributeList on the TH Log: - - [1649748119.656589][9559:9564] CHIP:DMG: SuppressResponse = true, - [1649748119.656616][9559:9564] CHIP:DMG: InteractionModelRevision = 1 - [1649748119.656639][9559:9564] CHIP:DMG: } - [1649748119.656908][9559:9564] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_FFFB DataVersion: 1406212801 - [1649748119.657030][9559:9564] CHIP:TOO: AttributeList: 68 entries - [1649748119.657064][9559:9564] CHIP:TOO: [1]: 0 - [1649748119.657089][9559:9564] CHIP:TOO: [2]: 1 - [1649748119.657114][9559:9564] CHIP:TOO: [3]: 2 - [1649748119.657139][9559:9564] CHIP:TOO: [4]: 3 - [1649748119.657163][9559:9564] CHIP:TOO: [5]: 4 - [1649748119.657187][9559:9564] CHIP:TOO: [6]: 5 - [1649748119.657211][9559:9564] CHIP:TOO: [7]: 6 - [1649748119.657235][9559:9564] CHIP:TOO: [8]: 7 - [1649748119.657259][9559:9564] CHIP:TOO: [9]: 8 - [1649748119.657283][9559:9564] CHIP:TOO: [10]: 9 - [1649748119.657308][9559:9564] CHIP:TOO: [11]: 10 - [1649748119.657333][9559:9564] CHIP:TOO: [12]: 11 - [1649748119.657357][9559:9564] CHIP:TOO: [13]: 12 - [1649748119.657381][9559:9564] CHIP:TOO: [14]: 13 - [1649748119.657405][9559:9564] CHIP:TOO: [15]: 14 - [1649748119.657429][9559:9564] CHIP:TOO: [16]: 15 - [1649748119.657453][9559:9564] CHIP:TOO: [17]: 16 - [1649748119.657477][9559:9564] CHIP:TOO: [18]: 17 - [1649748119.657502][9559:9564] CHIP:TOO: [19]: 18 - [1649748119.657526][9559:9564] CHIP:TOO: [20]: 19 - [1649748119.657550][9559:9564] CHIP:TOO: [21]: 20 - [1649748119.657575][9559:9564] CHIP:TOO: [22]: 21 - [1649748119.657599][9559:9564] CHIP:TOO: [23]: 22 - [1649748119.657623][9559:9564] CHIP:TOO: [24]: 23 - [1649748119.657647][9559:9564] CHIP:TOO: [25]: 24 - [1649748119.657671][9559:9564] CHIP:TOO: [26]: 25 - [1649748119.657695][9559:9564] CHIP:TOO: [27]: 26 - [1649748119.657719][9559:9564] CHIP:TOO: [28]: 27 - [1649748119.657744][9559:9564] CHIP:TOO: [29]: 28 - [1649748119.657768][9559:9564] CHIP:TOO: [30]: 29 - [1649748119.657792][9559:9564] CHIP:TOO: [31]: 30 - [1649748119.657816][9559:9564] CHIP:TOO: [32]: 31 - [1649748119.657840][9559:9564] CHIP:TOO: [33]: 32 - [1649748119.657864][9559:9564] CHIP:TOO: [34]: 33 - [1649748119.657888][9559:9564] CHIP:TOO: [35]: 34 - [1649748119.657912][9559:9564] CHIP:TOO: [36]: 35 - [1649748119.657970][9559:9564] CHIP:TOO: [37]: 36 - [1649748119.657996][9559:9564] CHIP:TOO: [38]: 37 - [1649748119.658020][9559:9564] CHIP:TOO: [39]: 38 - [1649748119.658044][9559:9564] CHIP:TOO: [40]: 39 - [1649748119.658068][9559:9564] CHIP:TOO: [41]: 40 - [1649748119.658093][9559:9564] CHIP:TOO: [42]: 41 - [1649748119.658117][9559:9564] CHIP:TOO: [43]: 42 - [1649748119.658141][9559:9564] CHIP:TOO: [44]: 43 - [1649748119.658165][9559:9564] CHIP:TOO: [45]: 44 - [1649748119.658189][9559:9564] CHIP:TOO: [46]: 45 - [1649748119.658213][9559:9564] CHIP:TOO: [47]: 46 - [1649748119.658237][9559:9564] CHIP:TOO: [48]: 47 - [1649748119.658261][9559:9564] CHIP:TOO: [49]: 48 - [1649748119.658285][9559:9564] CHIP:TOO: [50]: 49 - [1649748119.658310][9559:9564] CHIP:TOO: [51]: 50 - [1649748119.658334][9559:9564] CHIP:TOO: [52]: 51 - [1649748119.658358][9559:9564] CHIP:TOO: [53]: 52 - [1649748119.658382][9559:9564] CHIP:TOO: [54]: 53 - [1649748119.658406][9559:9564] CHIP:TOO: [55]: 54 - [1649748119.658431][9559:9564] CHIP:TOO: [56]: 55 - [1649748119.658455][9559:9564] CHIP:TOO: [57]: 56 - [1649748119.658479][9559:9564] CHIP:TOO: [58]: 57 - [1649748119.658503][9559:9564] CHIP:TOO: [59]: 58 - [1649748119.658527][9559:9564] CHIP:TOO: [60]: 59 - [1649748119.658551][9559:9564] CHIP:TOO: [61]: 60 - [1649748119.658575][9559:9564] CHIP:TOO: [62]: 61 - [1649748119.658599][9559:9564] CHIP:TOO: [63]: 62 - [1649748119.658623][9559:9564] CHIP:TOO: [64]: 65528 - [1649748119.658648][9559:9564] CHIP:TOO: [65]: 65529 - [1649748119.658673][9559:9564] CHIP:TOO: [66]: 65531 - [1649748119.658697][9559:9564] CHIP:TOO: [67]: 65532 - [1649748119.658722][9559:9564] CHIP:TOO: [68]: 65533 - disabled: true - - - label: "TH reads EventList from DUT" - verification: | - Event List is not supported by CHIP Tool - disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: + [ + 0, + 1, + 2, + 3, + 4, + 5, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 59, + 60, + 61, + 62, + 65528, + 65529, + 65531, + 65532, + 65533, + ] - label: "TH reads AcceptedCommandList from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read accepted-command-list 54 0 - - Verify AcceptedCommandList: 1 entries on the TH Log: - - [1649748231.835572][9579:9584] CHIP:DMG: SuppressResponse = true, - [1649748231.835633][9579:9584] CHIP:DMG: InteractionModelRevision = 1 - [1649748231.835690][9579:9584] CHIP:DMG: } - [1649748231.836192][9579:9584] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_FFF9 DataVersion: 1406212801 - [1649748231.836344][9579:9584] CHIP:TOO: AcceptedCommandList: 1 entries - [1649748231.836420][9579:9584] CHIP:TOO: [1]: 0 - disabled: true + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] - label: "TH reads GeneratedCommandList from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read generated-command-list 54 0 - - Verify GeneratedCommandList: 0 entries on the TH Log: - - [1649748201.118100][9570:9575] CHIP:DMG: SuppressResponse = true, - [1649748201.118163][9570:9575] CHIP:DMG: InteractionModelRevision = 1 - [1649748201.118221][9570:9575] CHIP:DMG: } - [1649748201.118561][9570:9575] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_FFF8 DataVersion: 1406212801 - [1649748201.118707][9570:9575] CHIP:TOO: GeneratedCommandList: 0 entries - disabled: true + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + #Commenting out the step EventList attribute which is out of scope for matter V1.0 + #- 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" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_1_1.yaml index 0d49aa45bbf4c9..4789c9736d130d 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_1_1.yaml @@ -13,142 +13,346 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 116.1.1. [TC-DRLK-1.1] Global Attributes [DUT-Server] +name: 113.1.1. [TC-DRLK-1.1] Global Attributes [DUT-Server] PICS: - DRLK.S config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Door Lock" + endpoint: 1 tests: - - label: "Commission DUT to TH" - verification: | - verification step to be updated. - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH reads the ClusterRevision from DUT" - verification: | - ./chip-tool doorlock read cluster-revision 1 1 + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 6 + constraints: + type: int16u - Verify " ClusterRevision " on the TH(Chip-tool) Log: + - label: "TH reads the FeatureMap from DUT" + PICS: + DRLK.S.F00 || DRLK.S.F01 || DRLK.S.F02 || DRLK.S.F04 || DRLK.S.F05 || + DRLK.S.F06 || DRLK.S.F07 || DRLK.S.F08 || DRLK.S.F10 || DRLK.S.F11 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + minValue: 0 + maxValue: 4095 - [1654670381.498137][2934:2939] CHIP:DMG: - [1654670381.498163][2934:2939] CHIP:DMG: SuppressResponse = true, - [1654670381.498189][2934:2939] CHIP:DMG: InteractionModelRevision = 1 - [1654670381.498214][2934:2939] CHIP:DMG: } - [1654670381.498373][2934:2939] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Attribute 0x0000_FFFD DataVersion: 1454093977 - [1654670381.498486][2934:2939] CHIP:TOO: ClusterRevision: 6 - disabled: true + - label: "TH reads AttributeList from DUT" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 2, 37, 38, 65528, 65529, 65531, 65532, 65533] - - label: "TH reads the FeatureMap from DUT" - verification: | - ./chip-tool doorlock read feature-map 1 1 + - label: + "TH reads Feature dependent(DRLK.S.F08) attributes in AttributeList" + PICS: DRLK.S.F08 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [17, 27, 28] - Verify " Featuremap " on the TH(Chip-tool) Log: + - label: + "TH reads Feature dependent(DRLK.S.F00) attributes in AttributeList" + PICS: DRLK.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [18, 23, 24] - [1659339327.515963][3169:3174] CHIP:DMG: SuppressResponse = true, - [1659339327.516018][3169:3174] CHIP:DMG: InteractionModelRevision = 1 - [1659339327.516059][3169:3174] CHIP:DMG: } - [1659339327.516250][3169:3174] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Attribute 0x0000_FFFC DataVersion: 429700879 - [1659339327.516335][3169:3174] CHIP:TOO: FeatureMap: 3507 - disabled: true + - label: + "TH reads Feature dependent(DRLK.S.F01) attributes in AttributeList" + PICS: DRLK.S.F01 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [19, 25, 26] - - label: "TH reads AttributeList from DUT" - verification: | - ./chip-tool doorlock read attribute-list 1 1 - - Verify " AttributeList " on the TH(Chip-tool) Log: - - [1656418220.810680][10056:10061] CHIP:DMG: ], - [1656418220.810827][10056:10061] CHIP:DMG: - [1656418220.810851][10056:10061] CHIP:DMG: SuppressResponse = true, - [1656418220.810876][10056:10061] CHIP:DMG: InteractionModelRevision = 1 - [1656418220.810898][10056:10061] CHIP:DMG: } - [1656418220.812834][10056:10061] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Attribute 0x0000_FFFB DataVersion: 1452725250 - [1659339383.420974][3178:3183] CHIP:TOO: [1]: 0 - [1659339383.420999][3178:3183] CHIP:TOO: [2]: 1 - [1659339383.421024][3178:3183] CHIP:TOO: [3]: 2 - [1659339383.421048][3178:3183] CHIP:TOO: [4]: 3 - [1659339383.421072][3178:3183] CHIP:TOO: [5]: 17 - [1659339383.421096][3178:3183] CHIP:TOO: [6]: 18 - [1659339383.421121][3178:3183] CHIP:TOO: [7]: 19 - [1659339383.421145][3178:3183] CHIP:TOO: [8]: 20 - [1659339383.421169][3178:3183] CHIP:TOO: [9]: 21 - [1659339383.421193][3178:3183] CHIP:TOO: [10]: 22 - [1659339383.421217][3178:3183] CHIP:TOO: [11]: 23 - [1659339383.421241][3178:3183] CHIP:TOO: [12]: 24 - [1659339383.421265][3178:3183] CHIP:TOO: [13]: 25 - [1659339383.421289][3178:3183] CHIP:TOO: [14]: 26 - [1659339383.421313][3178:3183] CHIP:TOO: [15]: 27 - [1659339383.421337][3178:3183] CHIP:TOO: [16]: 28 - [1659339383.421361][3178:3183] CHIP:TOO: [17]: 33 - [1659339383.421385][3178:3183] CHIP:TOO: [18]: 35 - [1659339383.421409][3178:3183] CHIP:TOO: [19]: 36 - [1659339383.421433][3178:3183] CHIP:TOO: [20]: 37 - [1659339383.421457][3178:3183] CHIP:TOO: [21]: 38 - [1659339383.421480][3178:3183] CHIP:TOO: [22]: 41 - [1659339383.421505][3178:3183] CHIP:TOO: [23]: 43 - [1659339383.421529][3178:3183] CHIP:TOO: [24]: 48 - [1659339383.421553][3178:3183] CHIP:TOO: [25]: 49 - [1659339383.421576][3178:3183] CHIP:TOO: [26]: 51 - [1659339383.421601][3178:3183] CHIP:TOO: [27]: 65528 - [1659339383.421625][3178:3183] CHIP:TOO: [28]: 65529 - [1659339383.421649][3178:3183] CHIP:TOO: [29]: 65531 - [1659339383.421673][3178:3183] CHIP:TOO: [30]: 65532 - [1659339383.421697][3178:3183] CHIP:TOO: [31]: 65533 - disabled: true - - - label: "TH reads EventList from DUT" - verification: | - OUT OF SCOPE FOR V1.0 - disabled: true + - label: "TH reads Feature dependent(DRLK.S.F04) attribute in AttributeList" + PICS: DRLK.S.F04 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [20] + + - label: "TH reads Feature dependent(DRLK.S.F10) attribute in AttributeList" + PICS: DRLK.S.F10 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [21] + + - label: "TH reads Feature dependent(DRLK.S.F11) attribute in AttributeList" + PICS: DRLK.S.F11 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [22] + + - label: + "TH reads Feature dependent(DRLK.S.F00 or DRLK.S.F01) attributes in + AttributeList" + PICS: DRLK.S.F00 || DRLK.S.F01 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [48, 49] + + - label: + "TH reads Feature dependent(DRLK.S.F07 or DRLK.S.F00) attribute in + AttributeList" + PICS: DRLK.S.F07 || DRLK.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [51] + + - label: "TH reads optional attribute(Language) in AttributeList" + PICS: DRLK.S.A0021 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [33] + + - label: "TH reads optional attribute(LEDSettings) in AttributeList" + PICS: DRLK.S.A0022 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [34] + + - label: "TH reads optional attribute(AutoRelockTime) in AttributeList" + PICS: DRLK.S.A0023 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [35] + + - label: "TH reads optional attribute(SoundVolume) in AttributeList" + PICS: DRLK.S.A0024 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [36] + + - label: + "TH reads optional attribute(DefaultConfigurationRegister) in + AttributeList" + PICS: DRLK.S.A0027 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [39] + + - label: + "TH reads optional attribute(EnableLocalProgramming) in AttributeList" + PICS: DRLK.S.A0028 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [40] + + - label: + "TH reads optional attribute(EnableOneTouchLocking) in AttributeList" + PICS: DRLK.S.A0029 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [41] + + - label: + "TH reads optional attribute(EnableInsideStatusLED) in AttributeList" + PICS: DRLK.S.A002a + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [42] + + - label: + "TH reads optional attribute(EnablePrivacyModeButton) in AttributeList" + PICS: DRLK.S.A002b + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [43] + + - label: + "TH reads optional attribute(LocalProgrammingFeatures) in + AttributeList" + PICS: DRLK.S.A002c + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [44] - label: "TH reads AcceptedCommandList from DUT" - verification: | - ./chip-tool doorlock read accepted-command-list 1 1 - - Verify " AcceptedCommandList " on the TH(Chip-tool) Log: - - [1656418338.200497][10068:10073] CHIP:DMG: ], - [1656418338.200598][10068:10073] CHIP:DMG: - [1656418338.200622][10068:10073] CHIP:DMG: SuppressResponse = true, - [1656418338.200646][10068:10073] CHIP:DMG: InteractionModelRevision = 1 - [1656418338.200669][10068:10073] CHIP:DMG: } - [1656418338.201816][10068:10073] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Attribute 0x0000_FFF9 DataVersion: 1452725250 - [1659339522.172254][3214:3219] CHIP:TOO: [1]: 0 - [1659339522.172281][3214:3219] CHIP:TOO: [2]: 1 - [1659339522.172306][3214:3219] CHIP:TOO: [3]: 3 - [1659339522.172341][3214:3219] CHIP:TOO: [4]: 11 - [1659339522.172366][3214:3219] CHIP:TOO: [5]: 12 - [1659339522.172390][3214:3219] CHIP:TOO: [6]: 13 - [1659339522.172424][3214:3219] CHIP:TOO: [7]: 14 - [1659339522.172448][3214:3219] CHIP:TOO: [8]: 15 - [1659339522.172482][3214:3219] CHIP:TOO: [9]: 16 - [1659339522.172507][3214:3219] CHIP:TOO: [10]: 17 - [1659339522.172540][3214:3219] CHIP:TOO: [11]: 18 - [1659339522.172566][3214:3219] CHIP:TOO: [12]: 19 - [1659339522.172599][3214:3219] CHIP:TOO: [13]: 26 - [1659339522.172625][3214:3219] CHIP:TOO: [14]: 27 - [1659339522.172650][3214:3219] CHIP:TOO: [15]: 29 - [1659339522.172684][3214:3219] CHIP:TOO: [16]: 34 - [1659339522.172708][3214:3219] CHIP:TOO: [17]: 36 - [1659339522.172742][3214:3219] CHIP:TOO: [18]: 38 - disabled: true - - - label: "TH reads GeneratedCommandList from DUT" - verification: | - ./chip-tool doorlock read generated-command-list 1 1 - - Verify " GeneratedCommandList " on the TH(Chip-tool) Log: - - [1659330738.031410][2549:2555] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Attribute 0x0000_FFF8 DataVersion: 1452725250 - [1659339542.981573][3222:3227] CHIP:TOO: [1]: 12 - [1659339542.981605][3222:3227] CHIP:TOO: [2]: 15 - [1659339542.981635][3222:3227] CHIP:TOO: [3]: 18 - [1659339542.981666][3222:3227] CHIP:TOO: [4]: 28 - [1659339542.981696][3222:3227] CHIP:TOO: [5]: 35 - [1659339542.981726][3222:3227] CHIP:TOO: [6]: 37 - disabled: true + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0, 1] + + - label: + "TH reads Feature dependent commands(DRLK.S.F04) in + AcceptedCommandList" + PICS: DRLK.S.F04 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [11, 12, 13] + + - label: + "TH reads Feature dependent commands(DRLK.S.F10) in + AcceptedCommandList" + PICS: DRLK.S.F10 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [14, 15, 16] + + - label: + "TH reads Feature dependent commands(DRLK.S.F11) in + AcceptedCommandList" + PICS: DRLK.S.F11 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [17, 18, 19] + + - label: + "TH reads Feature dependent commands(DRLK.S.F08) in + AcceptedCommandList" + PICS: DRLK.S.F08 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [26, 27, 29, 34, 36, 38] + + - label: "TH reads optional commands(DRLK.S.C03.Rsp) in AcceptedCommandList" + PICS: DRLK.S.C03.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [3] + + - label: + "TH reads Feature dependent command(DRLK.S.F04) in + GeneratedCommandList" + PICS: DRLK.S.F04 + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [12] + + - label: + "TH reads Feature dependent command(DRLK.S.F10) in + GeneratedCommandList" + PICS: DRLK.S.F10 + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [15] + + - label: + "TH reads Feature dependent command(DRLK.S.F11) in + GeneratedCommandList" + PICS: DRLK.S.F11 + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [18] + + - label: + "TH reads Feature dependent command(DRLK.S.F08) in + GeneratedCommandList" + PICS: DRLK.S.F08 + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [28, 35] + #Commenting out the step EventList attribute which is out of scope for matter V1.0 + #- 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" diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 52705fa562980d..d75838c3862f92 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -27,6 +27,8 @@ TMP.S.A0002=1 TMP.S.A0003=1 TMP.M.ManuallyControlled=1 +#Software Diagnostics +DGSW.S.F00=1 DGSW.S.E00=1 DGSW.S.A0000=1 DGSW.S.A0001=1 @@ -879,6 +881,9 @@ DGETH.S.A0005=1 DGETH.S.A0006=1 DGETH.S.A0007=1 DGETH.S.A0008=1 +#Features +DGETH.S.F00=1 +DGETH.S.F01=1 #Wi-Fi Network Diagnostics Cluster DGWIFI.S.F00=1 @@ -963,6 +968,11 @@ LCFG.C.A0001=1 PSCFG.S.A0000=1 #Thread Network Diagnostics Cluster +#Features +DGTHREAD.S.F00=1 +DGTHREAD.S.F01=1 +DGTHREAD.S.F02=1 +DGTHREAD.S.F03=1 #server DGTHREAD.S.A0000=1 DGTHREAD.S.A0001=1 @@ -1136,17 +1146,17 @@ DRLK.S.A001a=1 DRLK.S.A001b=1 DRLK.S.A001c=1 DRLK.S.A0021=1 -DRLK.S.A0022=1 +DRLK.S.A0022=0 DRLK.S.A0023=1 DRLK.S.A0024=1 DRLK.S.A0025=1 DRLK.S.A0026=1 -DRLK.S.A0027=1 -DRLK.S.A0028=1 +DRLK.S.A0027=0 +DRLK.S.A0028=0 DRLK.S.A0029=1 -DRLK.S.A002a=1 +DRLK.S.A002a=0 DRLK.S.A002b=1 -DRLK.S.A002c=1 +DRLK.S.A002c=0 DRLK.S.A0030=1 DRLK.S.A0031=1 DRLK.S.A0032=1 diff --git a/src/app/tests/suites/tests.js b/src/app/tests/suites/tests.js index 72a6a945a5c4ca..86799a1415e135 100644 --- a/src/app/tests/suites/tests.js +++ b/src/app/tests/suites/tests.js @@ -151,7 +151,6 @@ function getManualTests() { ]; const EthernetNetworkDiagnostics = [ - "Test_TC_DGETH_1_1", "Test_TC_DGETH_3_1", "Test_TC_DGETH_3_2", ]; @@ -314,7 +313,6 @@ function getManualTests() { ]; const SoftwareDiagnostics = [ - "Test_TC_DGSW_1_1", "Test_TC_DGSW_3_1", "Test_TC_DGSW_3_2", ]; @@ -376,7 +374,6 @@ function getManualTests() { ]; const DoorLock = [ - "Test_TC_DRLK_1_1", "Test_TC_DRLK_2_1", "Test_TC_DRLK_2_6", "Test_TC_DRLK_2_8", @@ -430,7 +427,6 @@ function getManualTests() { ]; const ThreadNetworkDiagnostics = [ - "Test_TC_DGTHREAD_1_1", "Test_TC_DGTHREAD_2_5", "Test_TC_DGTHREAD_3_1", "Test_TC_DGTHREAD_3_2", @@ -467,7 +463,6 @@ function getManualTests() { ]; const Binding = [ - "Test_TC_BIND_1_1", "Test_TC_BIND_2_1", "Test_TC_BIND_2_2", "Test_TC_BIND_2_3", @@ -486,9 +481,6 @@ function getManualTests() { ]; const AccessControl = [ - "Test_TC_ACL_1_1", - "Test_TC_ACL_2_1", - "Test_TC_ACL_2_2", "Test_TC_ACL_2_3", "Test_TC_ACL_2_4", "Test_TC_ACL_2_5", @@ -570,6 +562,9 @@ function getManualTests() { function getTests() { const AccessControl = [ "TestAccessControlCluster", + "Test_TC_ACL_1_1", + "Test_TC_ACL_2_1", + "Test_TC_ACL_2_2", ]; const BooleanState = [ @@ -581,6 +576,10 @@ function getTests() { "Test_TC_ACT_1_1", ]; + const Binding = [ + "Test_TC_BIND_1_1", + ] + const ColorControl = [ "Test_TC_CC_1_1", "Test_TC_CC_2_1", @@ -613,6 +612,7 @@ function getTests() { ]; const EthernetNetworkDiagnostics = [ + "Test_TC_DGETH_1_1", "Test_TC_DGETH_2_1", "Test_TC_DGETH_2_2", ]; @@ -778,6 +778,7 @@ function getTests() { ]; const ThreadNetworkDiagnostics = [ + "Test_TC_DGTHREAD_1_1", "Test_TC_DGTHREAD_2_1", "Test_TC_DGTHREAD_2_2", "Test_TC_DGTHREAD_2_3", @@ -858,6 +859,7 @@ function getTests() { ]; const SoftwareDiagnostics = [ + "Test_TC_DGSW_1_1", "Test_TC_DGSW_2_1", "Test_TC_DGSW_2_2", "Test_TC_DGSW_2_3", @@ -871,6 +873,7 @@ function getTests() { "DL_UsersAndCredentials", "DL_LockUnlock", "DL_Schedules", + "Test_TC_DRLK_1_1", "Test_TC_DRLK_2_2", "Test_TC_DRLK_2_3", "Test_TC_DRLK_2_4", @@ -889,6 +892,7 @@ function getTests() { AccessControl, BooleanState, Actions, + Binding, ColorControl, DeviceManagement, Descriptor, diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index c76e7d2e50ac8e..89cc6b855400ae 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -35,9 +35,13 @@ class TestList : public Command CHIP_ERROR Run() override { printf("TestAccessControlCluster\n"); + printf("Test_TC_ACL_1_1\n"); + printf("Test_TC_ACL_2_1\n"); + printf("Test_TC_ACL_2_2\n"); printf("Test_TC_BOOL_1_1\n"); printf("Test_TC_BOOL_2_1\n"); printf("Test_TC_ACT_1_1\n"); + printf("Test_TC_BIND_1_1\n"); printf("Test_TC_CC_1_1\n"); printf("Test_TC_CC_2_1\n"); printf("Test_TC_CC_3_2\n"); @@ -60,6 +64,7 @@ class TestList : public Command printf("Test_TC_BINFO_2_1\n"); printf("Test_TC_CNET_1_3\n"); printf("Test_TC_DESC_1_1\n"); + printf("Test_TC_DGETH_1_1\n"); printf("Test_TC_DGETH_2_1\n"); printf("Test_TC_DGETH_2_2\n"); printf("Test_TC_FLW_1_1\n"); @@ -149,6 +154,7 @@ class TestList : public Command printf("Test_TC_TSUIC_1_1\n"); printf("Test_TC_TSUIC_2_1\n"); printf("Test_TC_TSUIC_2_2\n"); + printf("Test_TC_DGTHREAD_1_1\n"); printf("Test_TC_DGTHREAD_2_1\n"); printf("Test_TC_DGTHREAD_2_2\n"); printf("Test_TC_DGTHREAD_2_3\n"); @@ -215,6 +221,7 @@ class TestList : public Command printf("TestLevelControlWithOnOffDependency\n"); printf("TestCommissioningWindow\n"); printf("TestMultiAdmin\n"); + printf("Test_TC_DGSW_1_1\n"); printf("Test_TC_DGSW_2_1\n"); printf("Test_TC_DGSW_2_2\n"); printf("Test_TC_DGSW_2_3\n"); @@ -222,6 +229,7 @@ class TestList : public Command printf("DL_UsersAndCredentials\n"); printf("DL_LockUnlock\n"); printf("DL_Schedules\n"); + printf("Test_TC_DRLK_1_1\n"); printf("Test_TC_DRLK_2_2\n"); printf("Test_TC_DRLK_2_3\n"); printf("Test_TC_DRLK_2_4\n"); @@ -339,7 +347,6 @@ class ManualTestList : public Command printf("Test_TC_DLOG_3_1\n"); printf("Test_TC_DESC_2_1\n"); printf("Test_TC_DESC_2_2\n"); - printf("Test_TC_DGETH_1_1\n"); printf("Test_TC_DGETH_3_1\n"); printf("Test_TC_DGETH_3_2\n"); printf("Test_TC_CGEN_2_2\n"); @@ -465,7 +472,6 @@ class ManualTestList : public Command printf("Test_TC_SC_4_8\n"); printf("Test_TC_SC_4_9\n"); printf("Test_TC_SC_4_10\n"); - printf("Test_TC_DGSW_1_1\n"); printf("Test_TC_DGSW_3_1\n"); printf("Test_TC_DGSW_3_2\n"); printf("Test_TC_DGWIFI_1_1\n"); @@ -499,7 +505,6 @@ class ManualTestList : public Command printf("Test_TC_CC_9_1\n"); printf("Test_TC_CC_9_2\n"); printf("Test_TC_CC_9_3\n"); - printf("Test_TC_DRLK_1_1\n"); printf("Test_TC_DRLK_2_1\n"); printf("Test_TC_DRLK_2_6\n"); printf("Test_TC_DRLK_2_8\n"); @@ -526,7 +531,6 @@ class ManualTestList : public Command printf("Test_TC_TSTAT_3_1\n"); printf("Test_TC_TSTAT_3_2\n"); printf("Test_TC_TSUIC_3_1\n"); - printf("Test_TC_DGTHREAD_1_1\n"); printf("Test_TC_DGTHREAD_2_5\n"); printf("Test_TC_DGTHREAD_3_1\n"); printf("Test_TC_DGTHREAD_3_2\n"); @@ -548,7 +552,6 @@ class ManualTestList : public Command printf("Test_TC_FLABEL_1_1\n"); printf("Test_TC_FLABEL_2_1\n"); printf("Test_TC_FLABEL_3_1\n"); - printf("Test_TC_BIND_1_1\n"); printf("Test_TC_BIND_2_1\n"); printf("Test_TC_BIND_2_2\n"); printf("Test_TC_BIND_2_3\n"); @@ -558,9 +561,6 @@ class ManualTestList : public Command printf("Test_TC_S_2_3\n"); printf("Test_TC_S_3_1\n"); printf("Test_TC_PCC_3_1\n"); - printf("Test_TC_ACL_1_1\n"); - printf("Test_TC_ACL_2_1\n"); - printf("Test_TC_ACL_2_2\n"); printf("Test_TC_ACL_2_3\n"); printf("Test_TC_ACL_2_4\n"); printf("Test_TC_ACL_2_5\n"); @@ -1880,10 +1880,10 @@ class TestAccessControlClusterSuite : public TestCommand } }; -class Test_TC_BOOL_1_1Suite : public TestCommand +class Test_TC_ACL_1_1Suite : public TestCommand { public: - Test_TC_BOOL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_1_1", 6, credsIssuerConfig) + Test_TC_ACL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_1_1", 6, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -1891,7 +1891,7 @@ class Test_TC_BOOL_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BOOL_1_1Suite() {} + ~Test_TC_ACL_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -1945,6 +1945,10 @@ class Test_TC_BOOL_1_1Suite : public TestCommand VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); @@ -1999,39 +2003,39 @@ class Test_TC_BOOL_1_1Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::ClusterRevision::Id, + LogStep(1, "TH reads ClusterRevision attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::ClusterRevision::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Read the global attribute: FeatureMap"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::FeatureMap::Id, true, + LogStep(2, "TH reads FeatureMap attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::FeatureMap::Id, true, chip::NullOptional); } case 3: { - LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::AttributeList::Id, + LogStep(3, "TH reads AttributeList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::AttributeList::Id, true, chip::NullOptional); } case 4: { - LogStep(4, "Read the global attribute: AcceptedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, - BooleanState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + LogStep(4, "TH reads AcceptedCommandList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "Read the global attribute: GeneratedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, - BooleanState::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + LogStep(5, "TH reads GeneratedCommandList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); } } return CHIP_NO_ERROR; } }; -class Test_TC_BOOL_2_1Suite : public TestCommand +class Test_TC_ACL_2_1Suite : public TestCommand { public: - Test_TC_BOOL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_2_1", 2, credsIssuerConfig) + Test_TC_ACL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_1", 4, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -2039,7 +2043,7 @@ class Test_TC_BOOL_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BOOL_2_1Suite() {} + ~Test_TC_ACL_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -2071,9 +2075,31 @@ class Test_TC_BOOL_2_1Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - bool value; + uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + 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", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 3U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 3U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); } break; default: @@ -2099,9 +2125,116 @@ class Test_TC_BOOL_2_1Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Read mandatory non-global attribute: StateValue"); - VerifyOrDo(!ShouldSkip("BOOL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::StateValue::Id, true, + LogStep(1, "TH reads SubjectsPerAccessControlEntry attribute from DUT"); + VerifyOrDo(!ShouldSkip("ACL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::SubjectsPerAccessControlEntry::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads TargetsPerAccessControlEntry attribute from DUT"); + VerifyOrDo(!ShouldSkip("ACL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::TargetsPerAccessControlEntry::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads AccessControlEntriesPerFabric attribute from DUT"); + VerifyOrDo(!ShouldSkip("ACL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, + AccessControl::Attributes::AccessControlEntriesPerFabric::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_2Suite : public TestCommand +{ +public: + Test_TC_ACL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_2", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACL_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 31UL)); + } + break; + case 2: + 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", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 31UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH1 reads DUT Descriptor cluster ServerList attribute from Endpoint 0"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::ServerList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH1 reads DUT Descriptor cluster ServerList attribute from every Endpoint except 0"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Descriptor::Id, Descriptor::Attributes::ServerList::Id, true, chip::NullOptional); } } @@ -2109,10 +2242,10 @@ class Test_TC_BOOL_2_1Suite : public TestCommand } }; -class Test_TC_ACT_1_1Suite : public TestCommand +class Test_TC_BOOL_1_1Suite : public TestCommand { public: - Test_TC_ACT_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_1_1", 7, credsIssuerConfig) + Test_TC_BOOL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_1_1", 6, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -2120,7 +2253,7 @@ class Test_TC_ACT_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ACT_1_1Suite() {} + ~Test_TC_BOOL_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -2174,18 +2307,23 @@ class Test_TC_ACT_1_1Suite : public TestCommand VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; case 4: 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(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); } break; case 5: @@ -2193,20 +2331,244 @@ class Test_TC_ACT_1_1Suite : public TestCommand { 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", "list")); - VerifyOrReturn(CheckConstraintMaxLength("value", value, 11)); } break; - case 6: + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, + BooleanState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, + BooleanState::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BOOL_2_1Suite : public TestCommand +{ +public: + Test_TC_BOOL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_2_1", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BOOL_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + bool value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); - } - VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read mandatory non-global attribute: StateValue"); + VerifyOrDo(!ShouldSkip("BOOL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::StateValue::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACT_1_1Suite : public TestCommand +{ +public: + Test_TC_ACT_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_1_1", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACT_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + 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)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 11)); + } + 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", "list")); } break; default: @@ -2267,6 +2629,154 @@ class Test_TC_ACT_1_1Suite : public TestCommand } }; +class Test_TC_BIND_1_1Suite : public TestCommand +{ +public: + Test_TC_BIND_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_1_1", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BIND_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + 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)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + 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(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + 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("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads AttributeList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Binding::Id, Binding::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_CC_1_1Suite : public TestCommand { public: @@ -8270,13 +8780,13 @@ class Test_TC_CC_6_1Suite : public TestCommand } case 17: { LogStep(17, "TH reads ColorMode attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, chip::NullOptional); } case 18: { LogStep(18, "TH reads EnhancedColorMode attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, chip::NullOptional); } @@ -8302,7 +8812,7 @@ class Test_TC_CC_6_1Suite : public TestCommand class Test_TC_CC_6_2Suite : public TestCommand { public: - Test_TC_CC_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_2", 23, credsIssuerConfig) + Test_TC_CC_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_2", 32, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -8325,6 +8835,11 @@ class Test_TC_CC_6_2Suite : public TestCommand uint16_t ColorTempPhysicalMinMiredsValue; uint16_t ColorTempPhysicalMaxMiredsValue; + uint16_t ColorTemperatureMiredsStep2c; + uint16_t ColorTemperatureMiredsStep2d; + uint16_t ColorTemperatureMiredsStep3b; + uint16_t ColorTemperatureMiredsStep3c; + uint16_t ColorTemperatureMiredsStep4c; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -8382,7 +8897,6 @@ class Test_TC_CC_6_2Suite : public TestCommand 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)); @@ -8390,7 +8904,6 @@ class Test_TC_CC_6_2Suite : public TestCommand 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)); @@ -8398,7 +8911,14 @@ class Test_TC_CC_6_2Suite : public TestCommand break; case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, + (ColorTempPhysicalMinMiredsValue + ColorTempPhysicalMaxMiredsValue) / 2)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + ColorTemperatureMiredsStep2c = value; + } break; case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -8406,7 +8926,13 @@ class Test_TC_CC_6_2Suite : public TestCommand break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTemperatureMiredsStep2c)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + ColorTemperatureMiredsStep2d = value; + } break; case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -8414,11 +8940,15 @@ class Test_TC_CC_6_2Suite : public TestCommand break; case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTemperatureMiredsStep2d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } break; case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -8426,7 +8956,13 @@ class Test_TC_CC_6_2Suite : public TestCommand break; case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + ColorTemperatureMiredsStep3b = value; + } break; case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -8434,7 +8970,13 @@ class Test_TC_CC_6_2Suite : public TestCommand break; case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTemperatureMiredsStep3b)); + ColorTemperatureMiredsStep3c = value; + } break; case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -8442,8 +8984,68 @@ class Test_TC_CC_6_2Suite : public TestCommand break; case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTemperatureMiredsStep3c)); + } break; case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, + (ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue) / 20)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + ColorTemperatureMiredsStep4c = value; + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorTemperature", value, ColorTemperatureMiredsStep4c)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -8513,164 +9115,215 @@ class Test_TC_CC_6_2Suite : public TestCommand LogStep(6, "TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds=(ColorTempPhysicalMinMireds + " "ColorTempPhysicalMaxMireds)/2 and TransitionTime=0 (immediately)."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type value; + value.colorTemperature = static_cast((ColorTempPhysicalMinMiredsValue + ColorTempPhysicalMaxMiredsValue) / 2); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColorTemperature::Id, + value, chip::NullOptional + + ); } case 7: { - LogStep(7, - "TH sends MoveColorTemperature command to DUT with MoveMode = 0x01 (up), Rate = (ColorTempPhysicalMaxMireds - " - "ColorTempPhysicalMinMireds)/40"); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(7, "Wait 100ms"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); } case 8: { - LogStep(8, "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(8, + "TH sends MoveColorTemperature command to DUT with MoveMode = 0x01 (up), Rate = (ColorTempPhysicalMaxMireds - " + "ColorTempPhysicalMinMireds)/40"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(1); + value.rate = static_cast((ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue) / 40); + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value, chip::NullOptional + + ); } case 9: { - LogStep(9, "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(9, "Wait 10s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); } case 10: { - LogStep(10, "After another 5 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(10, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); } case 11: { - LogStep(11, - "TH sends MoveColorTemperature command to DUT with MoveMode = 0x03(down), Rate = (ColorTempPhysicalMaxMireds - " - "ColorTempPhysicalMinMireds)/20"); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(11, "Wait 10s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); } case 12: { - LogStep(12, "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(12, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); } case 13: { - LogStep(13, "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(13, "Wait 5s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); } case 14: { - LogStep(14, "After another 5 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(14, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); } case 15: { LogStep(15, - "TH sends MoveColorTemperature command to DUT with MoveMode = 0x01(up), Rate = (ColorTempPhysicalMaxMireds - " + "TH sends MoveColorTemperature command to DUT with MoveMode = 0x03(down), Rate = (ColorTempPhysicalMaxMireds - " "ColorTempPhysicalMinMireds)/20"); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(3); + value.rate = static_cast((ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue) / 20); + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value, chip::NullOptional + + ); } case 16: { - LogStep(16, - "After 10 seconds, TH sends MoveColorTemperature command to DUT with MoveMode = 0x00(stop), Rate = " - "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20"); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(16, "Wait 10s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); } case 17: { LogStep(17, "TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); } case 18: { - LogStep(18, "After another 2 seconds, TH reads ColorTemperatureMireds attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(18, "Wait 10s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); } case 19: { - LogStep(19, "TH reads ColorMode attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0008 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(19, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); } case 20: { - LogStep(20, "TH reads EnhancedColorMode attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A4001 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(20, "Wait 5s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); } case 21: { - LogStep(21, "Turn off light that we turned on"); + LogStep(21, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); + } + case 22: { + LogStep(22, + "TH sends MoveColorTemperature command to DUT with MoveMode = 0x01(up), Rate = (ColorTempPhysicalMaxMireds - " + "ColorTempPhysicalMinMireds)/20"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(1); + value.rate = static_cast((ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue) / 20); + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 24: { + LogStep(24, + "After 10 seconds, TH sends MoveColorTemperature command to DUT with MoveMode = 0x00(stop), Rate = " + "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(0); + value.rate = static_cast((ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue) / 20); + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); + } + case 26: { + LogStep(26, "Wait 2s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 27: { + LogStep(27, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); + } + case 28: { + LogStep(28, "TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, "TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 30: { + LogStep(30, "Turn off light that we turned on"); VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; @@ -8678,8 +9331,8 @@ class Test_TC_CC_6_2Suite : public TestCommand ); } - case 22: { - LogStep(22, "Check on/off attribute value is false after off command"); + case 31: { + LogStep(31, "Check on/off attribute value is false after off command"); VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); } @@ -8691,7 +9344,7 @@ class Test_TC_CC_6_2Suite : public TestCommand class Test_TC_CC_6_3Suite : public TestCommand { public: - Test_TC_CC_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_3", 19, credsIssuerConfig) + Test_TC_CC_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_3", 26, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -8714,6 +9367,10 @@ class Test_TC_CC_6_3Suite : public TestCommand uint16_t ColorTempPhysicalMinMiredsValue; uint16_t ColorTempPhysicalMaxMiredsValue; + uint16_t ColorTemperatureMiredsStep2c; + uint16_t ColorTemperatureMiredsStep2d; + uint16_t ColorTemperatureMiredsStep3b; + uint16_t ColorTemperatureMiredsStep3c; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -8771,7 +9428,6 @@ class Test_TC_CC_6_3Suite : public TestCommand 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)); @@ -8779,7 +9435,6 @@ class Test_TC_CC_6_3Suite : public TestCommand 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)); @@ -8787,7 +9442,14 @@ class Test_TC_CC_6_3Suite : public TestCommand break; case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, + (ColorTempPhysicalMinMiredsValue + ColorTempPhysicalMaxMiredsValue) / 2)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + ColorTemperatureMiredsStep2c = value; + } break; case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -8795,7 +9457,13 @@ class Test_TC_CC_6_3Suite : public TestCommand break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTemperatureMiredsStep2c)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + ColorTemperatureMiredsStep2d = value; + } break; case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -8803,11 +9471,15 @@ class Test_TC_CC_6_3Suite : public TestCommand break; case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTemperatureMiredsStep2d)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + } break; case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -8815,8 +9487,63 @@ class Test_TC_CC_6_3Suite : public TestCommand break; case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMiredsValue)); + ColorTemperatureMiredsStep3b = value; + } break; case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTemperatureMiredsStep3b)); + ColorTemperatureMiredsStep3c = value; + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, ColorTempPhysicalMinMiredsValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTemperatureMiredsStep3c)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -8886,120 +9613,155 @@ class Test_TC_CC_6_3Suite : public TestCommand LogStep(6, "TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds=(ColorTempPhysicalMinMireds + " "ColorTempPhysicalMaxMireds)/2 and TransitionTime=0 (immediately)."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type value; + value.colorTemperature = static_cast((ColorTempPhysicalMinMiredsValue + ColorTempPhysicalMaxMiredsValue) / 2); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColorTemperature::Id, + value, chip::NullOptional + + ); } case 7: { - LogStep(7, - "TH sends StepColorTemperature command to DUT with StepMode = 0x01 (up), StepSize = " - "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/2 and TransitionTime = 200 (20s)."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4c.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(7, "Wait 100ms"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); } case 8: { - LogStep(8, "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(8, + "TH sends StepColorTemperature command to DUT with StepMode = 0x01 (up), StepSize = " + "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/2 and TransitionTime = 200 (20s)."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type value; + value.stepMode = static_cast(1); + value.stepSize = static_cast((ColorTempPhysicalMinMiredsValue + ColorTempPhysicalMaxMiredsValue) / 2); + value.transitionTime = 200U; + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepColorTemperature::Id, + value, chip::NullOptional + + ); } case 9: { - LogStep(9, "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(9, "Wait 10s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); } case 10: { - LogStep(10, "After another 5 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(10, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); } case 11: { - LogStep(11, - "TH sends StepColorTemperature command to DUT with StepMode = 0x03 (down), StepSize = " - "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds) and TransitionTime = 200 (20s)."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4c.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(11, "Wait 10s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); } case 12: { - LogStep(12, "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(12, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); } case 13: { - LogStep(13, "After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(13, "Wait 5s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); } case 14: { - LogStep(14, "After another 5 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(14, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); } case 15: { - LogStep(15, "TH reads ColorMode attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0008 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(15, + "TH sends StepColorTemperature command to DUT with StepMode = 0x03 (down), StepSize = " + "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds) and TransitionTime = 200 (20s)."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type value; + value.stepMode = static_cast(3); + value.stepSize = static_cast(ColorTempPhysicalMaxMiredsValue - ColorTempPhysicalMinMiredsValue); + value.transitionTime = 200U; + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMiredsValue; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMiredsValue; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepColorTemperature::Id, + value, chip::NullOptional + + ); } case 16: { - LogStep(16, "TH reads EnhancedColorMode attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A4001 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(16, "Wait 10s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); } case 17: { - LogStep(17, "Turn Off light that we turned on"); + LogStep(17, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); + } + case 18: { + LogStep(18, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Wait 10s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); + } + case 22: { + LogStep(22, "TH reads ColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Turn Off light that we turned on"); VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; @@ -9007,8 +9769,8 @@ class Test_TC_CC_6_3Suite : public TestCommand ); } - case 18: { - LogStep(18, "Check on/off attribute value is false after off command"); + case 25: { + LogStep(25, "Check on/off attribute value is false after off command"); VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); } @@ -10305,7 +11067,7 @@ class Test_TC_CC_7_4Suite : public TestCommand class Test_TC_CC_8_1Suite : public TestCommand { public: - Test_TC_CC_8_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_8_1", 36, credsIssuerConfig) + Test_TC_CC_8_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_8_1", 39, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -10329,6 +11091,7 @@ class Test_TC_CC_8_1Suite : public TestCommand uint8_t CurrentSaturationValue; uint16_t ColorTempPhysicalMinMireds; uint16_t ColorTempPhysicalMaxMireds; + uint16_t ColorTemperatureMiredsStep4f; uint16_t EnhancedCurrentHueValue; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -10456,7 +11219,6 @@ class Test_TC_CC_8_1Suite : public TestCommand break; case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -10464,7 +11226,6 @@ class Test_TC_CC_8_1Suite : public TestCommand break; case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -10472,10 +11233,17 @@ class Test_TC_CC_8_1Suite : public TestCommand break; case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn( + CheckConstraintMinValue("value", value, (ColorTempPhysicalMaxMireds + ColorTempPhysicalMinMireds) / 2)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, ColorTempPhysicalMaxMireds)); + ColorTemperatureMiredsStep4f = value; + } break; case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -10483,15 +11251,30 @@ class Test_TC_CC_8_1Suite : public TestCommand break; case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("colorTemperature", value, ColorTemperatureMiredsStep4f)); + } break; case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -10501,11 +11284,11 @@ class Test_TC_CC_8_1Suite : public TestCommand EnhancedCurrentHueValue = value; } break; - case 32: + case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 33: + case 36: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -10514,10 +11297,10 @@ class Test_TC_CC_8_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 26500U)); } break; - case 34: + case 37: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 35: + case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -10569,7 +11352,7 @@ class Test_TC_CC_8_1Suite : public TestCommand LogStep(3, "TH sends MoveToHue command to DUT with Hue=200, Direction=0x00 (shortest distance) and TransitionTime=0 " "(immediately)."); - VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; value.hue = 200U; @@ -10591,7 +11374,7 @@ class Test_TC_CC_8_1Suite : public TestCommand } case 5: { LogStep(5, "TH sends MoveHue command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)"); - VerifyOrDo(!ShouldSkip("CC.S.C01.Rsp && CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; value.moveMode = static_cast(1); @@ -10612,7 +11395,7 @@ class Test_TC_CC_8_1Suite : public TestCommand } case 7: { LogStep(7, "TH sends StopMoveStep command to DUT"); - VerifyOrDo(!ShouldSkip("CC.S.C47.Rsp && CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; value.optionsMask = 0U; @@ -10624,7 +11407,7 @@ class Test_TC_CC_8_1Suite : public TestCommand } case 8: { LogStep(8, "TH reads CurrentHue attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.A0000 && CC.S.C01.Rsp && CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.A0000 && CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, chip::NullOptional); } @@ -10637,13 +11420,13 @@ class Test_TC_CC_8_1Suite : public TestCommand } case 10: { LogStep(10, "TH reads CurrentHue attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.A0000 && CC.S.C01.Rsp && CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.A0000 && CC.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, chip::NullOptional); } case 11: { LogStep(11, "TH sends MoveToSaturation command to DUT with Saturation=150 and TransitionTime=0 (immediately)"); - VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; value.saturation = 150U; @@ -10664,7 +11447,7 @@ class Test_TC_CC_8_1Suite : public TestCommand } case 13: { LogStep(13, "TH sends MoveSaturation command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)"); - VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.C04.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; value.moveMode = static_cast(1); @@ -10685,7 +11468,7 @@ class Test_TC_CC_8_1Suite : public TestCommand } case 15: { LogStep(15, "TH sends StopMoveStep command to DUT"); - VerifyOrDo(!ShouldSkip("CC.S.C47.Rsp && CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; value.optionsMask = 0U; @@ -10697,7 +11480,7 @@ class Test_TC_CC_8_1Suite : public TestCommand } case 16: { LogStep(16, "TH reads CurrentSaturation attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, true, chip::NullOptional); } @@ -10710,19 +11493,19 @@ class Test_TC_CC_8_1Suite : public TestCommand } case 18: { LogStep(18, "TH reads CurrentSaturation attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, true, chip::NullOptional); } case 19: { LogStep(19, "TH reads ColorTempPhysicalMinMireds attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTempPhysicalMinMireds::Id, true, chip::NullOptional); } case 20: { LogStep(20, "TH reads ColorTempPhysicalMaxMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id, true, chip::NullOptional); } @@ -10730,61 +11513,86 @@ class Test_TC_CC_8_1Suite : public TestCommand LogStep(21, "TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds= ColorTempPhysicalMaxMireds / 2 " "and TransitionTime=0 (immediately)."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.C0a.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type value; + value.colorTemperature = static_cast((ColorTempPhysicalMinMireds + ColorTempPhysicalMaxMireds) / 2); + value.transitionTime = 0U; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColorTemperature::Id, + value, chip::NullOptional + + ); } case 22: { - LogStep( - 22, - "TH sends MoveColorTemperature command to DUT with MoveMode = 0x01 (up), Rate = ColorTempPhysicalMaxMireds / 40"); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(22, "Wait 100ms"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); } case 23: { - LogStep(23, "After 10 seconds, TH sends StopMoveStep command to DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.C47.Rsp && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(23, + "TH sends MoveColorTemperature command to DUT with MoveMode = 0x01 (up), Rate = (ColorTempPhysicalMaxMireds - " + "ColorTempPhysicalMinMireds)/40"); + VerifyOrDo(!ShouldSkip("CC.S.C4b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(1); + value.rate = static_cast((ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds) / 40); + value.colorTemperatureMinimumMireds = ColorTempPhysicalMinMireds; + value.colorTemperatureMaximumMireds = ColorTempPhysicalMaxMireds; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value, chip::NullOptional + + ); } case 24: { - LogStep(24, "TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(24, "Wait 10s"); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); } case 25: { - LogStep(25, "After another 2 seconds, TH reads ColorTemperatureMireds attribute from DUT."); - VerifyOrDo(!ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(25, "TH sends StopMoveStep command to DUT"); + VerifyOrDo(!ShouldSkip("CC.S.C4b.Rsp && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0U; + value.optionsOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value, + chip::NullOptional + + ); } case 26: { - LogStep(26, + LogStep(26, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.A0007 && CC.S.C4b.Rsp && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); + } + case 27: { + LogStep(27, "Wait 2s"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "TH reads ColorTemperatureMireds attribute from DUT."); + VerifyOrDo(!ShouldSkip("CC.S.A0007 && CC.S.C4b.Rsp && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + true, chip::NullOptional); + } + case 29: { + LogStep(29, "TH sends EnhancedMoveToHue command to DUT with EnhancedHue=20000, Direction=0x00 (shortest distance) and " "TransitionTime=0 (immediately)."); - VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("CC.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; value.enhancedHue = 20000U; @@ -10797,16 +11605,16 @@ class Test_TC_CC_8_1Suite : public TestCommand ); } - case 27: { - LogStep(27, "Wait 100ms"); + case 30: { + LogStep(30, "Wait 100ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs(kIdentityAlpha, value); } - case 28: { - LogStep(28, "TH sends EnhancedMoveHue command to DUT with MoveMode=0x01 (up) and Rate=500 (units/s)"); - VerifyOrDo(!ShouldSkip("CC.S.F01 && CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 31: { + LogStep(31, "TH sends EnhancedMoveHue command to DUT with MoveMode=0x01 (up) and Rate=500 (units/s)"); + VerifyOrDo(!ShouldSkip("CC.S.C41.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; value.moveMode = static_cast(1); @@ -10818,15 +11626,15 @@ class Test_TC_CC_8_1Suite : public TestCommand ); } - case 29: { - LogStep(29, "Wait 10s"); + case 32: { + LogStep(32, "Wait 10s"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; return WaitForMs(kIdentityAlpha, value); } - case 30: { - LogStep(30, "TH sends StopMoveStep command to DUT"); + case 33: { + LogStep(33, "TH sends StopMoveStep command to DUT"); VerifyOrDo(!ShouldSkip("CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; @@ -10837,27 +11645,27 @@ class Test_TC_CC_8_1Suite : public TestCommand ); } - case 31: { - LogStep(31, "TH reads EnhancedCurrentHue attribute from DUT"); + case 34: { + LogStep(34, "TH reads EnhancedCurrentHue attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A4000 && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, true, chip::NullOptional); } - case 32: { - LogStep(32, "Wait 10s"); + case 35: { + LogStep(35, "Wait 10s"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; return WaitForMs(kIdentityAlpha, value); } - case 33: { - LogStep(33, "TH reads EnhancedCurrentHue attribute from DUT"); + case 36: { + LogStep(36, "TH reads EnhancedCurrentHue attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A4000 && CC.S.C47.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, true, chip::NullOptional); } - case 34: { - LogStep(34, "Turn Off light that we turned on"); + case 37: { + LogStep(37, "Turn Off light that we turned on"); VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; @@ -10865,8 +11673,8 @@ class Test_TC_CC_8_1Suite : public TestCommand ); } - case 35: { - LogStep(35, "Check on/off attribute value is false after off command"); + case 38: { + LogStep(38, "Check on/off attribute value is false after off command"); VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); } @@ -10878,7 +11686,7 @@ class Test_TC_CC_8_1Suite : public TestCommand class Test_TC_BINFO_1_1Suite : public TestCommand { public: - Test_TC_BINFO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BINFO_1_1", 0, credsIssuerConfig) + Test_TC_BINFO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BINFO_1_1", 14, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -10911,6 +11719,149 @@ class Test_TC_BINFO_1_1Suite : public TestCommand switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + 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)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + } + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 14UL)); + } + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + } + break; + case 9: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 10: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + } + break; + case 11: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + } + break; + case 12: + 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", "list")); + } + break; + case 13: + 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", "list")); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -10926,6 +11877,86 @@ class Test_TC_BINFO_1_1Suite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads AttributeList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads optional attribute(ManufacturingDate) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads optional attribute(PartNumber) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads optional attribute(ProductURL) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads optional attribute(ProductLabel) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads optional attribute(SerialNumber) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads optional attribute(LocalConfigDisabled) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads optional attribute(Reachable) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads optional attribute(UniqueID) in attributeList"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "TH1 reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "TH1 reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } } return CHIP_NO_ERROR; } @@ -12319,6 +13350,170 @@ class Test_TC_DESC_1_1Suite : public TestCommand } }; +class Test_TC_DGETH_1_1Suite : public TestCommand +{ +public: + Test_TC_DGETH_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGETH_1_1", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGETH_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + 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", "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", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads AttributeList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip("DGETH.S.F00 || DGETH.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip(" !DGETH.S.F00 && !DGETH.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), EthernetNetworkDiagnostics::Id, + EthernetNetworkDiagnostics::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_DGETH_2_1Suite : public TestCommand { public: @@ -34095,6 +35290,171 @@ class Test_TC_TSUIC_2_2Suite : public TestCommand } }; +class Test_TC_DGTHREAD_1_1Suite : public TestCommand +{ +public: + Test_TC_DGTHREAD_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_1_1", 6, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGTHREAD_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 31UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 59UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 60UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 61UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 62UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + 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("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.F00 || DGTHREAD.S.F01 || DGTHREAD.S.F02 || DGTHREAD.S.F03"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads AttributeList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_DGTHREAD_2_1Suite : public TestCommand { public: @@ -58612,6 +59972,230 @@ class TestMultiAdminSuite : public TestCommand } }; +class Test_TC_DGSW_1_1Suite : public TestCommand +{ +public: + Test_TC_DGSW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGSW_1_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DGSW_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 9: + 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", "list")); + } + break; + case 10: + 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", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads AttributeList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads optional attribute(ThreadMetrics) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGSW.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads optional attribute(CurrentHeapFree) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGSW.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads optional attribute(CurrentHeapUsed) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGSW.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads Feature dependent attribute(CurrentHeapHighWatermark) in AttributeList"); + VerifyOrDo(!ShouldSkip("DGSW.S.F00 || DGSW.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip("DGSW.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip(" !DGSW.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), SoftwareDiagnostics::Id, + SoftwareDiagnostics::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_DGSW_2_1Suite : public TestCommand { public: @@ -65533,6 +67117,567 @@ class DL_SchedulesSuite : public TestCommand } }; +class Test_TC_DRLK_1_1Suite : public TestCommand +{ +public: + Test_TC_DRLK_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_1_1", 32, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 6U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4095UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 37UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 38UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 27UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 28UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 23UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 24UL)); + } + 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))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 25UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 26UL)); + } + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 20UL)); + } + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 21UL)); + } + break; + case 9: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 22UL)); + } + break; + case 10: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 48UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 49UL)); + } + break; + case 11: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 51UL)); + } + break; + case 12: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 33UL)); + } + break; + case 13: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 34UL)); + } + break; + case 14: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 35UL)); + } + break; + case 15: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 36UL)); + } + break; + case 16: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 39UL)); + } + break; + case 17: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 40UL)); + } + break; + case 18: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 41UL)); + } + break; + case 19: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 42UL)); + } + break; + case 20: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 43UL)); + } + break; + case 21: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 44UL)); + } + break; + case 22: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 23: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + } + break; + case 24: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 14UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 16UL)); + } + break; + case 25: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 19UL)); + } + break; + case 26: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 26UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 27UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 29UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 34UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 36UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 38UL)); + } + break; + case 27: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 28: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + break; + case 29: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + } + break; + case 30: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + } + break; + case 31: + 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", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 28UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 35UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F00 || DRLK.S.F01 || DRLK.S.F02 || DRLK.S.F04 || DRLK.S.F05 || DRLK.S.F06 || DRLK.S.F07 " + "|| DRLK.S.F08 || DRLK.S.F10 || DRLK.S.F11"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads AttributeList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads Feature dependent(DRLK.S.F08) attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads Feature dependent(DRLK.S.F00) attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads Feature dependent(DRLK.S.F01) attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads Feature dependent(DRLK.S.F04) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads Feature dependent(DRLK.S.F10) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F10"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads Feature dependent(DRLK.S.F11) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F11"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads Feature dependent(DRLK.S.F00 or DRLK.S.F01) attributes in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F00 || DRLK.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads Feature dependent(DRLK.S.F07 or DRLK.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F07 || DRLK.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "TH reads optional attribute(Language) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "TH reads optional attribute(LEDSettings) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0022"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "TH reads optional attribute(AutoRelockTime) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0023"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads optional attribute(SoundVolume) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0024"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "TH reads optional attribute(DefaultConfigurationRegister) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0027"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "TH reads optional attribute(EnableLocalProgramming) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0028"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "TH reads optional attribute(EnableOneTouchLocking) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A0029"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "TH reads optional attribute(EnableInsideStatusLED) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A002a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "TH reads optional attribute(EnablePrivacyModeButton) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A002b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "TH reads optional attribute(LocalProgrammingFeatures) in AttributeList"); + VerifyOrDo(!ShouldSkip("DRLK.S.A002c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, "TH reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "TH reads Feature dependent commands(DRLK.S.F04) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "TH reads Feature dependent commands(DRLK.S.F10) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F10"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "TH reads Feature dependent commands(DRLK.S.F11) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F11"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "TH reads Feature dependent commands(DRLK.S.F08) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "TH reads optional commands(DRLK.S.C03.Rsp) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 28: { + LogStep(28, "TH reads Feature dependent command(DRLK.S.F04) in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, "TH reads Feature dependent command(DRLK.S.F10) in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F10"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 30: { + LogStep(30, "TH reads Feature dependent command(DRLK.S.F11) in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F11"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 31: { + LogStep(31, "TH reads Feature dependent command(DRLK.S.F08) in GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_DRLK_2_2Suite : public TestCommand { public: @@ -75326,66 +77471,10 @@ class Test_TC_CNET_4_22Suite : public TestCommand } }; -class Test_TC_DLOG_1_1Suite : public TestCommand -{ -public: - Test_TC_DLOG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_1_1", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_DLOG_1_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_DLOG_2_1Suite : public TestCommand +class Test_TC_DLOG_1_1Suite : public TestCommand { public: - Test_TC_DLOG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_2_1", 0, credsIssuerConfig) + Test_TC_DLOG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -75393,7 +77482,7 @@ class Test_TC_DLOG_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DLOG_2_1Suite() {} + ~Test_TC_DLOG_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -75438,10 +77527,10 @@ class Test_TC_DLOG_2_1Suite : public TestCommand } }; -class Test_TC_DLOG_2_2Suite : public TestCommand +class Test_TC_DLOG_2_1Suite : public TestCommand { public: - Test_TC_DLOG_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_2_2", 0, credsIssuerConfig) + Test_TC_DLOG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -75449,7 +77538,7 @@ class Test_TC_DLOG_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DLOG_2_2Suite() {} + ~Test_TC_DLOG_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -75494,10 +77583,10 @@ class Test_TC_DLOG_2_2Suite : public TestCommand } }; -class Test_TC_DLOG_3_1Suite : public TestCommand +class Test_TC_DLOG_2_2Suite : public TestCommand { public: - Test_TC_DLOG_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_3_1", 0, credsIssuerConfig) + Test_TC_DLOG_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -75505,7 +77594,7 @@ class Test_TC_DLOG_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DLOG_3_1Suite() {} + ~Test_TC_DLOG_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -75550,10 +77639,10 @@ class Test_TC_DLOG_3_1Suite : public TestCommand } }; -class Test_TC_DESC_2_1Suite : public TestCommand +class Test_TC_DLOG_3_1Suite : public TestCommand { public: - Test_TC_DESC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DESC_2_1", 0, credsIssuerConfig) + Test_TC_DLOG_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DLOG_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -75561,7 +77650,7 @@ class Test_TC_DESC_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DESC_2_1Suite() {} + ~Test_TC_DLOG_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -75606,10 +77695,10 @@ class Test_TC_DESC_2_1Suite : public TestCommand } }; -class Test_TC_DESC_2_2Suite : public TestCommand +class Test_TC_DESC_2_1Suite : public TestCommand { public: - Test_TC_DESC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DESC_2_2", 0, credsIssuerConfig) + Test_TC_DESC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DESC_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -75617,7 +77706,7 @@ class Test_TC_DESC_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DESC_2_2Suite() {} + ~Test_TC_DESC_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -75662,10 +77751,10 @@ class Test_TC_DESC_2_2Suite : public TestCommand } }; -class Test_TC_DGETH_1_1Suite : public TestCommand +class Test_TC_DESC_2_2Suite : public TestCommand { public: - Test_TC_DGETH_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGETH_1_1", 0, credsIssuerConfig) + Test_TC_DESC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DESC_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -75673,7 +77762,7 @@ class Test_TC_DGETH_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DGETH_1_1Suite() {} + ~Test_TC_DESC_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -84803,234 +86892,10 @@ class Test_TC_SC_3_2Suite : public TestCommand } }; -class Test_TC_SC_3_3Suite : public TestCommand -{ -public: - Test_TC_SC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_3_3", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_SC_3_3Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_SC_3_4Suite : public TestCommand -{ -public: - Test_TC_SC_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_3_4", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_SC_3_4Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_SC_3_6Suite : public TestCommand -{ -public: - Test_TC_SC_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_3_6", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_SC_3_6Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_SC_4_1Suite : public TestCommand -{ -public: - Test_TC_SC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_1", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_SC_4_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_SC_4_3Suite : public TestCommand +class Test_TC_SC_3_3Suite : public TestCommand { public: - Test_TC_SC_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_3", 0, credsIssuerConfig) + Test_TC_SC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_3_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85038,7 +86903,7 @@ class Test_TC_SC_4_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_3Suite() {} + ~Test_TC_SC_3_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -85083,10 +86948,10 @@ class Test_TC_SC_4_3Suite : public TestCommand } }; -class Test_TC_SC_4_4Suite : public TestCommand +class Test_TC_SC_3_4Suite : public TestCommand { public: - Test_TC_SC_4_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_4", 0, credsIssuerConfig) + Test_TC_SC_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_3_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85094,7 +86959,7 @@ class Test_TC_SC_4_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_4Suite() {} + ~Test_TC_SC_3_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -85139,10 +87004,10 @@ class Test_TC_SC_4_4Suite : public TestCommand } }; -class Test_TC_SC_4_5Suite : public TestCommand +class Test_TC_SC_3_6Suite : public TestCommand { public: - Test_TC_SC_4_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_5", 0, credsIssuerConfig) + Test_TC_SC_3_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_3_6", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85150,7 +87015,7 @@ class Test_TC_SC_4_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_5Suite() {} + ~Test_TC_SC_3_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -85195,10 +87060,10 @@ class Test_TC_SC_4_5Suite : public TestCommand } }; -class Test_TC_SC_4_6Suite : public TestCommand +class Test_TC_SC_4_1Suite : public TestCommand { public: - Test_TC_SC_4_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_6", 0, credsIssuerConfig) + Test_TC_SC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85206,7 +87071,7 @@ class Test_TC_SC_4_6Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_6Suite() {} + ~Test_TC_SC_4_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -85251,10 +87116,10 @@ class Test_TC_SC_4_6Suite : public TestCommand } }; -class Test_TC_SC_4_7Suite : public TestCommand +class Test_TC_SC_4_3Suite : public TestCommand { public: - Test_TC_SC_4_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_7", 0, credsIssuerConfig) + Test_TC_SC_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85262,7 +87127,7 @@ class Test_TC_SC_4_7Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_7Suite() {} + ~Test_TC_SC_4_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -85307,10 +87172,10 @@ class Test_TC_SC_4_7Suite : public TestCommand } }; -class Test_TC_SC_4_8Suite : public TestCommand +class Test_TC_SC_4_4Suite : public TestCommand { public: - Test_TC_SC_4_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_8", 0, credsIssuerConfig) + Test_TC_SC_4_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85318,7 +87183,7 @@ class Test_TC_SC_4_8Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_8Suite() {} + ~Test_TC_SC_4_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -85363,10 +87228,10 @@ class Test_TC_SC_4_8Suite : public TestCommand } }; -class Test_TC_SC_4_9Suite : public TestCommand +class Test_TC_SC_4_5Suite : public TestCommand { public: - Test_TC_SC_4_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_9", 0, credsIssuerConfig) + Test_TC_SC_4_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85374,7 +87239,7 @@ class Test_TC_SC_4_9Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_9Suite() {} + ~Test_TC_SC_4_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -85419,10 +87284,10 @@ class Test_TC_SC_4_9Suite : public TestCommand } }; -class Test_TC_SC_4_10Suite : public TestCommand +class Test_TC_SC_4_6Suite : public TestCommand { public: - Test_TC_SC_4_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_10", 0, credsIssuerConfig) + Test_TC_SC_4_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_6", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85430,7 +87295,7 @@ class Test_TC_SC_4_10Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_SC_4_10Suite() {} + ~Test_TC_SC_4_6Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -85475,10 +87340,10 @@ class Test_TC_SC_4_10Suite : public TestCommand } }; -class Test_TC_DGSW_1_1Suite : public TestCommand +class Test_TC_SC_4_7Suite : public TestCommand { public: - Test_TC_DGSW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGSW_1_1", 0, credsIssuerConfig) + Test_TC_SC_4_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85486,7 +87351,175 @@ class Test_TC_DGSW_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DGSW_1_1Suite() {} + ~Test_TC_SC_4_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_8Suite : public TestCommand +{ +public: + Test_TC_SC_4_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_8", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_8Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_9Suite : public TestCommand +{ +public: + Test_TC_SC_4_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_9", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_SC_4_10Suite : public TestCommand +{ +public: + Test_TC_SC_4_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_10", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_SC_4_10Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -90984,62 +93017,6 @@ class Test_TC_CC_9_3Suite : public TestCommand } }; -class Test_TC_DRLK_1_1Suite : public TestCommand -{ -public: - Test_TC_DRLK_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_1_1", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_DRLK_1_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - class Test_TC_DRLK_2_1Suite : public TestCommand { public: @@ -93710,381 +95687,10 @@ class Test_TC_OO_3_2Suite : public TestCommand } }; -class Test_TC_RH_2_2Suite : public TestCommand -{ -public: - Test_TC_RH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_2_2", 6, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_RH_2_2Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::app::DataModel::Nullable ValueBeforeChange; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::Nullable value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); - } - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::Nullable value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); - } - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::Nullable value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); - ValueBeforeChange = value; - } - 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::Nullable value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintNotValue("value", value, ValueBeforeChange)); - } - break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); - } - case 1: { - LogStep(1, "Reads constraints of attribute: MinMeasuredValue"); - VerifyOrDo(!ShouldSkip("RH.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, - RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); - } - case 2: { - LogStep(2, "Reads constraints of attribute: MaxMeasuredValue"); - VerifyOrDo(!ShouldSkip("RH.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, - RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); - } - case 3: { - LogStep(3, "Reads MeasuredValue attribute from DUT"); - VerifyOrDo(!ShouldSkip("RH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, - RelativeHumidityMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); - } - case 4: { - LogStep(4, "Operate on device to change the relative humidity significantly"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && RH.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - case 5: { - LogStep(5, "Read the mandatory attribute: MeasuredValue"); - VerifyOrDo(!ShouldSkip("RH.S.A0000 && RH.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, - RelativeHumidityMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_RH_3_1Suite : public TestCommand -{ -public: - Test_TC_RH_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_3_1", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_RH_3_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_SWTCH_2_2Suite : public TestCommand -{ -public: - Test_TC_SWTCH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_2_2", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_SWTCH_2_2Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_SWTCH_3_1Suite : public TestCommand -{ -public: - Test_TC_SWTCH_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_3_1", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_SWTCH_3_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_SWTCH_3_2Suite : public TestCommand -{ -public: - Test_TC_SWTCH_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_3_2", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_SWTCH_3_2Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_TMP_2_2Suite : public TestCommand +class Test_TC_RH_2_2Suite : public TestCommand { public: - Test_TC_TMP_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TMP_2_2", 6, credsIssuerConfig) + Test_TC_RH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_2_2", 6, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94092,7 +95698,7 @@ class Test_TC_TMP_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_TMP_2_2Suite() {} + ~Test_TC_RH_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94105,7 +95711,7 @@ class Test_TC_TMP_2_2Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - chip::app::DataModel::Nullable valueBeforeChange; + chip::app::DataModel::Nullable ValueBeforeChange; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -94126,32 +95732,32 @@ class Test_TC_TMP_2_2Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -27314)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); } break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -27314)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); - valueBeforeChange = value; + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + ValueBeforeChange = value; } break; case 4: @@ -94161,12 +95767,10 @@ class Test_TC_TMP_2_2Suite : public TestCommand case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -27314)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); - VerifyOrReturn(CheckConstraintNotValue("value", value, valueBeforeChange)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintNotValue("value", value, ValueBeforeChange)); } break; default: @@ -94192,26 +95796,26 @@ class Test_TC_TMP_2_2Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Read the mandatory attribute: MinMeasuredValue"); - VerifyOrDo(!ShouldSkip("TMP.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, - TemperatureMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + LogStep(1, "Reads constraints of attribute: MinMeasuredValue"); + VerifyOrDo(!ShouldSkip("RH.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Read the mandatory attribute: MaxMeasuredValue"); - VerifyOrDo(!ShouldSkip("TMP.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, - TemperatureMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + LogStep(2, "Reads constraints of attribute: MaxMeasuredValue"); + VerifyOrDo(!ShouldSkip("RH.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); } case 3: { LogStep(3, "Reads MeasuredValue attribute from DUT"); - VerifyOrDo(!ShouldSkip("TMP.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, - TemperatureMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + VerifyOrDo(!ShouldSkip("RH.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); } case 4: { - LogStep(4, "Operate on device to change the temperature significantly"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TMP.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(4, "Operate on device to change the relative humidity significantly"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && RH.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -94221,19 +95825,19 @@ class Test_TC_TMP_2_2Suite : public TestCommand } case 5: { LogStep(5, "Read the mandatory attribute: MeasuredValue"); - VerifyOrDo(!ShouldSkip("TMP.S.A0000 && TMP.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, - TemperatureMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + VerifyOrDo(!ShouldSkip("RH.S.A0000 && RH.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RelativeHumidityMeasurement::Id, + RelativeHumidityMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); } } return CHIP_NO_ERROR; } }; -class Test_TC_TMP_3_1Suite : public TestCommand +class Test_TC_RH_3_1Suite : public TestCommand { public: - Test_TC_TMP_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TMP_3_1", 0, credsIssuerConfig) + Test_TC_RH_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RH_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94241,7 +95845,7 @@ class Test_TC_TMP_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_TMP_3_1Suite() {} + ~Test_TC_RH_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94286,10 +95890,10 @@ class Test_TC_TMP_3_1Suite : public TestCommand } }; -class Test_TC_TSTAT_3_1Suite : public TestCommand +class Test_TC_SWTCH_2_2Suite : public TestCommand { public: - Test_TC_TSTAT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_3_1", 0, credsIssuerConfig) + Test_TC_SWTCH_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94297,7 +95901,7 @@ class Test_TC_TSTAT_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_TSTAT_3_1Suite() {} + ~Test_TC_SWTCH_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94342,10 +95946,10 @@ class Test_TC_TSTAT_3_1Suite : public TestCommand } }; -class Test_TC_TSTAT_3_2Suite : public TestCommand +class Test_TC_SWTCH_3_1Suite : public TestCommand { public: - Test_TC_TSTAT_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_3_2", 0, credsIssuerConfig) + Test_TC_SWTCH_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94353,7 +95957,7 @@ class Test_TC_TSTAT_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_TSTAT_3_2Suite() {} + ~Test_TC_SWTCH_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94398,10 +96002,10 @@ class Test_TC_TSTAT_3_2Suite : public TestCommand } }; -class Test_TC_TSUIC_3_1Suite : public TestCommand +class Test_TC_SWTCH_3_2Suite : public TestCommand { public: - Test_TC_TSUIC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSUIC_3_1", 0, credsIssuerConfig) + Test_TC_SWTCH_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SWTCH_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94409,7 +96013,7 @@ class Test_TC_TSUIC_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_TSUIC_3_1Suite() {} + ~Test_TC_SWTCH_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94454,11 +96058,10 @@ class Test_TC_TSUIC_3_1Suite : public TestCommand } }; -class Test_TC_DGTHREAD_1_1Suite : public TestCommand +class Test_TC_TMP_2_2Suite : public TestCommand { public: - Test_TC_DGTHREAD_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DGTHREAD_1_1", 0, credsIssuerConfig) + Test_TC_TMP_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TMP_2_2", 6, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94466,7 +96069,7 @@ class Test_TC_DGTHREAD_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DGTHREAD_1_1Suite() {} + ~Test_TC_TMP_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94479,6 +96082,8 @@ class Test_TC_DGTHREAD_1_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; + chip::app::DataModel::Nullable valueBeforeChange; + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } // @@ -94491,6 +96096,56 @@ class Test_TC_DGTHREAD_1_1Suite : public TestCommand switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27314)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27314)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + valueBeforeChange = value; + } + 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::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -27314)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + VerifyOrReturn(CheckConstraintNotValue("value", value, valueBeforeChange)); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -94506,16 +96161,56 @@ class Test_TC_DGTHREAD_1_1Suite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the mandatory attribute: MinMeasuredValue"); + VerifyOrDo(!ShouldSkip("TMP.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the mandatory attribute: MaxMeasuredValue"); + VerifyOrDo(!ShouldSkip("TMP.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Reads MeasuredValue attribute from DUT"); + VerifyOrDo(!ShouldSkip("TMP.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Operate on device to change the temperature significantly"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TMP.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Read the mandatory attribute: MeasuredValue"); + VerifyOrDo(!ShouldSkip("TMP.S.A0000 && TMP.M.ManuallyControlled"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TemperatureMeasurement::Id, + TemperatureMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } } return CHIP_NO_ERROR; } }; -class Test_TC_DGTHREAD_2_5Suite : public TestCommand +class Test_TC_TMP_3_1Suite : public TestCommand { public: - Test_TC_DGTHREAD_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DGTHREAD_2_5", 0, credsIssuerConfig) + Test_TC_TMP_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TMP_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94523,7 +96218,7 @@ class Test_TC_DGTHREAD_2_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DGTHREAD_2_5Suite() {} + ~Test_TC_TMP_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94568,11 +96263,10 @@ class Test_TC_DGTHREAD_2_5Suite : public TestCommand } }; -class Test_TC_DGTHREAD_3_1Suite : public TestCommand +class Test_TC_TSTAT_3_1Suite : public TestCommand { public: - Test_TC_DGTHREAD_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DGTHREAD_3_1", 0, credsIssuerConfig) + Test_TC_TSTAT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94580,7 +96274,7 @@ class Test_TC_DGTHREAD_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DGTHREAD_3_1Suite() {} + ~Test_TC_TSTAT_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94625,11 +96319,10 @@ class Test_TC_DGTHREAD_3_1Suite : public TestCommand } }; -class Test_TC_DGTHREAD_3_2Suite : public TestCommand +class Test_TC_TSTAT_3_2Suite : public TestCommand { public: - Test_TC_DGTHREAD_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DGTHREAD_3_2", 0, credsIssuerConfig) + Test_TC_TSTAT_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94637,7 +96330,7 @@ class Test_TC_DGTHREAD_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DGTHREAD_3_2Suite() {} + ~Test_TC_TSTAT_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94682,11 +96375,10 @@ class Test_TC_DGTHREAD_3_2Suite : public TestCommand } }; -class Test_TC_DGTHREAD_3_3Suite : public TestCommand +class Test_TC_TSUIC_3_1Suite : public TestCommand { public: - Test_TC_DGTHREAD_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DGTHREAD_3_3", 0, credsIssuerConfig) + Test_TC_TSUIC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSUIC_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94694,7 +96386,7 @@ class Test_TC_DGTHREAD_3_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DGTHREAD_3_3Suite() {} + ~Test_TC_TSUIC_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94739,11 +96431,11 @@ class Test_TC_DGTHREAD_3_3Suite : public TestCommand } }; -class Test_TC_DGTHREAD_3_4Suite : public TestCommand +class Test_TC_DGTHREAD_2_5Suite : public TestCommand { public: - Test_TC_DGTHREAD_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DGTHREAD_3_4", 0, credsIssuerConfig) + Test_TC_DGTHREAD_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_2_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94751,7 +96443,7 @@ class Test_TC_DGTHREAD_3_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DGTHREAD_3_4Suite() {} + ~Test_TC_DGTHREAD_2_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94796,11 +96488,11 @@ class Test_TC_DGTHREAD_3_4Suite : public TestCommand } }; -class Test_TC_DGTHREAD_3_5Suite : public TestCommand +class Test_TC_DGTHREAD_3_1Suite : public TestCommand { public: - Test_TC_DGTHREAD_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DGTHREAD_3_5", 0, credsIssuerConfig) + Test_TC_DGTHREAD_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94808,7 +96500,7 @@ class Test_TC_DGTHREAD_3_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DGTHREAD_3_5Suite() {} + ~Test_TC_DGTHREAD_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94853,10 +96545,11 @@ class Test_TC_DGTHREAD_3_5Suite : public TestCommand } }; -class Test_TC_ACT_2_1Suite : public TestCommand +class Test_TC_DGTHREAD_3_2Suite : public TestCommand { public: - Test_TC_ACT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_2_1", 0, credsIssuerConfig) + Test_TC_DGTHREAD_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94864,7 +96557,7 @@ class Test_TC_ACT_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ACT_2_1Suite() {} + ~Test_TC_DGTHREAD_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94909,10 +96602,11 @@ class Test_TC_ACT_2_1Suite : public TestCommand } }; -class Test_TC_ACT_2_2Suite : public TestCommand +class Test_TC_DGTHREAD_3_3Suite : public TestCommand { public: - Test_TC_ACT_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_2_2", 0, credsIssuerConfig) + Test_TC_DGTHREAD_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_3_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94920,7 +96614,7 @@ class Test_TC_ACT_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ACT_2_2Suite() {} + ~Test_TC_DGTHREAD_3_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -94965,10 +96659,11 @@ class Test_TC_ACT_2_2Suite : public TestCommand } }; -class Test_TC_ACT_3_1Suite : public TestCommand +class Test_TC_DGTHREAD_3_4Suite : public TestCommand { public: - Test_TC_ACT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_3_1", 0, credsIssuerConfig) + Test_TC_DGTHREAD_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_3_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -94976,7 +96671,7 @@ class Test_TC_ACT_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ACT_3_1Suite() {} + ~Test_TC_DGTHREAD_3_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95021,10 +96716,11 @@ class Test_TC_ACT_3_1Suite : public TestCommand } }; -class Test_TC_ACT_3_2Suite : public TestCommand +class Test_TC_DGTHREAD_3_5Suite : public TestCommand { public: - Test_TC_ACT_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_3_2", 0, credsIssuerConfig) + Test_TC_DGTHREAD_3_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DGTHREAD_3_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95032,7 +96728,7 @@ class Test_TC_ACT_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ACT_3_2Suite() {} + ~Test_TC_DGTHREAD_3_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95077,10 +96773,10 @@ class Test_TC_ACT_3_2Suite : public TestCommand } }; -class Test_TC_LTIME_1_1Suite : public TestCommand +class Test_TC_ACT_2_1Suite : public TestCommand { public: - Test_TC_LTIME_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_1_1", 0, credsIssuerConfig) + Test_TC_ACT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95088,7 +96784,7 @@ class Test_TC_LTIME_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LTIME_1_1Suite() {} + ~Test_TC_ACT_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95133,10 +96829,10 @@ class Test_TC_LTIME_1_1Suite : public TestCommand } }; -class Test_TC_LTIME_1_2Suite : public TestCommand +class Test_TC_ACT_2_2Suite : public TestCommand { public: - Test_TC_LTIME_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_1_2", 0, credsIssuerConfig) + Test_TC_ACT_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95144,7 +96840,7 @@ class Test_TC_LTIME_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LTIME_1_2Suite() {} + ~Test_TC_ACT_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95189,10 +96885,10 @@ class Test_TC_LTIME_1_2Suite : public TestCommand } }; -class Test_TC_LTIME_2_1Suite : public TestCommand +class Test_TC_ACT_3_1Suite : public TestCommand { public: - Test_TC_LTIME_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_2_1", 0, credsIssuerConfig) + Test_TC_ACT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95200,7 +96896,7 @@ class Test_TC_LTIME_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LTIME_2_1Suite() {} + ~Test_TC_ACT_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95245,10 +96941,10 @@ class Test_TC_LTIME_2_1Suite : public TestCommand } }; -class Test_TC_LTIME_3_1Suite : public TestCommand +class Test_TC_ACT_3_2Suite : public TestCommand { public: - Test_TC_LTIME_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_3_1", 0, credsIssuerConfig) + Test_TC_ACT_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACT_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95256,7 +96952,7 @@ class Test_TC_LTIME_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LTIME_3_1Suite() {} + ~Test_TC_ACT_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95301,10 +96997,10 @@ class Test_TC_LTIME_3_1Suite : public TestCommand } }; -class Test_TC_LUNIT_1_1Suite : public TestCommand +class Test_TC_LTIME_1_1Suite : public TestCommand { public: - Test_TC_LUNIT_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_1_1", 0, credsIssuerConfig) + Test_TC_LTIME_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95312,7 +97008,7 @@ class Test_TC_LUNIT_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LUNIT_1_1Suite() {} + ~Test_TC_LTIME_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95357,10 +97053,10 @@ class Test_TC_LUNIT_1_1Suite : public TestCommand } }; -class Test_TC_LUNIT_1_2Suite : public TestCommand +class Test_TC_LTIME_1_2Suite : public TestCommand { public: - Test_TC_LUNIT_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_1_2", 0, credsIssuerConfig) + Test_TC_LTIME_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95368,7 +97064,7 @@ class Test_TC_LUNIT_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LUNIT_1_2Suite() {} + ~Test_TC_LTIME_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95413,10 +97109,10 @@ class Test_TC_LUNIT_1_2Suite : public TestCommand } }; -class Test_TC_LUNIT_2_1Suite : public TestCommand +class Test_TC_LTIME_2_1Suite : public TestCommand { public: - Test_TC_LUNIT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_2_1", 0, credsIssuerConfig) + Test_TC_LTIME_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95424,7 +97120,7 @@ class Test_TC_LUNIT_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LUNIT_2_1Suite() {} + ~Test_TC_LTIME_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95469,10 +97165,10 @@ class Test_TC_LUNIT_2_1Suite : public TestCommand } }; -class Test_TC_LUNIT_3_1Suite : public TestCommand +class Test_TC_LTIME_3_1Suite : public TestCommand { public: - Test_TC_LUNIT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_3_1", 9, credsIssuerConfig) + Test_TC_LTIME_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95480,7 +97176,7 @@ class Test_TC_LUNIT_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LUNIT_3_1Suite() {} + ~Test_TC_LTIME_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95505,54 +97201,6 @@ class Test_TC_LUNIT_3_1Suite : public TestCommand switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::UnitLocalization::TempUnit value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); - } - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::UnitLocalization::TempUnit value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("temperatureUnit", value, 0U)); - } - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::UnitLocalization::TempUnit value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("temperatureUnit", value, 1U)); - } - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::UnitLocalization::TempUnit value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("temperatureUnit", value, 2U)); - } - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -95568,82 +97216,71 @@ class Test_TC_LUNIT_3_1Suite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); - } - case 1: { - LogStep(1, "TH reads TemperatureUnit attribute from DUT"); - VerifyOrDo(!ShouldSkip("LUNIT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, - UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); - } - case 2: { - LogStep(2, "TH writes 0 (Fahrenheit) to TemperatureUnit attribute"); - VerifyOrDo(!ShouldSkip("LUNIT.C.A0000.Fahrenheit"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::UnitLocalization::TempUnit value; - value = static_cast(0); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, - UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); - } - case 3: { - LogStep(3, "TH reads TemperatureUnit attribute"); - VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, - UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); - } - case 4: { - LogStep(4, "TH writes 1 (Celsius) to TemperatureUnit attribute"); - VerifyOrDo(!ShouldSkip("LUNIT.C.A0000.Celsius"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::UnitLocalization::TempUnit value; - value = static_cast(1); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, - UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); - } - case 5: { - LogStep(5, "TH reads TemperatureUnit attribute"); - VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, - UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); } - case 6: { - LogStep(6, "TH writes 2 (Kelvin) to TemperatureUnit attribute"); - VerifyOrDo(!ShouldSkip("LUNIT.C.A0000.Kelvin"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::UnitLocalization::TempUnit value; - value = static_cast(2); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, - UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); - } - case 7: { - LogStep(7, "TH reads TemperatureUnit attribute"); - VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, - UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LUNIT_1_1Suite : public TestCommand +{ +public: + Test_TC_LUNIT_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_1_1", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LUNIT_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } - case 8: { - LogStep(8, "TH writes 5 to TemperatureUnit attribute"); - VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::UnitLocalization::TempUnit value; - value = static_cast(5); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, - UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { } return CHIP_NO_ERROR; } }; -class Test_TC_FLABEL_1_1Suite : public TestCommand +class Test_TC_LUNIT_1_2Suite : public TestCommand { public: - Test_TC_FLABEL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLABEL_1_1", 0, credsIssuerConfig) + Test_TC_LUNIT_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95651,7 +97288,7 @@ class Test_TC_FLABEL_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_FLABEL_1_1Suite() {} + ~Test_TC_LUNIT_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95696,10 +97333,10 @@ class Test_TC_FLABEL_1_1Suite : public TestCommand } }; -class Test_TC_FLABEL_2_1Suite : public TestCommand +class Test_TC_LUNIT_2_1Suite : public TestCommand { public: - Test_TC_FLABEL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLABEL_2_1", 0, credsIssuerConfig) + Test_TC_LUNIT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95707,7 +97344,7 @@ class Test_TC_FLABEL_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_FLABEL_2_1Suite() {} + ~Test_TC_LUNIT_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95752,10 +97389,10 @@ class Test_TC_FLABEL_2_1Suite : public TestCommand } }; -class Test_TC_FLABEL_3_1Suite : public TestCommand +class Test_TC_LUNIT_3_1Suite : public TestCommand { public: - Test_TC_FLABEL_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLABEL_3_1", 0, credsIssuerConfig) + Test_TC_LUNIT_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LUNIT_3_1", 9, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95763,7 +97400,7 @@ class Test_TC_FLABEL_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_FLABEL_3_1Suite() {} + ~Test_TC_LUNIT_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95788,6 +97425,54 @@ class Test_TC_FLABEL_3_1Suite : public TestCommand switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnit value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnit value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureUnit", value, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnit value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureUnit", value, 1U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UnitLocalization::TempUnit value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("temperatureUnit", value, 2U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -95803,71 +97488,82 @@ class Test_TC_FLABEL_3_1Suite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_BIND_1_1Suite : public TestCommand -{ -public: - Test_TC_BIND_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_1_1", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_BIND_1_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + case 1: { + LogStep(1, "TH reads TemperatureUnit attribute from DUT"); + VerifyOrDo(!ShouldSkip("LUNIT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); + case 2: { + LogStep(2, "TH writes 0 (Fahrenheit) to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000.Fahrenheit"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnit value; + value = static_cast(0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH writes 1 (Celsius) to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000.Celsius"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnit value; + value = static_cast(1); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH writes 2 (Kelvin) to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000.Kelvin"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnit value; + value = static_cast(2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH writes 5 to TemperatureUnit attribute"); + VerifyOrDo(!ShouldSkip("LUNIT.C.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::UnitLocalization::TempUnit value; + value = static_cast(5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), UnitLocalization::Id, + UnitLocalization::Attributes::TemperatureUnit::Id, value, chip::NullOptional, chip::NullOptional); } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { } return CHIP_NO_ERROR; } }; -class Test_TC_BIND_2_1Suite : public TestCommand +class Test_TC_FLABEL_1_1Suite : public TestCommand { public: - Test_TC_BIND_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_2_1", 0, credsIssuerConfig) + Test_TC_FLABEL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLABEL_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95875,7 +97571,7 @@ class Test_TC_BIND_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BIND_2_1Suite() {} + ~Test_TC_FLABEL_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95920,10 +97616,10 @@ class Test_TC_BIND_2_1Suite : public TestCommand } }; -class Test_TC_BIND_2_2Suite : public TestCommand +class Test_TC_FLABEL_2_1Suite : public TestCommand { public: - Test_TC_BIND_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_2_2", 0, credsIssuerConfig) + Test_TC_FLABEL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLABEL_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95931,7 +97627,7 @@ class Test_TC_BIND_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BIND_2_2Suite() {} + ~Test_TC_FLABEL_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -95976,10 +97672,10 @@ class Test_TC_BIND_2_2Suite : public TestCommand } }; -class Test_TC_BIND_2_3Suite : public TestCommand +class Test_TC_FLABEL_3_1Suite : public TestCommand { public: - Test_TC_BIND_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_2_3", 0, credsIssuerConfig) + Test_TC_FLABEL_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLABEL_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95987,7 +97683,7 @@ class Test_TC_BIND_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BIND_2_3Suite() {} + ~Test_TC_FLABEL_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -96032,10 +97728,10 @@ class Test_TC_BIND_2_3Suite : public TestCommand } }; -class Test_TC_S_1_1Suite : public TestCommand +class Test_TC_BIND_2_1Suite : public TestCommand { public: - Test_TC_S_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_1_1", 0, credsIssuerConfig) + Test_TC_BIND_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96043,7 +97739,7 @@ class Test_TC_S_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_S_1_1Suite() {} + ~Test_TC_BIND_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -96088,10 +97784,10 @@ class Test_TC_S_1_1Suite : public TestCommand } }; -class Test_TC_S_2_1Suite : public TestCommand +class Test_TC_BIND_2_2Suite : public TestCommand { public: - Test_TC_S_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_2_1", 0, credsIssuerConfig) + Test_TC_BIND_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96099,7 +97795,7 @@ class Test_TC_S_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_S_2_1Suite() {} + ~Test_TC_BIND_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -96144,10 +97840,10 @@ class Test_TC_S_2_1Suite : public TestCommand } }; -class Test_TC_S_2_2Suite : public TestCommand +class Test_TC_BIND_2_3Suite : public TestCommand { public: - Test_TC_S_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_2_2", 0, credsIssuerConfig) + Test_TC_BIND_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BIND_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96155,7 +97851,7 @@ class Test_TC_S_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_S_2_2Suite() {} + ~Test_TC_BIND_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -96200,10 +97896,10 @@ class Test_TC_S_2_2Suite : public TestCommand } }; -class Test_TC_S_2_3Suite : public TestCommand +class Test_TC_S_1_1Suite : public TestCommand { public: - Test_TC_S_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_2_3", 0, credsIssuerConfig) + Test_TC_S_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96211,7 +97907,7 @@ class Test_TC_S_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_S_2_3Suite() {} + ~Test_TC_S_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -96256,10 +97952,10 @@ class Test_TC_S_2_3Suite : public TestCommand } }; -class Test_TC_S_3_1Suite : public TestCommand +class Test_TC_S_2_1Suite : public TestCommand { public: - Test_TC_S_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_3_1", 0, credsIssuerConfig) + Test_TC_S_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96267,7 +97963,7 @@ class Test_TC_S_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_S_3_1Suite() {} + ~Test_TC_S_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -96312,10 +98008,10 @@ class Test_TC_S_3_1Suite : public TestCommand } }; -class Test_TC_PCC_3_1Suite : public TestCommand +class Test_TC_S_2_2Suite : public TestCommand { public: - Test_TC_PCC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PCC_3_1", 0, credsIssuerConfig) + Test_TC_S_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96323,7 +98019,7 @@ class Test_TC_PCC_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PCC_3_1Suite() {} + ~Test_TC_S_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -96368,10 +98064,10 @@ class Test_TC_PCC_3_1Suite : public TestCommand } }; -class Test_TC_ACL_1_1Suite : public TestCommand +class Test_TC_S_2_3Suite : public TestCommand { public: - Test_TC_ACL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_1_1", 0, credsIssuerConfig) + Test_TC_S_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96379,7 +98075,7 @@ class Test_TC_ACL_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ACL_1_1Suite() {} + ~Test_TC_S_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -96424,10 +98120,10 @@ class Test_TC_ACL_1_1Suite : public TestCommand } }; -class Test_TC_ACL_2_1Suite : public TestCommand +class Test_TC_S_3_1Suite : public TestCommand { public: - Test_TC_ACL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_1", 0, credsIssuerConfig) + Test_TC_S_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_S_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96435,7 +98131,7 @@ class Test_TC_ACL_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ACL_2_1Suite() {} + ~Test_TC_S_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -96480,10 +98176,10 @@ class Test_TC_ACL_2_1Suite : public TestCommand } }; -class Test_TC_ACL_2_2Suite : public TestCommand +class Test_TC_PCC_3_1Suite : public TestCommand { public: - Test_TC_ACL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_2", 0, credsIssuerConfig) + Test_TC_PCC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PCC_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96491,7 +98187,7 @@ class Test_TC_ACL_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ACL_2_2Suite() {} + ~Test_TC_PCC_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -97335,9 +99031,13 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(), make_unique(), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -97360,6 +99060,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -97449,6 +99150,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -97515,6 +99217,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -97522,6 +99225,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -97628,7 +99332,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -97754,7 +99457,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -97788,7 +99490,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -97815,7 +99516,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -97837,7 +99537,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -97847,9 +99546,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index e24e40da323a8b..56e843108725bc 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -34,9 +34,13 @@ class TestList : public Command { CHIP_ERROR Run() override { printf("TestAccessControlCluster\n"); + printf("Test_TC_ACL_1_1\n"); + printf("Test_TC_ACL_2_1\n"); + printf("Test_TC_ACL_2_2\n"); printf("Test_TC_BOOL_1_1\n"); printf("Test_TC_BOOL_2_1\n"); printf("Test_TC_ACT_1_1\n"); + printf("Test_TC_BIND_1_1\n"); printf("Test_TC_CC_1_1\n"); printf("Test_TC_CC_2_1\n"); printf("Test_TC_CC_3_2\n"); @@ -49,14 +53,12 @@ class TestList : public Command { printf("Test_TC_CC_5_2\n"); printf("Test_TC_CC_5_3\n"); printf("Test_TC_CC_6_1\n"); - printf("Test_TC_CC_6_2\n"); - printf("Test_TC_CC_6_3\n"); printf("Test_TC_CC_7_3\n"); printf("Test_TC_CC_7_4\n"); - printf("Test_TC_CC_8_1\n"); printf("Test_TC_BINFO_1_1\n"); printf("Test_TC_CNET_1_3\n"); printf("Test_TC_DESC_1_1\n"); + printf("Test_TC_DGETH_1_1\n"); printf("Test_TC_DGETH_2_1\n"); printf("Test_TC_DGETH_2_2\n"); printf("Test_TC_FLW_1_1\n"); @@ -141,6 +143,7 @@ class TestList : public Command { printf("Test_TC_TSUIC_1_1\n"); printf("Test_TC_TSUIC_2_1\n"); printf("Test_TC_TSUIC_2_2\n"); + printf("Test_TC_DGTHREAD_1_1\n"); printf("Test_TC_ULABEL_1_1\n"); printf("Test_TC_ULABEL_2_2\n"); printf("Test_TC_ULABEL_2_3\n"); @@ -200,6 +203,7 @@ class TestList : public Command { printf("TestLevelControlWithOnOffDependency\n"); printf("TestCommissioningWindow\n"); printf("TestMultiAdmin\n"); + printf("Test_TC_DGSW_1_1\n"); printf("Test_TC_DGSW_2_1\n"); printf("Test_TC_DGSW_2_2\n"); printf("Test_TC_DGSW_2_3\n"); @@ -207,6 +211,7 @@ class TestList : public Command { printf("DL_UsersAndCredentials\n"); printf("DL_LockUnlock\n"); printf("DL_Schedules\n"); + printf("Test_TC_DRLK_1_1\n"); printf("Test_TC_DRLK_2_2\n"); printf("Test_TC_DRLK_2_3\n"); printf("Test_TC_DRLK_2_4\n"); @@ -2089,6 +2094,589 @@ class TestAccessControlCluster : public TestCommandBridge { } }; +class Test_TC_ACL_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ACL_1_1() + : TestCommandBridge("Test_TC_ACL_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ACL_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ACL_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ACL_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads ClusterRevision attribute from DUT\n"); + err = TestThReadsClusterRevisionAttributeFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads FeatureMap attribute from DUT\n"); + err = TestThReadsFeatureMapAttributeFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AttributeList attribute from DUT\n"); + err = TestThReadsAttributeListAttributeFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads AcceptedCommandList attribute from DUT\n"); + err = TestThReadsAcceptedCommandListAttributeFromDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads GeneratedCommandList attribute from DUT\n"); + err = TestThReadsGeneratedCommandListAttributeFromDut_5(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + 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 = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsClusterRevisionAttributeFromDut_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAccessControl * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads ClusterRevision attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFeatureMapAttributeFromDut_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAccessControl * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads FeatureMap attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAttributeListAttributeFromDut_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAccessControl * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AttributeList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAcceptedCommandListAttributeFromDut_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAccessControl * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AcceptedCommandList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsGeneratedCommandListAttributeFromDut_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAccessControl * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads GeneratedCommandList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ACL_2_1() + : TestCommandBridge("Test_TC_ACL_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ACL_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ACL_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ACL_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads SubjectsPerAccessControlEntry attribute from DUT\n"); + if (ShouldSkip("ACL.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsSubjectsPerAccessControlEntryAttributeFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads TargetsPerAccessControlEntry attribute from DUT\n"); + if (ShouldSkip("ACL.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsTargetsPerAccessControlEntryAttributeFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AccessControlEntriesPerFabric attribute from DUT\n"); + if (ShouldSkip("ACL.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsAccessControlEntriesPerFabricAttributeFromDut_3(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsSubjectsPerAccessControlEntryAttributeFromDut_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAccessControl * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSubjectsPerAccessControlEntryWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads SubjectsPerAccessControlEntry attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("subjectsPerAccessControlEntry", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("subjectsPerAccessControlEntry", [value unsignedShortValue], 4U)); + VerifyOrReturn(CheckConstraintMaxValue("subjectsPerAccessControlEntry", [value unsignedShortValue], 65535U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTargetsPerAccessControlEntryAttributeFromDut_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAccessControl * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTargetsPerAccessControlEntryWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TargetsPerAccessControlEntry attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("targetsPerAccessControlEntry", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("targetsPerAccessControlEntry", [value unsignedShortValue], 3U)); + VerifyOrReturn(CheckConstraintMaxValue("targetsPerAccessControlEntry", [value unsignedShortValue], 65535U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAccessControlEntriesPerFabricAttributeFromDut_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAccessControl * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAccessControlEntriesPerFabricWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AccessControlEntriesPerFabric attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("accessControlEntriesPerFabric", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("accessControlEntriesPerFabric", [value unsignedShortValue], 3U)); + VerifyOrReturn(CheckConstraintMaxValue("accessControlEntriesPerFabric", [value unsignedShortValue], 65535U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACL_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ACL_2_2() + : TestCommandBridge("Test_TC_ACL_2_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ACL_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ACL_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ACL_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : TH1 reads DUT Descriptor cluster ServerList attribute from Endpoint 0\n"); + err = TestTh1ReadsDutDescriptorClusterServerListAttributeFromEndpoint0_1(); + break; + case 2: + ChipLogProgress(chipTool, + " ***** Test Step 2 : TH1 reads DUT Descriptor cluster ServerList attribute from every Endpoint except 0\n"); + err = TestTh1ReadsDutDescriptorClusterServerListAttributeFromEveryEndpointExcept0_2(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + 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 = 3; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestTh1ReadsDutDescriptorClusterServerListAttributeFromEndpoint0_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Descriptor cluster ServerList attribute from Endpoint 0 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("serverList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("serverList", value, 31UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutDescriptorClusterServerListAttributeFromEveryEndpointExcept0_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Descriptor cluster ServerList attribute from every Endpoint except 0 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("serverList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("serverList", value, 31UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_BOOL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -2711,11 +3299,11 @@ class Test_TC_ACT_1_1 : public TestCommandBridge { } }; -class Test_TC_CC_1_1 : public TestCommandBridge { +class Test_TC_BIND_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_1_1() - : TestCommandBridge("Test_TC_CC_1_1") + Test_TC_BIND_1_1() + : TestCommandBridge("Test_TC_BIND_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -2725,7 +3313,7 @@ class Test_TC_CC_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_1_1() {} + ~Test_TC_BIND_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -2733,7 +3321,243 @@ class Test_TC_CC_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BIND_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BIND_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision from DUT\n"); + err = TestThReadsTheClusterRevisionFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap from DUT\n"); + err = TestThReadsTheFeatureMapFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AttributeList from DUT\n"); + err = TestThReadsAttributeListFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads AcceptedCommandList from DUT\n"); + err = TestThReadsAcceptedCommandListFromDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads GeneratedCommandList from DUT\n"); + err = TestThReadsGeneratedCommandListFromDut_5(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + 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 = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterBinding * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterBinding * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAttributeListFromDut_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterBinding * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAcceptedCommandListFromDut_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterBinding * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AcceptedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsGeneratedCommandListFromDut_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterBinding * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads GeneratedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CC_1_1() + : TestCommandBridge("Test_TC_CC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_1_1\n"); } if (mTestCount == mTestIndex) { @@ -14004,7 +14828,7 @@ class Test_TC_CC_6_1 : public TestCommandBridge { break; case 17: ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads ColorMode attribute from DUT\n"); - if (ShouldSkip("CC.S.F00 && CC.S.A0008")) { + if (ShouldSkip("CC.S.F04 && CC.S.A0008")) { NextTest(); return; } @@ -14012,7 +14836,7 @@ class Test_TC_CC_6_1 : public TestCommandBridge { break; case 18: ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads EnhancedColorMode attribute from DUT\n"); - if (ShouldSkip("CC.S.F00 && CC.S.A4001")) { + if (ShouldSkip("CC.S.F04 && CC.S.A4001")) { NextTest(); return; } @@ -14518,11 +15342,11 @@ class Test_TC_CC_6_1 : public TestCommandBridge { } }; -class Test_TC_CC_6_2 : public TestCommandBridge { +class Test_TC_CC_7_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_6_2() - : TestCommandBridge("Test_TC_CC_6_2") + Test_TC_CC_7_3() + : TestCommandBridge("Test_TC_CC_7_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -14532,7 +15356,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_6_2() {} + ~Test_TC_CC_7_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -14540,11 +15364,11 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -14562,7 +15386,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : TH writes 0 to the Options attribute\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A000f")) { + if (ShouldSkip("CC.S.F01 && CC.S.A000f")) { NextTest(); return; } @@ -14577,182 +15401,180 @@ class Test_TC_CC_6_2 : public TestCommandBridge { err = TestThSendsOnCommandToDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads ColorTempPhysicalMinMireds attribute from DUT\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A400b")) { + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH sends EnhancedMoveToHue command to DUT with EnhancedHue=6000, Direction=0x00 (shortest " + "distance) and TransitionTime=0 (immediately).\n"); + if (ShouldSkip("CC.S.F01 && CC.S.C40.Rsp")) { NextTest(); return; } - err = TestThReadsColorTempPhysicalMinMiredsAttributeFromDut_3(); + err = TestThSendsEnhancedMoveToHueCommandToDutWithEnhancedHue6000Direction0x00ShortestDistanceAndTransitionTime0Immediately_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads ColorTempPhysicalMaxMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A400c")) { - NextTest(); - return; - } - err = TestThReadsColorTempPhysicalMaxMiredsAttributeFromDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Wait 100ms\n"); + err = TestWait100ms_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007")) { + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends EnhancedStepHue command to DUT with StepMode=0x01 (up), StepSize=6000 and " + "TransitionTime=300 (30s).\n"); + if (ShouldSkip("CC.S.F01 && CC.S.C42.Rsp")) { NextTest(); return; } - err = TestThReadsColorTemperatureMiredsAttributeFromDut_5(); + err = TestThSendsEnhancedStepHueCommandToDutWithStepMode0x01UpStepSize6000AndTransitionTime30030s_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : TH sends MoveToColorTemperature command to DUT with " - "ColorTemperatureMireds=(ColorTempPhysicalMinMireds + ColorTempPhysicalMaxMireds)/2 and TransitionTime=0 " - "(immediately).\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestThSendsMoveToColorTemperatureCommandToDutWithColorTemperatureMiredsColorTempPhysicalMinMiredsColorTempPhysicalMaxMireds2AndTransitionTime0Immediately_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10s\n"); + err = TestWait10s_6(); break; case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : TH sends MoveColorTemperature command to DUT with MoveMode = 0x01 (up), Rate = " - "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/40\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { NextTest(); return; } - err = TestThSendsMoveColorTemperatureCommandToDutWithMoveMode0x01UpRateColorTempPhysicalMaxMiredsColorTempPhysicalMinMireds40_7(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_7(); break; case 8: - ChipLogProgress( - chipTool, " ***** Test Step 8 : After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10s\n"); + err = TestWait10s_8(); break; case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { NextTest(); return; } - err = TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_9(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_9(); break; case 10: - ChipLogProgress( - chipTool, " ***** Test Step 10 : After another 5 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestAfterAnother5SecondsThReadsColorTemperatureMiredsAttributeFromDut_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 10s\n"); + err = TestWait10s_10(); break; case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : TH sends MoveColorTemperature command to DUT with MoveMode = 0x03(down), Rate = " - "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { NextTest(); return; } - err = TestThSendsMoveColorTemperatureCommandToDutWithMoveMode0x03downRateColorTempPhysicalMaxMiredsColorTempPhysicalMinMireds20_11(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_11(); break; case 12: - ChipLogProgress( - chipTool, " ***** Test Step 12 : After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 5s\n"); + err = TestWait5s_12(); break; case 13: - ChipLogProgress( - chipTool, " ***** Test Step 13 : After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { NextTest(); return; } - err = TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_13(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_13(); break; case 14: - ChipLogProgress( - chipTool, " ***** Test Step 14 : After another 5 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, + " ***** Test Step 14 : TH sends EnhancedMoveToHue command to DUT with EnhancedHue=12000, Direction=0x00 (shortest " + "distance) and TransitionTime=0 (immediately).\n"); + if (ShouldSkip("CC.S.F01 && CC.S.C40.Rsp")) { NextTest(); return; } - err = TestAfterAnother5SecondsThReadsColorTemperatureMiredsAttributeFromDut_14(); + err = TestThSendsEnhancedMoveToHueCommandToDutWithEnhancedHue12000Direction0x00ShortestDistanceAndTransitionTime0Immediately_14(); break; case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 100ms\n"); + err = TestWait100ms_15(); + break; + case 16: ChipLogProgress(chipTool, - " ***** Test Step 15 : TH sends MoveColorTemperature command to DUT with MoveMode = 0x01(up), Rate = " - "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT")) { + " ***** Test Step 16 : TH sends EnhancedStepHue command to DUT with StepMode=0x03 (down), StepSize=6000 and " + "TransitionTime=300 (30s)\n"); + if (ShouldSkip("CC.S.F01 && CC.S.C42.Rsp")) { NextTest(); return; } - err = TestThSendsMoveColorTemperatureCommandToDutWithMoveMode0x01upRateColorTempPhysicalMaxMiredsColorTempPhysicalMinMireds20_15(); + err = TestThSendsEnhancedStepHueCommandToDutWithStepMode0x03DownStepSize6000AndTransitionTime30030s_16(); break; - case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : After 10 seconds, TH sends MoveColorTemperature command to DUT with MoveMode = 0x00(stop), " - "Rate = (ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/20\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C4b.Rsp && PICS_USER_PROMPT")) { + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Wait 10s\n"); + err = TestWait10s_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { NextTest(); return; } - err = TestAfter10SecondsThSendsMoveColorTemperatureCommandToDutWithMoveMode0x00stopRateColorTempPhysicalMaxMiredsColorTempPhysicalMinMireds20_16(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_18(); break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Wait 10s\n"); + err = TestWait10s_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { NextTest(); return; } - err = TestThReadsColorTemperatureMiredsAttributeFromDut_17(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_20(); break; - case 18: - ChipLogProgress( - chipTool, " ***** Test Step 18 : After another 2 seconds, TH reads ColorTemperatureMireds attribute from DUT\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Wait 10s\n"); + err = TestWait10s_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { NextTest(); return; } - err = TestAfterAnother2SecondsThReadsColorTemperatureMiredsAttributeFromDut_18(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_22(); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : TH reads ColorMode attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0008 && PICS_USER_PROMPT")) { + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Wait 5s\n"); + err = TestWait5s_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { NextTest(); return; } - err = TestThReadsColorModeAttributeFromDut_19(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_24(); break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads EnhancedColorMode attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A4001 && PICS_USER_PROMPT")) { + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads ColorMode attribute from DUT\n"); + if (ShouldSkip("CC.S.F00 && CC.S.A0008")) { NextTest(); return; } - err = TestThReadsEnhancedColorModeAttributeFromDut_20(); + err = TestThReadsColorModeAttributeFromDut_25(); break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Turn off light that we turned on\n"); + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : TH reads EnhancedColorMode attribute from DUT\n"); + if (ShouldSkip("CC.S.F00 && CC.S.A4001")) { + NextTest(); + return; + } + err = TestThReadsEnhancedColorModeAttributeFromDut_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Turn Off light that we turned on\n"); if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestTurnOffLightThatWeTurnedOn_21(); + err = TestTurnOffLightThatWeTurnedOn_27(); break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Check on/off attribute value is false after off command\n"); + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Check on/off attribute value is false after off command\n"); if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_28(); break; } @@ -14834,6 +15656,24 @@ class Test_TC_CC_6_2 : public TestCommandBridge { case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -14847,7 +15687,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 23; + const uint16_t mTestCount = 29; chip::Optional mNodeId; chip::Optional mCluster; @@ -14899,9 +15739,9 @@ class Test_TC_CC_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull ColorTempPhysicalMinMiredsValue; - CHIP_ERROR TestThReadsColorTempPhysicalMinMiredsAttributeFromDut_3() + CHIP_ERROR + TestThSendsEnhancedMoveToHueCommandToDutWithEnhancedHue6000Direction0x00ShortestDistanceAndTransitionTime0Immediately_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -14909,27 +15749,69 @@ class Test_TC_CC_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeColorTempPhysicalMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ColorTempPhysicalMinMireds attribute from DUT Error: %@", err); + __auto_type * params = [[MTRColorControlClusterEnhancedMoveToHueParams alloc] init]; + params.enhancedHue = [NSNumber numberWithUnsignedShort:6000U]; + params.direction = [NSNumber numberWithUnsignedChar:0U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster enhancedMoveToHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends EnhancedMoveToHue command to DUT with EnhancedHue=6000, Direction=0x00 (shortest " + @"distance) and TransitionTime=0 (immediately). Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("colorTempPhysicalMinMireds", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMinMireds", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMinMireds", [value unsignedShortValue], 65279U)); - { - ColorTempPhysicalMinMiredsValue = value; - } + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait100ms_4() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThSendsEnhancedStepHueCommandToDutWithStepMode0x01UpStepSize6000AndTransitionTime30030s_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRColorControlClusterEnhancedStepHueParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:1U]; + params.stepSize = [NSNumber numberWithUnsignedShort:6000U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster enhancedStepHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends EnhancedStepHue command to DUT with StepMode=0x01 (up), StepSize=6000 and " + @"TransitionTime=300 (30s). Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull ColorTempPhysicalMaxMiredsValue; - CHIP_ERROR TestThReadsColorTempPhysicalMaxMiredsAttributeFromDut_4() + CHIP_ERROR TestWait10s_6() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -14937,26 +15819,28 @@ class Test_TC_CC_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeColorTempPhysicalMaxMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ColorTempPhysicalMaxMireds attribute from DUT. Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("colorTempPhysicalMaxMireds", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMaxMireds", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMaxMireds", [value unsignedShortValue], 65279U)); - { - ColorTempPhysicalMaxMiredsValue = value; - } + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 7000U)); + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 9000U)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsColorTemperatureMiredsAttributeFromDut_5() + CHIP_ERROR TestWait10s_8() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -14964,16 +15848,13 @@ class Test_TC_CC_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ColorTemperatureMireds attribute from DUT. Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("colorTemperature", "int16u", "int16u")); - VerifyOrReturn( - CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], ColorTempPhysicalMinMiredsValue)); - VerifyOrReturn( - CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], ColorTempPhysicalMaxMiredsValue)); + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 9000U)); + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 11000U)); NextTest(); }]; @@ -14981,154 +15862,300 @@ class Test_TC_CC_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsMoveToColorTemperatureCommandToDutWithColorTemperatureMiredsColorTempPhysicalMinMiredsColorTempPhysicalMaxMireds2AndTransitionTime0Immediately_6() + CHIP_ERROR TestWait10s_10() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR - TestThSendsMoveColorTemperatureCommandToDutWithMoveMode0x01UpRateColorTempPhysicalMaxMiredsColorTempPhysicalMinMireds40_7() + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_11() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 11000U)); + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 12000U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_8() + CHIP_ERROR TestWait5s_12() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_9() + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_13() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, 12000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestAfterAnother5SecondsThReadsColorTemperatureMiredsAttributeFromDut_10() + CHIP_ERROR + TestThSendsEnhancedMoveToHueCommandToDutWithEnhancedHue12000Direction0x00ShortestDistanceAndTransitionTime0Immediately_14() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRColorControlClusterEnhancedMoveToHueParams alloc] init]; + params.enhancedHue = [NSNumber numberWithUnsignedShort:12000U]; + params.direction = [NSNumber numberWithUnsignedChar:0U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster enhancedMoveToHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends EnhancedMoveToHue command to DUT with EnhancedHue=12000, Direction=0x00 (shortest " + @"distance) and TransitionTime=0 (immediately). Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsMoveColorTemperatureCommandToDutWithMoveMode0x03downRateColorTempPhysicalMaxMiredsColorTempPhysicalMinMireds20_11() + CHIP_ERROR TestWait100ms_15() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_12() + CHIP_ERROR TestThSendsEnhancedStepHueCommandToDutWithStepMode0x03DownStepSize6000AndTransitionTime30030s_16() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRColorControlClusterEnhancedStepHueParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:3U]; + params.stepSize = [NSNumber numberWithUnsignedShort:6000U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster enhancedStepHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends EnhancedStepHue command to DUT with StepMode=0x03 (down), StepSize=6000 and " + @"TransitionTime=300 (30s) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_13() + CHIP_ERROR TestWait10s_17() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestAfterAnother5SecondsThReadsColorTemperatureMiredsAttributeFromDut_14() + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_18() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 9000U)); + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 11000U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsMoveColorTemperatureCommandToDutWithMoveMode0x01upRateColorTempPhysicalMaxMiredsColorTempPhysicalMinMireds20_15() + CHIP_ERROR TestWait10s_19() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR - TestAfter10SecondsThSendsMoveColorTemperatureCommandToDutWithMoveMode0x00stopRateColorTempPhysicalMaxMiredsColorTempPhysicalMinMireds20_16() + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_20() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 7000U)); + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 9000U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsColorTemperatureMiredsAttributeFromDut_17() + CHIP_ERROR TestWait10s_21() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestAfterAnother2SecondsThReadsColorTemperatureMiredsAttributeFromDut_18() + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_22() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 6000U)); + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 7000U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsColorModeAttributeFromDut_19() + CHIP_ERROR TestWait5s_23() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsEnhancedColorModeAttributeFromDut_20() + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_24() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, 6000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsColorModeAttributeFromDut_25() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads ColorMode attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("colorMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("colorMode", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEnhancedColorModeAttributeFromDut_26() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedColorMode attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("colorMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("colorMode", [value unsignedCharValue], 3U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_21() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_27() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); + NSLog(@"Turn Off light that we turned on Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -15138,7 +16165,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_28() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -15161,11 +16188,11 @@ class Test_TC_CC_6_2 : public TestCommandBridge { } }; -class Test_TC_CC_6_3 : public TestCommandBridge { +class Test_TC_CC_7_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_6_3() - : TestCommandBridge("Test_TC_CC_6_3") + Test_TC_CC_7_4() + : TestCommandBridge("Test_TC_CC_7_4") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -15175,7 +16202,7 @@ class Test_TC_CC_6_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_6_3() {} + ~Test_TC_CC_7_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -15183,11 +16210,11 @@ class Test_TC_CC_6_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -15205,7 +16232,7 @@ class Test_TC_CC_6_3 : public TestCommandBridge { break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : TH writes 0 to the Options attribute\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A000f")) { + if (ShouldSkip("CC.S.F01 && CC.S.A000f")) { NextTest(); return; } @@ -15220,145 +16247,136 @@ class Test_TC_CC_6_3 : public TestCommandBridge { err = TestThSendsOnCommandToDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads ColorTempPhysicalMinMireds attribute from DUT\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A400b")) { + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH sends EnhancedMoveToHueAndSaturation command to DUT with EnhancedHue=20000, Saturation=50 " + "and TransitionTime=0 (immediately)\n"); + if (ShouldSkip("CC.S.F01 && CC.S.C43.Rsp")) { NextTest(); return; } - err = TestThReadsColorTempPhysicalMinMiredsAttributeFromDut_3(); + err = TestThSendsEnhancedMoveToHueAndSaturationCommandToDutWithEnhancedHue20000Saturation50AndTransitionTime0Immediately_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads ColorTempPhysicalMaxMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A400c")) { - NextTest(); - return; - } - err = TestThReadsColorTempPhysicalMaxMiredsAttributeFromDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Wait 100ms\n"); + err = TestWait100ms_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000")) { NextTest(); return; } - err = TestThReadsColorTemperatureMiredsAttributeFromDut_5(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : TH sends MoveToColorTemperature command to DUT with " - "ColorTemperatureMireds=(ColorTempPhysicalMinMireds + ColorTempPhysicalMaxMireds)/2 and TransitionTime=0 " - "(immediately).\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads CurrentSaturation attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A0001")) { NextTest(); return; } - err = TestThSendsMoveToColorTemperatureCommandToDutWithColorTemperatureMiredsColorTempPhysicalMinMiredsColorTempPhysicalMaxMireds2AndTransitionTime0Immediately_6(); + err = TestThReadsCurrentSaturationAttributeFromDut_6(); break; case 7: ChipLogProgress(chipTool, - " ***** Test Step 7 : TH sends StepColorTemperature command to DUT with StepMode = 0x01 (up), StepSize = " - "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds)/2 and TransitionTime = 200 (20s).\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C4c.Rsp && PICS_USER_PROMPT")) { + " ***** Test Step 7 : TH sends EnhancedMoveToHueAndSaturation command to DUT with EnhancedHue=16000, Saturation=80 " + "and TransitionTime=200 (20s)\n"); + if (ShouldSkip("CC.S.F01 && CC.S.C43.Rsp")) { NextTest(); return; } - err = TestThSendsStepColorTemperatureCommandToDutWithStepMode0x01UpStepSizeColorTempPhysicalMaxMiredsColorTempPhysicalMinMireds2AndTransitionTime20020s_7(); + err = TestThSendsEnhancedMoveToHueAndSaturationCommandToDutWithEnhancedHue16000Saturation80AndTransitionTime20020s_7(); break; case 8: - ChipLogProgress( - chipTool, " ***** Test Step 8 : After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10s\n"); + err = TestWait10s_8(); break; case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000")) { NextTest(); return; } - err = TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_9(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_9(); break; case 10: - ChipLogProgress( - chipTool, " ***** Test Step 10 : After another 5 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads CurrentSaturation attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A0001")) { NextTest(); return; } - err = TestAfterAnother5SecondsThReadsColorTemperatureMiredsAttributeFromDut_10(); + err = TestThReadsCurrentSaturationAttributeFromDut_10(); break; case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : TH sends StepColorTemperature command to DUT with StepMode = 0x03 (down), StepSize = " - "(ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds) and TransitionTime = 200 (20s).\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C4c.Rsp && PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestThSendsStepColorTemperatureCommandToDutWithStepMode0x03DownStepSizeColorTempPhysicalMaxMiredsColorTempPhysicalMinMiredsAndTransitionTime20020s_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Wait 10s\n"); + err = TestWait10s_11(); break; case 12: - ChipLogProgress( - chipTool, " ***** Test Step 12 : After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000")) { NextTest(); return; } - err = TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_12(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_12(); break; case 13: - ChipLogProgress( - chipTool, " ***** Test Step 13 : After 10 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads CurrentSaturation attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A0001")) { NextTest(); return; } - err = TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_13(); + err = TestThReadsCurrentSaturationAttributeFromDut_13(); break; case 14: - ChipLogProgress( - chipTool, " ***** Test Step 14 : After another 5 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestAfterAnother5SecondsThReadsColorTemperatureMiredsAttributeFromDut_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 5s\n"); + err = TestWait5s_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads ColorMode attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0008 && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A4000")) { NextTest(); return; } - err = TestThReadsColorModeAttributeFromDut_15(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads EnhancedColorMode attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A4001 && PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads CurrentSaturation attribute from DUT\n"); + if (ShouldSkip("CC.S.F01 && CC.S.A0001")) { NextTest(); return; } - err = TestThReadsEnhancedColorModeAttributeFromDut_16(); + err = TestThReadsCurrentSaturationAttributeFromDut_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Turn Off light that we turned on\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads ColorMode attribute from DUT\n"); + if (ShouldSkip("CC.S.F00 && CC.S.A0008")) { NextTest(); return; } - err = TestTurnOffLightThatWeTurnedOn_17(); + err = TestThReadsColorModeAttributeFromDut_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Check on/off attribute value is false after off command\n"); + ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads EnhancedColorMode attribute from DUT\n"); + if (ShouldSkip("CC.S.F00 && CC.S.A4001")) { + NextTest(); + return; + } + err = TestThReadsEnhancedColorModeAttributeFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Turn Off light that we turned on\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestTurnOffLightThatWeTurnedOn_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Check on/off attribute value is false after off command\n"); if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_18(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20(); break; } @@ -15428,6 +16446,12 @@ class Test_TC_CC_6_3 : public TestCommandBridge { case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -15441,7 +16465,7 @@ class Test_TC_CC_6_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 19; + const uint16_t mTestCount = 21; chip::Optional mNodeId; chip::Optional mCluster; @@ -15493,9 +16517,9 @@ class Test_TC_CC_6_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull ColorTempPhysicalMinMiredsValue; - CHIP_ERROR TestThReadsColorTempPhysicalMinMiredsAttributeFromDut_3() + CHIP_ERROR + TestThSendsEnhancedMoveToHueAndSaturationCommandToDutWithEnhancedHue20000Saturation50AndTransitionTime0Immediately_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -15503,27 +16527,34 @@ class Test_TC_CC_6_3 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeColorTempPhysicalMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ColorTempPhysicalMinMireds attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRColorControlClusterEnhancedMoveToHueAndSaturationParams alloc] init]; + params.enhancedHue = [NSNumber numberWithUnsignedShort:20000U]; + params.saturation = [NSNumber numberWithUnsignedChar:50U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster enhancedMoveToHueAndSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends EnhancedMoveToHueAndSaturation command to DUT with EnhancedHue=20000, " + @"Saturation=50 and TransitionTime=0 (immediately) Error: %@", + err); - VerifyOrReturn(CheckConstraintType("colorTempPhysicalMinMireds", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMinMireds", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMinMireds", [value unsignedShortValue], 65279U)); - { - ColorTempPhysicalMinMiredsValue = value; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull ColorTempPhysicalMaxMiredsValue; - CHIP_ERROR TestThReadsColorTempPhysicalMaxMiredsAttributeFromDut_4() + CHIP_ERROR TestWait100ms_4() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -15531,26 +16562,23 @@ class Test_TC_CC_6_3 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeColorTempPhysicalMaxMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ColorTempPhysicalMaxMireds attribute from DUT. Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("colorTempPhysicalMaxMireds", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMaxMireds", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMaxMireds", [value unsignedShortValue], 65279U)); - { - ColorTempPhysicalMaxMiredsValue = value; - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, 20000U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsColorTemperatureMiredsAttributeFromDut_5() + CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -15558,16 +16586,15 @@ class Test_TC_CC_6_3 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ColorTemperatureMireds attribute from DUT. Error: %@", err); + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("colorTemperature", "int16u", "int16u")); - VerifyOrReturn( - CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], ColorTempPhysicalMinMiredsValue)); - VerifyOrReturn( - CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], ColorTempPhysicalMaxMiredsValue)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentSaturation", actualValue, 50U)); + } NextTest(); }]; @@ -15575,109 +16602,238 @@ class Test_TC_CC_6_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsMoveToColorTemperatureCommandToDutWithColorTemperatureMiredsColorTempPhysicalMinMiredsColorTempPhysicalMaxMireds2AndTransitionTime0Immediately_6() + CHIP_ERROR TestThSendsEnhancedMoveToHueAndSaturationCommandToDutWithEnhancedHue16000Saturation80AndTransitionTime20020s_7() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRColorControlClusterEnhancedMoveToHueAndSaturationParams alloc] init]; + params.enhancedHue = [NSNumber numberWithUnsignedShort:16000U]; + params.saturation = [NSNumber numberWithUnsignedChar:80U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:200U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster enhancedMoveToHueAndSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends EnhancedMoveToHueAndSaturation command to DUT with EnhancedHue=16000, " + @"Saturation=80 and TransitionTime=200 (20s) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsStepColorTemperatureCommandToDutWithStepMode0x01UpStepSizeColorTempPhysicalMaxMiredsColorTempPhysicalMinMireds2AndTransitionTime20020s_7() + CHIP_ERROR TestWait10s_8() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_8() + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_9() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 17000U)); + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 19000U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_9() + CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_10() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 56U)); + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 74U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestAfterAnother5SecondsThReadsColorTemperatureMiredsAttributeFromDut_10() + CHIP_ERROR TestWait10s_11() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR - TestThSendsStepColorTemperatureCommandToDutWithStepMode0x03DownStepSizeColorTempPhysicalMaxMiredsColorTempPhysicalMinMiredsAndTransitionTime20020s_11() + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_12() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 16000U)); + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 17000U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_12() + CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_13() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 68U)); + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 80U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestAfter10SecondsThReadsColorTemperatureMiredsAttributeFromDut_13() + CHIP_ERROR TestWait5s_14() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestAfterAnother5SecondsThReadsColorTemperatureMiredsAttributeFromDut_14() + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_15() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, 16000U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsColorModeAttributeFromDut_15() + CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_16() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentSaturation", actualValue, 80U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEnhancedColorModeAttributeFromDut_16() + CHIP_ERROR TestThReadsColorModeAttributeFromDut_17() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads ColorMode attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("colorMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("colorMode", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_17() + CHIP_ERROR TestThReadsEnhancedColorModeAttributeFromDut_18() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EnhancedColorMode attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("colorMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("colorMode", [value unsignedCharValue], 3U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -15694,7 +16850,7 @@ class Test_TC_CC_6_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_18() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -15717,11 +16873,11 @@ class Test_TC_CC_6_3 : public TestCommandBridge { } }; -class Test_TC_CC_7_3 : public TestCommandBridge { +class Test_TC_BINFO_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_7_3() - : TestCommandBridge("Test_TC_CC_7_3") + Test_TC_BINFO_1_1() + : TestCommandBridge("Test_TC_BINFO_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -15731,7 +16887,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_7_3() {} + ~Test_TC_BINFO_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -15739,11 +16895,11 @@ class Test_TC_CC_7_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BINFO_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BINFO_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -15760,228 +16916,120 @@ class Test_TC_CC_7_3 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH writes 0 to the Options attribute\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A000f")) { - NextTest(); - return; - } - err = TestThWrites0ToTheOptionsAttribute_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision from DUT\n"); + err = TestThReadsTheClusterRevisionFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestThSendsOnCommandToDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap from DUT\n"); + err = TestThReadsTheFeatureMapFromDut_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : TH sends EnhancedMoveToHue command to DUT with EnhancedHue=6000, Direction=0x00 (shortest " - "distance) and TransitionTime=0 (immediately).\n"); - if (ShouldSkip("CC.S.F01 && CC.S.C40.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AttributeList from DUT\n"); + err = TestThReadsAttributeListFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads optional attribute(ManufacturingDate) in attributeList\n"); + if (ShouldSkip("BINFO.S.A000b")) { NextTest(); return; } - err = TestThSendsEnhancedMoveToHueCommandToDutWithEnhancedHue6000Direction0x00ShortestDistanceAndTransitionTime0Immediately_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Wait 100ms\n"); - err = TestWait100ms_4(); + err = TestThReadsOptionalAttributeManufacturingDateInAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : TH sends EnhancedStepHue command to DUT with StepMode=0x01 (up), StepSize=6000 and " - "TransitionTime=300 (30s).\n"); - if (ShouldSkip("CC.S.F01 && CC.S.C42.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads optional attribute(PartNumber) in attributeList\n"); + if (ShouldSkip("BINFO.S.A000c")) { NextTest(); return; } - err = TestThSendsEnhancedStepHueCommandToDutWithStepMode0x01UpStepSize6000AndTransitionTime30030s_5(); + err = TestThReadsOptionalAttributePartNumberInAttributeList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10s\n"); - err = TestWait10s_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads optional attribute(ProductURL) in attributeList\n"); + if (ShouldSkip("BINFO.S.A000d")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeProductURLInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads optional attribute(ProductLabel) in attributeList\n"); + if (ShouldSkip("BINFO.S.A000e")) { NextTest(); return; } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_7(); + err = TestThReadsOptionalAttributeProductLabelInAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10s\n"); - err = TestWait10s_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads optional attribute(SerialNumber) in attributeList\n"); + if (ShouldSkip("BINFO.S.A000f")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeSerialNumberInAttributeList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads optional attribute(LocalConfigDisabled) in attributeList\n"); + if (ShouldSkip("BINFO.S.A0010")) { NextTest(); return; } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_9(); + err = TestThReadsOptionalAttributeLocalConfigDisabledInAttributeList_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 10s\n"); - err = TestWait10s_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads optional attribute(Reachable) in attributeList\n"); + if (ShouldSkip("BINFO.S.A0011")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeReachableInAttributeList_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads optional attribute(UniqueID) in attributeList\n"); + if (ShouldSkip("BINFO.S.A0012")) { NextTest(); return; } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_11(); + err = TestThReadsOptionalAttributeUniqueIDInAttributeList_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 5s\n"); - err = TestWait5s_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : TH1 reads AcceptedCommandList from DUT\n"); + err = TestTh1ReadsAcceptedCommandListFromDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { - NextTest(); - return; - } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : TH1 reads GeneratedCommandList from DUT\n"); + err = TestTh1ReadsGeneratedCommandListFromDut_13(); break; - case 14: - ChipLogProgress(chipTool, - " ***** Test Step 14 : TH sends EnhancedMoveToHue command to DUT with EnhancedHue=12000, Direction=0x00 (shortest " - "distance) and TransitionTime=0 (immediately).\n"); - if (ShouldSkip("CC.S.F01 && CC.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestThSendsEnhancedMoveToHueCommandToDutWithEnhancedHue12000Direction0x00ShortestDistanceAndTransitionTime0Immediately_14(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 100ms\n"); - err = TestWait100ms_15(); + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : TH sends EnhancedStepHue command to DUT with StepMode=0x03 (down), StepSize=6000 and " - "TransitionTime=300 (30s)\n"); - if (ShouldSkip("CC.S.F01 && CC.S.C42.Rsp")) { - NextTest(); - return; - } - err = TestThSendsEnhancedStepHueCommandToDutWithStepMode0x03DownStepSize6000AndTransitionTime30030s_16(); + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Wait 10s\n"); - err = TestWait10s_17(); + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { - NextTest(); - return; - } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_18(); + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Wait 10s\n"); - err = TestWait10s_19(); + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { - NextTest(); - return; - } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Wait 10s\n"); - err = TestWait10s_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { - NextTest(); - return; - } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Wait 5s\n"); - err = TestWait5s_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp")) { - NextTest(); - return; - } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads ColorMode attribute from DUT\n"); - if (ShouldSkip("CC.S.F00 && CC.S.A0008")) { - NextTest(); - return; - } - err = TestThReadsColorModeAttributeFromDut_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : TH reads EnhancedColorMode attribute from DUT\n"); - if (ShouldSkip("CC.S.F00 && CC.S.A4001")) { - NextTest(); - return; - } - err = TestThReadsEnhancedColorModeAttributeFromDut_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Turn Off light that we turned on\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestTurnOffLightThatWeTurnedOn_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_28(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -16004,51 +17052,6 @@ class Test_TC_CC_7_3 : public TestCommandBridge { case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 25: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 26: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -16062,7 +17065,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 29; + const uint16_t mTestCount = 14; chip::Optional mNodeId; chip::Optional mCluster; @@ -16076,131 +17079,101 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThWrites0ToTheOptionsAttribute_1() + CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes 0 to the Options attribute Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOnCommandToDut_2() + CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends On command to DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsEnhancedMoveToHueCommandToDutWithEnhancedHue6000Direction0x00ShortestDistanceAndTransitionTime0Immediately_3() + CHIP_ERROR TestThReadsAttributeListFromDut_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:6000U]; - params.direction = [NSNumber numberWithUnsignedChar:0U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends EnhancedMoveToHue command to DUT with EnhancedHue=6000, Direction=0x00 (shortest " - @"distance) and TransitionTime=0 (immediately). Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait100ms_4() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThSendsEnhancedStepHueCommandToDutWithStepMode0x01UpStepSize6000AndTransitionTime30030s_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AttributeList from DUT Error: %@", err); - __auto_type * params = [[MTRColorControlClusterEnhancedStepHueParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1U]; - params.stepSize = [NSNumber numberWithUnsignedShort:6000U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster enhancedStepHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends EnhancedStepHue command to DUT with StepMode=0x01 (up), StepSize=6000 and " - @"TransitionTime=300 (30s). Error: %@", - err); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_6() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_7() + CHIP_ERROR TestThReadsOptionalAttributeManufacturingDateInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ManufacturingDate) in attributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 7000U)); - VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 9000U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 11UL)); NextTest(); }]; @@ -16208,28 +17181,19 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_8() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_9() + CHIP_ERROR TestThReadsOptionalAttributePartNumberInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(PartNumber) in attributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 9000U)); - VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 11000U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 12UL)); NextTest(); }]; @@ -16237,28 +17201,19 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_10() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_11() + CHIP_ERROR TestThReadsOptionalAttributeProductURLInAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ProductURL) in attributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 11000U)); - VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 12000U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 13UL)); NextTest(); }]; @@ -16266,30 +17221,19 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait5s_12() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_13() + CHIP_ERROR TestThReadsOptionalAttributeProductLabelInAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ProductLabel) in attributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, 12000U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 14UL)); NextTest(); }]; @@ -16297,92 +17241,39 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsEnhancedMoveToHueCommandToDutWithEnhancedHue12000Direction0x00ShortestDistanceAndTransitionTime0Immediately_14() + CHIP_ERROR TestThReadsOptionalAttributeSerialNumberInAttributeList_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:12000U]; - params.direction = [NSNumber numberWithUnsignedChar:0U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends EnhancedMoveToHue command to DUT with EnhancedHue=12000, Direction=0x00 (shortest " - @"distance) and TransitionTime=0 (immediately). Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait100ms_15() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThSendsEnhancedStepHueCommandToDutWithStepMode0x03DownStepSize6000AndTransitionTime30030s_16() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SerialNumber) in attributeList Error: %@", err); - __auto_type * params = [[MTRColorControlClusterEnhancedStepHueParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:3U]; - params.stepSize = [NSNumber numberWithUnsignedShort:6000U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster enhancedStepHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends EnhancedStepHue command to DUT with StepMode=0x03 (down), StepSize=6000 and " - @"TransitionTime=300 (30s) Error: %@", - err); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_17() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_18() + CHIP_ERROR TestThReadsOptionalAttributeLocalConfigDisabledInAttributeList_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(LocalConfigDisabled) in attributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 9000U)); - VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 11000U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); NextTest(); }]; @@ -16390,28 +17281,19 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_19() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_20() + CHIP_ERROR TestThReadsOptionalAttributeReachableInAttributeList_10() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(Reachable) in attributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 7000U)); - VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 9000U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); NextTest(); }]; @@ -16419,28 +17301,19 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_21() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_22() + CHIP_ERROR TestThReadsOptionalAttributeUniqueIDInAttributeList_11() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(UniqueID) in attributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 6000U)); - VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 7000U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); NextTest(); }]; @@ -16448,126 +17321,128 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait5s_23() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_24() + CHIP_ERROR TestTh1ReadsAcceptedCommandListFromDut_12() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads AcceptedCommandList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, 6000U)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsColorModeAttributeFromDut_25() + CHIP_ERROR TestTh1ReadsGeneratedCommandListFromDut_13() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ColorMode attribute from DUT Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads GeneratedCommandList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("colorMode", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorMode", [value unsignedCharValue], 2U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestThReadsEnhancedColorModeAttributeFromDut_26() +class Test_TC_CNET_1_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CNET_1_3() + : TestCommandBridge("Test_TC_CNET_1_3") + , mTestIndex(0) { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedColorMode attribute from DUT Error: %@", err); + ~Test_TC_CNET_1_3() {} - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrReturn(CheckConstraintMinValue("colorMode", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorMode", [value unsignedCharValue], 3U)); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CNET_1_3\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CNET_1_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_27() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn Off light that we turned on Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + Wait(); - NextTest(); - }]; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_28() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + switch (mTestIndex - 1) { + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - NextTest(); - }]; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; - return CHIP_NO_ERROR; - } + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; }; -class Test_TC_CC_7_4 : public TestCommandBridge { +class Test_TC_DESC_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_7_4() - : TestCommandBridge("Test_TC_CC_7_4") + Test_TC_DESC_1_1() + : TestCommandBridge("Test_TC_DESC_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -16577,7 +17452,7 @@ class Test_TC_CC_7_4 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_7_4() {} + ~Test_TC_DESC_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -16585,11 +17460,11 @@ class Test_TC_CC_7_4 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DESC_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DESC_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -16606,152 +17481,24 @@ class Test_TC_CC_7_4 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH writes 0 to the Options attribute\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A000f")) { - NextTest(); - return; - } - err = TestThWrites0ToTheOptionsAttribute_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestThSendsOnCommandToDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : TH sends EnhancedMoveToHueAndSaturation command to DUT with EnhancedHue=20000, Saturation=50 " - "and TransitionTime=0 (immediately)\n"); - if (ShouldSkip("CC.S.F01 && CC.S.C43.Rsp")) { - NextTest(); - return; - } - err = TestThSendsEnhancedMoveToHueAndSaturationCommandToDutWithEnhancedHue20000Saturation50AndTransitionTime0Immediately_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Wait 100ms\n"); - err = TestWait100ms_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000")) { - NextTest(); - return; - } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads CurrentSaturation attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A0001")) { - NextTest(); - return; - } - err = TestThReadsCurrentSaturationAttributeFromDut_6(); - break; - case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : TH sends EnhancedMoveToHueAndSaturation command to DUT with EnhancedHue=16000, Saturation=80 " - "and TransitionTime=200 (20s)\n"); - if (ShouldSkip("CC.S.F01 && CC.S.C43.Rsp")) { - NextTest(); - return; - } - err = TestThSendsEnhancedMoveToHueAndSaturationCommandToDutWithEnhancedHue16000Saturation80AndTransitionTime20020s_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10s\n"); - err = TestWait10s_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000")) { - NextTest(); - return; - } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads CurrentSaturation attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A0001")) { - NextTest(); - return; - } - err = TestThReadsCurrentSaturationAttributeFromDut_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Wait 10s\n"); - err = TestWait10s_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000")) { - NextTest(); - return; - } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads CurrentSaturation attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A0001")) { - NextTest(); - return; - } - err = TestThReadsCurrentSaturationAttributeFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 5s\n"); - err = TestWait5s_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A4000")) { - NextTest(); - return; - } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads CurrentSaturation attribute from DUT\n"); - if (ShouldSkip("CC.S.F01 && CC.S.A0001")) { - NextTest(); - return; - } - err = TestThReadsCurrentSaturationAttributeFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads ColorMode attribute from DUT\n"); - if (ShouldSkip("CC.S.F00 && CC.S.A0008")) { - NextTest(); - return; - } - err = TestThReadsColorModeAttributeFromDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads EnhancedColorMode attribute from DUT\n"); - if (ShouldSkip("CC.S.F00 && CC.S.A4001")) { - NextTest(); - return; - } - err = TestThReadsEnhancedColorModeAttributeFromDut_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Turn Off light that we turned on\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestTurnOffLightThatWeTurnedOn_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); break; } @@ -16782,51 +17529,6 @@ class Test_TC_CC_7_4 : public TestCommandBridge { case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -16840,7 +17542,7 @@ class Test_TC_CC_7_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 21; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; @@ -16854,180 +17556,79 @@ class Test_TC_CC_7_4 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThWrites0ToTheOptionsAttribute_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes 0 to the Options attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsOnCommandToDut_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends On command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR - TestThSendsEnhancedMoveToHueAndSaturationCommandToDutWithEnhancedHue20000Saturation50AndTransitionTime0Immediately_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterEnhancedMoveToHueAndSaturationParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:20000U]; - params.saturation = [NSNumber numberWithUnsignedChar:50U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster enhancedMoveToHueAndSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends EnhancedMoveToHueAndSaturation command to DUT with EnhancedHue=20000, " - @"Saturation=50 and TransitionTime=0 (immediately) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait100ms_4() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_5() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, 20000U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); } + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_6() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("CurrentSaturation", actualValue, 50U)); + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsEnhancedMoveToHueAndSaturationCommandToDutWithEnhancedHue16000Saturation80AndTransitionTime20020s_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterEnhancedMoveToHueAndSaturationParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:16000U]; - params.saturation = [NSNumber numberWithUnsignedChar:80U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:200U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster enhancedMoveToHueAndSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends EnhancedMoveToHueAndSaturation command to DUT with EnhancedHue=16000, " - @"Saturation=80 and TransitionTime=200 (20s) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait10s_8() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_9() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 17000U)); - VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 19000U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -17035,128 +17636,229 @@ class Test_TC_CC_7_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_10() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 56U)); - VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 74U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_11() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_12() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 16000U)); - VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 17000U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_13() +class Test_TC_DGETH_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DGETH_1_1() + : TestCommandBridge("Test_TC_DGETH_1_1") + , mTestIndex(0) { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); + ~Test_TC_DGETH_1_1() {} - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 68U)); - VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 80U)); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGETH_1_1\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGETH_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return CHIP_NO_ERROR; + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision from DUT\n"); + err = TestThReadsTheClusterRevisionFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap from DUT\n"); + err = TestThReadsTheFeatureMapFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AttributeList from DUT\n"); + err = TestThReadsAttributeListFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads AcceptedCommandList from DUT\n"); + if (ShouldSkip("DGETH.S.F00 || DGETH.S.F01")) { + NextTest(); + return; + } + err = TestThReadsAcceptedCommandListFromDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AcceptedCommandList from DUT\n"); + if (ShouldSkip(" !DGETH.S.F00 && !DGETH.S.F01 ")) { + NextTest(); + return; + } + err = TestThReadsAcceptedCommandListFromDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads GeneratedCommandList from DUT\n"); + err = TestThReadsGeneratedCommandListFromDut_6(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestWait5s_14() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); } - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_15() + 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 = 7; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, 16000U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); } + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_16() + CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentSaturation", actualValue, 80U)); - } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 3UL)); NextTest(); }]; @@ -17164,21 +17866,24 @@ class Test_TC_CC_7_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsColorModeAttributeFromDut_17() + CHIP_ERROR TestThReadsAttributeListFromDut_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ColorMode attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AttributeList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("colorMode", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorMode", [value unsignedCharValue], 2U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -17186,21 +17891,20 @@ class Test_TC_CC_7_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEnhancedColorModeAttributeFromDut_18() + CHIP_ERROR TestThReadsAcceptedCommandListFromDut_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedColorMode attribute from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AcceptedCommandList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("colorMode", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorMode", [value unsignedCharValue], 3U)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); NextTest(); }]; @@ -17208,39 +17912,48 @@ class Test_TC_CC_7_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_19() + CHIP_ERROR TestThReadsAcceptedCommandListFromDut_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn Off light that we turned on Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AcceptedCommandList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20() + CHIP_ERROR TestThReadsGeneratedCommandListFromDut_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads GeneratedCommandList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -17248,11 +17961,11 @@ class Test_TC_CC_7_4 : public TestCommandBridge { } }; -class Test_TC_CC_8_1 : public TestCommandBridge { +class Test_TC_DGETH_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_8_1() - : TestCommandBridge("Test_TC_CC_8_1") + Test_TC_DGETH_2_1() + : TestCommandBridge("Test_TC_DGETH_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -17262,7 +17975,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_8_1() {} + ~Test_TC_DGETH_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -17270,11 +17983,11 @@ class Test_TC_CC_8_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_8_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGETH_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_8_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGETH_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -17291,262 +18004,146 @@ class Test_TC_CC_8_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH writes 0 to the Options attribute\n"); - if (ShouldSkip("CC.S.A000f")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Read PHYRate attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestThWrites0ToTheOptionsAttribute_1(); + err = TestReadPHYRateAttributeConstraints_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Read FullDuplex attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0001")) { NextTest(); return; } - err = TestThSendsOnCommandToDut_2(); + err = TestReadFullDuplexAttributeConstraints_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : TH sends MoveToHue command to DUT with Hue=200, Direction=0x00 (shortest distance) and " - "TransitionTime=0 (immediately).\n"); - if (ShouldSkip("CC.S.F00 && CC.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Read PacketRxCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0002")) { NextTest(); return; } - err = TestThSendsMoveToHueCommandToDutWithHue200Direction0x00ShortestDistanceAndTransitionTime0Immediately_3(); + err = TestReadPacketRxCountAttributeConstraints_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Wait 100ms\n"); - err = TestWait100ms_4(); - break; - case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : TH sends MoveHue command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)\n"); - if (ShouldSkip("CC.S.C01.Rsp && CC.S.F00")) { - NextTest(); - return; - } - err = TestThSendsMoveHueCommandToDutWithMoveMode0x01UpAndRate5UnitsS_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10s\n"); - err = TestWait10s_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH sends StopMoveStep command to DUT\n"); - if (ShouldSkip("CC.S.C47.Rsp && CC.S.F00")) { - NextTest(); - return; - } - err = TestThSendsStopMoveStepCommandToDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads CurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.A0000 && CC.S.C01.Rsp && CC.S.F00")) { - NextTest(); - return; - } - err = TestThReadsCurrentHueAttributeFromDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 2s\n"); - err = TestWait2s_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads CurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.A0000 && CC.S.C01.Rsp && CC.S.F00")) { - NextTest(); - return; - } - err = TestThReadsCurrentHueAttributeFromDut_10(); - break; - case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : TH sends MoveToSaturation command to DUT with Saturation=150 and TransitionTime=0 " - "(immediately)\n"); - if (ShouldSkip("CC.S.F00 && CC.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestThSendsMoveToSaturationCommandToDutWithSaturation150AndTransitionTime0Immediately_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 100ms\n"); - err = TestWait100ms_12(); - break; - case 13: ChipLogProgress(chipTool, - " ***** Test Step 13 : TH sends MoveSaturation command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s)\n"); - if (ShouldSkip("CC.S.F00 && CC.S.C04.Rsp")) { - NextTest(); - return; - } - err = TestThSendsMoveSaturationCommandToDutWithMoveMode0x01UpAndRate5UnitsS_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 10s\n"); - err = TestWait10s_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH sends StopMoveStep command to DUT\n"); - if (ShouldSkip("CC.S.C47.Rsp && CC.S.F00")) { - NextTest(); - return; - } - err = TestThSendsStopMoveStepCommandToDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads CurrentSaturation attribute from DUT\n"); - if (ShouldSkip("CC.S.F00 && CC.S.A0001")) { - NextTest(); - return; - } - err = TestThReadsCurrentSaturationAttributeFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Wait 2s\n"); - err = TestWait2s_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads CurrentSaturation attribute from DUT\n"); - if (ShouldSkip("CC.S.F00 && CC.S.A0001")) { - NextTest(); - return; - } - err = TestThReadsCurrentSaturationAttributeFromDut_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : TH reads ColorTempPhysicalMinMireds attribute from DUT\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A400b")) { - NextTest(); - return; - } - err = TestThReadsColorTempPhysicalMinMiredsAttributeFromDut_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads ColorTempPhysicalMaxMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A400c")) { + " ***** Test Step 4 : Read PacketRxCount value from DUT and verify the number of packets received on ethernet " + "network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0002")) { NextTest(); return; } - err = TestThReadsColorTempPhysicalMaxMiredsAttributeFromDut_20(); + err = TestReadPacketRxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_4(); break; - case 21: - ChipLogProgress(chipTool, - " ***** Test Step 21 : TH sends MoveToColorTemperature command to DUT with ColorTemperatureMireds= " - "ColorTempPhysicalMaxMireds / 2 and TransitionTime=0 (immediately).\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT")) { + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read PacketTxCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0003")) { NextTest(); return; } - err = TestThSendsMoveToColorTemperatureCommandToDutWithColorTemperatureMiredsColorTempPhysicalMaxMireds2AndTransitionTime0Immediately_21(); + err = TestReadPacketTxCountAttributeConstraints_5(); break; - case 22: + case 6: ChipLogProgress(chipTool, - " ***** Test Step 22 : TH sends MoveColorTemperature command to DUT with MoveMode = 0x01 (up), Rate = " - "ColorTempPhysicalMaxMireds / 40\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C0a.Rsp && PICS_USER_PROMPT")) { + " ***** Test Step 6 : Read PacketTxCount value from DUT and verify the number of packets received on ethernet " + "network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0003")) { NextTest(); return; } - err = TestThSendsMoveColorTemperatureCommandToDutWithMoveMode0x01UpRateColorTempPhysicalMaxMireds40_22(); + err = TestReadPacketTxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_6(); break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : After 10 seconds, TH sends StopMoveStep command to DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.C47.Rsp && PICS_USER_PROMPT")) { + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read TxErrCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0004")) { NextTest(); return; } - err = TestAfter10SecondsThSendsStopMoveStepCommandToDut_23(); + err = TestReadTxErrCountAttributeConstraints_7(); break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Read TxErrCount value from DUT and verify value indicates the number of failed packet " + "transmission on ethernet network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0004")) { NextTest(); return; } - err = TestThReadsColorTemperatureMiredsAttributeFromDut_24(); + err = TestReadTxErrCountValueFromDutAndVerifyValueIndicatesTheNumberOfFailedPacketTransmissionOnEthernetNetworkInterface_8(); break; - case 25: - ChipLogProgress( - chipTool, " ***** Test Step 25 : After another 2 seconds, TH reads ColorTemperatureMireds attribute from DUT.\n"); - if (ShouldSkip("CC.S.F04 && CC.S.A0007 && PICS_USER_PROMPT")) { + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read CollisionCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0005")) { NextTest(); return; } - err = TestAfterAnother2SecondsThReadsColorTemperatureMiredsAttributeFromDut_25(); + err = TestReadCollisionCountAttributeConstraints_9(); break; - case 26: + case 10: ChipLogProgress(chipTool, - " ***** Test Step 26 : TH sends EnhancedMoveToHue command to DUT with EnhancedHue=20000, Direction=0x00 (shortest " - "distance) and TransitionTime=0 (immediately).\n"); - if (ShouldSkip("CC.S.F01 && CC.S.C40.Rsp")) { + " ***** Test Step 10 : Read CollisionCount value from DUT and verify value indicates the number of collision " + "occurred while transmitting packets on ethernet network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0005")) { NextTest(); return; } - err = TestThSendsEnhancedMoveToHueCommandToDutWithEnhancedHue20000Direction0x00ShortestDistanceAndTransitionTime0Immediately_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Wait 100ms\n"); - err = TestWait100ms_27(); + err = TestReadCollisionCountValueFromDutAndVerifyValueIndicatesTheNumberOfCollisionOccurredWhileTransmittingPacketsOnEthernetNetworkInterface_10(); break; - case 28: - ChipLogProgress(chipTool, - " ***** Test Step 28 : TH sends EnhancedMoveHue command to DUT with MoveMode=0x01 (up) and Rate=500 (units/s)\n"); - if (ShouldSkip("CC.S.F01 && CC.S.C41.Rsp")) { + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read OverrunCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0006")) { NextTest(); return; } - err = TestThSendsEnhancedMoveHueCommandToDutWithMoveMode0x01UpAndRate500UnitsS_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Wait 10s\n"); - err = TestWait10s_29(); + err = TestReadOverrunCountAttributeConstraints_11(); break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : TH sends StopMoveStep command to DUT\n"); - if (ShouldSkip("CC.S.C47.Rsp")) { + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Read OverrunCount value from DUT and verify value indicates the number of packets dropped " + "due to lack of buffer memory on ethernet network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0006")) { NextTest(); return; } - err = TestThSendsStopMoveStepCommandToDut_30(); + err = TestReadOverrunCountValueFromDutAndVerifyValueIndicatesTheNumberOfPacketsDroppedDueToLackOfBufferMemoryOnEthernetNetworkInterface_12(); break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.A4000 && CC.S.C47.Rsp")) { + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Read CarrierDetect attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0007")) { NextTest(); return; } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Wait 10s\n"); - err = TestWait10s_32(); + err = TestReadCarrierDetectAttributeConstraints_13(); break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : TH reads EnhancedCurrentHue attribute from DUT\n"); - if (ShouldSkip("CC.S.A4000 && CC.S.C47.Rsp")) { + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : Read CarrierDetect value from DUT and verify value indicates the presence of carrier detect " + "control signal on ethernet network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0007")) { NextTest(); return; } - err = TestThReadsEnhancedCurrentHueAttributeFromDut_33(); + err = TestReadCarrierDetectValueFromDutAndVerifyValueIndicatesThePresenceOfCarrierDetectControlSignalOnEthernetNetworkInterface_14(); break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Turn Off light that we turned on\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read TimeSinceReset attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0008")) { NextTest(); return; } - err = TestTurnOffLightThatWeTurnedOn_34(); + err = TestReadTimeSinceResetAttributeConstraints_15(); break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Read TimeSinceReset value from DUT and verify the value indicates the duration of time, in " + "minutes\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0008")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_35(); + err = TestReadTimeSinceResetValueFromDutAndVerifyTheValueIndicatesTheDurationOfTimeInMinutes_16(); break; } @@ -17610,63 +18207,6 @@ class Test_TC_CC_8_1 : public TestCommandBridge { case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 25: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 26: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 31: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 32: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 33: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 34: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 35: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -17680,7 +18220,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 36; + const uint16_t mTestCount = 17; chip::Optional mNodeId; chip::Optional mCluster; @@ -17694,545 +18234,212 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThWrites0ToTheOptionsAttribute_1() + CHIP_ERROR TestReadPHYRateAttributeConstraints_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes 0 to the Options attribute Error: %@", err); + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PHYRate attribute constraints Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOnCommandToDut_2() + CHIP_ERROR TestReadFullDuplexAttributeConstraints_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends On command to DUT Error: %@", err); + [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read FullDuplex attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("fullDuplex", "boolean", "boolean")); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsMoveToHueCommandToDutWithHue200Direction0x00ShortestDistanceAndTransitionTime0Immediately_3() + CHIP_ERROR TestReadPacketRxCountAttributeConstraints_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRColorControlClusterMoveToHueParams alloc] init]; - params.hue = [NSNumber numberWithUnsignedChar:200U]; - params.direction = [NSNumber numberWithUnsignedChar:0U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends MoveToHue command to DUT with Hue=200, Direction=0x00 (shortest distance) and " - @"TransitionTime=0 (immediately). Error: %@", - err); + [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PacketRxCount attribute constraints Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("packetRxCount", "int64u", "int64u")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_4() + CHIP_ERROR TestReadPacketRxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_4() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestThSendsMoveHueCommandToDutWithMoveMode0x01UpAndRate5UnitsS_5() + CHIP_ERROR TestReadPacketTxCountAttributeConstraints_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRColorControlClusterMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1U]; - params.rate = [NSNumber numberWithUnsignedChar:5U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends MoveHue command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait10s_6() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThSendsStopMoveStepCommandToDut_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterStopMoveStepParams alloc] init]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster stopMoveStepWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends StopMoveStep command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsCurrentHueAttributeFromDut_8() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentHue attribute from DUT Error: %@", err); + [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PacketTxCount attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 235U)); - VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254U)); - + VerifyOrReturn(CheckConstraintType("packetTxCount", "int64u", "int64u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait2s_9() + CHIP_ERROR TestReadPacketTxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_6() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 2000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestThReadsCurrentHueAttributeFromDut_10() + CHIP_ERROR TestReadTxErrCountAttributeConstraints_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read TxErrCount attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 240U)); - VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254U)); - + VerifyOrReturn(CheckConstraintType("txErrCount", "int64u", "int64u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsMoveToSaturationCommandToDutWithSaturation150AndTransitionTime0Immediately_11() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterMoveToSaturationParams alloc] init]; - params.saturation = [NSNumber numberWithUnsignedChar:150U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends MoveToSaturation command to DUT with Saturation=150 and TransitionTime=0 " - @"(immediately) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait100ms_12() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThSendsMoveSaturationCommandToDutWithMoveMode0x01UpAndRate5UnitsS_13() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1U]; - params.rate = [NSNumber numberWithUnsignedChar:5U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster - moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends MoveSaturation command to DUT with MoveMode=0x01 (up) and Rate=5 (units/s) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait10s_14() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThSendsStopMoveStepCommandToDut_15() + CHIP_ERROR + TestReadTxErrCountValueFromDutAndVerifyValueIndicatesTheNumberOfFailedPacketTransmissionOnEthernetNetworkInterface_8() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterStopMoveStepParams alloc] init]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster stopMoveStepWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends StopMoveStep command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - NSNumber * _Nonnull CurrentSaturationValue; - CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_16() + CHIP_ERROR TestReadCollisionCountAttributeConstraints_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); + [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CollisionCount attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 170U)); - VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 230U)); - { - CurrentSaturationValue = value; - } - + VerifyOrReturn(CheckConstraintType("collisionCount", "int64u", "int64u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait2s_17() + CHIP_ERROR + TestReadCollisionCountValueFromDutAndVerifyValueIndicatesTheNumberOfCollisionOccurredWhileTransmittingPacketsOnEthernetNetworkInterface_10() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 2000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_18() + CHIP_ERROR TestReadOverrunCountAttributeConstraints_11() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OverrunCount attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn( - CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], CurrentSaturationValue)); - VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 230U)); - + VerifyOrReturn(CheckConstraintType("overrunCount", "int64u", "int64u")); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull ColorTempPhysicalMinMireds; - - CHIP_ERROR TestThReadsColorTempPhysicalMinMiredsAttributeFromDut_19() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeColorTempPhysicalMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ColorTempPhysicalMinMireds attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("colorTempPhysicalMinMireds", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMinMireds", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMinMireds", [value unsignedShortValue], 65279U)); - { - ColorTempPhysicalMinMireds = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull ColorTempPhysicalMaxMireds; - - CHIP_ERROR TestThReadsColorTempPhysicalMaxMiredsAttributeFromDut_20() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeColorTempPhysicalMaxMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads ColorTempPhysicalMaxMireds attribute from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("colorTempPhysicalMaxMireds", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("colorTempPhysicalMaxMireds", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMaxMireds", [value unsignedShortValue], 65279U)); - { - ColorTempPhysicalMaxMireds = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } CHIP_ERROR - TestThSendsMoveToColorTemperatureCommandToDutWithColorTemperatureMiredsColorTempPhysicalMaxMireds2AndTransitionTime0Immediately_21() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThSendsMoveColorTemperatureCommandToDutWithMoveMode0x01UpRateColorTempPhysicalMaxMireds40_22() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestAfter10SecondsThSendsStopMoveStepCommandToDut_23() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThReadsColorTemperatureMiredsAttributeFromDut_24() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestAfterAnother2SecondsThReadsColorTemperatureMiredsAttributeFromDut_25() + TestReadOverrunCountValueFromDutAndVerifyValueIndicatesTheNumberOfPacketsDroppedDueToLackOfBufferMemoryOnEthernetNetworkInterface_12() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("please enter 'y' for successgarbage: not in length on purpose", 28); + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR - TestThSendsEnhancedMoveToHueCommandToDutWithEnhancedHue20000Direction0x00ShortestDistanceAndTransitionTime0Immediately_26() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:20000U]; - params.direction = [NSNumber numberWithUnsignedChar:0U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends EnhancedMoveToHue command to DUT with EnhancedHue=20000, Direction=0x00 (shortest " - @"distance) and TransitionTime=0 (immediately). Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait100ms_27() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThSendsEnhancedMoveHueCommandToDutWithMoveMode0x01UpAndRate500UnitsS_28() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterEnhancedMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1U]; - params.rate = [NSNumber numberWithUnsignedShort:500U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster - enhancedMoveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends EnhancedMoveHue command to DUT with MoveMode=0x01 (up) and Rate=500 (units/s) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait10s_29() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThSendsStopMoveStepCommandToDut_30() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterStopMoveStepParams alloc] init]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster stopMoveStepWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends StopMoveStep command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull EnhancedCurrentHueValue; - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_31() + CHIP_ERROR TestReadCarrierDetectAttributeConstraints_13() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CarrierDetect attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 23500U)); - VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 26500U)); - { - EnhancedCurrentHueValue = value; + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("carrierDetect", "boolean", "boolean")); } NextTest(); @@ -18241,81 +18448,50 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_32() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_33() + CHIP_ERROR + TestReadCarrierDetectValueFromDutAndVerifyValueIndicatesThePresenceOfCarrierDetectControlSignalOnEthernetNetworkInterface_14() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn( - CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], EnhancedCurrentHueValue)); - VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 26500U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_34() + CHIP_ERROR TestReadTimeSinceResetAttributeConstraints_15() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn Off light that we turned on Error: %@", err); + [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read TimeSinceReset attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("timeSinceReset", "int64u", "int64u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_35() + CHIP_ERROR TestReadTimeSinceResetValueFromDutAndVerifyTheValueIndicatesTheDurationOfTimeInMinutes_16() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } }; -class Test_TC_BINFO_1_1 : public TestCommandBridge { +class Test_TC_DGETH_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_BINFO_1_1() - : TestCommandBridge("Test_TC_BINFO_1_1") + Test_TC_DGETH_2_2() + : TestCommandBridge("Test_TC_DGETH_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -18325,7 +18501,7 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_BINFO_1_1() {} + ~Test_TC_DGETH_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -18333,400 +18509,11 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BINFO_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGETH_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BINFO_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - 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 = 0; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; -}; - -class Test_TC_CNET_1_3 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CNET_1_3() - : TestCommandBridge("Test_TC_CNET_1_3") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_CNET_1_3() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CNET_1_3\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CNET_1_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - 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 = 0; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; -}; - -class Test_TC_DESC_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DESC_1_1() - : TestCommandBridge("Test_TC_DESC_1_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_DESC_1_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DESC_1_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DESC_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 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: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); - break; - case 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: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - 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 = 6; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device - endpoint:0 - 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 ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device - endpoint:0 - 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 ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device - endpoint:0 - 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 ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device - endpoint:0 - 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 ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_DGETH_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGETH_2_1() - : TestCommandBridge("Test_TC_DGETH_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_DGETH_2_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGETH_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGETH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGETH_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -18743,146 +18530,172 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read PHYRate attribute constraints\n"); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads PHYRate attribute from DUT\n"); if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestReadPHYRateAttributeConstraints_1(); + err = TestThReadsPHYRateAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read FullDuplex attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads PHYRate attribute from DUT\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestReadFullDuplexAttributeConstraints_2(); + err = TestThReadsPHYRateAttributeFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read PacketRxCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads PHYRate attribute from DUT\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestReadPacketRxCountAttributeConstraints_3(); + err = TestThReadsPHYRateAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : Read PacketRxCount value from DUT and verify the number of packets received on ethernet " - "network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads PHYRate attribute from DUT\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestReadPacketRxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_4(); + err = TestThReadsPHYRateAttributeFromDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read PacketTxCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads PHYRate attribute from DUT\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestReadPacketTxCountAttributeConstraints_5(); + err = TestThReadsPHYRateAttributeFromDut_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Read PacketTxCount value from DUT and verify the number of packets received on ethernet " - "network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads PHYRate attribute from DUT\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestReadPacketTxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_6(); + err = TestThReadsPHYRateAttributeFromDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read TxErrCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0004")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads PHYRate attribute from DUT\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestReadTxErrCountAttributeConstraints_7(); + err = TestThReadsPHYRateAttributeFromDut_7(); break; case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Read TxErrCount value from DUT and verify value indicates the number of failed packet " - "transmission on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0004")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads PHYRate attribute from DUT\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestReadTxErrCountValueFromDutAndVerifyValueIndicatesTheNumberOfFailedPacketTransmissionOnEthernetNetworkInterface_8(); + err = TestThReadsPHYRateAttributeFromDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read CollisionCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0005")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads PHYRate attribute from DUT\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestReadCollisionCountAttributeConstraints_9(); + err = TestThReadsPHYRateAttributeFromDut_9(); break; case 10: - ChipLogProgress(chipTool, - " ***** Test Step 10 : Read CollisionCount value from DUT and verify value indicates the number of collision " - "occurred while transmitting packets on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0005")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads PHYRate attribute from DUT\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestReadCollisionCountValueFromDutAndVerifyValueIndicatesTheNumberOfCollisionOccurredWhileTransmittingPacketsOnEthernetNetworkInterface_10(); + err = TestThReadsPHYRateAttributeFromDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read OverrunCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0006")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads PacketRxCount attribute value from DUT\n"); + if (ShouldSkip("DGETH.S.A0002")) { NextTest(); return; } - err = TestReadOverrunCountAttributeConstraints_11(); + err = TestThReadsPacketRxCountAttributeValueFromDut_11(); break; case 12: - ChipLogProgress(chipTool, - " ***** Test Step 12 : Read OverrunCount value from DUT and verify value indicates the number of packets dropped " - "due to lack of buffer memory on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0006")) { + ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads PacketTxCount attribute value from DUT\n"); + if (ShouldSkip("DGETH.S.A0003")) { NextTest(); return; } - err = TestReadOverrunCountValueFromDutAndVerifyValueIndicatesTheNumberOfPacketsDroppedDueToLackOfBufferMemoryOnEthernetNetworkInterface_12(); + err = TestThReadsPacketTxCountAttributeValueFromDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read CarrierDetect attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0007")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads TxErrCount attribute value from DUT\n"); + if (ShouldSkip("DGETH.S.A0004")) { NextTest(); return; } - err = TestReadCarrierDetectAttributeConstraints_13(); + err = TestThReadsTxErrCountAttributeValueFromDut_13(); break; case 14: - ChipLogProgress(chipTool, - " ***** Test Step 14 : Read CarrierDetect value from DUT and verify value indicates the presence of carrier detect " - "control signal on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0007")) { + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads CollisionCount attribute value from DUT\n"); + if (ShouldSkip("DGETH.S.A0005")) { NextTest(); return; } - err = TestReadCarrierDetectValueFromDutAndVerifyValueIndicatesThePresenceOfCarrierDetectControlSignalOnEthernetNetworkInterface_14(); + err = TestThReadsCollisionCountAttributeValueFromDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Read TimeSinceReset attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0008")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads OverrunCount attribute value from DUT\n"); + if (ShouldSkip("DGETH.S.A0006")) { NextTest(); return; } - err = TestReadTimeSinceResetAttributeConstraints_15(); + err = TestThReadsOverrunCountAttributeValueFromDut_15(); break; case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : Read TimeSinceReset value from DUT and verify the value indicates the duration of time, in " - "minutes\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0008")) { + ChipLogProgress(chipTool, " ***** Test Step 16 : Sends ResetCounts command\n"); + if (ShouldSkip("DGETH.S.C00.Rsp")) { NextTest(); return; } - err = TestReadTimeSinceResetValueFromDutAndVerifyTheValueIndicatesTheDurationOfTimeInMinutes_16(); + err = TestSendsResetCountsCommand_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads PacketRxCount attribute value from DUT\n"); + if (ShouldSkip("DGETH.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsPacketRxCountAttributeValueFromDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads PacketTxCount attribute value from DUT\n"); + if (ShouldSkip("DGETH.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsPacketTxCountAttributeValueFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH reads TxErrCount attribute value from DUT\n"); + if (ShouldSkip("DGETH.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsTxErrCountAttributeValueFromDut_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads CollisionCount attribute value from DUT\n"); + if (ShouldSkip("DGETH.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsCollisionCountAttributeValueFromDut_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : TH reads OverrunCount attribute value from DUT\n"); + if (ShouldSkip("DGETH.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsOverrunCountAttributeValueFromDut_21(); break; } @@ -18946,6 +18759,21 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -18959,7 +18787,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 22; chip::Optional mNodeId; chip::Optional mCluster; @@ -18973,7 +18801,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadPHYRateAttributeConstraints_1() + CHIP_ERROR TestThReadsPHYRateAttributeFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterEthernetNetworkDiagnostics * cluster = @@ -18981,7 +18809,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read PHYRate attribute constraints Error: %@", err); + NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -18998,21 +18826,23 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadFullDuplexAttributeConstraints_2() + CHIP_ERROR TestThReadsPHYRateAttributeFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterEthernetNetworkDiagnostics * cluster = [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read FullDuplex attribute constraints Error: %@", err); + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("fullDuplex", "boolean", "boolean")); + VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); } NextTest(); @@ -19021,164 +18851,290 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadPacketRxCountAttributeConstraints_3() + CHIP_ERROR TestThReadsPHYRateAttributeFromDut_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterEthernetNetworkDiagnostics * cluster = [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read PacketRxCount attribute constraints Error: %@", err); + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("packetRxCount", "int64u", "int64u")); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadPacketRxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_4() + CHIP_ERROR TestThReadsPHYRateAttributeFromDut_4() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadPacketTxCountAttributeConstraints_5() + CHIP_ERROR TestThReadsPHYRateAttributeFromDut_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterEthernetNetworkDiagnostics * cluster = [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read PacketTxCount attribute constraints Error: %@", err); + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("packetTxCount", "int64u", "int64u")); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadPacketTxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_6() + CHIP_ERROR TestThReadsPHYRateAttributeFromDut_6() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTxErrCountAttributeConstraints_7() + CHIP_ERROR TestThReadsPHYRateAttributeFromDut_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterEthernetNetworkDiagnostics * cluster = [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read TxErrCount attribute constraints Error: %@", err); + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("txErrCount", "int64u", "int64u")); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadTxErrCountValueFromDutAndVerifyValueIndicatesTheNumberOfFailedPacketTransmissionOnEthernetNetworkInterface_8() + CHIP_ERROR TestThReadsPHYRateAttributeFromDut_8() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadCollisionCountAttributeConstraints_9() + CHIP_ERROR TestThReadsPHYRateAttributeFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterEthernetNetworkDiagnostics * cluster = [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CollisionCount attribute constraints Error: %@", err); + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("collisionCount", "int64u", "int64u")); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadCollisionCountValueFromDutAndVerifyValueIndicatesTheNumberOfCollisionOccurredWhileTransmittingPacketsOnEthernetNetworkInterface_10() + CHIP_ERROR TestThReadsPHYRateAttributeFromDut_10() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } + NSNumber * _Nonnull PacketRxCount; - CHIP_ERROR TestReadOverrunCountAttributeConstraints_11() + CHIP_ERROR TestThReadsPacketRxCountAttributeValueFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterEthernetNetworkDiagnostics * cluster = [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read OverrunCount attribute constraints Error: %@", err); + [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PacketRxCount attribute value from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("overrunCount", "int64u", "int64u")); + { + PacketRxCount = value; + } + NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull PacketTxCount; - CHIP_ERROR - TestReadOverrunCountValueFromDutAndVerifyValueIndicatesTheNumberOfPacketsDroppedDueToLackOfBufferMemoryOnEthernetNetworkInterface_12() + CHIP_ERROR TestThReadsPacketTxCountAttributeValueFromDut_12() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PacketTxCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + PacketTxCount = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } + NSNumber * _Nonnull TxErrCount; - CHIP_ERROR TestReadCarrierDetectAttributeConstraints_13() + CHIP_ERROR TestThReadsTxErrCountAttributeValueFromDut_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterEthernetNetworkDiagnostics * cluster = [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CarrierDetect attribute constraints Error: %@", err); + [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxErrCount attribute value from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { + { + TxErrCount = value; + } - VerifyOrReturn(CheckConstraintType("carrierDetect", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull CollisionCount; + + CHIP_ERROR TestThReadsCollisionCountAttributeValueFromDut_14() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CollisionCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + CollisionCount = value; } NextTest(); @@ -19186,51 +19142,154 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nonnull OverrunCount; - CHIP_ERROR - TestReadCarrierDetectValueFromDutAndVerifyValueIndicatesThePresenceOfCarrierDetectControlSignalOnEthernetNetworkInterface_14() + CHIP_ERROR TestThReadsOverrunCountAttributeValueFromDut_15() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads OverrunCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + OverrunCount = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTimeSinceResetAttributeConstraints_15() + CHIP_ERROR TestSendsResetCountsCommand_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterEthernetNetworkDiagnostics * cluster = [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read TimeSinceReset attribute constraints Error: %@", err); + [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends ResetCounts command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("timeSinceReset", "int64u", "int64u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTimeSinceResetValueFromDutAndVerifyTheValueIndicatesTheDurationOfTimeInMinutes_16() + CHIP_ERROR TestThReadsPacketRxCountAttributeValueFromDut_17() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PacketRxCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMaxValue("packetRxCount", [value unsignedLongLongValue], PacketRxCount)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsPacketTxCountAttributeValueFromDut_18() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads PacketTxCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMaxValue("packetTxCount", [value unsignedLongLongValue], PacketTxCount)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxErrCountAttributeValueFromDut_19() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxErrCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMaxValue("txErrCount", [value unsignedLongLongValue], TxErrCount)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCollisionCountAttributeValueFromDut_20() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CollisionCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMaxValue("collisionCount", [value unsignedLongLongValue], CollisionCount)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOverrunCountAttributeValueFromDut_21() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads OverrunCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMaxValue("overrunCount", [value unsignedLongLongValue], OverrunCount)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } }; -class Test_TC_DGETH_2_2 : public TestCommandBridge { +class Test_TC_FLW_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGETH_2_2() - : TestCommandBridge("Test_TC_DGETH_2_2") + Test_TC_FLW_1_1() + : TestCommandBridge("Test_TC_FLW_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -19240,7 +19299,7 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DGETH_2_2() {} + ~Test_TC_FLW_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -19248,11 +19307,11 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGETH_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGETH_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -19269,250 +19328,65 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads PHYRate attribute from DUT\n"); - if (ShouldSkip("DGETH.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsPHYRateAttributeFromDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads PHYRate attribute from DUT\n"); - if (ShouldSkip("DGETH.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsPHYRateAttributeFromDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads PHYRate attribute from DUT\n"); - if (ShouldSkip("DGETH.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsPHYRateAttributeFromDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads PHYRate attribute from DUT\n"); - if (ShouldSkip("DGETH.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(Tolerance) in AttributeList\n"); + if (ShouldSkip("FLW.S.A0003")) { NextTest(); return; } - err = TestThReadsPHYRateAttributeFromDut_4(); + err = TestReadTheOptionalAttributeToleranceInAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads PHYRate attribute from DUT\n"); - if (ShouldSkip("DGETH.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsPHYRateAttributeFromDut_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads PHYRate attribute from DUT\n"); - if (ShouldSkip("DGETH.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsPHYRateAttributeFromDut_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads PHYRate attribute from DUT\n"); - if (ShouldSkip("DGETH.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsPHYRateAttributeFromDut_7(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads PHYRate attribute from DUT\n"); - if (ShouldSkip("DGETH.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsPHYRateAttributeFromDut_8(); + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads PHYRate attribute from DUT\n"); - if (ShouldSkip("DGETH.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsPHYRateAttributeFromDut_9(); + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads PHYRate attribute from DUT\n"); - if (ShouldSkip("DGETH.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsPHYRateAttributeFromDut_10(); + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads PacketRxCount attribute value from DUT\n"); - if (ShouldSkip("DGETH.S.A0002")) { - NextTest(); - return; - } - err = TestThReadsPacketRxCountAttributeValueFromDut_11(); + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads PacketTxCount attribute value from DUT\n"); - if (ShouldSkip("DGETH.S.A0003")) { - NextTest(); - return; - } - err = TestThReadsPacketTxCountAttributeValueFromDut_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads TxErrCount attribute value from DUT\n"); - if (ShouldSkip("DGETH.S.A0004")) { - NextTest(); - return; - } - err = TestThReadsTxErrCountAttributeValueFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads CollisionCount attribute value from DUT\n"); - if (ShouldSkip("DGETH.S.A0005")) { - NextTest(); - return; - } - err = TestThReadsCollisionCountAttributeValueFromDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads OverrunCount attribute value from DUT\n"); - if (ShouldSkip("DGETH.S.A0006")) { - NextTest(); - return; - } - err = TestThReadsOverrunCountAttributeValueFromDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Sends ResetCounts command\n"); - if (ShouldSkip("DGETH.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestSendsResetCountsCommand_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads PacketRxCount attribute value from DUT\n"); - if (ShouldSkip("DGETH.S.A0002")) { - NextTest(); - return; - } - err = TestThReadsPacketRxCountAttributeValueFromDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads PacketTxCount attribute value from DUT\n"); - if (ShouldSkip("DGETH.S.A0003")) { - NextTest(); - return; - } - err = TestThReadsPacketTxCountAttributeValueFromDut_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : TH reads TxErrCount attribute value from DUT\n"); - if (ShouldSkip("DGETH.S.A0004")) { - NextTest(); - return; - } - err = TestThReadsTxErrCountAttributeValueFromDut_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads CollisionCount attribute value from DUT\n"); - if (ShouldSkip("DGETH.S.A0005")) { - NextTest(); - return; - } - err = TestThReadsCollisionCountAttributeValueFromDut_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : TH reads OverrunCount attribute value from DUT\n"); - if (ShouldSkip("DGETH.S.A0006")) { - NextTest(); - return; - } - err = TestThReadsOverrunCountAttributeValueFromDut_21(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -19526,7 +19400,7 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 22; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -19540,74 +19414,78 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsPHYRateAttributeFromDut_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); } + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsPHYRateAttributeFromDut_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsPHYRateAttributeFromDut_3() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -19615,24 +19493,21 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsPHYRateAttributeFromDut_4() + CHIP_ERROR TestReadTheOptionalAttributeToleranceInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(Tolerance) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); NextTest(); }]; @@ -19640,123 +19515,202 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsPHYRateAttributeFromDut_5() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsPHYRateAttributeFromDut_6() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestThReadsPHYRateAttributeFromDut_7() +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") + , mTestIndex(0) { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + ~Test_TC_FLW_2_1() {} - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - if (value != nil) { + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_2_1\n"); + } - VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - NextTest(); - }]; + Wait(); - return CHIP_NO_ERROR; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the mandatory attribute: MinMeasuredValue\n"); + if (ShouldSkip("FLW.S.A0001")) { + NextTest(); + return; + } + err = TestReadTheMandatoryAttributeMinMeasuredValue_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute: MaxMeasuredValue\n"); + if (ShouldSkip("FLW.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheMandatoryAttributeMaxMeasuredValue_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the mandatory attribute: MeasuredValue\n"); + if (ShouldSkip("FLW.S.A0000")) { + NextTest(); + return; + } + err = TestReadTheMandatoryAttributeMeasuredValue_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the Tolerance attribute\n"); + if (ShouldSkip("FLW.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheToleranceAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestThReadsPHYRateAttributeFromDut_8() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } - if (value != nil) { + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - return CHIP_NO_ERROR; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsPHYRateAttributeFromDut_9() + CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute: MinMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 65533U)); } NextTest(); @@ -19765,23 +19719,24 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsPHYRateAttributeFromDut_10() + CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PHYRate attribute from DUT Error: %@", err); + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute: MaxMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 65534U)); } NextTest(); @@ -19789,22 +19744,25 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull PacketRxCount; - CHIP_ERROR TestThReadsPacketRxCountAttributeValueFromDut_11() + CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PacketRxCount attribute value from DUT Error: %@", err); + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute: MeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - PacketRxCount = value; + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], 65535U)); } NextTest(); @@ -19812,170 +19770,223 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull PacketTxCount; - CHIP_ERROR TestThReadsPacketTxCountAttributeValueFromDut_12() + CHIP_ERROR TestThReadsFromTheDutTheToleranceAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PacketTxCount attribute value from DUT Error: %@", err); + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Tolerance attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - PacketTxCount = value; - } + VerifyOrReturn(CheckConstraintType("tolerance", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull TxErrCount; +}; - CHIP_ERROR TestThReadsTxErrCountAttributeValueFromDut_13() +class Test_TC_CGEN_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CGEN_1_1() + : TestCommandBridge("Test_TC_CGEN_1_1") + , mTestIndex(0) { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads TxErrCount attribute value from DUT Error: %@", err); + ~Test_TC_CGEN_1_1() {} - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - TxErrCount = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull CollisionCount; - - CHIP_ERROR TestThReadsCollisionCountAttributeValueFromDut_14() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CollisionCount attribute value from DUT Error: %@", err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CGEN_1_1\n"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CGEN_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - { - CollisionCount = value; - } + Wait(); - NextTest(); - }]; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 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: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 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: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - NSNumber * _Nonnull OverrunCount; - CHIP_ERROR TestThReadsOverrunCountAttributeValueFromDut_15() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads OverrunCount attribute value from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - OverrunCount = value; - } - - NextTest(); - }]; + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - return CHIP_NO_ERROR; + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); } - CHIP_ERROR TestSendsResetCountsCommand_16() + chip::System::Clock::Timeout GetWaitDuration() const override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ResetCounts command Error: %@", err); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - return CHIP_NO_ERROR; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsPacketRxCountAttributeValueFromDut_17() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PacketRxCount attribute value from DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMaxValue("packetRxCount", [value unsignedLongLongValue], PacketRxCount)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsPacketTxCountAttributeValueFromDut_18() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads PacketTxCount attribute value from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMaxValue("packetTxCount", [value unsignedLongLongValue], PacketTxCount)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTxErrCountAttributeValueFromDut_19() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads TxErrCount attribute value from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMaxValue("txErrCount", [value unsignedLongLongValue], TxErrCount)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -19983,19 +19994,23 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCollisionCountAttributeValueFromDut_20() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CollisionCount attribute value from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMaxValue("collisionCount", [value unsignedLongLongValue], CollisionCount)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); NextTest(); }]; @@ -20003,19 +20018,23 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOverrunCountAttributeValueFromDut_21() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads OverrunCount attribute value from DUT Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMaxValue("overrunCount", [value unsignedLongLongValue], OverrunCount)); + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 5UL)); NextTest(); }]; @@ -20024,11 +20043,11 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { } }; -class Test_TC_FLW_1_1 : public TestCommandBridge { +class Test_TC_CGEN_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_FLW_1_1() - : TestCommandBridge("Test_TC_FLW_1_1") + Test_TC_CGEN_2_1() + : TestCommandBridge("Test_TC_CGEN_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -20038,7 +20057,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_FLW_1_1() {} + ~Test_TC_CGEN_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -20046,11 +20065,11 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CGEN_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CGEN_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -20067,32 +20086,63 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH1 reads the BreadCrumb Attribute from the DUT\n"); + if (ShouldSkip("CGEN.S.A0000")) { + NextTest(); + return; + } + err = TestTh1ReadsTheBreadCrumbAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH1 writes the BreadCrumb attribute as 1 to the DUT\n"); + if (ShouldSkip("CGEN.S.A0000")) { + NextTest(); + return; + } + err = TestTh1WritesTheBreadCrumbAttributeAs1ToTheDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : TH1 reads the BreadCrumb attribute from the DUT\n"); + if (ShouldSkip("CGEN.S.A0000")) { + NextTest(); + return; + } + err = TestTh1ReadsTheBreadCrumbAttributeFromTheDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(Tolerance) in AttributeList\n"); - if (ShouldSkip("FLW.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : TH1 reads the RegulatoryConfig attribute from the DUT\n"); + if (ShouldSkip("CGEN.S.A0002")) { NextTest(); return; } - err = TestReadTheOptionalAttributeToleranceInAttributeList_4(); + err = TestTh1ReadsTheRegulatoryConfigAttributeFromTheDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : TH1 reads the LocationCapability attribute from the DUT\n"); + if (ShouldSkip("CGEN.S.A0003")) { + NextTest(); + return; + } + err = TestTh1ReadsTheLocationCapabilityAttributeFromTheDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + ChipLogProgress(chipTool, + " ***** Test Step 6 : TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the " + "BasicCommissioningInfo attribute has the following field: FailSafeExpiryLengthSeconds field value is within a " + "duration range of 0 to 65535\n"); + if (ShouldSkip("CGEN.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsBasicCommissioningInfoAttributeFromDutAndVerifyThatTheBasicCommissioningInfoAttributeHasTheFollowingFieldFailSafeExpiryLengthSecondsFieldValueIsWithinADurationRangeOf0To65535_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH1 reads SupportsConcurrentConnection attribute from the DUT\n"); + if (ShouldSkip("CGEN.S.A0004")) { + NextTest(); + return; + } + err = TestTh1ReadsSupportsConcurrentConnectionAttributeFromTheDut_7(); break; } @@ -20126,6 +20176,9 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -20139,7 +20192,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -20153,78 +20206,87 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestTh1ReadsTheBreadCrumbAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + 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); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads the BreadCrumb Attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintType("breadcrumb", "int64u", "int64u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestTh1WritesTheBreadCrumbAttributeAs1ToTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + id breadcrumbArgument; + breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; + [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH1 writes the BreadCrumb attribute as 1 to the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsTheBreadCrumbAttributeFromTheDut_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads the BreadCrumb attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 1ULL)); } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestTh1ReadsTheRegulatoryConfigAttributeFromTheDut_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + 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 readAttributeRegulatoryConfigWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads the RegulatoryConfig attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintMinValue("regulatoryConfig", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("regulatoryConfig", [value unsignedCharValue], 2U)); NextTest(); }]; @@ -20232,21 +20294,21 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeToleranceInAttributeList_4() + CHIP_ERROR TestTh1ReadsTheLocationCapabilityAttributeFromTheDut_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute(Tolerance) in AttributeList Error: %@", err); + [cluster readAttributeLocationCapabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads the LocationCapability attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintMinValue("locationCapability", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("locationCapability", [value unsignedCharValue], 2U)); NextTest(); }]; @@ -20254,62 +20316,57 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR + TestTh1ReadsBasicCommissioningInfoAttributeFromDutAndVerifyThatTheBasicCommissioningInfoAttributeHasTheFollowingFieldFailSafeExpiryLengthSecondsFieldValueIsWithinADurationRangeOf0To65535_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + 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 readAttributeBasicCommissioningInfoWithCompletionHandler:^( + MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable err) { + NSLog( + @"TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the BasicCommissioningInfo attribute has the " + @"following field: FailSafeExpiryLengthSeconds field value is within a duration range of 0 to 65535 Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + CHIP_ERROR TestTh1ReadsSupportsConcurrentConnectionAttributeFromTheDut_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + 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 ? err.code : 0, 0)); + [cluster + readAttributeSupportsConcurrentConnectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads SupportsConcurrentConnection attribute from the DUT Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("supportsConcurrentConnection", "boolean", "boolean")); + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_FLW_2_1 : public TestCommandBridge { +class Test_TC_DGGEN_1_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") + Test_TC_DGGEN_1_1() + : TestCommandBridge("Test_TC_DGGEN_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -20319,7 +20376,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_FLW_2_1() {} + ~Test_TC_DGGEN_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -20327,11 +20384,11 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGGEN_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGGEN_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -20348,36 +20405,24 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the mandatory attribute: MinMeasuredValue\n"); - if (ShouldSkip("FLW.S.A0001")) { - NextTest(); - return; - } - err = TestReadTheMandatoryAttributeMinMeasuredValue_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 mandatory attribute: MaxMeasuredValue\n"); - if (ShouldSkip("FLW.S.A0002")) { - NextTest(); - return; - } - err = TestReadTheMandatoryAttributeMaxMeasuredValue_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the mandatory attribute: MeasuredValue\n"); - if (ShouldSkip("FLW.S.A0000")) { - NextTest(); - return; - } - err = TestReadTheMandatoryAttributeMeasuredValue_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the Tolerance attribute\n"); - if (ShouldSkip("FLW.S.A0003")) { - NextTest(); - return; - } - err = TestThReadsFromTheDutTheToleranceAttribute_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; } @@ -20405,6 +20450,9 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -20418,7 +20466,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; @@ -20432,77 +20480,99 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: MinMeasuredValue Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 65533U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); } + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: MaxMeasuredValue Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 65534U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_3() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: MeasuredValue Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - VerifyOrReturn(CheckConstraintType("measuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], 65535U)); - } + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + 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 ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); NextTest(); }]; @@ -20510,23 +20580,25 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsFromTheDutTheToleranceAttribute_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads from the DUT the Tolerance attribute Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("tolerance", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -20534,11 +20606,11 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { } }; -class Test_TC_CGEN_1_1 : public TestCommandBridge { +class Test_TC_DGGEN_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CGEN_1_1() - : TestCommandBridge("Test_TC_CGEN_1_1") + Test_TC_DGGEN_2_1() + : TestCommandBridge("Test_TC_DGGEN_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -20548,7 +20620,7 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CGEN_1_1() {} + ~Test_TC_DGGEN_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -20556,11 +20628,11 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CGEN_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGGEN_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CGEN_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGGEN_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -20577,24 +20649,126 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads NetworkInterfaces structure attribute from DUT.\n"); + if (ShouldSkip("DGGEN.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsNetworkInterfacesStructureAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads a RebootCount attribute value from DUT.\n"); + if (ShouldSkip("DGGEN.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsARebootCountAttributeValueFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestRebootTargetDevice_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestRebootTargetDeviceDUT_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestRebootTargetDevice_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestRebootTargetDeviceDUT_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : DUT reboots and TH reads a UpTime attribute value of DUT since some arbitrary start time of " + "DUT rebooting.\n"); + if (ShouldSkip("DGGEN.S.A0002")) { + NextTest(); + return; + } + err = TestDutRebootsAndThReadsAUpTimeAttributeValueOfDutSinceSomeArbitraryStartTimeOfDutRebooting_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads a TotalOperationalHours attribute value from DUT.\n"); + if (ShouldSkip("DGGEN.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsATotalOperationalHoursAttributeValueFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestRebootTargetDevice_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestRebootTargetDeviceDUT_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads BootReason attribute value from DUT.\n"); + if (ShouldSkip("DGGEN.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsBootReasonAttributeValueFromDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads ActiveHardwareFaults attribute value from DUT.\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsActiveHardwareFaultsAttributeValueFromDut_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads ActiveRadioFaults attribute value from DUT.\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsActiveRadioFaultsAttributeValueFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads ActiveNetworkFaults attribute value from DUT.\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0007")) { + NextTest(); + return; + } + err = TestThReadsActiveNetworkFaultsAttributeValueFromDut_16(); break; } @@ -20625,6 +20799,39 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -20638,7 +20845,7 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 17; chip::Optional mNodeId; chip::Optional mCluster; @@ -20652,104 +20859,126 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestThReadsNetworkInterfacesStructureAttributeFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + 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); + [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads NetworkInterfaces structure attribute from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintType("networkInterfaces", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestThReadsARebootCountAttributeValueFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + [cluster readAttributeRebootCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads a RebootCount attribute value from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } + VerifyOrReturn(CheckConstraintType("rebootCount", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("rebootCount", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("rebootCount", [value unsignedShortValue], 65535U)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestRebootTargetDevice_3() + { + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } + + CHIP_ERROR TestRebootTargetDeviceDUT_4() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestRebootTargetDevice_5() + { + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } + + CHIP_ERROR TestRebootTargetDeviceDUT_6() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_7() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestDutRebootsAndThReadsAUpTimeAttributeValueOfDutSinceSomeArbitraryStartTimeOfDutRebooting_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + 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 readAttributeUpTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"DUT reboots and TH reads a UpTime attribute value of DUT since some arbitrary start time of DUT rebooting. " + @"Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - + VerifyOrReturn(CheckConstraintType("upTime", "int64u", "int64u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestThReadsATotalOperationalHoursAttributeValueFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + 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 readAttributeTotalOperationalHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads a TotalOperationalHours attribute value from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); + VerifyOrReturn(CheckConstraintType("totalOperationalHours", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("totalOperationalHours", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("totalOperationalHours", [value unsignedIntValue], 4294967294UL)); NextTest(); }]; @@ -20757,36 +20986,84 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestRebootTargetDevice_10() + { + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } + + CHIP_ERROR TestRebootTargetDeviceDUT_11() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_12() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsBootReasonAttributeValueFromDut_13() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + 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); + [cluster readAttributeBootReasonsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads BootReason attribute value from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 5UL)); + VerifyOrReturn(CheckConstraintMinValue("bootReasons", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("bootReasons", [value unsignedCharValue], 6U)); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestThReadsActiveHardwareFaultsAttributeValueFromDut_14() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestThReadsActiveRadioFaultsAttributeValueFromDut_15() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestThReadsActiveNetworkFaultsAttributeValueFromDut_16() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } }; -class Test_TC_CGEN_2_1 : public TestCommandBridge { +class Test_TC_I_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CGEN_2_1() - : TestCommandBridge("Test_TC_CGEN_2_1") + Test_TC_I_1_1() + : TestCommandBridge("Test_TC_I_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -20796,7 +21073,7 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CGEN_2_1() {} + ~Test_TC_I_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -20804,11 +21081,11 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CGEN_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CGEN_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -20825,63 +21102,61 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH1 reads the BreadCrumb Attribute from the DUT\n"); - if (ShouldSkip("CGEN.S.A0000")) { - NextTest(); - return; - } - err = TestTh1ReadsTheBreadCrumbAttributeFromTheDut_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 : TH1 writes the BreadCrumb attribute as 1 to the DUT\n"); - if (ShouldSkip("CGEN.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); + if (ShouldSkip(" !I.S.F00 ")) { NextTest(); return; } - err = TestTh1WritesTheBreadCrumbAttributeAs1ToTheDut_2(); + err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH1 reads the BreadCrumb attribute from the DUT\n"); - if (ShouldSkip("CGEN.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the FeatureMap attribute from the DUT\n"); + if (ShouldSkip("I.S.F00")) { NextTest(); return; } - err = TestTh1ReadsTheBreadCrumbAttributeFromTheDut_3(); + err = TestThReadsTheFeatureMapAttributeFromTheDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH1 reads the RegulatoryConfig attribute from the DUT\n"); - if (ShouldSkip("CGEN.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_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 optional command(TriggerEffect) in AcceptedCommandList\n"); + if (ShouldSkip("I.C.C40.Tx")) { NextTest(); return; } - err = TestTh1ReadsTheRegulatoryConfigAttributeFromTheDut_4(); + err = TestReadTheOptionalCommandTriggerEffectInAcceptedCommandList_6(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH1 reads the LocationCapability attribute from the DUT\n"); - if (ShouldSkip("CGEN.S.A0003")) { + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional attribute(IdentifyQuery) in AcceptedCommandList\n"); + if (ShouldSkip("I.C.C01.Tx")) { NextTest(); return; } - err = TestTh1ReadsTheLocationCapabilityAttributeFromTheDut_5(); + err = TestReadTheOptionalAttributeIdentifyQueryInAcceptedCommandList_7(); break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the " - "BasicCommissioningInfo attribute has the following field: FailSafeExpiryLengthSeconds field value is within a " - "duration range of 0 to 65535\n"); - if (ShouldSkip("CGEN.S.A0001")) { - NextTest(); - return; - } - err = TestTh1ReadsBasicCommissioningInfoAttributeFromDutAndVerifyThatTheBasicCommissioningInfoAttributeHasTheFollowingFieldFailSafeExpiryLengthSecondsFieldValueIsWithinADurationRangeOf0To65535_6(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH1 reads SupportsConcurrentConnection attribute from the DUT\n"); - if (ShouldSkip("CGEN.S.A0004")) { + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Read the optional attribute(IdentifyQueryResponse) in GeneratedCommandList\n"); + if (ShouldSkip("I.S.C00.Tx")) { NextTest(); return; } - err = TestTh1ReadsSupportsConcurrentConnectionAttributeFromTheDut_7(); + err = TestReadTheOptionalAttributeIdentifyQueryResponseInGeneratedCommandList_9(); break; } @@ -20918,6 +21193,12 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -20931,7 +21212,7 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -20945,87 +21226,94 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestTh1ReadsTheBreadCrumbAttributeFromTheDut_1() + CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the BreadCrumb Attribute from the DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("breadcrumb", "int64u", "int64u")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1WritesTheBreadCrumbAttributeAs1ToTheDut_2() + CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id breadcrumbArgument; - breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH1 writes the BreadCrumb attribute as 1 to the DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsTheBreadCrumbAttributeFromTheDut_3() + CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the BreadCrumb attribute from the DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 1ULL)); + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsTheRegulatoryConfigAttributeFromTheDut_4() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRegulatoryConfigWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the RegulatoryConfig attribute from the DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("regulatoryConfig", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("regulatoryConfig", [value unsignedCharValue], 2U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -21033,21 +21321,19 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsTheLocationCapabilityAttributeFromTheDut_5() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLocationCapabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the LocationCapability attribute from the DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("locationCapability", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("locationCapability", [value unsignedCharValue], 2U)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); NextTest(); }]; @@ -21055,57 +21341,99 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestTh1ReadsBasicCommissioningInfoAttributeFromDutAndVerifyThatTheBasicCommissioningInfoAttributeHasTheFollowingFieldFailSafeExpiryLengthSecondsFieldValueIsWithinADurationRangeOf0To65535_6() + CHIP_ERROR TestReadTheOptionalCommandTriggerEffectInAcceptedCommandList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBasicCommissioningInfoWithCompletionHandler:^( - MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable err) { - NSLog( - @"TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the BasicCommissioningInfo attribute has the " - @"following field: FailSafeExpiryLengthSeconds field value is within a duration range of 0 to 65535 Error: %@", - err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(TriggerEffect) in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 64UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsSupportsConcurrentConnectionAttributeFromTheDut_7() + CHIP_ERROR TestReadTheOptionalAttributeIdentifyQueryInAcceptedCommandList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeSupportsConcurrentConnectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads SupportsConcurrentConnection attribute from the DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(IdentifyQuery) in AcceptedCommandList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("supportsConcurrentConnection", "boolean", "boolean")); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify 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 ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeIdentifyQueryResponseInGeneratedCommandList_9() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify 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 optional attribute(IdentifyQueryResponse) in GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_DGGEN_1_1 : public TestCommandBridge { +class Test_TC_I_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGGEN_1_1() - : TestCommandBridge("Test_TC_DGGEN_1_1") + Test_TC_I_2_1() + : TestCommandBridge("Test_TC_I_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -21115,7 +21443,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DGGEN_1_1() {} + ~Test_TC_I_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -21123,11 +21451,11 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGGEN_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGGEN_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -21144,24 +21472,12 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the IdentifyTime attribute from the DUT\n"); + err = TestThReadsTheIdentifyTimeAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); - break; - case 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: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the IdentifyType attribute from the DUT\n"); + err = TestThReadsTheIdentifyTypeAttributeFromTheDut_2(); break; } @@ -21183,15 +21499,6 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -21205,7 +21512,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -21219,99 +21526,20 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - 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 ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - 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 ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestThReadsTheIdentifyTimeAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify 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 readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintType("identifyTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 65535U)); NextTest(); }]; @@ -21319,25 +21547,21 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestThReadsTheIdentifyTypeAttributeFromTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify 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); + [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintType("identifyType", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5U)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -21345,11 +21569,11 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { } }; -class Test_TC_DGGEN_2_1 : public TestCommandBridge { +class Test_TC_I_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGGEN_2_1() - : TestCommandBridge("Test_TC_DGGEN_2_1") + Test_TC_I_2_2() + : TestCommandBridge("Test_TC_I_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -21359,7 +21583,7 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DGGEN_2_1() {} + ~Test_TC_I_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -21367,11 +21591,11 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGGEN_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGGEN_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -21388,126 +21612,89 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads NetworkInterfaces structure attribute from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0000")) { + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH sends Identify command to DUT, with the identify time field set to 0x003c (60s).\n"); + if (ShouldSkip("I.S.C00.Rsp")) { NextTest(); return; } - err = TestThReadsNetworkInterfacesStructureAttributeFromDut_1(); + err = TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads a RebootCount attribute value from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads immediately IdentifyTime attribute from DUT\n"); + if (ShouldSkip("I.S.A0000")) { NextTest(); return; } - err = TestThReadsARebootCountAttributeValueFromDut_2(); + err = TestThReadsImmediatelyIdentifyTimeAttributeFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestRebootTargetDevice_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Wait 10000ms\n"); + err = TestWait10000ms_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : After 10 seconds, the TH reads IdentifyTime attribute from DUT\n"); + if (ShouldSkip("I.S.A0000")) { NextTest(); return; } - err = TestRebootTargetDeviceDUT_4(); + err = TestAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends IdentifyQuery command to DUT and Verify IdentifyQueryResponse command to TH,with " + "the Timeout field set to a value in the range 0x0000 to 0x0032\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C01.Rsp && I.S.C00.Tx")) { NextTest(); return; } - err = TestRebootTargetDevice_5(); + err = TestThSendsIdentifyQueryCommandToDutAndVerifyIdentifyQueryResponseCommandToTHwithTheTimeoutFieldSetToAValueInTheRange0x0000To0x0032_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, + " ***** Test Step 6 : TH sends Identify command to DUT, with the identify time field set to 0x0000 (stop " + "identifying).\n"); + if (ShouldSkip("I.S.C00.Rsp")) { NextTest(); return; } - err = TestRebootTargetDeviceDUT_6(); + err = TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads immediately IdentifyTime attribute from DUT\n"); + if (ShouldSkip("I.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsImmediatelyIdentifyTimeAttributeFromDut_7(); break; case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : DUT reboots and TH reads a UpTime attribute value of DUT since some arbitrary start time of " - "DUT rebooting.\n"); - if (ShouldSkip("DGGEN.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : TH sends IdentifyQuery command to DUT \n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C01.Rsp && I.S.C00.Tx")) { NextTest(); return; } - err = TestDutRebootsAndThReadsAUpTimeAttributeValueOfDutSinceSomeArbitraryStartTimeOfDutRebooting_8(); + err = TestThSendsIdentifyQueryCommandToDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads a TotalOperationalHours attribute value from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT\n"); + if (ShouldSkip("I.S.A0000")) { NextTest(); return; } - err = TestThReadsATotalOperationalHoursAttributeValueFromDut_9(); + err = TestThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestRebootTargetDevice_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 5000ms\n"); + err = TestWait5000ms_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestRebootTargetDeviceDUT_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads BootReason attribute value from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0004")) { - NextTest(); - return; - } - err = TestThReadsBootReasonAttributeValueFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads ActiveHardwareFaults attribute value from DUT.\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0005")) { - NextTest(); - return; - } - err = TestThReadsActiveHardwareFaultsAttributeValueFromDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads ActiveRadioFaults attribute value from DUT.\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0006")) { - NextTest(); - return; - } - err = TestThReadsActiveRadioFaultsAttributeValueFromDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads ActiveNetworkFaults attribute value from DUT.\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0007")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : After 5 seconds, the TH reads IdentifyTime attribute from DUT\n"); + if (ShouldSkip("I.S.A0000")) { NextTest(); return; } - err = TestThReadsActiveNetworkFaultsAttributeValueFromDut_16(); + err = TestAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_11(); break; } @@ -21556,21 +21743,6 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -21584,7 +21756,7 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -21598,42 +21770,39 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsNetworkInterfacesStructureAttributeFromDut_1() + CHIP_ERROR TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads NetworkInterfaces structure attribute from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("networkInterfaces", "list", "list")); - NextTest(); - }]; + __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; + params.identifyTime = [NSNumber numberWithUnsignedShort:60U]; + [cluster identifyWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Identify command to DUT, with the identify time field set to 0x003c (60s). Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsARebootCountAttributeValueFromDut_2() + CHIP_ERROR TestThReadsImmediatelyIdentifyTimeAttributeFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRebootCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads a RebootCount attribute value from DUT. Error: %@", err); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads immediately IdentifyTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("rebootCount", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("rebootCount", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("rebootCount", [value unsignedShortValue], 65535U)); + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 51U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 69U)); NextTest(); }]; @@ -21641,83 +21810,81 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDevice_3() + CHIP_ERROR TestWait10000ms_3() { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestRebootTargetDeviceDUT_4() + CHIP_ERROR TestAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_4() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestRebootTargetDevice_5() - { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"After 10 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 43U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 57U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDeviceDUT_6() + CHIP_ERROR + TestThSendsIdentifyQueryCommandToDutAndVerifyIdentifyQueryResponseCommandToTHwithTheTimeoutFieldSetToAValueInTheRange0x0000To0x0032_5() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_7() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestDutRebootsAndThReadsAUpTimeAttributeValueOfDutSinceSomeArbitraryStartTimeOfDutRebooting_8() + CHIP_ERROR TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeUpTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DUT reboots and TH reads a UpTime attribute value of DUT since some arbitrary start time of DUT rebooting. " - @"Error: %@", - err); + __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; + params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; + [cluster + identifyWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"TH sends Identify command to DUT, with the identify time field set to 0x0000 (stop identifying). Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("upTime", "int64u", "int64u")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsATotalOperationalHoursAttributeValueFromDut_9() + CHIP_ERROR TestThReadsImmediatelyIdentifyTimeAttributeFromDut_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTotalOperationalHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads a TotalOperationalHours attribute value from DUT. Error: %@", err); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads immediately IdentifyTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("totalOperationalHours", "int32u", "int32u")); - VerifyOrReturn(CheckConstraintMinValue("totalOperationalHours", [value unsignedIntValue], 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("totalOperationalHours", [value unsignedIntValue], 4294967294UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("identify time", actualValue, 0U)); + } NextTest(); }]; @@ -21725,84 +21892,68 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDevice_10() - { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestRebootTargetDeviceDUT_11() + CHIP_ERROR TestThSendsIdentifyQueryCommandToDut_8() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_12() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThReadsBootReasonAttributeValueFromDut_13() + CHIP_ERROR TestThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBootReasonsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads BootReason attribute value from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + id identifyTimeArgument; + identifyTimeArgument = [NSNumber numberWithUnsignedShort:15U]; + [cluster writeAttributeIdentifyTimeWithValue:identifyTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT Error: %@", err); - VerifyOrReturn(CheckConstraintMinValue("bootReasons", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("bootReasons", [value unsignedCharValue], 6U)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsActiveHardwareFaultsAttributeValueFromDut_14() + CHIP_ERROR TestWait5000ms_10() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsActiveRadioFaultsAttributeValueFromDut_15() + CHIP_ERROR TestAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_11() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestThReadsActiveNetworkFaultsAttributeValueFromDut_16() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"After 5 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 5U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 15U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } }; -class Test_TC_I_1_1 : public TestCommandBridge { +class Test_TC_I_2_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_1_1() - : TestCommandBridge("Test_TC_I_1_1") + Test_TC_I_2_3() + : TestCommandBridge("Test_TC_I_2_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -21812,7 +21963,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_I_1_1() {} + ~Test_TC_I_2_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -21820,11 +21971,11 @@ class Test_TC_I_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -21837,65 +21988,188 @@ class Test_TC_I_1_1 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : 1.Wait for the commissioned device to be retrieved\n"); + err = Test1WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); - err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and " + "the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); - if (ShouldSkip(" !I.S.F00 ")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : DUT executes a blink effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { NextTest(); return; } - err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); + err = TestDutExecutesABlinkEffect_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the FeatureMap attribute from the DUT\n"); - if (ShouldSkip("I.S.F00")) { + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe " + "and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { NextTest(); return; } - err = TestThReadsTheFeatureMapAttributeFromTheDut_3(); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : DUT executes a breathe effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutExecutesABreatheEffect_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay and " + "the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional command(TriggerEffect) in AcceptedCommandList\n"); - if (ShouldSkip("I.C.C40.Tx")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : DUT executes an okay effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { NextTest(); return; } - err = TestReadTheOptionalCommandTriggerEffectInAcceptedCommandList_6(); + err = TestDutExecutesAnOkayEffect_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional attribute(IdentifyQuery) in AcceptedCommandList\n"); - if (ShouldSkip("I.C.C01.Tx")) { + ChipLogProgress(chipTool, + " ***** Test Step 7 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b channel " + "change and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { NextTest(); return; } - err = TestReadTheOptionalAttributeIdentifyQueryInAcceptedCommandList_7(); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : DUT executes a channel change effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutExecutesAChannelChangeEffect_8(); break; case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : Read the optional attribute(IdentifyQueryResponse) in GeneratedCommandList\n"); - if (ShouldSkip("I.S.C00.Tx")) { + ChipLogProgress(chipTool, + " ***** Test Step 9 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe " + "and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { NextTest(); return; } - err = TestReadTheOptionalAttributeIdentifyQueryResponseInGeneratedCommandList_9(); + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : DUT executes a breathe effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutExecutesABreatheEffect_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0xfe finish " + "effect and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xfeFinishEffectAndTheEffectVariantFieldSetTo0x00Default_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : DUT stops the breathe effect after the current effect sequence\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutStopsTheBreatheEffectAfterTheCurrentEffectSequence_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe " + "and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : DUT executes a breathe effect\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutExecutesABreatheEffect_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop " + "effect and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xffStopEffectAndTheEffectVariantFieldSetTo0x00Default_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : DUT stops the breathe effect as soon as possible.\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutStopsTheBreatheEffectAsSoonAsPossible_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink " + "and the effect variant field set to 0x42 unknown\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x42Unknown_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Check DUT executes a blink effect.\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestCheckDutExecutesABlinkEffect_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop " + "effect and the effect variant field set to 0x00 default\n"); + if (ShouldSkip("I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xffStopEffectAndTheEffectVariantFieldSetTo0x00Default_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : DUT stops any effect that may be still running as soon as possible\n"); + if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + NextTest(); + return; + } + err = TestDutStopsAnyEffectThatMayBeStillRunningAsSoonAsPossible_20(); break; } @@ -21938,6 +22212,39 @@ class Test_TC_I_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -21951,368 +22258,356 @@ class Test_TC_I_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 21; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR Test1WaitForTheCommissionedDeviceToBeRetrieved_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() + CHIP_ERROR + TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:0U]; + params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and " + @"the effect variant field set to 0x00 default Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_2() + CHIP_ERROR TestDutExecutesABlinkEffect_2() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_3() + CHIP_ERROR + TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:1U]; + params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and " + @"the effect variant field set to 0x00 default Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() + CHIP_ERROR TestDutExecutesABreatheEffect_4() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify 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 ? err.code : 0, 0)); + __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:2U]; + params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay and the " + @"effect variant field set to 0x00 default Error: %@", + err); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR TestDutExecutesAnOkayEffect_6() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify 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 ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestReadTheOptionalCommandTriggerEffectInAcceptedCommandList_6() + CHIP_ERROR + TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify 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 optional command(TriggerEffect) in AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:11U]; + params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b channel " + @"change and the effect variant field set to 0x00 default Error: %@", + err); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 64UL)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeIdentifyQueryInAcceptedCommandList_7() + CHIP_ERROR TestDutExecutesAChannelChangeEffect_8() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify 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 optional attribute(IdentifyQuery) in AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:1U]; + params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and " + @"the effect variant field set to 0x00 default Error: %@", + err); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestDutExecutesABreatheEffect_10() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xfeFinishEffectAndTheEffectVariantFieldSetTo0x00Default_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify 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 ? err.code : 0, 0)); + __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:254U]; + params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xfe finish " + @"effect and the effect variant field set to 0x00 default Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeIdentifyQueryResponseInGeneratedCommandList_9() + CHIP_ERROR TestDutStopsTheBreatheEffectAfterTheCurrentEffectSequence_12() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify 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 optional attribute(IdentifyQueryResponse) in GeneratedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:1U]; + params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and " + @"the effect variant field set to 0x00 default Error: %@", + err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class Test_TC_I_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_1() - : TestCommandBridge("Test_TC_I_2_1") - , mTestIndex(0) + CHIP_ERROR TestDutExecutesABreatheEffect_14() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_I_2_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR + TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xffStopEffectAndTheEffectVariantFieldSetTo0x00Default_15() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the IdentifyTime attribute from the DUT\n"); - err = TestThReadsTheIdentifyTimeAttributeFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the IdentifyType attribute from the DUT\n"); - err = TestThReadsTheIdentifyTypeAttributeFromTheDut_2(); - break; - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } + __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:255U]; + params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop effect " + @"and the effect variant field set to 0x00 default Error: %@", + err); - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } + NextTest(); + }]; - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestDutStopsTheBreatheEffectAsSoonAsPossible_16() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestThReadsTheIdentifyTimeAttributeFromTheDut_1() + CHIP_ERROR + TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x42Unknown_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:0U]; + params.effectVariant = [NSNumber numberWithUnsignedChar:66U]; + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and " + @"the effect variant field set to 0x42 unknown Error: %@", + err); - VerifyOrReturn(CheckConstraintType("identifyTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 65535U)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheIdentifyTypeAttributeFromTheDut_2() + CHIP_ERROR TestCheckDutExecutesABlinkEffect_18() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xffStopEffectAndTheEffectVariantFieldSetTo0x00Default_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:255U]; + params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop effect " + @"and the effect variant field set to 0x00 default Error: %@", + err); - VerifyOrReturn(CheckConstraintType("identifyType", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5U)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestDutStopsAnyEffectThatMayBeStillRunningAsSoonAsPossible_20() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } }; -class Test_TC_I_2_2 : public TestCommandBridge { +class Test_TC_ILL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_2() - : TestCommandBridge("Test_TC_I_2_2") + Test_TC_ILL_1_1() + : TestCommandBridge("Test_TC_ILL_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -22322,7 +22617,7 @@ class Test_TC_I_2_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_I_2_2() {} + ~Test_TC_ILL_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -22330,11 +22625,11 @@ class Test_TC_I_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -22351,89 +22646,40 @@ class Test_TC_I_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH sends Identify command to DUT, with the identify time field set to 0x003c (60s).\n"); - if (ShouldSkip("I.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads immediately IdentifyTime attribute from DUT\n"); - if (ShouldSkip("I.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsImmediatelyIdentifyTimeAttributeFromDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Wait 10000ms\n"); - err = TestWait10000ms_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : After 10 seconds, the TH reads IdentifyTime attribute from DUT\n"); - if (ShouldSkip("I.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(Tolerance) in AttributeList\n"); + if (ShouldSkip("ILL.S.A0003")) { NextTest(); return; } - err = TestAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_4(); + err = TestReadTheOptionalAttributeToleranceInAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : TH sends IdentifyQuery command to DUT and Verify IdentifyQueryResponse command to TH,with " - "the Timeout field set to a value in the range 0x0000 to 0x0032\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C01.Rsp && I.S.C00.Tx")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute(LightSensorType) in AttributeList\n"); + if (ShouldSkip("ILL.S.A0004")) { NextTest(); return; } - err = TestThSendsIdentifyQueryCommandToDutAndVerifyIdentifyQueryResponseCommandToTHwithTheTimeoutFieldSetToAValueInTheRange0x0000To0x0032_5(); + err = TestReadTheOptionalAttributeLightSensorTypeInAttributeList_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : TH sends Identify command to DUT, with the identify time field set to 0x0000 (stop " - "identifying).\n"); - if (ShouldSkip("I.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads immediately IdentifyTime attribute from DUT\n"); - if (ShouldSkip("I.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsImmediatelyIdentifyTimeAttributeFromDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH sends IdentifyQuery command to DUT \n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C01.Rsp && I.S.C00.Tx")) { - NextTest(); - return; - } - err = TestThSendsIdentifyQueryCommandToDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT\n"); - if (ShouldSkip("I.S.A0000")) { - NextTest(); - return; - } - err = TestThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 5000ms\n"); - err = TestWait5000ms_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : After 5 seconds, the TH reads IdentifyTime attribute from DUT\n"); - if (ShouldSkip("I.S.A0000")) { - NextTest(); - return; - } - err = TestAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_11(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_7(); break; } @@ -22470,18 +22716,6 @@ class Test_TC_I_2_2 : public TestCommandBridge { case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -22495,7 +22729,7 @@ class Test_TC_I_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -22509,121 +22743,117 @@ class Test_TC_I_2_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; - params.identifyTime = [NSNumber numberWithUnsignedShort:60U]; - [cluster identifyWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Identify command to DUT, with the identify time field set to 0x003c (60s). Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsImmediatelyIdentifyTimeAttributeFromDut_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads immediately IdentifyTime attribute from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 51U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 69U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_3() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_4() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"After 10 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 43U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 57U)); - + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsIdentifyQueryCommandToDutAndVerifyIdentifyQueryResponseCommandToTHwithTheTimeoutFieldSetToAValueInTheRange0x0000To0x0032_5() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_6() + CHIP_ERROR TestReadTheOptionalAttributeToleranceInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; - params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; - [cluster - identifyWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"TH sends Identify command to DUT, with the identify time field set to 0x0000 (stop identifying). Error: %@", - err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(Tolerance) in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsImmediatelyIdentifyTimeAttributeFromDut_7() + CHIP_ERROR TestReadTheOptionalAttributeLightSensorTypeInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads immediately IdentifyTime attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(LightSensorType) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("identify time", actualValue, 0U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); NextTest(); }]; @@ -22631,56 +22861,48 @@ class Test_TC_I_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsIdentifyQueryCommandToDut_8() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_9() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id identifyTimeArgument; - identifyTimeArgument = [NSNumber numberWithUnsignedShort:15U]; - [cluster writeAttributeIdentifyTimeWithValue:identifyTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; - CHIP_ERROR TestWait5000ms_10() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR TestAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_11() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"After 5 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 5U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 15U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -22688,11 +22910,11 @@ class Test_TC_I_2_2 : public TestCommandBridge { } }; -class Test_TC_I_2_3 : public TestCommandBridge { +class Test_TC_ILL_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_3() - : TestCommandBridge("Test_TC_I_2_3") + Test_TC_ILL_2_1() + : TestCommandBridge("Test_TC_ILL_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -22702,7 +22924,7 @@ class Test_TC_I_2_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_I_2_3() {} + ~Test_TC_ILL_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -22710,11 +22932,11 @@ class Test_TC_I_2_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -22727,188 +22949,48 @@ class Test_TC_I_2_3 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : 1.Wait for the commissioned device to be retrieved\n"); - err = Test1WaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and " - "the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads MinMeasuredValue attribute from DUT\n"); + if (ShouldSkip("ILL.S.A0001")) { NextTest(); return; } - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1(); + err = TestThReadsMinMeasuredValueAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : DUT executes a blink effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads MaxMeasuredValue attribute from DUT\n"); + if (ShouldSkip("ILL.S.A0002")) { NextTest(); return; } - err = TestDutExecutesABlinkEffect_2(); + err = TestThReadsMaxMeasuredValueAttributeFromDut_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe " - "and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads MeasuredValue attribute from DUT\n"); + if (ShouldSkip("ILL.S.A0000")) { NextTest(); return; } - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3(); + err = TestThReadsMeasuredValueAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : DUT executes a breathe effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads Tolerance attribute from DUT\n"); + if (ShouldSkip("ILL.S.A0003")) { NextTest(); return; } - err = TestDutExecutesABreatheEffect_4(); + err = TestThReadsToleranceAttributeFromDut_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay and " - "the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : DUT executes an okay effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestDutExecutesAnOkayEffect_6(); - break; - case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b channel " - "change and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : DUT executes a channel change effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestDutExecutesAChannelChangeEffect_8(); - break; - case 9: - ChipLogProgress(chipTool, - " ***** Test Step 9 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe " - "and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : DUT executes a breathe effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestDutExecutesABreatheEffect_10(); - break; - case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0xfe finish " - "effect and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xfeFinishEffectAndTheEffectVariantFieldSetTo0x00Default_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : DUT stops the breathe effect after the current effect sequence\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestDutStopsTheBreatheEffectAfterTheCurrentEffectSequence_12(); - break; - case 13: - ChipLogProgress(chipTool, - " ***** Test Step 13 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe " - "and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : DUT executes a breathe effect\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestDutExecutesABreatheEffect_14(); - break; - case 15: - ChipLogProgress(chipTool, - " ***** Test Step 15 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop " - "effect and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xffStopEffectAndTheEffectVariantFieldSetTo0x00Default_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : DUT stops the breathe effect as soon as possible.\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestDutStopsTheBreatheEffectAsSoonAsPossible_16(); - break; - case 17: - ChipLogProgress(chipTool, - " ***** Test Step 17 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink " - "and the effect variant field set to 0x42 unknown\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x42Unknown_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Check DUT executes a blink effect.\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestCheckDutExecutesABlinkEffect_18(); - break; - case 19: - ChipLogProgress(chipTool, - " ***** Test Step 19 : TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop " - "effect and the effect variant field set to 0x00 default\n"); - if (ShouldSkip("I.S.C40.Rsp")) { - NextTest(); - return; - } - err = TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xffStopEffectAndTheEffectVariantFieldSetTo0x00Default_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : DUT stops any effect that may be still running as soon as possible\n"); - if (ShouldSkip("PICS_USER_PROMPT && I.S.C40.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads LightSensorType attribute from DUT\n"); + if (ShouldSkip("ILL.S.A0004")) { NextTest(); return; } - err = TestDutStopsAnyEffectThatMayBeStillRunningAsSoonAsPossible_20(); + err = TestThReadsLightSensorTypeAttributeFromDut_5(); break; } @@ -22939,51 +23021,6 @@ class Test_TC_I_2_3 : public TestCommandBridge { case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -22997,356 +23034,148 @@ class Test_TC_I_2_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 21; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR Test1WaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - CHIP_ERROR - TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x00Default_1() + CHIP_ERROR TestThReadsMinMeasuredValueAttributeFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:0U]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and " - @"the effect variant field set to 0x00 default Error: %@", - err); + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads MinMeasuredValue attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + if (value != nil) { - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 1U)); + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 65533U)); + } - CHIP_ERROR TestDutExecutesABlinkEffect_2() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_3() + CHIP_ERROR TestThReadsMaxMeasuredValueAttributeFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:1U]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and " - @"the effect variant field set to 0x00 default Error: %@", - err); + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads MaxMeasuredValue attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + if (value != nil) { - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 2U)); + VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 65534U)); + } - CHIP_ERROR TestDutExecutesABreatheEffect_4() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x02OkayAndTheEffectVariantFieldSetTo0x00Default_5() + CHIP_ERROR TestThReadsMeasuredValueAttributeFromDut_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:2U]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x02 okay and the " - @"effect variant field set to 0x00 default Error: %@", - err); + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads MeasuredValue attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + if (value != nil) { - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckConstraintType("measuredValue", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], 65534U)); + } - CHIP_ERROR TestDutExecutesAnOkayEffect_6() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x0bChannelChangeAndTheEffectVariantFieldSetTo0x00Default_7() + CHIP_ERROR TestThReadsToleranceAttributeFromDut_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:11U]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x0b channel " - @"change and the effect variant field set to 0x00 default Error: %@", - err); + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("tolerance", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); - return CHIP_NO_ERROR; - } + NextTest(); + }]; - CHIP_ERROR TestDutExecutesAChannelChangeEffect_8() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_9() + CHIP_ERROR TestThReadsLightSensorTypeAttributeFromDut_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterIlluminanceMeasurement * cluster = + [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:1U]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and " - @"the effect variant field set to 0x00 default Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestDutExecutesABreatheEffect_10() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR - TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xfeFinishEffectAndTheEffectVariantFieldSetTo0x00Default_11() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:254U]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xfe finish " - @"effect and the effect variant field set to 0x00 default Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestDutStopsTheBreatheEffectAfterTheCurrentEffectSequence_12() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR - TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x01BreatheAndTheEffectVariantFieldSetTo0x00Default_13() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:1U]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x01 breathe and " - @"the effect variant field set to 0x00 default Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestDutExecutesABreatheEffect_14() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR - TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xffStopEffectAndTheEffectVariantFieldSetTo0x00Default_15() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:255U]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop effect " - @"and the effect variant field set to 0x00 default Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestDutStopsTheBreatheEffectAsSoonAsPossible_16() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR - TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0x00BlinkAndTheEffectVariantFieldSetTo0x42Unknown_17() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:0U]; - params.effectVariant = [NSNumber numberWithUnsignedChar:66U]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0x00 blink and " - @"the effect variant field set to 0x42 unknown Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCheckDutExecutesABlinkEffect_18() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); - CHIP_ERROR - TestThSendsTriggerEffectCommandToDutWithTheEffectIdentifierFieldSetTo0xffStopEffectAndTheEffectVariantFieldSetTo0x00Default_19() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - __auto_type * params = [[MTRIdentifyClusterTriggerEffectParams alloc] init]; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:255U]; - params.effectVariant = [NSNumber numberWithUnsignedChar:0U]; - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends TriggerEffect command to DUT with the effect identifier field set to 0xff stop effect " - @"and the effect variant field set to 0x00 default Error: %@", - err); + if (value != nil) { - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("lightSensorType", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("lightSensorType", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("lightSensorType", [value unsignedCharValue], 254U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - - CHIP_ERROR TestDutStopsAnyEffectThatMayBeStillRunningAsSoonAsPossible_20() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } }; -class Test_TC_ILL_1_1 : public TestCommandBridge { +class Test_TC_LVL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_ILL_1_1() - : TestCommandBridge("Test_TC_ILL_1_1") + Test_TC_LVL_1_1() + : TestCommandBridge("Test_TC_LVL_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -23356,7 +23185,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_ILL_1_1() {} + ~Test_TC_LVL_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -23364,11 +23193,11 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -23385,11 +23214,15 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + 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: FeatureMap\n"); + if (ShouldSkip("LVL.S.F00 || LVL.S.F01 || LVL.S.F02")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: @@ -23397,28 +23230,88 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(Tolerance) in AttributeList\n"); - if (ShouldSkip("ILL.S.A0003")) { + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read the optonal attribute(StartUpCurrentLevel and RemainingTime) in AttributeList\n"); + if (ShouldSkip("LVL.S.F01")) { NextTest(); return; } - err = TestReadTheOptionalAttributeToleranceInAttributeList_4(); + err = TestReadTheOptonalAttributeStartUpCurrentLevelAndRemainingTimeInAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute(LightSensorType) in AttributeList\n"); - if (ShouldSkip("ILL.S.A0004")) { + ChipLogProgress(chipTool, + " ***** Test Step 5 : Read the optonal attribute(CurrentFrequency, MinFrequency and MinFrequency) in " + "AttributeList\n"); + if (ShouldSkip("LVL.S.F02")) { NextTest(); return; } - err = TestReadTheOptionalAttributeLightSensorTypeInAttributeList_5(); + err = TestReadTheOptonalAttributeCurrentFrequencyMinFrequencyAndMinFrequencyInAttributeList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optonal attribute(MinLevel) in AttributeList\n"); + if (ShouldSkip("LVL.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptonalAttributeMinLevelInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optonal attribute(MaxLevel) in AttributeList\n"); + if (ShouldSkip("LVL.S.A0003")) { + NextTest(); + return; + } + err = TestReadTheOptonalAttributeMaxLevelInAttributeList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the optonal attribute(OnOffTransitionTime) in AttributeList\n"); + if (ShouldSkip("LVL.S.A0010")) { + NextTest(); + return; + } + err = TestReadTheOptonalAttributeOnOffTransitionTimeInAttributeList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optonal attribute(OnTransitionTime) in AttributeList\n"); + if (ShouldSkip("LVL.S.A0012")) { + NextTest(); + return; + } + err = TestReadTheOptonalAttributeOnTransitionTimeInAttributeList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the optonal attribute(OffTransitionTime) in AttributeList\n"); + if (ShouldSkip("LVL.S.A0013")) { + NextTest(); + return; + } + err = TestReadTheOptonalAttributeOffTransitionTimeInAttributeList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read the optonal attribute(DefaultMoveRate) in AttributeList\n"); + if (ShouldSkip("LVL.S.A0014")) { + NextTest(); + return; + } + err = TestReadTheOptonalAttributeDefaultMoveRateInAttributeList_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_12(); + break; + case 13: + ChipLogProgress( + chipTool, " ***** Test Step 13 : Read the Feature-dependent(LVL.S.F02) attribute in AcceptedCommandList\n"); + if (ShouldSkip("LVL.S.F02")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentLVLSF02AttributeInAcceptedCommandList_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_14(); break; } @@ -23455,6 +23348,27 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -23468,7 +23382,7 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 15; chip::Optional mNodeId; chip::Optional mCluster; @@ -23485,18 +23399,19 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl 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); + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); } VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); @@ -23509,8 +23424,9 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -23518,12 +23434,10 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 7UL)); + NextTest(); }]; @@ -23533,8 +23447,9 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -23544,13 +23459,8 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); NextTest(); }]; @@ -23558,20 +23468,22 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeToleranceInAttributeList_4() + CHIP_ERROR TestReadTheOptonalAttributeStartUpCurrentLevelAndRemainingTimeInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl 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 optional attribute(Tolerance) in AttributeList Error: %@", err); + NSLog(@"Read the optonal attribute(StartUpCurrentLevel and RemainingTime) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16384UL)); NextTest(); }]; @@ -23579,20 +23491,23 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeLightSensorTypeInAttributeList_5() + CHIP_ERROR TestReadTheOptonalAttributeCurrentFrequencyMinFrequencyAndMinFrequencyInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl 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 optional attribute(LightSensorType) in AttributeList Error: %@", err); + NSLog(@"Read the optonal attribute(CurrentFrequency, MinFrequency and MinFrequency) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); NextTest(); }]; @@ -23600,211 +23515,109 @@ class Test_TC_ILL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() + CHIP_ERROR TestReadTheOptonalAttributeMinLevelInAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl 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 optonal attribute(MinLevel) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_7() + CHIP_ERROR TestReadTheOptonalAttributeMaxLevelInAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl 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); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optonal attribute(MaxLevel) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; - -class Test_TC_ILL_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_ILL_2_1() - : TestCommandBridge("Test_TC_ILL_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_ILL_2_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadTheOptonalAttributeOnOffTransitionTimeInAttributeList_8() { - CHIP_ERROR err = CHIP_NO_ERROR; + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ILL_2_1\n"); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optonal attribute(OnOffTransitionTime) in AttributeList Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ILL_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - Wait(); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads MinMeasuredValue attribute from DUT\n"); - if (ShouldSkip("ILL.S.A0001")) { - NextTest(); - return; - } - err = TestThReadsMinMeasuredValueAttributeFromDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads MaxMeasuredValue attribute from DUT\n"); - if (ShouldSkip("ILL.S.A0002")) { - NextTest(); - return; - } - err = TestThReadsMaxMeasuredValueAttributeFromDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads MeasuredValue attribute from DUT\n"); - if (ShouldSkip("ILL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsMeasuredValueAttributeFromDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads Tolerance attribute from DUT\n"); - if (ShouldSkip("ILL.S.A0003")) { - NextTest(); - return; - } - err = TestThReadsToleranceAttributeFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads LightSensorType attribute from DUT\n"); - if (ShouldSkip("ILL.S.A0004")) { - NextTest(); - return; - } - err = TestThReadsLightSensorTypeAttributeFromDut_5(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestReadTheOptonalAttributeOnTransitionTimeInAttributeList_9() { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optonal attribute(OnTransitionTime) in AttributeList Error: %@", err); - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsMinMeasuredValueAttributeFromDut_1() + CHIP_ERROR TestReadTheOptonalAttributeOffTransitionTimeInAttributeList_10() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads MinMeasuredValue attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optonal attribute(OffTransitionTime) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 65533U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); NextTest(); }]; @@ -23812,24 +23625,21 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsMaxMeasuredValueAttributeFromDut_2() + CHIP_ERROR TestReadTheOptonalAttributeDefaultMoveRateInAttributeList_11() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads MaxMeasuredValue attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optonal attribute(DefaultMoveRate) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 2U)); - VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 65534U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 20UL)); NextTest(); }]; @@ -23837,24 +23647,28 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsMeasuredValueAttributeFromDut_3() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_12() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads MeasuredValue attribute from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("measuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], 65534U)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 7UL)); NextTest(); }]; @@ -23862,21 +23676,21 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsToleranceAttributeFromDut_4() + CHIP_ERROR TestReadTheFeatureDependentLVLSF02AttributeInAcceptedCommandList_13() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Tolerance attribute from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the Feature-dependent(LVL.S.F02) attribute in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("tolerance", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 8UL)); NextTest(); }]; @@ -23884,25 +23698,25 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsLightSensorTypeAttributeFromDut_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_14() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIlluminanceMeasurement * cluster = - [[MTRBaseClusterIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LightSensorType attribute from DUT Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("lightSensorType", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("lightSensorType", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("lightSensorType", [value unsignedCharValue], 254U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -23910,11 +23724,11 @@ class Test_TC_ILL_2_1 : public TestCommandBridge { } }; -class Test_TC_LVL_1_1 : public TestCommandBridge { +class Test_TC_LVL_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_1_1() - : TestCommandBridge("Test_TC_LVL_1_1") + Test_TC_LVL_2_1() + : TestCommandBridge("Test_TC_LVL_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -23924,7 +23738,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_1_1() {} + ~Test_TC_LVL_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -23932,11 +23746,11 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -23953,104 +23767,164 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the CurrentLevel attribute\n"); + if (ShouldSkip("LVL.S.A0000")) { + NextTest(); + return; + } + err = TestReadsTheCurrentLevelAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip("LVL.S.F00 || LVL.S.F01 || LVL.S.F02")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the RemainingTime attribute\n"); + if (ShouldSkip("LVL.S.A0001")) { NextTest(); return; } - err = TestReadTheGlobalAttributeFeatureMap_2(); + err = TestReadsTheRemainingTimeAttribute_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the MinLevel attribute\n"); + if (ShouldSkip("LVL.S.A0002 && LVL.S.F01")) { + NextTest(); + return; + } + err = TestReadsTheMinLevelAttribute_3(); break; case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : Read the optonal attribute(StartUpCurrentLevel and RemainingTime) in AttributeList\n"); - if (ShouldSkip("LVL.S.F01")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the MinLevel attribute\n"); + if (ShouldSkip("LVL.S.A0002 && !LVL.S.F01")) { NextTest(); return; } - err = TestReadTheOptonalAttributeStartUpCurrentLevelAndRemainingTimeInAttributeList_4(); + err = TestReadsTheMinLevelAttribute_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : Read the optonal attribute(CurrentFrequency, MinFrequency and MinFrequency) in " - "AttributeList\n"); - if (ShouldSkip("LVL.S.F02")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the MaxLevel attribute\n"); + if (ShouldSkip("LVL.S.A0003 && LVL.S.F01")) { NextTest(); return; } - err = TestReadTheOptonalAttributeCurrentFrequencyMinFrequencyAndMinFrequencyInAttributeList_5(); + err = TestReadsTheMaxLevelAttribute_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optonal attribute(MinLevel) in AttributeList\n"); - if (ShouldSkip("LVL.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the MaxLevel attribute\n"); + if (ShouldSkip("LVL.S.A0003 && !LVL.S.F01")) { NextTest(); return; } - err = TestReadTheOptonalAttributeMinLevelInAttributeList_6(); + err = TestReadsTheMaxLevelAttribute_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optonal attribute(MaxLevel) in AttributeList\n"); - if (ShouldSkip("LVL.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 4b & 4C Reads the CurrentLevel attribute\n"); + if (ShouldSkip("LVL.S.F01 && LVL.S.A0002 && LVL.S.A0003")) { NextTest(); return; } - err = TestReadTheOptonalAttributeMaxLevelInAttributeList_7(); + err = TestStep4b4cReadsTheCurrentLevelAttribute_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the optonal attribute(OnOffTransitionTime) in AttributeList\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 4b & 4C Reads the CurrentLevel attribute\n"); + if (ShouldSkip("LVL.S.A0002 && LVL.S.A0003 && !LVL.S.F01")) { NextTest(); return; } - err = TestReadTheOptonalAttributeOnOffTransitionTimeInAttributeList_8(); + err = TestStep4b4cReadsTheCurrentLevelAttribute_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optonal attribute(OnTransitionTime) in AttributeList\n"); - if (ShouldSkip("LVL.S.A0012")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the CurrentFrequency attribute\n"); + if (ShouldSkip("LVL.S.A0004")) { NextTest(); return; } - err = TestReadTheOptonalAttributeOnTransitionTimeInAttributeList_9(); + err = TestReadsTheCurrentFrequencyAttribute_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read the optonal attribute(OffTransitionTime) in AttributeList\n"); - if (ShouldSkip("LVL.S.A0013")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the MinFrequency attribute\n"); + if (ShouldSkip("LVL.S.A0005")) { NextTest(); return; } - err = TestReadTheOptonalAttributeOffTransitionTimeInAttributeList_10(); + err = TestReadsTheMinFrequencyAttribute_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read the optonal attribute(DefaultMoveRate) in AttributeList\n"); - if (ShouldSkip("LVL.S.A0014")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the MaxFrequency attribute\n"); + if (ShouldSkip("LVL.S.A0006")) { NextTest(); return; } - err = TestReadTheOptonalAttributeDefaultMoveRateInAttributeList_11(); + err = TestReadsTheMaxFrequencyAttribute_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 7b & 7C Reads the CurrentFrequency attribute\n"); + if (ShouldSkip("LVL.S.A0004 && LVL.S.A0005 && LVL.S.A0006")) { + NextTest(); + return; + } + err = TestStep7b7cReadsTheCurrentFrequencyAttribute_12(); break; case 13: - ChipLogProgress( - chipTool, " ***** Test Step 13 : Read the Feature-dependent(LVL.S.F02) attribute in AcceptedCommandList\n"); - if (ShouldSkip("LVL.S.F02")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the OnOffTransitionTime attribute\n"); + if (ShouldSkip("LVL.S.A0010")) { NextTest(); return; } - err = TestReadTheFeatureDependentLVLSF02AttributeInAcceptedCommandList_13(); + err = TestReadsTheOnOffTransitionTimeAttribute_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the OnLevel attribute \n"); + if (ShouldSkip("LVL.S.F01 && LVL.S.A0011")) { + NextTest(); + return; + } + err = TestReadsTheOnLevelAttribute_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Reads the OnLevel attribute \n"); + if (ShouldSkip("LVL.S.A0011 && !LVL.S.F01")) { + NextTest(); + return; + } + err = TestReadsTheOnLevelAttribute_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Reads the OnTransitionTime attribute \n"); + if (ShouldSkip("LVL.S.A0012")) { + NextTest(); + return; + } + err = TestReadsTheOnTransitionTimeAttribute_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Reads the OffTransitionTime attribute \n"); + if (ShouldSkip("LVL.S.A0013")) { + NextTest(); + return; + } + err = TestReadsTheOffTransitionTimeAttribute_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Reads the DefaultMoveRate attribute \n"); + if (ShouldSkip("LVL.S.A0014")) { + NextTest(); + return; + } + err = TestReadsTheDefaultMoveRateAttribute_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Reads the Options attribute \n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestReadsTheOptionsAttribute_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Reads the StartUpCurrentLevel attribute \n"); + if (ShouldSkip("LVL.S.A4000")) { + NextTest(); + return; + } + err = TestReadsTheStartUpCurrentLevelAttribute_20(); break; } @@ -24108,6 +23982,24 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -24121,7 +24013,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 15; + const uint16_t mTestCount = 21; chip::Optional mNodeId; chip::Optional mCluster; @@ -24134,8 +24026,9 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } + NSNumber * _Nullable CurrentLevelValue; - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadsTheCurrentLevelAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24143,24 +24036,28 @@ class Test_TC_LVL_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: ClusterRevision Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentLevel attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 254U)); + } { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 5U)); + CurrentLevelValue = value; } - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestReadsTheRemainingTimeAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24168,22 +24065,23 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the RemainingTime attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 7UL)); + VerifyOrReturn(CheckConstraintType("remainingTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("remainingTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("remainingTime", [value unsignedShortValue], 65535U)); NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull MinLevelValue; - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadsTheMinLevelAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24191,23 +24089,29 @@ class Test_TC_LVL_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 readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the MinLevel attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("MinLevel", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("minLevel", "int8u", "int8u")); + { + MinLevelValue = value; + } NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull MinLevelFeatureMapNotSupportedValue; - CHIP_ERROR TestReadTheOptonalAttributeStartUpCurrentLevelAndRemainingTimeInAttributeList_4() + CHIP_ERROR TestReadsTheMinLevelAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24215,22 +24119,26 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optonal attribute(StartUpCurrentLevel and RemainingTime) in AttributeList Error: %@", err); + [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the MinLevel attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16384UL)); + VerifyOrReturn(CheckConstraintType("minLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("minLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("minLevel", [value unsignedCharValue], 254U)); + { + MinLevelFeatureMapNotSupportedValue = value; + } NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull MaxLevelValue; - CHIP_ERROR TestReadTheOptonalAttributeCurrentFrequencyMinFrequencyAndMinFrequencyInAttributeList_5() + CHIP_ERROR TestReadsTheMaxLevelAttribute_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24238,23 +24146,30 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optonal attribute(CurrentFrequency, MinFrequency and MinFrequency) in AttributeList Error: %@", err); + [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the MaxLevel attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("MaxLevel", actualValue, 254U)); + } + + VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], MinLevelValue)); + { + MaxLevelValue = value; + } NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull MaxLevelFeatureMapNotSupportedValue; - CHIP_ERROR TestReadTheOptonalAttributeMinLevelInAttributeList_6() + CHIP_ERROR TestReadsTheMaxLevelAttribute_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24262,13 +24177,18 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optonal attribute(MinLevel) in AttributeList Error: %@", err); + [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the MaxLevel attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); + VerifyOrReturn( + CheckConstraintMinValue("maxLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); + VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); + { + MaxLevelFeatureMapNotSupportedValue = value; + } NextTest(); }]; @@ -24276,7 +24196,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptonalAttributeMaxLevelInAttributeList_7() + CHIP_ERROR TestStep4b4cReadsTheCurrentLevelAttribute_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24284,13 +24204,17 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optonal attribute(MaxLevel) in AttributeList Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b & 4C Reads the CurrentLevel attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], MinLevelValue)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], MaxLevelValue)); + } NextTest(); }]; @@ -24298,7 +24222,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptonalAttributeOnOffTransitionTimeInAttributeList_8() + CHIP_ERROR TestStep4b4cReadsTheCurrentLevelAttribute_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24306,13 +24230,19 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optonal attribute(OnOffTransitionTime) in AttributeList Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b & 4C Reads the CurrentLevel attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue( + "currentLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); + VerifyOrReturn(CheckConstraintMaxValue( + "currentLevel", [value unsignedCharValue], MaxLevelFeatureMapNotSupportedValue)); + } NextTest(); }]; @@ -24320,7 +24250,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptonalAttributeOnTransitionTimeInAttributeList_9() + CHIP_ERROR TestReadsTheCurrentFrequencyAttribute_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24328,21 +24258,23 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optonal attribute(OnTransitionTime) in AttributeList Error: %@", err); + [cluster readAttributeCurrentFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentFrequency attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], 65535U)); NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull MinFrequencyValue; - CHIP_ERROR TestReadTheOptonalAttributeOffTransitionTimeInAttributeList_10() + CHIP_ERROR TestReadsTheMinFrequencyAttribute_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24350,21 +24282,26 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optonal attribute(OffTransitionTime) in AttributeList Error: %@", err); + [cluster readAttributeMinFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the MinFrequency attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); + VerifyOrReturn(CheckConstraintType("minFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("minFrequency", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("minFrequency", [value unsignedShortValue], 65535U)); + { + MinFrequencyValue = value; + } NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull MaxFrequencyValue; - CHIP_ERROR TestReadTheOptonalAttributeDefaultMoveRateInAttributeList_11() + CHIP_ERROR TestReadsTheMaxFrequencyAttribute_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24372,13 +24309,17 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optonal attribute(DefaultMoveRate) in AttributeList Error: %@", err); + [cluster readAttributeMaxFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the MaxFrequency attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 20UL)); + VerifyOrReturn(CheckConstraintType("maxFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("maxFrequency", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("maxFrequency", [value unsignedShortValue], 65535U)); + { + MaxFrequencyValue = value; + } NextTest(); }]; @@ -24386,7 +24327,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_12() + CHIP_ERROR TestStep7b7cReadsTheCurrentFrequencyAttribute_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24394,20 +24335,14 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { 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 readAttributeCurrentFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7b & 7C Reads the CurrentFrequency attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 5UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 6UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 7UL)); + VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], MinFrequencyValue)); + VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], MaxFrequencyValue)); NextTest(); }]; @@ -24415,7 +24350,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheFeatureDependentLVLSF02AttributeInAcceptedCommandList_13() + CHIP_ERROR TestReadsTheOnOffTransitionTimeAttribute_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24423,13 +24358,14 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the Feature-dependent(LVL.S.F02) attribute in AcceptedCommandList Error: %@", err); + [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OnOffTransitionTime attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 8UL)); + VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("onOffTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onOffTransitionTime", [value unsignedShortValue], 65535U)); NextTest(); }]; @@ -24437,7 +24373,7 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_14() + CHIP_ERROR TestReadsTheOnLevelAttribute_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24445,17 +24381,175 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { 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); + [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OnLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("onLevel", [value unsignedCharValue], MinLevelValue)); + VerifyOrReturn(CheckConstraintMaxValue("onLevel", [value unsignedCharValue], MaxLevelValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheOnLevelAttribute_15() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OnLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); + VerifyOrReturn( + CheckConstraintMinValue("onLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); + VerifyOrReturn( + CheckConstraintMaxValue("onLevel", [value unsignedCharValue], MaxLevelFeatureMapNotSupportedValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheOnTransitionTimeAttribute_16() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OnTransitionTime attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("onTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onTransitionTime", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheOffTransitionTimeAttribute_17() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OffTransitionTime attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("offTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("offTransitionTime", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheDefaultMoveRateAttribute_18() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the DefaultMoveRate attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("defaultMoveRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("defaultMoveRate", [value unsignedCharValue], 255U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheOptionsAttribute_19() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the Options attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("Options", actualValue, 0U)); + } + + VerifyOrReturn(CheckConstraintType("options", "bitmap8", "bitmap8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheStartUpCurrentLevelAttribute_20() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the StartUpCurrentLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("startUpCurrentLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("startUpCurrentLevel", [value unsignedCharValue], 255U)); } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -24463,21 +24557,27 @@ class Test_TC_LVL_1_1 : public TestCommandBridge { } }; -class Test_TC_LVL_2_1 : public TestCommandBridge { +class Test_TC_LVL_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_2_1() - : TestCommandBridge("Test_TC_LVL_2_1") + Test_TC_LVL_2_2() + : TestCommandBridge("Test_TC_LVL_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("OnOffTransitionTimeConfigValue", 0, UINT16_MAX, &mOnOffTransitionTimeConfigValue); + AddArgument("OnLevelConfigValue", 0, UINT8_MAX, &mOnLevelConfigValue); + AddArgument("OnTransitionTimeConfigValue", 0, UINT16_MAX, &mOnTransitionTimeConfigValue); + AddArgument("OffTransitionTimeConfigValue", 0, UINT16_MAX, &mOffTransitionTimeConfigValue); + AddArgument("DefaultMoveRateConfigValue", 0, UINT8_MAX, &mDefaultMoveRateConfigValue); + AddArgument("StartUpCurrentLevelConfigValue", 0, UINT8_MAX, &mStartUpCurrentLevelConfigValue); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_2_1() {} + ~Test_TC_LVL_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -24485,11 +24585,11 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -24506,164 +24606,156 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the CurrentLevel attribute\n"); - if (ShouldSkip("LVL.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the OnOffTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0010")) { NextTest(); return; } - err = TestReadsTheCurrentLevelAttribute_1(); + err = TestReadsTheOnOffTransitionTimeAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the RemainingTime attribute\n"); - if (ShouldSkip("LVL.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : writes the OnOffTransitionTime attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A0010")) { NextTest(); return; } - err = TestReadsTheRemainingTimeAttribute_2(); + err = TestWritesTheOnOffTransitionTimeAttributeOnTheDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the MinLevel attribute\n"); - if (ShouldSkip("LVL.S.A0002 && LVL.S.F01")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the OnOffTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0010")) { NextTest(); return; } - err = TestReadsTheMinLevelAttribute_3(); + err = TestReadsTheOnOffTransitionTimeAttributeFromTheDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the MinLevel attribute\n"); - if (ShouldSkip("LVL.S.A0002 && !LVL.S.F01")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the OnLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0011")) { NextTest(); return; } - err = TestReadsTheMinLevelAttribute_4(); + err = TestReadsTheOnLevelAttributeFromTheDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the MaxLevel attribute\n"); - if (ShouldSkip("LVL.S.A0003 && LVL.S.F01")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : writes the OnLevel attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A0011")) { NextTest(); return; } - err = TestReadsTheMaxLevelAttribute_5(); + err = TestWritesTheOnLevelAttributeOnTheDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the MaxLevel attribute\n"); - if (ShouldSkip("LVL.S.A0003 && !LVL.S.F01")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the OnLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0011")) { NextTest(); return; } - err = TestReadsTheMaxLevelAttribute_6(); + err = TestReadsTheOnLevelAttributeFromTheDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 4b & 4C Reads the CurrentLevel attribute\n"); - if (ShouldSkip("LVL.S.F01 && LVL.S.A0002 && LVL.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Reads the OnTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0012")) { NextTest(); return; } - err = TestStep4b4cReadsTheCurrentLevelAttribute_7(); + err = TestReadsTheOnTransitionTimeAttributeFromTheDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 4b & 4C Reads the CurrentLevel attribute\n"); - if (ShouldSkip("LVL.S.A0002 && LVL.S.A0003 && !LVL.S.F01")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Writes the OnTransitionTime attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A0012")) { NextTest(); return; } - err = TestStep4b4cReadsTheCurrentLevelAttribute_8(); + err = TestWritesTheOnTransitionTimeAttributeOnTheDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the CurrentFrequency attribute\n"); - if (ShouldSkip("LVL.S.A0004")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the OnTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0012")) { NextTest(); return; } - err = TestReadsTheCurrentFrequencyAttribute_9(); + err = TestReadsTheOnTransitionTimeAttributeFromTheDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the MinFrequency attribute\n"); - if (ShouldSkip("LVL.S.A0005")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the OffTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0013")) { NextTest(); return; } - err = TestReadsTheMinFrequencyAttribute_10(); + err = TestReadsTheOffTransitionTimeAttributeFromTheDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the MaxFrequency attribute\n"); - if (ShouldSkip("LVL.S.A0006")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : Writes the OffTransitionTime attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A0013")) { NextTest(); return; } - err = TestReadsTheMaxFrequencyAttribute_11(); + err = TestWritesTheOffTransitionTimeAttributeOnTheDut_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Step 7b & 7C Reads the CurrentFrequency attribute\n"); - if (ShouldSkip("LVL.S.A0004 && LVL.S.A0005 && LVL.S.A0006")) { + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the OffTransitionTime attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0013")) { NextTest(); return; } - err = TestStep7b7cReadsTheCurrentFrequencyAttribute_12(); + err = TestReadsTheOffTransitionTimeAttributeFromTheDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the OnOffTransitionTime attribute\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the DefaultMoveRate attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0014")) { NextTest(); return; } - err = TestReadsTheOnOffTransitionTimeAttribute_13(); + err = TestReadsTheDefaultMoveRateAttributeFromTheDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the OnLevel attribute \n"); - if (ShouldSkip("LVL.S.F01 && LVL.S.A0011")) { + ChipLogProgress(chipTool, " ***** Test Step 14 : Writes the DefaultMoveRate attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A0014")) { NextTest(); return; } - err = TestReadsTheOnLevelAttribute_14(); + err = TestWritesTheDefaultMoveRateAttributeOnTheDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Reads the OnLevel attribute \n"); - if (ShouldSkip("LVL.S.A0011 && !LVL.S.F01")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : Reads the DefaultMoveRate attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0014")) { NextTest(); return; } - err = TestReadsTheOnLevelAttribute_15(); + err = TestReadsTheDefaultMoveRateAttributeFromTheDut_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Reads the OnTransitionTime attribute \n"); - if (ShouldSkip("LVL.S.A0012")) { + ChipLogProgress(chipTool, " ***** Test Step 16 : Reads the StartUpCurrentLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A4000")) { NextTest(); return; } - err = TestReadsTheOnTransitionTimeAttribute_16(); + err = TestReadsTheStartUpCurrentLevelAttributeFromTheDut_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Reads the OffTransitionTime attribute \n"); - if (ShouldSkip("LVL.S.A0013")) { + ChipLogProgress(chipTool, " ***** Test Step 17 : writes the StartUpCurrentLevel attribute on the DUT\n"); + if (ShouldSkip("LVL.S.A4000")) { NextTest(); return; } - err = TestReadsTheOffTransitionTimeAttribute_17(); + err = TestWritesTheStartUpCurrentLevelAttributeOnTheDut_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Reads the DefaultMoveRate attribute \n"); - if (ShouldSkip("LVL.S.A0014")) { + ChipLogProgress(chipTool, " ***** Test Step 18 : reads the StartUpCurrentLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A4000")) { NextTest(); return; } - err = TestReadsTheDefaultMoveRateAttribute_18(); + err = TestReadsTheStartUpCurrentLevelAttributeFromTheDut_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Reads the Options attribute \n"); - if (ShouldSkip("LVL.S.A000f")) { - NextTest(); - return; - } - err = TestReadsTheOptionsAttribute_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Reads the StartUpCurrentLevel attribute \n"); - if (ShouldSkip("LVL.S.A4000")) { + ChipLogProgress(chipTool, " ***** Test Step 19 : writes back default value of OnOffTransitionTime attribute\n"); + if (ShouldSkip("LVL.S.A0010")) { NextTest(); return; } - err = TestReadsTheStartUpCurrentLevelAttribute_20(); + err = TestWritesBackDefaultValueOfOnOffTransitionTimeAttribute_19(); break; } @@ -24736,9 +24828,6 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -24752,11 +24841,17 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 21; + const uint16_t mTestCount = 20; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mOnOffTransitionTimeConfigValue; + chip::Optional mOnLevelConfigValue; + chip::Optional mOnTransitionTimeConfigValue; + chip::Optional mOffTransitionTimeConfigValue; + chip::Optional mDefaultMoveRateConfigValue; + chip::Optional mStartUpCurrentLevelConfigValue; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -24765,9 +24860,9 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable CurrentLevelValue; + NSNumber * _Nonnull OnOffTransitionTimeValue; - CHIP_ERROR TestReadsTheCurrentLevelAttribute_1() + CHIP_ERROR TestReadsTheOnOffTransitionTimeAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24775,19 +24870,16 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentLevel attribute Error: %@", err); + [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OnOffTransitionTime attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 254U)); - } + VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("onOffTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onOffTransitionTime", [value unsignedShortValue], 65535U)); { - CurrentLevelValue = value; + OnOffTransitionTimeValue = value; } NextTest(); @@ -24796,7 +24888,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheRemainingTimeAttribute_2() + CHIP_ERROR TestWritesTheOnOffTransitionTimeAttributeOnTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24804,23 +24896,23 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the RemainingTime attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + id onOffTransitionTimeArgument; + onOffTransitionTimeArgument = mOnOffTransitionTimeConfigValue.HasValue() + ? [NSNumber numberWithUnsignedShort:mOnOffTransitionTimeConfigValue.Value()] + : [NSNumber numberWithUnsignedShort:10U]; + [cluster writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"writes the OnOffTransitionTime attribute on the DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("remainingTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("remainingTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("remainingTime", [value unsignedShortValue], 65535U)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull MinLevelValue; - CHIP_ERROR TestReadsTheMinLevelAttribute_3() + CHIP_ERROR TestReadsTheOnOffTransitionTimeAttributeFromTheDut_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24828,29 +24920,28 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MinLevel attribute Error: %@", err); + [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OnOffTransitionTime attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("MinLevel", actualValue, 1U)); + VerifyOrReturn(CheckValue("OnOffTransitionTime", actualValue, + mOnOffTransitionTimeConfigValue.HasValue() ? mOnOffTransitionTimeConfigValue.Value() : 10U)); } - VerifyOrReturn(CheckConstraintType("minLevel", "int8u", "int8u")); - { - MinLevelValue = value; - } + VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintNotValue("onOffTransitionTime", value, OnOffTransitionTimeValue)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull MinLevelFeatureMapNotSupportedValue; + NSNumber * _Nullable OnLevelValue; - CHIP_ERROR TestReadsTheMinLevelAttribute_4() + CHIP_ERROR TestReadsTheOnLevelAttributeFromTheDut_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24858,16 +24949,19 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MinLevel attribute Error: %@", err); + [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OnLevel attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("minLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("minLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minLevel", [value unsignedCharValue], 254U)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("onLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onLevel", [value unsignedCharValue], 254U)); + } { - MinLevelFeatureMapNotSupportedValue = value; + OnLevelValue = value; } NextTest(); @@ -24875,9 +24969,8 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull MaxLevelValue; - CHIP_ERROR TestReadsTheMaxLevelAttribute_5() + CHIP_ERROR TestWritesTheOnLevelAttributeOnTheDut_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24885,30 +24978,54 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MaxLevel attribute Error: %@", err); + id onLevelArgument; + onLevelArgument = mOnLevelConfigValue.HasValue() ? [NSNumber numberWithUnsignedChar:mOnLevelConfigValue.Value()] + : [NSNumber numberWithUnsignedChar:5U]; + [cluster writeAttributeOnLevelWithValue:onLevelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"writes the OnLevel attribute on the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheOnLevelAttributeFromTheDut_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OnLevel attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("MaxLevel", actualValue, 254U)); + VerifyOrReturn(CheckValueNonNull("OnLevel", actualValue)); + VerifyOrReturn( + CheckValue("OnLevel", actualValue, mOnLevelConfigValue.HasValue() ? mOnLevelConfigValue.Value() : 5U)); } + if (value != nil) { - VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], MinLevelValue)); - { - MaxLevelValue = value; + VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); } + VerifyOrReturn(CheckConstraintNotValue("onLevel", value, OnLevelValue)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull MaxLevelFeatureMapNotSupportedValue; + NSNumber * _Nullable OnTransitionTimeValue; - CHIP_ERROR TestReadsTheMaxLevelAttribute_6() + CHIP_ERROR TestReadsTheOnTransitionTimeAttributeFromTheDut_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24916,17 +25033,19 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MaxLevel attribute Error: %@", err); + [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OnTransitionTime attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); - VerifyOrReturn( - CheckConstraintMinValue("maxLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); - VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("onTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onTransitionTime", [value unsignedShortValue], 65535U)); + } { - MaxLevelFeatureMapNotSupportedValue = value; + OnTransitionTimeValue = value; } NextTest(); @@ -24935,7 +25054,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4b4cReadsTheCurrentLevelAttribute_7() + CHIP_ERROR TestWritesTheOnTransitionTimeAttributeOnTheDut_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24943,25 +25062,23 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b & 4C Reads the CurrentLevel attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + id onTransitionTimeArgument; + onTransitionTimeArgument = mOnTransitionTimeConfigValue.HasValue() + ? [NSNumber numberWithUnsignedShort:mOnTransitionTimeConfigValue.Value()] + : [NSNumber numberWithUnsignedShort:5U]; + [cluster writeAttributeOnTransitionTimeWithValue:onTransitionTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the OnTransitionTime attribute on the DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], MinLevelValue)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], MaxLevelValue)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4b4cReadsTheCurrentLevelAttribute_8() + CHIP_ERROR TestReadsTheOnTransitionTimeAttributeFromTheDut_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24969,27 +25086,31 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b & 4C Reads the CurrentLevel attribute Error: %@", err); + [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OnTransitionTime attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("OnTransitionTime", actualValue)); + VerifyOrReturn(CheckValue("OnTransitionTime", actualValue, + mOnTransitionTimeConfigValue.HasValue() ? mOnTransitionTimeConfigValue.Value() : 5U)); + } if (value != nil) { - VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue( - "currentLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); - VerifyOrReturn(CheckConstraintMaxValue( - "currentLevel", [value unsignedCharValue], MaxLevelFeatureMapNotSupportedValue)); + VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); } + VerifyOrReturn(CheckConstraintNotValue("onTransitionTime", value, OnTransitionTimeValue)); NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nullable OffTransitionTimeValue; - CHIP_ERROR TestReadsTheCurrentFrequencyAttribute_9() + CHIP_ERROR TestReadsTheOffTransitionTimeAttributeFromTheDut_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24997,67 +25118,19 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentFrequency attribute Error: %@", err); + [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OffTransitionTime attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], 65535U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull MinFrequencyValue; - - CHIP_ERROR TestReadsTheMinFrequencyAttribute_10() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MinFrequency attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + if (value != nil) { - VerifyOrReturn(CheckConstraintType("minFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("minFrequency", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minFrequency", [value unsignedShortValue], 65535U)); - { - MinFrequencyValue = value; + VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("offTransitionTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("offTransitionTime", [value unsignedShortValue], 65535U)); } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull MaxFrequencyValue; - - CHIP_ERROR TestReadsTheMaxFrequencyAttribute_11() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the MaxFrequency attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("maxFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("maxFrequency", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("maxFrequency", [value unsignedShortValue], 65535U)); { - MaxFrequencyValue = value; + OffTransitionTimeValue = value; } NextTest(); @@ -25066,7 +25139,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7b7cReadsTheCurrentFrequencyAttribute_12() + CHIP_ERROR TestWritesTheOffTransitionTimeAttributeOnTheDut_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25074,22 +25147,23 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7b & 7C Reads the CurrentFrequency attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + id offTransitionTimeArgument; + offTransitionTimeArgument = mOffTransitionTimeConfigValue.HasValue() + ? [NSNumber numberWithUnsignedShort:mOffTransitionTimeConfigValue.Value()] + : [NSNumber numberWithUnsignedShort:10U]; + [cluster writeAttributeOffTransitionTimeWithValue:offTransitionTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the OffTransitionTime attribute on the DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("currentFrequency", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("currentFrequency", [value unsignedShortValue], MinFrequencyValue)); - VerifyOrReturn(CheckConstraintMaxValue("currentFrequency", [value unsignedShortValue], MaxFrequencyValue)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheOnOffTransitionTimeAttribute_13() + CHIP_ERROR TestReadsTheOffTransitionTimeAttributeFromTheDut_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25097,22 +25171,31 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnOffTransitionTime attribute Error: %@", err); + [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OffTransitionTime attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("onOffTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onOffTransitionTime", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("OffTransitionTime", actualValue)); + VerifyOrReturn(CheckValue("OffTransitionTime", actualValue, + mOffTransitionTimeConfigValue.HasValue() ? mOffTransitionTimeConfigValue.Value() : 10U)); + } + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); + } + VerifyOrReturn(CheckConstraintNotValue("offTransitionTime", value, OffTransitionTimeValue)); NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nullable DefaultMoveRatevalue; - CHIP_ERROR TestReadsTheOnLevelAttribute_14() + CHIP_ERROR TestReadsTheDefaultMoveRateAttributeFromTheDut_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25120,16 +25203,19 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnLevel attribute Error: %@", err); + [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the DefaultMoveRate attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("onLevel", [value unsignedCharValue], MinLevelValue)); - VerifyOrReturn(CheckConstraintMaxValue("onLevel", [value unsignedCharValue], MaxLevelValue)); + VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("defaultMoveRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("defaultMoveRate", [value unsignedCharValue], 255U)); + } + { + DefaultMoveRatevalue = value; } NextTest(); @@ -25138,7 +25224,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheOnLevelAttribute_15() + CHIP_ERROR TestWritesTheDefaultMoveRateAttributeOnTheDut_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25146,27 +25232,23 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnLevel attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + id defaultMoveRateArgument; + defaultMoveRateArgument = mDefaultMoveRateConfigValue.HasValue() + ? [NSNumber numberWithUnsignedChar:mDefaultMoveRateConfigValue.Value()] + : [NSNumber numberWithUnsignedChar:111U]; + [cluster writeAttributeDefaultMoveRateWithValue:defaultMoveRateArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the DefaultMoveRate attribute on the DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); - VerifyOrReturn( - CheckConstraintMinValue("onLevel", [value unsignedCharValue], MinLevelFeatureMapNotSupportedValue)); - VerifyOrReturn( - CheckConstraintMaxValue("onLevel", [value unsignedCharValue], MaxLevelFeatureMapNotSupportedValue)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheOnTransitionTimeAttribute_16() + CHIP_ERROR TestReadsTheDefaultMoveRateAttributeFromTheDut_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25174,25 +25256,31 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnTransitionTime attribute Error: %@", err); + [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the DefaultMoveRate attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("DefaultMoveRate", actualValue)); + VerifyOrReturn(CheckValue("DefaultMoveRate", actualValue, + mDefaultMoveRateConfigValue.HasValue() ? mDefaultMoveRateConfigValue.Value() : 111U)); + } if (value != nil) { - VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("onTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onTransitionTime", [value unsignedShortValue], 65535U)); + VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); } + VerifyOrReturn(CheckConstraintNotValue("defaultMoveRate", value, DefaultMoveRatevalue)); NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nullable StartUpCurrentLevelValue; - CHIP_ERROR TestReadsTheOffTransitionTimeAttribute_17() + CHIP_ERROR TestReadsTheStartUpCurrentLevelAttributeFromTheDut_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25200,16 +25288,19 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OffTransitionTime attribute Error: %@", err); + [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the StartUpCurrentLevel attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("offTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("offTransitionTime", [value unsignedShortValue], 65535U)); + VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("startUpCurrentLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("startUpCurrentLevel", [value unsignedCharValue], 255U)); + } + { + StartUpCurrentLevelValue = value; } NextTest(); @@ -25218,7 +25309,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheDefaultMoveRateAttribute_18() + CHIP_ERROR TestWritesTheStartUpCurrentLevelAttributeOnTheDut_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25226,25 +25317,23 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the DefaultMoveRate attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + id startUpCurrentLevelArgument; + startUpCurrentLevelArgument = mStartUpCurrentLevelConfigValue.HasValue() + ? [NSNumber numberWithUnsignedChar:mStartUpCurrentLevelConfigValue.Value()] + : [NSNumber numberWithUnsignedChar:5U]; + [cluster writeAttributeStartUpCurrentLevelWithValue:startUpCurrentLevelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"writes the StartUpCurrentLevel attribute on the DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("defaultMoveRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("defaultMoveRate", [value unsignedCharValue], 255U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheOptionsAttribute_19() + CHIP_ERROR TestReadsTheStartUpCurrentLevelAttributeFromTheDut_18() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25252,24 +25341,30 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the Options attribute Error: %@", err); + [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"reads the StartUpCurrentLevel attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("Options", actualValue, 0U)); + VerifyOrReturn(CheckValueNonNull("StartUpCurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("StartUpCurrentLevel", actualValue, + mStartUpCurrentLevelConfigValue.HasValue() ? mStartUpCurrentLevelConfigValue.Value() : 5U)); } + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); + } + VerifyOrReturn(CheckConstraintNotValue("startUpCurrentLevel", value, StartUpCurrentLevelValue)); - VerifyOrReturn(CheckConstraintType("options", "bitmap8", "bitmap8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheStartUpCurrentLevelAttribute_20() + CHIP_ERROR TestWritesBackDefaultValueOfOnOffTransitionTimeAttribute_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25277,46 +25372,36 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the StartUpCurrentLevel attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + id onOffTransitionTimeArgument; + onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"writes back default value of OnOffTransitionTime attribute Error: %@", err); - VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("startUpCurrentLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("startUpCurrentLevel", [value unsignedCharValue], 255U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_LVL_2_2 : public TestCommandBridge { +class Test_TC_LVL_3_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_2_2() - : TestCommandBridge("Test_TC_LVL_2_2") + Test_TC_LVL_3_1() + : TestCommandBridge("Test_TC_LVL_3_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("OnOffTransitionTimeConfigValue", 0, UINT16_MAX, &mOnOffTransitionTimeConfigValue); - AddArgument("OnLevelConfigValue", 0, UINT8_MAX, &mOnLevelConfigValue); - AddArgument("OnTransitionTimeConfigValue", 0, UINT16_MAX, &mOnTransitionTimeConfigValue); - AddArgument("OffTransitionTimeConfigValue", 0, UINT16_MAX, &mOffTransitionTimeConfigValue); - AddArgument("DefaultMoveRateConfigValue", 0, UINT8_MAX, &mDefaultMoveRateConfigValue); - AddArgument("StartUpCurrentLevelConfigValue", 0, UINT8_MAX, &mStartUpCurrentLevelConfigValue); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_2_2() {} + ~Test_TC_LVL_3_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -25324,11 +25409,11 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_3_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_3_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -25345,206 +25430,411 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the OnOffTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestReadsTheOnOffTransitionTimeAttributeFromTheDut_1(); + err = TestPreconditionSendOnCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : writes the OnOffTransitionTime attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestWritesTheOnOffTransitionTimeAttributeOnTheDut_2(); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the OnOffTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes 0 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { NextTest(); return; } - err = TestReadsTheOnOffTransitionTimeAttributeFromTheDut_3(); + err = TestThWrites0ToTheOptionsAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the OnLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0011")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends Off command to DUT\n"); + if (ShouldSkip("LVL.S.C04.Rsp && OO.S.C00.Rsp")) { NextTest(); return; } - err = TestReadsTheOnLevelAttributeFromTheDut_4(); + err = TestThSendsOffCommandToDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : writes the OnLevel attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A0011")) { + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends a MoveToLevelWithOnOff command to DUT, with Level =50 and TransitionTime =0 " + "(immediate)\n"); + if (ShouldSkip("LVL.S.C04.Rsp")) { NextTest(); return; } - err = TestWritesTheOnLevelAttributeOnTheDut_5(); + err = TestThSendsAMoveToLevelWithOnOffCommandToDutWithLevel50AndTransitionTime0Immediate_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the OnLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0011")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads OnOff attribute (On/Off cluster) from DUT\n"); + if (ShouldSkip("OO.S.A0000 && LVL.S.C04.Rsp")) { NextTest(); return; } - err = TestReadsTheOnLevelAttributeFromTheDut_6(); + err = TestThReadsOnOffAttributeOnOffClusterFromDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads the OnTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0012")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C04.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestReadsTheOnTransitionTimeAttributeFromTheDut_7(); + err = TestThReadsCurrentLevelAttributeFromDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Writes the OnTransitionTime attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A0012")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : TH sends On command to DUT\n"); + if (ShouldSkip("LVL.S.C04.Rsp && OO.S.C01.Rsp")) { NextTest(); return; } - err = TestWritesTheOnTransitionTimeAttributeOnTheDut_8(); + err = TestThSendsOnCommandToDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the OnTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0012")) { + ChipLogProgress(chipTool, + " ***** Test Step 9 : TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestReadsTheOnTransitionTimeAttributeFromTheDut_9(); + err = TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the OffTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0013")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestReadsTheOffTransitionTimeAttributeFromTheDut_10(); + err = TestThReadsCurrentLevelAttributeFromDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Writes the OffTransitionTime attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A0013")) { + ChipLogProgress(chipTool, + " ***** Test Step 11 : TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = 300 (30 s). " + "This means the level should increase by 150 units in 30s, so 5 units/s\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestWritesTheOffTransitionTimeAttributeOnTheDut_11(); + err = TestThSendsAMoveToLevelCommandToTheDutWithLevel200AndTransitionTime30030SThisMeansTheLevelShouldIncreaseBy150UnitsIn30sSo5UnitsS_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the OffTransitionTime attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0013")) { - NextTest(); - return; - } - err = TestReadsTheOffTransitionTimeAttributeFromTheDut_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 10000ms\n"); + err = TestWait10000ms_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the DefaultMoveRate attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0014")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestReadsTheDefaultMoveRateAttributeFromTheDut_13(); + err = TestThReadsCurrentLevelAttributeFromDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Writes the DefaultMoveRate attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A0014")) { - NextTest(); - return; - } - err = TestWritesTheDefaultMoveRateAttributeOnTheDut_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 10000ms\n"); + err = TestWait10000ms_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Reads the DefaultMoveRate attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0014")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestReadsTheDefaultMoveRateAttributeFromTheDut_15(); + err = TestThReadsCurrentLevelAttributeFromDut_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Reads the StartUpCurrentLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A4000")) { + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 10000ms\n"); + err = TestWait10000ms_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestReadsTheStartUpCurrentLevelAttributeFromTheDut_16(); + err = TestThReadsCurrentLevelAttributeFromDut_17(); break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : writes the StartUpCurrentLevel attribute on the DUT\n"); - if (ShouldSkip("LVL.S.A4000")) { + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 5000ms\n"); + err = TestWait5000ms_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestWritesTheStartUpCurrentLevelAttributeOnTheDut_17(); + err = TestThReadsCurrentLevelAttributeFromDut_19(); break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : reads the StartUpCurrentLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A4000")) { + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate")) { NextTest(); return; } - err = TestReadsTheStartUpCurrentLevelAttributeFromTheDut_18(); + err = TestThReadsCurrentLevelAttributeFromDut_20(); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : writes back default value of OnOffTransitionTime attribute\n"); - if (ShouldSkip("LVL.S.A0010")) { + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : TH writes 0 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { NextTest(); return; } - err = TestWritesBackDefaultValueOfOnOffTransitionTimeAttribute_19(); + err = TestThWrites0ToTheOptionsAttribute_21(); break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestThReadsOptionsAttribute_22(); break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestThSendsOnCommandToDut_23(); break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAMoveToLevelCommandToTheDutWith_24(); break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_25(); break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : TH sends Off command to DUT\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsOffCommandToDut_26(); break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAMoveToLevelCommandToTheDutWith_27(); break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_28(); break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAMoveToLevelCommandToTheDutWith_29(); break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_30(); break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAMoveToLevelCommandToTheDutWith_31(); break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_32(); break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : TH writes 1 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestThWrites1ToTheOptionsAttribute_33(); break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : TH reads Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestThReadsOptionsAttribute_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestThSendsOnCommandToDut_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAMoveToLevelCommandToTheDutWith_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : TH sends Off command to DUT\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsOffCommandToDut_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAMoveToLevelCommandToTheDutWith_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAMoveToLevelCommandToTheDutWith_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : TH sends a MoveToLevel command to the DUT with\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAMoveToLevelCommandToTheDutWith_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Precondition send Off Command\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestPreconditionSendOffCommand_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("OO.S.A0000")) { + NextTest(); + return; + } + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_46(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -25567,6 +25857,87 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -25580,17 +25951,11 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 20; + const uint16_t mTestCount = 47; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mOnOffTransitionTimeConfigValue; - chip::Optional mOnLevelConfigValue; - chip::Optional mOnTransitionTimeConfigValue; - chip::Optional mOffTransitionTimeConfigValue; - chip::Optional mDefaultMoveRateConfigValue; - chip::Optional mStartUpCurrentLevelConfigValue; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -25599,59 +25964,47 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nonnull OnOffTransitionTimeValue; - CHIP_ERROR TestReadsTheOnOffTransitionTimeAttributeFromTheDut_1() + CHIP_ERROR TestPreconditionSendOnCommand_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnOffTransitionTime attribute from the DUT Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Precondition Send On Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("onOffTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onOffTransitionTime", [value unsignedShortValue], 65535U)); - { - OnOffTransitionTimeValue = value; - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheOnOffTransitionTimeAttributeOnTheDut_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id onOffTransitionTimeArgument; - onOffTransitionTimeArgument = mOnOffTransitionTimeConfigValue.HasValue() - ? [NSNumber numberWithUnsignedShort:mOnOffTransitionTimeConfigValue.Value()] - : [NSNumber numberWithUnsignedShort:10U]; - [cluster writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"writes the OnOffTransitionTime attribute on the DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheOnOffTransitionTimeAttributeFromTheDut_3() + CHIP_ERROR TestThWrites0ToTheOptionsAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25659,57 +26012,38 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnOffTransitionTime attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOffTransitionTime", actualValue, - mOnOffTransitionTimeConfigValue.HasValue() ? mOnOffTransitionTimeConfigValue.Value() : 10U)); - } + id optionsArgument; + optionsArgument = [NSNumber numberWithUnsignedChar:0U]; + [cluster writeAttributeOptionsWithValue:optionsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes 0 to the Options attribute Error: %@", err); - VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintNotValue("onOffTransitionTime", value, OnOffTransitionTimeValue)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable OnLevelValue; - CHIP_ERROR TestReadsTheOnLevelAttributeFromTheDut_4() + CHIP_ERROR TestThSendsOffCommandToDut_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnLevel attribute from the DUT Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Off command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("onLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onLevel", [value unsignedCharValue], 254U)); - } - { - OnLevelValue = value; - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheOnLevelAttributeOnTheDut_5() + CHIP_ERROR TestThSendsAMoveToLevelWithOnOffCommandToDutWithLevel50AndTransitionTime0Immediate_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25717,12 +26051,16 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id onLevelArgument; - onLevelArgument = mOnLevelConfigValue.HasValue() ? [NSNumber numberWithUnsignedChar:mOnLevelConfigValue.Value()] - : [NSNumber numberWithUnsignedChar:5U]; - [cluster writeAttributeOnLevelWithValue:onLevelArgument + __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:50U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithOnOffWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"writes the OnLevel attribute on the DUT Error: %@", err); + NSLog(@"TH sends a MoveToLevelWithOnOff command to DUT, with Level =50 and TransitionTime =0 " + @"(immediate) Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -25732,39 +26070,29 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheOnLevelAttributeFromTheDut_6() + CHIP_ERROR TestThReadsOnOffAttributeOnOffClusterFromDut_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnLevel attribute from the DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads OnOff attribute (On/Off cluster) from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("OnLevel", actualValue)); - VerifyOrReturn( - CheckValue("OnLevel", actualValue, mOnLevelConfigValue.HasValue() ? mOnLevelConfigValue.Value() : 5U)); - } - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("onLevel", "int8u", "int8u")); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } - VerifyOrReturn(CheckConstraintNotValue("onLevel", value, OnLevelValue)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable OnTransitionTimeValue; - CHIP_ERROR TestReadsTheOnTransitionTimeAttributeFromTheDut_7() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25772,19 +26100,15 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnTransitionTime attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("onTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onTransitionTime", [value unsignedShortValue], 65535U)); - } { - OnTransitionTimeValue = value; + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); } NextTest(); @@ -25793,31 +26117,24 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheOnTransitionTimeAttributeOnTheDut_8() + CHIP_ERROR TestThSendsOnCommandToDut_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id onTransitionTimeArgument; - onTransitionTimeArgument = mOnTransitionTimeConfigValue.HasValue() - ? [NSNumber numberWithUnsignedShort:mOnTransitionTimeConfigValue.Value()] - : [NSNumber numberWithUnsignedShort:5U]; - [cluster writeAttributeOnTransitionTimeWithValue:onTransitionTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the OnTransitionTime attribute on the DUT Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends On command to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheOnTransitionTimeAttributeFromTheDut_9() + CHIP_ERROR TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25825,31 +26142,25 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OnTransitionTime attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("OnTransitionTime", actualValue)); - VerifyOrReturn(CheckValue("OnTransitionTime", actualValue, - mOnTransitionTimeConfigValue.HasValue() ? mOnTransitionTimeConfigValue.Value() : 5U)); - } - if (value != nil) { + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:50U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate) Error: %@", + err); - VerifyOrReturn(CheckConstraintType("onTransitionTime", "int16u", "int16u")); - } - VerifyOrReturn(CheckConstraintNotValue("onTransitionTime", value, OnTransitionTimeValue)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable OffTransitionTimeValue; - CHIP_ERROR TestReadsTheOffTransitionTimeAttributeFromTheDut_10() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25857,19 +26168,15 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OffTransitionTime attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("offTransitionTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("offTransitionTime", [value unsignedShortValue], 65535U)); - } { - OffTransitionTimeValue = value; + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); } NextTest(); @@ -25878,7 +26185,8 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheOffTransitionTimeAttributeOnTheDut_11() + CHIP_ERROR + TestThSendsAMoveToLevelCommandToTheDutWithLevel200AndTransitionTime30030SThisMeansTheLevelShouldIncreaseBy150UnitsIn30sSo5UnitsS_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25886,23 +26194,33 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id offTransitionTimeArgument; - offTransitionTimeArgument = mOffTransitionTimeConfigValue.HasValue() - ? [NSNumber numberWithUnsignedShort:mOffTransitionTimeConfigValue.Value()] - : [NSNumber numberWithUnsignedShort:10U]; - [cluster writeAttributeOffTransitionTimeWithValue:offTransitionTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the OffTransitionTime attribute on the DUT Error: %@", err); + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:200U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = 300 (30 s). This " + @"means the level should increase by 150 units in 30s, so 5 units/s Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheOffTransitionTimeAttributeFromTheDut_12() + CHIP_ERROR TestWait10000ms_12() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25910,31 +26228,31 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OffTransitionTime attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("OffTransitionTime", actualValue)); - VerifyOrReturn(CheckValue("OffTransitionTime", actualValue, - mOffTransitionTimeConfigValue.HasValue() ? mOffTransitionTimeConfigValue.Value() : 10U)); - } if (value != nil) { - VerifyOrReturn(CheckConstraintType("offTransitionTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); } - VerifyOrReturn(CheckConstraintNotValue("offTransitionTime", value, OffTransitionTimeValue)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable DefaultMoveRatevalue; - CHIP_ERROR TestReadsTheDefaultMoveRateAttributeFromTheDut_13() + CHIP_ERROR TestWait10000ms_14() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25942,19 +26260,15 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the DefaultMoveRate attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("defaultMoveRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("defaultMoveRate", [value unsignedCharValue], 255U)); - } - { - DefaultMoveRatevalue = value; + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 127U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 173U)); } NextTest(); @@ -25963,7 +26277,14 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheDefaultMoveRateAttributeOnTheDut_14() + CHIP_ERROR TestWait10000ms_16() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25971,23 +26292,31 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id defaultMoveRateArgument; - defaultMoveRateArgument = mDefaultMoveRateConfigValue.HasValue() - ? [NSNumber numberWithUnsignedChar:mDefaultMoveRateConfigValue.Value()] - : [NSNumber numberWithUnsignedChar:111U]; - [cluster writeAttributeDefaultMoveRateWithValue:defaultMoveRateArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes the DefaultMoveRate attribute on the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 170U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 200U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheDefaultMoveRateAttributeFromTheDut_15() + CHIP_ERROR TestWait5000ms_18() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25995,31 +26324,49 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the DefaultMoveRate attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("DefaultMoveRate", actualValue)); - VerifyOrReturn(CheckValue("DefaultMoveRate", actualValue, - mDefaultMoveRateConfigValue.HasValue() ? mDefaultMoveRateConfigValue.Value() : 111U)); + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); } - if (value != nil) { - VerifyOrReturn(CheckConstraintType("defaultMoveRate", "int8u", "int8u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_20() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); } - VerifyOrReturn(CheckConstraintNotValue("defaultMoveRate", value, DefaultMoveRatevalue)); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable StartUpCurrentLevelValue; - CHIP_ERROR TestReadsTheStartUpCurrentLevelAttributeFromTheDut_16() + CHIP_ERROR TestThWrites0ToTheOptionsAttribute_21() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -26027,19 +26374,170 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the StartUpCurrentLevel attribute from the DUT Error: %@", err); + id optionsArgument; + optionsArgument = [NSNumber numberWithUnsignedChar:0U]; + [cluster writeAttributeOptionsWithValue:optionsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes 0 to the Options attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionsAttribute_22() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Options attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { + { + id actualValue = value; + VerifyOrReturn(CheckValue("Options", actualValue, 0U)); + } - VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("startUpCurrentLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("startUpCurrentLevel", [value unsignedCharValue], 255U)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsOnCommandToDut_23() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends On command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_24() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:100U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_25() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsOffCommandToDut_26() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Off command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_27() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:120U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_28() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { - StartUpCurrentLevelValue = value; + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); } NextTest(); @@ -26048,7 +26546,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheStartUpCurrentLevelAttributeOnTheDut_17() + CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_29() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -26056,23 +26554,24 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id startUpCurrentLevelArgument; - startUpCurrentLevelArgument = mStartUpCurrentLevelConfigValue.HasValue() - ? [NSNumber numberWithUnsignedChar:mStartUpCurrentLevelConfigValue.Value()] - : [NSNumber numberWithUnsignedChar:5U]; - [cluster writeAttributeStartUpCurrentLevelWithValue:startUpCurrentLevelArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"writes the StartUpCurrentLevel attribute on the DUT Error: %@", err); + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:140U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheStartUpCurrentLevelAttributeFromTheDut_18() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_30() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -26080,22 +26579,66 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads the StartUpCurrentLevel attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("StartUpCurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("StartUpCurrentLevel", actualValue, - mStartUpCurrentLevelConfigValue.HasValue() ? mStartUpCurrentLevelConfigValue.Value() : 5U)); + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); } - if (value != nil) { - VerifyOrReturn(CheckConstraintType("startUpCurrentLevel", "int8u", "int8u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_31() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:160U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:1U]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_32() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 160U)); } - VerifyOrReturn(CheckConstraintNotValue("startUpCurrentLevel", value, StartUpCurrentLevelValue)); NextTest(); }]; @@ -26103,7 +26646,7 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesBackDefaultValueOfOnOffTransitionTimeAttribute_19() + CHIP_ERROR TestThWrites1ToTheOptionsAttribute_33() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -26111,419 +26654,534 @@ class Test_TC_LVL_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id onOffTransitionTimeArgument; - onOffTransitionTimeArgument = [NSNumber numberWithUnsignedShort:0U]; - [cluster writeAttributeOnOffTransitionTimeWithValue:onOffTransitionTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"writes back default value of OnOffTransitionTime attribute Error: %@", err); + id optionsArgument; + optionsArgument = [NSNumber numberWithUnsignedChar:1U]; + [cluster writeAttributeOptionsWithValue:optionsArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes 1 to the Options attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class Test_TC_LVL_3_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_3_1() - : TestCommandBridge("Test_TC_LVL_3_1") - , mTestIndex(0) + CHIP_ERROR TestThReadsOptionsAttribute_34() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Options attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Options", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_3_1() {} + CHIP_ERROR TestThSendsOnCommandToDut_35() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends On command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_36() { - CHIP_ERROR err = CHIP_NO_ERROR; + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_3_1\n"); - } + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:100U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_3_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - Wait(); + NextTest(); + }]; - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestPreconditionSendOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes 0 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { - NextTest(); - return; - } - err = TestThWrites0ToTheOptionsAttribute_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends Off command to DUT\n"); - if (ShouldSkip("LVL.S.C04.Rsp && OO.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsOffCommandToDut_4(); - break; - case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : TH sends a MoveToLevelWithOnOff command to DUT, with Level =50 and TransitionTime =0 " - "(immediate)\n"); - if (ShouldSkip("LVL.S.C04.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAMoveToLevelWithOnOffCommandToDutWithLevel50AndTransitionTime0Immediate_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads OnOff attribute (On/Off cluster) from DUT\n"); - if (ShouldSkip("OO.S.A0000 && LVL.S.C04.Rsp")) { - NextTest(); - return; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_37() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); } - err = TestThReadsOnOffAttributeOnOffClusterFromDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C04.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH sends On command to DUT\n"); - if (ShouldSkip("LVL.S.C04.Rsp && OO.S.C01.Rsp")) { - NextTest(); - return; + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsOffCommandToDut_38() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Off command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_39() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:120U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_40() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 120U)); } - err = TestThSendsOnCommandToDut_8(); - break; - case 9: - ChipLogProgress(chipTool, - " ***** Test Step 9 : TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_41() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:140U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_42() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 120U)); } - err = TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_43() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:160U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:1U]; + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_44() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 160U)); } - err = TestThReadsCurrentLevelAttributeFromDut_10(); - break; - case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = 300 (30 s). " - "This means the level should increase by 150 units in 30s, so 5 units/s\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.M.VarRate")) { - NextTest(); - return; + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPreconditionSendOffCommand_45() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Precondition send Off Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_46() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } - err = TestThSendsAMoveToLevelCommandToTheDutWithLevel200AndTransitionTime30030SThisMeansTheLevelShouldIncreaseBy150UnitsIn30sSo5UnitsS_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 10000ms\n"); - err = TestWait10000ms_12(); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_4_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LVL_4_1() + : TestCommandBridge("Test_TC_LVL_4_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_LVL_4_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_4_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_4_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 10000ms\n"); - err = TestWait10000ms_14(); + err = TestPreconditionSendOnCommand_1(); break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 10000ms\n"); - err = TestWait10000ms_16(); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes 0 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 5000ms\n"); - err = TestWait5000ms_18(); + err = TestThWrites0ToTheOptionsAttribute_3(); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads the MaxLevel attribute from the DUT\n"); + if (ShouldSkip("LVL.S.A0003")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_19(); + err = TestThReadsTheMaxLevelAttributeFromTheDut_4(); break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate")) { + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends Off command to DUT\n"); + if (ShouldSkip("OO.S.C00.Rsp && LVL.S.C05.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_20(); + err = TestThSendsOffCommandToDut_5(); break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : TH writes 0 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : TH sends a MoveWithOnOff command to DUT, with MoveMode =0x00 (up) and Rate =10 (units/s)\n"); + if (ShouldSkip("LVL.S.C05.Rsp")) { NextTest(); return; } - err = TestThWrites0ToTheOptionsAttribute_21(); + err = TestThSendsAMoveWithOnOffCommandToDutWithMoveMode0x00UpAndRate10UnitsS_6(); break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads OnOff attribute (On/Off cluster) from DUT\n"); + if (ShouldSkip("OO.S.A0000 && LVL.S.C05.Rsp")) { NextTest(); return; } - err = TestThReadsOptionsAttribute_22(); + err = TestThReadsOnOffAttributeOnOffClusterFromDut_7(); break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C05.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestThSendsOnCommandToDut_23(); + err = TestThReadsCurrentLevelAttributeFromDut_8(); break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAMoveToLevelCommandToTheDutWith_24(); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 5000ms\n"); + err = TestWait5000ms_9(); break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C05.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_25(); + err = TestThReadsCurrentLevelAttributeFromDut_10(); break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : TH sends Off command to DUT\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestThSendsOffCommandToDut_26(); + err = TestThSendsOnCommandToDut_11(); break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : TH sends a MoveToLevel command to the DUT with\n"); + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)\n"); if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsAMoveToLevelCommandToTheDutWith_27(); + err = TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_12(); break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : TH reads CurrentLevel attribute from DUT\n"); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads CurrentLevel attribute from DUT\n"); if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_28(); + err = TestThReadsCurrentLevelAttributeFromDut_13(); break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : TH sends a Move command to the DUT with MoveMode =0x00 (up) and Rate =5 (units/s)\n"); + if (ShouldSkip("LVL.S.C01.Rsp")) { NextTest(); return; } - err = TestThSendsAMoveToLevelCommandToTheDutWith_29(); + err = TestThSendsAMoveCommandToTheDutWithMoveMode0x00UpAndRate5UnitsS_14(); break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_30(); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 10s\n"); + err = TestWait10s_15(); break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestThSendsAMoveToLevelCommandToTheDutWith_31(); + err = TestThReadsCurrentLevelAttributeFromDut_16(); break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_32(); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Wait 10s\n"); + err = TestWait10s_17(); break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : TH writes 1 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestThWrites1ToTheOptionsAttribute_33(); + err = TestThReadsCurrentLevelAttributeFromDut_18(); break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : TH reads Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { - NextTest(); - return; - } - err = TestThReadsOptionsAttribute_34(); + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Wait 10s\n"); + err = TestWait10s_19(); break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestThSendsOnCommandToDut_35(); + err = TestThReadsCurrentLevelAttributeFromDut_20(); break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAMoveToLevelCommandToTheDutWith_36(); + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Wait 13s\n"); + err = TestWait13s_21(); break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_37(); + err = TestThReadsCurrentLevelAttributeFromDut_22(); break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : TH sends Off command to DUT\n"); + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Precondition send Off Command\n"); if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsOffCommandToDut_38(); + err = TestPreconditionSendOffCommand_23(); break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestThSendsAMoveToLevelCommandToTheDutWith_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAMoveToLevelCommandToTheDutWith_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : TH sends a MoveToLevel command to the DUT with\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAMoveToLevelCommandToTheDutWith_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Precondition send Off Command\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestPreconditionSendOffCommand_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_46(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_24(); break; } @@ -26611,72 +27269,6 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 25: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 26: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 31: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 32: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 33: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 34: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 35: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 36: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 37: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 38: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 39: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 40: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 41: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 42: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 43: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 44: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 45: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 46: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -26690,7 +27282,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 47; + const uint16_t mTestCount = 25; chip::Optional mNodeId; chip::Optional mCluster; @@ -26765,7 +27357,30 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOffCommandToDut_4() + CHIP_ERROR TestThReadsTheMaxLevelAttributeFromTheDut_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the MaxLevel attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsOffCommandToDut_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -26782,7 +27397,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelWithOnOffCommandToDutWithLevel50AndTransitionTime0Immediate_5() + CHIP_ERROR TestThSendsAMoveWithOnOffCommandToDutWithMoveMode0x00UpAndRate10UnitsS_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -26790,26 +27405,26 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:50U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + __auto_type * params = [[MTRLevelControlClusterMoveWithOnOffParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0U]; + params.rate = [NSNumber numberWithUnsignedChar:10U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithOnOffWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevelWithOnOff command to DUT, with Level =50 and TransitionTime =0 " - @"(immediate) Error: %@", - err); + [cluster + moveWithOnOffWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a MoveWithOnOff command to DUT, with MoveMode =0x00 (up) and Rate =10 (units/s) Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOnOffAttributeOnOffClusterFromDut_6() + CHIP_ERROR TestThReadsOnOffAttributeOnOffClusterFromDut_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -26830,8 +27445,9 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nullable CurrentLevelValue; - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_7() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -26844,10 +27460,12 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); + } { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); + CurrentLevelValue = value; } NextTest(); @@ -26856,7 +27474,39 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOnCommandToDut_8() + CHIP_ERROR TestWait5000ms_9() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_10() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 254U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsOnCommandToDut_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -26873,7 +27523,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_9() + CHIP_ERROR TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -26899,7 +27549,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_10() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -26924,8 +27574,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsAMoveToLevelCommandToTheDutWithLevel200AndTransitionTime30030SThisMeansTheLevelShouldIncreaseBy150UnitsIn30sSo5UnitsS_11() + CHIP_ERROR TestThSendsAMoveCommandToTheDutWithMoveMode0x00UpAndRate5UnitsS_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -26933,33 +27582,31 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:200U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; + __auto_type * params = [[MTRLevelControlClusterMoveParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0U]; + params.rate = [NSNumber numberWithUnsignedChar:5U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = 300 (30 s). This " - @"means the level should increase by 150 units in 30s, so 5 units/s Error: %@", - err); + [cluster moveWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a Move command to the DUT with MoveMode =0x00 (up) and Rate =5 (units/s) Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_12() + CHIP_ERROR TestWait10s_15() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_13() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -26984,14 +27631,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_14() + CHIP_ERROR TestWait10s_17() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_15() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_18() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27016,14 +27663,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_16() + CHIP_ERROR TestWait10s_19() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_17() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_20() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27039,7 +27686,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 170U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 200U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 230U)); } NextTest(); @@ -27048,152 +27695,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait5000ms_18() + CHIP_ERROR TestWait13s_21() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; + value.ms = 13000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_19() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_20() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWrites0ToTheOptionsAttribute_21() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes 0 to the Options attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsOptionsAttribute_22() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Options attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("Options", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsOnCommandToDut_23() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends On command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_24() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:100U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_25() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_22() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27209,7 +27718,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { { id actualValue = value; VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 254U)); } NextTest(); @@ -27218,14 +27727,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOffCommandToDut_26() + CHIP_ERROR TestPreconditionSendOffCommand_23() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Off command to DUT Error: %@", err); + NSLog(@"Precondition send Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -27235,48 +27744,20 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_27() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:120U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_28() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_24() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } NextTest(); @@ -27284,99 +27765,343 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_29() +class Test_TC_LVL_5_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LVL_5_1() + : TestCommandBridge("Test_TC_LVL_5_1") + , mTestIndex(0) { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:140U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_30() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + ~Test_TC_LVL_5_1() {} - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_5_1\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_5_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return CHIP_NO_ERROR; - } + Wait(); - CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_31() - { + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestPreconditionSendOnCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + if (ShouldSkip("OO.S.A0000")) { + NextTest(); + return; + } + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes 0 to the Options attribute\n"); + if (ShouldSkip("LVL.S.A000f")) { + NextTest(); + return; + } + err = TestThWrites0ToTheOptionsAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends Off command to DUT\n"); + if (ShouldSkip("OO.S.C00.Rsp && LVL.S.C06.Rsp")) { + NextTest(); + return; + } + err = TestThSendsOffCommandToDut_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends a StepWithOnOff command to DUT, with StepMode =0x00 (up), StepSize =50 and " + "TransitionTime =0 (immediate)\n"); + if (ShouldSkip("LVL.S.C06.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAStepWithOnOffCommandToDutWithStepMode0x00UpStepSize50AndTransitionTime0Immediate_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads OnOff attribute (On/Off cluster) from DUT\n"); + if (ShouldSkip("OO.S.A0000 && LVL.S.C06.Rsp")) { + NextTest(); + return; + } + err = TestThReadsOnOffAttributeOnOffClusterFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestThSendsOnCommandToDut_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads current level attribute from DUT\n"); + if (ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadsCurrentLevelAttributeFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and " + "TransitionTime =300\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestThSendsAStepCommandToTheDutWithStepMode0x00UpStepSize150AndTransitionTime300_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Wait 10s\n"); + err = TestWait10s_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 10s\n"); + err = TestWait10s_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 10s\n"); + err = TestWait10s_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Wait 5000ms\n"); + err = TestWait5000ms_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : TH reads CurrentLevel attribute from DUT (after DUT has finished the transition)\n"); + if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestThReadsCurrentLevelAttributeFromDutAfterDutHasFinishedTheTransition_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Precondition send Off Command\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestPreconditionSendOffCommand_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("OO.S.A0000")) { + NextTest(); + return; + } + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_21(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + 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 = 22; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestPreconditionSendOnCommand_1() + { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:160U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:1U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Precondition Send On Command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_32() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 160U)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } NextTest(); @@ -27385,7 +28110,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWrites1ToTheOptionsAttribute_33() + CHIP_ERROR TestThWrites0ToTheOptionsAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27394,10 +28119,10 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:1U]; + optionsArgument = [NSNumber numberWithUnsignedChar:0U]; [cluster writeAttributeOptionsWithValue:optionsArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes 1 to the Options attribute Error: %@", err); + NSLog(@"TH writes 0 to the Options attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -27407,38 +28132,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionsAttribute_34() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads Options attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("Options", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsOnCommandToDut_35() + CHIP_ERROR TestThSendsOffCommandToDut_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends On command to DUT Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Off command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -27448,7 +28149,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_36() + CHIP_ERROR TestThSendsAStepWithOnOffCommandToDutWithStepMode0x00UpStepSize50AndTransitionTime0Immediate_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27456,40 +28157,40 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:100U]; + __auto_type * params = [[MTRLevelControlClusterStepWithOnOffParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:0U]; + params.stepSize = [NSNumber numberWithUnsignedChar:50U]; params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + [cluster stepWithOnOffWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a StepWithOnOff command to DUT, with StepMode =0x00 (up), StepSize =50 and " + @"TransitionTime =0 (immediate) Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_37() + CHIP_ERROR TestThReadsOnOffAttributeOnOffClusterFromDut_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads OnOff attribute (On/Off cluster) from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 100U)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } NextTest(); @@ -27498,14 +28199,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOffCommandToDut_38() + CHIP_ERROR TestThSendsOnCommandToDut_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Off command to DUT Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends On command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -27515,7 +28216,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_39() + CHIP_ERROR TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27524,13 +28225,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:120U]; + params.level = [NSNumber numberWithUnsignedChar:50U]; params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; [cluster moveToLevelWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + NSLog(@"TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate) Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -27540,7 +28242,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_40() + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27549,14 +28251,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + NSLog(@"Reads current level attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 120U)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); } NextTest(); @@ -27565,7 +28267,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_41() + CHIP_ERROR TestThSendsAStepCommandToTheDutWithStepMode0x00UpStepSize150AndTransitionTime300_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27573,24 +28275,35 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:140U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + __auto_type * params = [[MTRLevelControlClusterStepParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:0U]; + params.stepSize = [NSNumber numberWithUnsignedChar:150U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + [cluster + stepWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and TransitionTime =300 Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_42() + CHIP_ERROR TestWait10s_11() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27603,10 +28316,10 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 120U)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); } NextTest(); @@ -27615,7 +28328,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelCommandToTheDutWith_43() + CHIP_ERROR TestWait10s_13() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27623,24 +28343,31 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:160U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:1U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to the DUT with Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 127U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 173U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_44() + CHIP_ERROR TestWait10s_15() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -27653,10 +28380,10 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 160U)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 170U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 200U)); } NextTest(); @@ -27665,27 +28392,84 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionSendOffCommand_45() + CHIP_ERROR TestWait5000ms_17() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_18() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition send Off Command Error: %@", err); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_46() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDutAfterDutHasFinishedTheTransition_19() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentLevel attribute from DUT (after DUT has finished the transition) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); + VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPreconditionSendOffCommand_20() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Precondition send Off Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_21() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -27705,11 +28489,11 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { } }; -class Test_TC_LVL_4_1 : public TestCommandBridge { +class Test_TC_LVL_6_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_4_1() - : TestCommandBridge("Test_TC_LVL_4_1") + Test_TC_LVL_6_1() + : TestCommandBridge("Test_TC_LVL_6_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -27719,7 +28503,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_4_1() {} + ~Test_TC_LVL_6_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -27727,11 +28511,11 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_4_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_6_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_4_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_6_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -27772,155 +28556,121 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { err = TestThWrites0ToTheOptionsAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads the MaxLevel attribute from the DUT\n"); - if (ShouldSkip("LVL.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestThReadsTheMaxLevelAttributeFromTheDut_4(); + err = TestThSendsOnCommandToDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends Off command to DUT\n"); - if (ShouldSkip("OO.S.C00.Rsp && LVL.S.C05.Rsp")) { + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)\n"); + if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsOffCommandToDut_5(); + err = TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : TH sends a MoveWithOnOff command to DUT, with MoveMode =0x00 (up) and Rate =10 (units/s)\n"); - if (ShouldSkip("LVL.S.C05.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsAMoveWithOnOffCommandToDutWithMoveMode0x00UpAndRate10UnitsS_6(); + err = TestThReadsCurrentLevelAttributeFromDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads OnOff attribute (On/Off cluster) from DUT\n"); - if (ShouldSkip("OO.S.A0000 && LVL.S.C05.Rsp")) { + ChipLogProgress(chipTool, + " ***** Test Step 7 : TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the " + "Rate field set to 0x05 (5 units/s)\n"); + if (ShouldSkip("LVL.S.C01.Rsp")) { NextTest(); return; } - err = TestThReadsOnOffAttributeOnOffClusterFromDut_7(); + err = TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C05.Rsp && LVL.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 5000ms\n"); + err = TestWait5000ms_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Physically verify that the device has stopped transitioning\n"); + if (ShouldSkip("PICS_USER_PROMPT && LVL.S.C03.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 5000ms\n"); - err = TestWait5000ms_9(); + err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C05.Rsp && LVL.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Sends stop command to DUT\n"); + if (ShouldSkip("LVL.S.C03.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_10(); + err = TestSendsStopCommandToDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.C03.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestThSendsOnCommandToDut_11(); + err = TestThReadsCurrentLevelAttributeFromDut_11(); break; case 12: ChipLogProgress(chipTool, - " ***** Test Step 12 : TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + " ***** Test Step 12 : TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the " + "Rate field set to 0x05 (5 units/s)\n"); + if (ShouldSkip("LVL.S.C01.Rsp")) { NextTest(); return; } - err = TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_12(); + err = TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 5000ms\n"); + err = TestWait5000ms_13(); break; case 14: - ChipLogProgress(chipTool, - " ***** Test Step 14 : TH sends a Move command to the DUT with MoveMode =0x00 (up) and Rate =5 (units/s)\n"); - if (ShouldSkip("LVL.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 14 : TH sends a StopWithOnOff command to the DUT\n"); + if (ShouldSkip("LVL.S.C07.Rsp")) { NextTest(); return; } - err = TestThSendsAMoveCommandToTheDutWithMoveMode0x00UpAndRate5UnitsS_14(); + err = TestThSendsAStopWithOnOffCommandToTheDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 10s\n"); - err = TestWait10s_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Wait 10s\n"); - err = TestWait10s_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Wait 10s\n"); - err = TestWait10s_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : Physically verify that the device has stopped transitioning\n"); + if (ShouldSkip("PICS_USER_PROMPT && LVL.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Wait 13s\n"); - err = TestWait13s_21(); + err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_15(); break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.A0000")) { + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Reads CurrentLevel attribute from DUT\n"); + if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.C07.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_22(); + err = TestReadsCurrentLevelAttributeFromDut_16(); break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Precondition send Off Command\n"); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Precondition send Off Command\n"); if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestPreconditionSendOffCommand_23(); + err = TestPreconditionSendOffCommand_17(); break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Check on/off attribute value is false after off command\n"); + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Check on/off attribute value is false after off command\n"); if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_24(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_18(); break; } @@ -27990,24 +28740,6 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -28021,7 +28753,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 25; + const uint16_t mTestCount = 19; chip::Optional mNodeId; chip::Optional mCluster; @@ -28096,156 +28828,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheMaxLevelAttributeFromTheDut_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the MaxLevel attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("maxLevel", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsOffCommandToDut_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Off command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsAMoveWithOnOffCommandToDutWithMoveMode0x00UpAndRate10UnitsS_6() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveWithOnOffParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0U]; - params.rate = [NSNumber numberWithUnsignedChar:10U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster - moveWithOnOffWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveWithOnOff command to DUT, with MoveMode =0x00 (up) and Rate =10 (units/s) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsOnOffAttributeOnOffClusterFromDut_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads OnOff attribute (On/Off cluster) from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nullable CurrentLevelValue; - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_8() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("currentLevel", "int8u", "int8u")); - } - { - CurrentLevelValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait5000ms_9() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_10() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 254U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsOnCommandToDut_11() + CHIP_ERROR TestThSendsOnCommandToDut_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -28262,7 +28845,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_12() + CHIP_ERROR TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -28288,7 +28871,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_13() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -28313,7 +28896,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveCommandToTheDutWithMoveMode0x00UpAndRate5UnitsS_14() + CHIP_ERROR TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -28328,7 +28911,9 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; [cluster moveWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a Move command to the DUT with MoveMode =0x00 (up) and Rate =5 (units/s) Error: %@", err); + NSLog(@"TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the Rate field set " + @"to 0x05 (5 units/s) Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -28338,14 +28923,23 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_15() + CHIP_ERROR TestWait5000ms_8() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; + value.ms = 5000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_16() + CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_9() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestSendsStopCommandToDut_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -28353,31 +28947,22 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + __auto_type * params = [[MTRLevelControlClusterStopParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster stopWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends stop command to DUT Error: %@", err); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_17() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_18() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -28392,8 +28977,8 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 127U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 173U)); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 64U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 86U)); } NextTest(); @@ -28402,14 +28987,41 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10s_19() + CHIP_ERROR TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_12() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterMoveParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0U]; + params.rate = [NSNumber numberWithUnsignedChar:5U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the Rate field set " + @"to 0x05 (5 units/s) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait5000ms_13() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; + value.ms = 5000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_20() + CHIP_ERROR TestThSendsAStopWithOnOffCommandToTheDut_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -28417,31 +29029,31 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { + __auto_type * params = [[MTRLevelControlClusterStopWithOnOffParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster stopWithOnOffWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a StopWithOnOff command to the DUT Error: %@", err); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 170U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 230U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait13s_21() + CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_15() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 13000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_22() + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -28450,14 +29062,14 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + NSLog(@"Reads CurrentLevel attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 254U)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); } NextTest(); @@ -28466,7 +29078,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionSendOffCommand_23() + CHIP_ERROR TestPreconditionSendOffCommand_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -28483,7 +29095,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_24() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_18() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -28506,11 +29118,11 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { } }; -class Test_TC_LVL_5_1 : public TestCommandBridge { +class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_5_1() - : TestCommandBridge("Test_TC_LVL_5_1") + Test_TC_LOWPOWER_1_1() + : TestCommandBridge("Test_TC_LOWPOWER_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -28520,7 +29132,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_5_1() {} + ~Test_TC_LOWPOWER_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -28528,11 +29140,11 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_5_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LOWPOWER_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_5_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LOWPOWER_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -28549,162 +29161,24 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestPreconditionSendOnCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes 0 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { - NextTest(); - return; - } - err = TestThWrites0ToTheOptionsAttribute_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends Off command to DUT\n"); - if (ShouldSkip("OO.S.C00.Rsp && LVL.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestThSendsOffCommandToDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : TH sends a StepWithOnOff command to DUT, with StepMode =0x00 (up), StepSize =50 and " - "TransitionTime =0 (immediate)\n"); - if (ShouldSkip("LVL.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAStepWithOnOffCommandToDutWithStepMode0x00UpStepSize50AndTransitionTime0Immediate_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads OnOff attribute (On/Off cluster) from DUT\n"); - if (ShouldSkip("OO.S.A0000 && LVL.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestThReadsOnOffAttributeOnOffClusterFromDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestThSendsOnCommandToDut_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads current level attribute from DUT\n"); - if (ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestReadsCurrentLevelAttributeFromDut_9(); - break; - case 10: - ChipLogProgress(chipTool, - " ***** Test Step 10 : TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and " - "TransitionTime =300\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestThSendsAStepCommandToTheDutWithStepMode0x00UpStepSize150AndTransitionTime300_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Wait 10s\n"); - err = TestWait10s_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 10s\n"); - err = TestWait10s_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 10s\n"); - err = TestWait10s_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Wait 5000ms\n"); - err = TestWait5000ms_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_18(); - break; - case 19: - ChipLogProgress(chipTool, - " ***** Test Step 19 : TH reads CurrentLevel attribute from DUT (after DUT has finished the transition)\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDutAfterDutHasFinishedTheTransition_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Precondition send Off Command\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestPreconditionSendOffCommand_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_21(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); break; } @@ -28735,54 +29209,6 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -28796,7 +29222,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 22; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; @@ -28810,195 +29236,339 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestPreconditionSendOnCommand_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition Send On Command Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThWrites0ToTheOptionsAttribute_3() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes 0 to the Options attribute Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65532UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65533UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOffCommandToDut_4() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Off command to DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAStepWithOnOffCommandToDutWithStepMode0x00UpStepSize50AndTransitionTime0Immediate_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterStepWithOnOffParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:0U]; - params.stepSize = [NSNumber numberWithUnsignedChar:50U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster stepWithOnOffWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a StepWithOnOff command to DUT, with StepMode =0x00 (up), StepSize =50 and " - @"TransitionTime =0 (immediate) Error: %@", - err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestThReadsOnOffAttributeOnOffClusterFromDut_6() +class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_KEYPADINPUT_1_2() + : TestCommandBridge("Test_TC_KEYPADINPUT_1_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_KEYPADINPUT_1_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_KEYPADINPUT_1_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_KEYPADINPUT_1_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 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: FeatureMap\n"); + if (ShouldSkip("KEYPADINPUT.S.NV || KEYPADINPUT.S.LK || KEYPADINPUT.S.NK")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 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: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + 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 = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads OnOff attribute (On/Off cluster) from DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); } + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOnCommandToDut_7() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends On command to DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 7UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_8() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:50U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate) Error: %@", - err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_9() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads current level attribute from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); NextTest(); }]; @@ -29006,220 +29576,21 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAStepCommandToTheDutWithStepMode0x00UpStepSize150AndTransitionTime300_10() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterStepParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:0U]; - params.stepSize = [NSNumber numberWithUnsignedChar:150U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster - stepWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and TransitionTime =300 Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait10s_11() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_12() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait10s_13() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_14() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 127U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 173U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait10s_15() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_16() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 170U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 200U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait5000ms_17() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_18() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDutAfterDutHasFinishedTheTransition_19() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT (after DUT has finished the transition) Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 200U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestPreconditionSendOffCommand_20() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition send Off Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_21() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); NextTest(); }]; @@ -29228,11 +29599,11 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { } }; -class Test_TC_LVL_6_1 : public TestCommandBridge { +class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LVL_6_1() - : TestCommandBridge("Test_TC_LVL_6_1") + Test_TC_APPLAUNCHER_1_3() + : TestCommandBridge("Test_TC_APPLAUNCHER_1_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -29242,7 +29613,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LVL_6_1() {} + ~Test_TC_APPLAUNCHER_1_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -29250,11 +29621,11 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LVL_6_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_APPLAUNCHER_1_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LVL_6_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_APPLAUNCHER_1_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -29271,145 +29642,52 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestPreconditionSendOnCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - if (ShouldSkip("OO.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip("APPLAUNCHER.S.AP")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes 0 to the Options attribute\n"); - if (ShouldSkip("LVL.S.A000f")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !APPLAUNCHER.S.AP ")) { NextTest(); return; } - err = TestThWrites0ToTheOptionsAttribute_3(); + err = TestReadTheGlobalAttributeFeatureMap_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestThSendsOnCommandToDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)\n"); - if (ShouldSkip("LVL.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute(CatalogList) in AttributeList\n"); + if (ShouldSkip("APPLAUNCHER.S.A0000")) { NextTest(); return; } - err = TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_5(); + err = TestReadTheOptionalAttributeCatalogListInAttributeList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional attribute(CurrentApp) in AttributeList\n"); + if (ShouldSkip("APPLAUNCHER.S.A0001")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_6(); + err = TestReadTheOptionalAttributeCurrentAppInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the " - "Rate field set to 0x05 (5 units/s)\n"); - if (ShouldSkip("LVL.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 5000ms\n"); - err = TestWait5000ms_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Physically verify that the device has stopped transitioning\n"); - if (ShouldSkip("PICS_USER_PROMPT && LVL.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Sends stop command to DUT\n"); - if (ShouldSkip("LVL.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestSendsStopCommandToDut_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.C03.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsCurrentLevelAttributeFromDut_11(); - break; - case 12: - ChipLogProgress(chipTool, - " ***** Test Step 12 : TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the " - "Rate field set to 0x05 (5 units/s)\n"); - if (ShouldSkip("LVL.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 5000ms\n"); - err = TestWait5000ms_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH sends a StopWithOnOff command to the DUT\n"); - if (ShouldSkip("LVL.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAStopWithOnOffCommandToTheDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Physically verify that the device has stopped transitioning\n"); - if (ShouldSkip("PICS_USER_PROMPT && LVL.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Reads CurrentLevel attribute from DUT\n"); - if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.C07.Rsp && LVL.S.A0000")) { - NextTest(); - return; - } - err = TestReadsCurrentLevelAttributeFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Precondition send Off Command\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestPreconditionSendOffCommand_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_18(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); break; } @@ -29449,36 +29727,6 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -29492,7 +29740,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 19; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -29506,128 +29754,144 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestPreconditionSendOnCommand_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition Send On Command Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThWrites0ToTheOptionsAttribute_3() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id optionsArgument; - optionsArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOptionsWithValue:optionsArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes 0 to the Options attribute Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOnCommandToDut_4() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends On command to DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_5() + CHIP_ERROR TestReadTheOptionalAttributeCatalogListInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; - params.level = [NSNumber numberWithUnsignedChar:50U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate) Error: %@", - err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(CatalogList) in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_6() + CHIP_ERROR TestReadTheOptionalAttributeCurrentAppInAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(CurrentApp) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentLevel", actualValue)); - VerifyOrReturn(CheckValue("CurrentLevel", actualValue, 50U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); NextTest(); }]; @@ -29635,198 +29899,23 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_7() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0U]; - params.rate = [NSNumber numberWithUnsignedChar:5U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the Rate field set " - @"to 0x05 (5 units/s) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait5000ms_8() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_9() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestSendsStopCommandToDut_10() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterStopParams alloc] init]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster stopWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends stop command to DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_11() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentLevel attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 64U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 86U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_12() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0U]; - params.rate = [NSNumber numberWithUnsignedChar:5U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the Rate field set " - @"to 0x05 (5 units/s) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait5000ms_13() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThSendsAStopWithOnOffCommandToTheDut_14() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterStopWithOnOffParams alloc] init]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster stopWithOnOffWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a StopWithOnOff command to the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_15() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_16() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentLevel attribute from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 85U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 115U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestPreconditionSendOffCommand_17() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition send Off Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); NextTest(); }]; @@ -29834,21 +29923,21 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_18() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 3UL)); NextTest(); }]; @@ -29857,11 +29946,11 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { } }; -class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { +class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LOWPOWER_1_1() - : TestCommandBridge("Test_TC_LOWPOWER_1_1") + Test_TC_MEDIAINPUT_1_4() + : TestCommandBridge("Test_TC_MEDIAINPUT_1_4") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -29871,7 +29960,7 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LOWPOWER_1_1() {} + ~Test_TC_MEDIAINPUT_1_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -29879,11 +29968,11 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LOWPOWER_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_1_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LOWPOWER_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_1_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -29900,7 +29989,7 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: @@ -29912,12 +30001,28 @@ class Test_TC_LOWPOWER_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 the optional attribute(InputList) in AttributeList\n"); + if (ShouldSkip("MEDIAINPUT.S.A0000")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInputListInAttributeList_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 optional attribute(CurrentInput) in AttributeList\n"); + if (ShouldSkip("MEDIAINPUT.S.A0001")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeCurrentInputInAttributeList_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; } @@ -29948,6 +30053,12 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -29961,7 +30072,7 @@ class Test_TC_LOWPOWER_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; @@ -29978,11 +30089,13 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput 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); + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -30001,7 +30114,9 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -30009,12 +30124,10 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 1UL)); + NextTest(); }]; @@ -30024,7 +30137,9 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -30032,27 +30147,69 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); - VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 65532UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65533UL)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeInputListInAttributeList_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput 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 optional attribute(InputList) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestReadTheOptionalAttributeCurrentInputInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput 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 optional attribute(CurrentInput) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -30060,23 +30217,24 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -30097,11 +30255,11 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { } }; -class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { +class Test_TC_WAKEONLAN_1_5 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_KEYPADINPUT_1_2() - : TestCommandBridge("Test_TC_KEYPADINPUT_1_2") + Test_TC_WAKEONLAN_1_5() + : TestCommandBridge("Test_TC_WAKEONLAN_1_5") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -30111,7 +30269,7 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_KEYPADINPUT_1_2() {} + ~Test_TC_WAKEONLAN_1_5() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -30119,11 +30277,11 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_KEYPADINPUT_1_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WAKEONLAN_1_5\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_KEYPADINPUT_1_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WAKEONLAN_1_5\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -30140,15 +30298,11 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + 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: FeatureMap\n"); - if (ShouldSkip("KEYPADINPUT.S.NV || KEYPADINPUT.S.LK || KEYPADINPUT.S.NK")) { - NextTest(); - return; - } err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: @@ -30156,12 +30310,20 @@ class Test_TC_KEYPADINPUT_1_2 : 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 the optional attribute(MACAddress) in AttributeList\n"); + if (ShouldSkip("WAKEONLAN.S.A0000")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeMACAddressInAttributeList_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; } @@ -30192,6 +30354,9 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -30205,7 +30370,7 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -30222,13 +30387,11 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan 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); + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -30247,9 +30410,7 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -30257,10 +30418,12 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 7UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; @@ -30270,9 +30433,7 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -30284,7 +30445,7 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); @@ -30293,12 +30454,30 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestReadTheOptionalAttributeMACAddressInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan 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 optional attribute(MACAddress) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -30306,21 +30485,22 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -30328,9 +30508,12 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -30338,11 +30521,11 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { } }; -class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { +class Test_TC_CHANNEL_1_6 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_APPLAUNCHER_1_3() - : TestCommandBridge("Test_TC_APPLAUNCHER_1_3") + Test_TC_CHANNEL_1_6() + : TestCommandBridge("Test_TC_CHANNEL_1_6") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -30352,7 +30535,7 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_APPLAUNCHER_1_3() {} + ~Test_TC_CHANNEL_1_6() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -30360,11 +30543,11 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_APPLAUNCHER_1_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CHANNEL_1_6\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_APPLAUNCHER_1_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CHANNEL_1_6\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -30386,47 +30569,72 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip("APPLAUNCHER.S.AP")) { + if (ShouldSkip("CHANNEL.S.CL || CHANNEL.S.LI")) { NextTest(); return; } err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !APPLAUNCHER.S.AP ")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(ChannelList): AttributeList\n"); + if (ShouldSkip("CHANNEL.S.A0000")) { NextTest(); return; } - err = TestReadTheGlobalAttributeFeatureMap_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_4(); + err = TestReadTheOptionalAttributeChannelListAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute(CatalogList) in AttributeList\n"); - if (ShouldSkip("APPLAUNCHER.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Reading optional attribute(Lineup) in AttributeList\n"); + if (ShouldSkip("CHANNEL.S.A0001")) { NextTest(); return; } - err = TestReadTheOptionalAttributeCatalogListInAttributeList_5(); + err = TestReadingOptionalAttributeLineupInAttributeList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional attribute(CurrentApp) in AttributeList\n"); - if (ShouldSkip("APPLAUNCHER.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional attribute(CurrentChannel): AttributeList\n"); + if (ShouldSkip("CHANNEL.S.A0002")) { NextTest(); return; } - err = TestReadTheOptionalAttributeCurrentAppInAttributeList_6(); + err = TestReadTheOptionalAttributeCurrentChannelAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional command(ChangeChannel) in AcceptedCommandList\n"); + if (ShouldSkip("CHANNEL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandChangeChannelInAcceptedCommandList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress( + chipTool, " ***** Test Step 8 : Read the optional command(ChangeChannelByNumber) in AcceptedCommandList\n"); + if (ShouldSkip("CHANNEL.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandChangeChannelByNumberInAcceptedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command(SkipChannel) in AcceptedCommandList\n"); + if (ShouldSkip("CHANNEL.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandSkipChannelInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("CHANNEL.S.CL || CHANNEL.S.LI")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); break; } @@ -30466,6 +30674,12 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -30479,7 +30693,7 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 11; chip::Optional mNodeId; chip::Optional mCluster; @@ -30496,9 +30710,7 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -30521,9 +30733,7 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -30531,62 +30741,53 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); - } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 3UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_3() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel 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 global attribute: FeatureMap Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() + CHIP_ERROR TestReadTheOptionalAttributeChannelListAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel 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); + NSLog(@"Read the optional attribute(ChannelList): AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); NextTest(); }]; @@ -30594,21 +30795,19 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeCatalogListInAttributeList_5() + CHIP_ERROR TestReadingOptionalAttributeLineupInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel 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 optional attribute(CatalogList) in AttributeList Error: %@", err); + NSLog(@"Reading optional attribute(Lineup) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); NextTest(); }]; @@ -30616,21 +30815,19 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeCurrentAppInAttributeList_6() + CHIP_ERROR TestReadTheOptionalAttributeCurrentChannelAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel 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 optional attribute(CurrentApp) in AttributeList Error: %@", err); + NSLog(@"Read the optional attribute(CurrentChannel): AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); NextTest(); }]; @@ -30638,22 +30835,38 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalCommandChangeChannelInAcceptedCommandList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel 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); + NSLog(@"Read the optional command(ChangeChannel) in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalCommandChangeChannelByNumberInAcceptedCommandList_8() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel 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 optional command(ChangeChannelByNumber) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); NextTest(); @@ -30662,12 +30875,30 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandSkipChannelInAcceptedCommandList_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel 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 optional command(SkipChannel) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -30676,7 +30907,7 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); NextTest(); }]; @@ -30685,11 +30916,11 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { } }; -class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { +class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAINPUT_1_4() - : TestCommandBridge("Test_TC_MEDIAINPUT_1_4") + Test_TC_MEDIAPLAYBACK_1_7() + : TestCommandBridge("Test_TC_MEDIAPLAYBACK_1_7") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -30699,7 +30930,7 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAINPUT_1_4() {} + ~Test_TC_MEDIAPLAYBACK_1_7() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -30707,11 +30938,11 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_1_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAPLAYBACK_1_7\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_1_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAPLAYBACK_1_7\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -30733,6 +30964,10 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.AS || MEDIAPLAYBACK.S.VS")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: @@ -30740,28 +30975,124 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(InputList) in AttributeList\n"); - if (ShouldSkip("MEDIAINPUT.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(StartTime) in AttributeList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0001")) { NextTest(); return; } - err = TestReadTheOptionalAttributeInputListInAttributeList_4(); + err = TestReadTheOptionalAttributeStartTimeInAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute(CurrentInput) in AttributeList\n"); - if (ShouldSkip("MEDIAINPUT.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute(Duration) in AttributeList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0002")) { NextTest(); return; } - err = TestReadTheOptionalAttributeCurrentInputInAttributeList_5(); + err = TestReadTheOptionalAttributeDurationInAttributeList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional attribute(SampledPosition) in AttributeList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0003")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeSampledPositionInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional attribute(PlaybackSpeed) in AttributeList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0004")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributePlaybackSpeedInAttributeList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the optional attribute(SeekRangeEnd) in AttributeList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0005")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeSeekRangeEndInAttributeList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional attribute(SeekRangeStart) in AttributeList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0006")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeSeekRangeStartInAttributeList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read the optional command(StartOver) in AcceptedCommandList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandStartOverInAcceptedCommandList_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Read the optional command(Previous) in AcceptedCommandList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C04.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandPreviousInAcceptedCommandList_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Read the optional command(Next) in AcceptedCommandList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C05.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandNextInAcceptedCommandList_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the optional command(Rewind) in AcceptedCommandList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C06.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandRewindInAcceptedCommandList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional command(FastForward) in AcceptedCommandList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C07.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandFastForwardInAcceptedCommandList_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Read the optional command(SkipForward) in AcceptedCommandList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C08.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandSkipForwardInAcceptedCommandList_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Read the optional command(SkipBackward) in AcceptedCommandList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C09.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandSkipBackwardInAcceptedCommandList_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Read the optional command(Seek) in AcceptedCommandList\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C0B.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandSeekInAcceptedCommandList_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_19(); break; } @@ -30798,6 +31129,42 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -30811,7 +31178,7 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 20; chip::Optional mNodeId; chip::Optional mCluster; @@ -30828,9 +31195,9 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -30853,9 +31220,9 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -30865,7 +31232,7 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 1UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 3UL)); NextTest(); }]; @@ -30876,9 +31243,9 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -30887,6 +31254,7 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); @@ -30899,21 +31267,21 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeInputListInAttributeList_4() + CHIP_ERROR TestReadTheOptionalAttributeStartTimeInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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 optional attribute(InputList) in AttributeList Error: %@", err); + NSLog(@"Read the optional attribute(StartTime) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); NextTest(); }]; @@ -30921,21 +31289,21 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeCurrentInputInAttributeList_5() + CHIP_ERROR TestReadTheOptionalAttributeDurationInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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 optional attribute(CurrentInput) in AttributeList Error: %@", err); + NSLog(@"Read the optional attribute(Duration) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); NextTest(); }]; @@ -30943,24 +31311,21 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() + CHIP_ERROR TestReadTheOptionalAttributeSampledPositionInAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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 optional attribute(SampledPosition) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); NextTest(); }]; @@ -30968,224 +31333,199 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributePlaybackSpeedInAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(PlaybackSpeed) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; - -class Test_TC_WAKEONLAN_1_5 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_WAKEONLAN_1_5() - : TestCommandBridge("Test_TC_WAKEONLAN_1_5") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_WAKEONLAN_1_5() {} - - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadTheOptionalAttributeSeekRangeEndInAttributeList_8() { - CHIP_ERROR err = CHIP_NO_ERROR; + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_WAKEONLAN_1_5\n"); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(SeekRangeEnd) in AttributeList Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WAKEONLAN_1_5\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - Wait(); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 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: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); - break; - case 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 optional attribute(MACAddress) in AttributeList\n"); - if (ShouldSkip("WAKEONLAN.S.A0000")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeMACAddressInAttributeList_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; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestReadTheOptionalAttributeSeekRangeStartInAttributeList_9() { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(SeekRangeStart) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_10() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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 ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + CHIP_ERROR TestReadTheOptionalCommandStartOverInAcceptedCommandList_11() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(StartOver) in AcceptedCommandList Error: %@", err); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalCommandPreviousInAcceptedCommandList_12() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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 optional command(Previous) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheOptionalCommandNextInAcceptedCommandList_13() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(Next) in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 5UL)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestReadTheOptionalCommandRewindInAcceptedCommandList_14() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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 global attribute: FeatureMap Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(Rewind) in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 6UL)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadTheOptionalCommandFastForwardInAcceptedCommandList_15() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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 readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(FastForward) in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 7UL)); NextTest(); }]; @@ -31193,19 +31533,21 @@ class Test_TC_WAKEONLAN_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMACAddressInAttributeList_4() + CHIP_ERROR TestReadTheOptionalCommandSkipForwardInAcceptedCommandList_16() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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 optional attribute(MACAddress) in AttributeList Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(SkipForward) in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 8UL)); NextTest(); }]; @@ -31213,33 +31555,56 @@ class Test_TC_WAKEONLAN_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR TestReadTheOptionalCommandSkipBackwardInAcceptedCommandList_17() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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); + NSLog(@"Read the optional command(SkipBackward) in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 9UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalCommandSeekInAcceptedCommandList_18() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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 optional command(Seek) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 11UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_19() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterWakeOnLan * cluster = [[MTRBaseClusterWakeOnLan alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -31247,12 +31612,9 @@ class Test_TC_WAKEONLAN_1_5 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 10UL)); + NextTest(); }]; @@ -31260,11 +31622,11 @@ class Test_TC_WAKEONLAN_1_5 : public TestCommandBridge { } }; -class Test_TC_CHANNEL_1_6 : public TestCommandBridge { +class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CHANNEL_1_6() - : TestCommandBridge("Test_TC_CHANNEL_1_6") + Test_TC_AUDIOOUTPUT_1_8() + : TestCommandBridge("Test_TC_AUDIOOUTPUT_1_8") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -31274,7 +31636,7 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CHANNEL_1_6() {} + ~Test_TC_AUDIOOUTPUT_1_8() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -31282,11 +31644,11 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CHANNEL_1_6\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_AUDIOOUTPUT_1_8\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CHANNEL_1_6\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_AUDIOOUTPUT_1_8\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -31308,10 +31670,6 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip("CHANNEL.S.CL || CHANNEL.S.LI")) { - NextTest(); - return; - } err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: @@ -31319,61 +31677,24 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(ChannelList): AttributeList\n"); - if (ShouldSkip("CHANNEL.S.A0000")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeChannelListAttributeList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reading optional attribute(Lineup) in AttributeList\n"); - if (ShouldSkip("CHANNEL.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("MEDIAINPUT.S.NU")) { NextTest(); return; } - err = TestReadingOptionalAttributeLineupInAttributeList_5(); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional attribute(CurrentChannel): AttributeList\n"); - if (ShouldSkip("CHANNEL.S.A0002")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeCurrentChannelAttributeList_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional command(ChangeChannel) in AcceptedCommandList\n"); - if (ShouldSkip("CHANNEL.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandChangeChannelInAcceptedCommandList_7(); - break; - case 8: - ChipLogProgress( - chipTool, " ***** Test Step 8 : Read the optional command(ChangeChannelByNumber) in AcceptedCommandList\n"); - if (ShouldSkip("CHANNEL.S.C02.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandChangeChannelByNumberInAcceptedCommandList_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command(SkipChannel) in AcceptedCommandList\n"); - if (ShouldSkip("CHANNEL.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandSkipChannelInAcceptedCommandList_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); - if (ShouldSkip("CHANNEL.S.CL || CHANNEL.S.LI")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip(" !MEDIAINPUT.S.NU ")) { NextTest(); return; } - err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); break; } @@ -31407,18 +31728,6 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -31432,7 +31741,7 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -31449,7 +31758,9 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -31472,7 +31783,9 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -31493,7 +31806,9 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -31502,6 +31817,8 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); @@ -31514,74 +31831,16 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeChannelListAttributeList_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel 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 optional attribute(ChannelList): AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadingOptionalAttributeLineupInAttributeList_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reading optional attribute(Lineup) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeCurrentChannelAttributeList_6() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel 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 optional attribute(CurrentChannel): AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalCommandChangeChannelInAcceptedCommandList_7() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput 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 optional command(ChangeChannel) in AcceptedCommandList Error: %@", err); + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -31594,50 +31853,38 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalCommandChangeChannelByNumberInAcceptedCommandList_8() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel 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 optional command(ChangeChannelByNumber) in AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalCommandSkipChannelInAcceptedCommandList_9() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput 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 optional command(SkipChannel) in AcceptedCommandList Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -31645,9 +31892,12 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -31655,11 +31905,11 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { } }; -class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { +class Test_TC_TGTNAV_1_9 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAPLAYBACK_1_7() - : TestCommandBridge("Test_TC_MEDIAPLAYBACK_1_7") + Test_TC_TGTNAV_1_9() + : TestCommandBridge("Test_TC_TGTNAV_1_9") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -31669,7 +31919,7 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAPLAYBACK_1_7() {} + ~Test_TC_TGTNAV_1_9() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -31677,11 +31927,11 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAPLAYBACK_1_7\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TGTNAV_1_9\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAPLAYBACK_1_7\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TGTNAV_1_9\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -31703,10 +31953,6 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.AS || MEDIAPLAYBACK.S.VS")) { - NextTest(); - return; - } err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: @@ -31714,144 +31960,40 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(StartTime) in AttributeList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(CurrentTarget) in AttributeList\n"); + if (ShouldSkip("TGTNAV.S.A0001")) { NextTest(); return; } - err = TestReadTheOptionalAttributeStartTimeInAttributeList_4(); + err = TestReadTheOptionalAttributeCurrentTargetInAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute(Duration) in AttributeList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0002")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeDurationInAttributeList_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 optional attribute(SampledPosition) in AttributeList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0003")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeSampledPositionInAttributeList_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 attribute(PlaybackSpeed) in AttributeList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0004")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributePlaybackSpeedInAttributeList_7(); + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the optional attribute(SeekRangeEnd) in AttributeList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0005")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeSeekRangeEndInAttributeList_8(); + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional attribute(SeekRangeStart) in AttributeList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0006")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeSeekRangeStartInAttributeList_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read the optional command(StartOver) in AcceptedCommandList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandStartOverInAcceptedCommandList_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Read the optional command(Previous) in AcceptedCommandList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C04.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandPreviousInAcceptedCommandList_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read the optional command(Next) in AcceptedCommandList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C05.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandNextInAcceptedCommandList_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Read the optional command(Rewind) in AcceptedCommandList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandRewindInAcceptedCommandList_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional command(FastForward) in AcceptedCommandList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandFastForwardInAcceptedCommandList_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Read the optional command(SkipForward) in AcceptedCommandList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C08.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandSkipForwardInAcceptedCommandList_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Read the optional command(SkipBackward) in AcceptedCommandList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C09.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandSkipBackwardInAcceptedCommandList_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read the optional command(Seek) in AcceptedCommandList\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C0B.Rsp")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandSeekInAcceptedCommandList_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_19(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -31865,45 +32007,6 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -31917,7 +32020,7 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 20; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -31934,9 +32037,9 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -31959,9 +32062,9 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -31969,10 +32072,12 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 3UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; @@ -31982,9 +32087,9 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -32006,16 +32111,16 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeStartTimeInAttributeList_4() + CHIP_ERROR TestReadTheOptionalAttributeCurrentTargetInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator 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 optional attribute(StartTime) in AttributeList Error: %@", err); + NSLog(@"Read the optional attribute(CurrentTarget) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -32028,21 +32133,21 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeDurationInAttributeList_5() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator 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 optional attribute(Duration) in AttributeList Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); NextTest(); }]; @@ -32050,177 +32155,324 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeSampledPositionInAttributeList_6() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator 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 optional attribute(SampledPosition) in AttributeList Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadTheOptionalAttributePlaybackSpeedInAttributeList_7() +class Test_TC_TGTNAV_8_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TGTNAV_8_2() + : TestCommandBridge("Test_TC_TGTNAV_8_2") + , mTestIndex(0) { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute(PlaybackSpeed) in AttributeList Error: %@", err); + ~Test_TC_TGTNAV_8_2() {} - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TGTNAV_8_2\n"); + } - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TGTNAV_8_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return CHIP_NO_ERROR; + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadTheOptionalAttributeSeekRangeEndInAttributeList_8() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + } - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute(SeekRangeEnd) in AttributeList Error: %@", err); + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; +}; - return CHIP_NO_ERROR; +class Test_TC_APBSC_1_10 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_APBSC_1_10() + : TestCommandBridge("Test_TC_APBSC_1_10") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - CHIP_ERROR TestReadTheOptionalAttributeSeekRangeStartInAttributeList_9() + ~Test_TC_APBSC_1_10() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute(SeekRangeStart) in AttributeList Error: %@", err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_APBSC_1_10\n"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_APBSC_1_10\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + Wait(); - NextTest(); - }]; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read FeatureMap attribute from the DUT\n"); + err = TestReadFeatureMapAttributeFromTheDut_2(); + break; + case 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 optional attribute(VendorName) in AttributeList\n"); + if (ShouldSkip("APBSC.S.A0000")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeVendorNameInAttributeList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute(VendorID) in AttributeList\n"); + if (ShouldSkip("APBSC.S.A0001")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeVendorIDInAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional attribute(ProductID) in AttributeList\n"); + if (ShouldSkip("APBSC.S.A0003")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeProductIDInAttributeList_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; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_10() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 9; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - return CHIP_NO_ERROR; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheOptionalCommandStartOverInAcceptedCommandList_11() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(StartOver) in AcceptedCommandList Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalCommandPreviousInAcceptedCommandList_12() + CHIP_ERROR TestReadFeatureMapAttributeFromTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(Previous) in AcceptedCommandList Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read FeatureMap attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalCommandNextInAcceptedCommandList_13() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(Next) in AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 5UL)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -32228,21 +32480,21 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalCommandRewindInAcceptedCommandList_14() + CHIP_ERROR TestReadTheOptionalAttributeVendorNameInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(Rewind) in AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(VendorName) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 6UL)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); NextTest(); }]; @@ -32250,21 +32502,21 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalCommandFastForwardInAcceptedCommandList_15() + CHIP_ERROR TestReadTheOptionalAttributeVendorIDInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(FastForward) in AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(VendorID) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 7UL)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); NextTest(); }]; @@ -32272,21 +32524,21 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalCommandSkipForwardInAcceptedCommandList_16() + CHIP_ERROR TestReadTheOptionalAttributeProductIDInAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(SkipForward) in AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute(ProductID) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 8UL)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); NextTest(); }]; @@ -32294,56 +32546,37 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalCommandSkipBackwardInAcceptedCommandList_17() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(SkipBackward) in AcceptedCommandList Error: %@", err); + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 9UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalCommandSeekInAcceptedCommandList_18() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback 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 optional command(Seek) in AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 11UL)); - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_19() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -32351,9 +32584,12 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 10UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -32361,11 +32597,11 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { } }; -class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { +class Test_TC_CONTENTLAUNCHER_1_11 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_AUDIOOUTPUT_1_8() - : TestCommandBridge("Test_TC_AUDIOOUTPUT_1_8") + Test_TC_CONTENTLAUNCHER_1_11() + : TestCommandBridge("Test_TC_CONTENTLAUNCHER_1_11") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -32375,7 +32611,7 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_AUDIOOUTPUT_1_8() {} + ~Test_TC_CONTENTLAUNCHER_1_11() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -32383,11 +32619,11 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_AUDIOOUTPUT_1_8\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CONTENTLAUNCHER_1_11\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_AUDIOOUTPUT_1_8\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CONTENTLAUNCHER_1_11\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -32409,6 +32645,10 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.CS || CONTENTLAUNCHER.S.UP")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: @@ -32416,24 +32656,43 @@ class Test_TC_AUDIOOUTPUT_1_8 : 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 the optional attribute(AcceptHeader): AttributeList\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.A0000")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeAcceptHeaderAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - if (ShouldSkip("MEDIAINPUT.S.NU")) { + ChipLogProgress( + chipTool, " ***** Test Step 5 : Read the optional attribute(SupportedStreamingProtocols): AttributeList\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.A0001")) { NextTest(); return; } - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + err = TestReadTheOptionalAttributeSupportedStreamingProtocolsAttributeList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); - if (ShouldSkip(" !MEDIAINPUT.S.NU ")) { + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the optional command(LaunchContent) in AcceptedCommandList attribute\n"); + if (ShouldSkip("CONTENTLAUNCHER.C.C0000")) { NextTest(); return; } - err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + err = TestReadTheOptionalCommandLaunchContentInAcceptedCommandListAttribute_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Read the optional command(LaunchURL) in AcceptedCommandList attribute\n"); + if (ShouldSkip("CONTENTLAUNCHER.C.C0001")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandLaunchURLInAcceptedCommandListAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); break; } @@ -32467,6 +32726,12 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -32480,7 +32745,7 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -32497,9 +32762,9 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -32522,9 +32787,9 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -32545,9 +32810,9 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -32556,8 +32821,6 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); @@ -32570,16 +32833,60 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestReadTheOptionalAttributeAcceptHeaderAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher 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 optional attribute(AcceptHeader): AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeSupportedStreamingProtocolsAttributeList_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher 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 optional attribute(SupportedStreamingProtocols): AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalCommandLaunchContentInAcceptedCommandListAttribute_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher 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); + NSLog(@"Read the optional command(LaunchContent) in AcceptedCommandList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -32592,38 +32899,34 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestReadTheOptionalCommandLaunchURLInAcceptedCommandListAttribute_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher 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); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(LaunchURL) in AcceptedCommandList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -32631,12 +32934,9 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 2UL)); + NextTest(); }]; @@ -32644,11 +32944,11 @@ class Test_TC_AUDIOOUTPUT_1_8 : public TestCommandBridge { } }; -class Test_TC_TGTNAV_1_9 : public TestCommandBridge { +class Test_TC_ALOGIN_1_12 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TGTNAV_1_9() - : TestCommandBridge("Test_TC_TGTNAV_1_9") + Test_TC_ALOGIN_1_12() + : TestCommandBridge("Test_TC_ALOGIN_1_12") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -32658,7 +32958,7 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_TGTNAV_1_9() {} + ~Test_TC_ALOGIN_1_12() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -32666,11 +32966,11 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TGTNAV_1_9\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ALOGIN_1_12\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TGTNAV_1_9\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ALOGIN_1_12\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -32687,7 +32987,7 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: @@ -32699,20 +32999,12 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(CurrentTarget) in AttributeList\n"); - if (ShouldSkip("TGTNAV.S.A0001")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeCurrentTargetInAttributeList_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: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); break; } @@ -32743,9 +33035,6 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -32759,7 +33048,7 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; @@ -32776,13 +33065,13 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterAccountLogin * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device + endpoint:3 + 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); + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -32801,9 +33090,9 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterAccountLogin * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -32826,9 +33115,9 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterAccountLogin * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -32837,7 +33126,6 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); @@ -32850,34 +33138,12 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeCurrentTargetInAttributeList_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator 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 optional attribute(CurrentTarget) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterAccountLogin * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -32887,6 +33153,8 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); NextTest(); }]; @@ -32894,12 +33162,12 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterAccountLogin * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -32917,11 +33185,11 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { } }; -class Test_TC_TGTNAV_8_2 : public TestCommandBridge { +class Test_TC_LOWPOWER_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TGTNAV_8_2() - : TestCommandBridge("Test_TC_TGTNAV_8_2") + Test_TC_LOWPOWER_2_1() + : TestCommandBridge("Test_TC_LOWPOWER_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -32931,7 +33199,7 @@ class Test_TC_TGTNAV_8_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_TGTNAV_8_2() {} + ~Test_TC_LOWPOWER_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -32939,11 +33207,11 @@ class Test_TC_TGTNAV_8_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TGTNAV_8_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LOWPOWER_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TGTNAV_8_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LOWPOWER_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -32955,6 +33223,18 @@ class Test_TC_TGTNAV_8_2 : public TestCommandBridge { // but before our function call returns, we won't end up with an // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH sends Sleep command to DUT\n"); + if (ShouldSkip("LOWPOWER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsSleepCommandToDut_1(); + break; } if (CHIP_NO_ERROR != err) { @@ -32966,6 +33246,12 @@ class Test_TC_TGTNAV_8_2 : public TestCommandBridge { void OnStatusUpdate(const chip::app::StatusIB & status) override { switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -32979,19 +33265,43 @@ class Test_TC_TGTNAV_8_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; + const uint16_t mTestCount = 2; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThSendsSleepCommandToDut_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster sleepWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Sleep command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; -class Test_TC_APBSC_1_10 : public TestCommandBridge { +class Test_TC_KEYPADINPUT_3_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_APBSC_1_10() - : TestCommandBridge("Test_TC_APBSC_1_10") + Test_TC_KEYPADINPUT_3_2() + : TestCommandBridge("Test_TC_KEYPADINPUT_3_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -33001,7 +33311,7 @@ class Test_TC_APBSC_1_10 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_APBSC_1_10() {} + ~Test_TC_KEYPADINPUT_3_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -33009,11 +33319,11 @@ class Test_TC_APBSC_1_10 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_APBSC_1_10\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_KEYPADINPUT_3_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_APBSC_1_10\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_KEYPADINPUT_3_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -33030,48 +33340,20 @@ class Test_TC_APBSC_1_10 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read FeatureMap attribute from the DUT\n"); - err = TestReadFeatureMapAttributeFromTheDut_2(); - break; - case 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 optional attribute(VendorName) in AttributeList\n"); - if (ShouldSkip("APBSC.S.A0000")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeVendorNameInAttributeList_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute(VendorID) in AttributeList\n"); - if (ShouldSkip("APBSC.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : TH sends CEC Settings Keys(0x0A) to DUT\n"); + if (ShouldSkip("KEYPADINPUT.S.LK")) { NextTest(); return; } - err = TestReadTheOptionalAttributeVendorIDInAttributeList_5(); + err = TestThSendsCecSettingsKeys0x0AToDut_1(); break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional attribute(ProductID) in AttributeList\n"); - if (ShouldSkip("APBSC.S.A0003")) { + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends CEC Home Keys(0x09) to DUT\n"); + if (ShouldSkip("KEYPADINPUT.S.LK")) { NextTest(); return; } - err = TestReadTheOptionalAttributeProductIDInAttributeList_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(); + err = TestThSendsCecHomeKeys0x09ToDut_2(); break; } @@ -33093,24 +33375,6 @@ class Test_TC_APBSC_1_10 : public TestCommandBridge { case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -33124,7 +33388,7 @@ class Test_TC_APBSC_1_10 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -33138,209 +33402,66 @@ class Test_TC_APBSC_1_10 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestThSendsCecSettingsKeys0x0AToDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput 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); + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:10U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends CEC Settings Keys(0x0A) to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadFeatureMapAttributeFromTheDut_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read FeatureMap attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - 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 ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeVendorNameInAttributeList_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute(VendorName) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeVendorIDInAttributeList_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute(VendorID) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeProductIDInAttributeList_6() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute(ProductID) in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - 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 ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestThSendsCecHomeKeys0x09ToDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput 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); + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:9U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends CEC Home Keys(0x09) to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_CONTENTLAUNCHER_1_11 : public TestCommandBridge { +class Test_TC_KEYPADINPUT_3_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CONTENTLAUNCHER_1_11() - : TestCommandBridge("Test_TC_CONTENTLAUNCHER_1_11") + Test_TC_KEYPADINPUT_3_3() + : TestCommandBridge("Test_TC_KEYPADINPUT_3_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -33350,7 +33471,7 @@ class Test_TC_CONTENTLAUNCHER_1_11 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CONTENTLAUNCHER_1_11() {} + ~Test_TC_KEYPADINPUT_3_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -33358,11 +33479,11 @@ class Test_TC_CONTENTLAUNCHER_1_11 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CONTENTLAUNCHER_1_11\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_KEYPADINPUT_3_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CONTENTLAUNCHER_1_11\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_KEYPADINPUT_3_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -33379,59 +33500,76 @@ class Test_TC_CONTENTLAUNCHER_1_11 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Numbers1\n"); + if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { + NextTest(); + return; + } + err = TestSendNumbers1_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip("CONTENTLAUNCHER.S.CS || CONTENTLAUNCHER.S.UP")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Send Numbers2\n"); + if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { NextTest(); return; } - err = TestReadTheGlobalAttributeFeatureMap_2(); + err = TestSendNumbers2_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Send Numbers3\n"); + if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { + NextTest(); + return; + } + err = TestSendNumbers3_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute(AcceptHeader): AttributeList\n"); - if (ShouldSkip("CONTENTLAUNCHER.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Send Numbers4\n"); + if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { NextTest(); return; } - err = TestReadTheOptionalAttributeAcceptHeaderAttributeList_4(); + err = TestSendNumbers4_4(); break; case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : Read the optional attribute(SupportedStreamingProtocols): AttributeList\n"); - if (ShouldSkip("CONTENTLAUNCHER.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Send Numbers5\n"); + if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { NextTest(); return; } - err = TestReadTheOptionalAttributeSupportedStreamingProtocolsAttributeList_5(); + err = TestSendNumbers5_5(); break; case 6: - ChipLogProgress( - chipTool, " ***** Test Step 6 : Read the optional command(LaunchContent) in AcceptedCommandList attribute\n"); - if (ShouldSkip("CONTENTLAUNCHER.C.C0000")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Send Numbers6\n"); + if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { NextTest(); return; } - err = TestReadTheOptionalCommandLaunchContentInAcceptedCommandListAttribute_6(); + err = TestSendNumbers6_6(); break; case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : Read the optional command(LaunchURL) in AcceptedCommandList attribute\n"); - if (ShouldSkip("CONTENTLAUNCHER.C.C0001")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Send Numbers7\n"); + if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { NextTest(); return; } - err = TestReadTheOptionalCommandLaunchURLInAcceptedCommandListAttribute_7(); + err = TestSendNumbers7_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Send Numbers8\n"); + if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { + NextTest(); + return; + } + err = TestSendNumbers8_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Send Numbers9\n"); + if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { + NextTest(); + return; + } + err = TestSendNumbers9_9(); break; } @@ -33471,6 +33609,9 @@ class Test_TC_CONTENTLAUNCHER_1_11 : public TestCommandBridge { case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -33484,7 +33625,7 @@ class Test_TC_CONTENTLAUNCHER_1_11 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -33498,206 +33639,265 @@ class Test_TC_CONTENTLAUNCHER_1_11 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestSendNumbers1_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput 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); + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:33U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers1 Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestSendNumbers2_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput 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 global attribute: FeatureMap Error: %@", err); + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:34U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers2 Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 3UL)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestSendNumbers3_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput 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); + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:35U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers3 Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeAcceptHeaderAttributeList_4() + CHIP_ERROR TestSendNumbers4_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput 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 optional attribute(AcceptHeader): AttributeList Error: %@", err); + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:36U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers4 Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeSupportedStreamingProtocolsAttributeList_5() + CHIP_ERROR TestSendNumbers5_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput 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 optional attribute(SupportedStreamingProtocols): AttributeList Error: %@", err); + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:37U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers5 Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalCommandLaunchContentInAcceptedCommandListAttribute_6() + CHIP_ERROR TestSendNumbers6_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput 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 optional command(LaunchContent) in AcceptedCommandList attribute Error: %@", err); + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:38U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers6 Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalCommandLaunchURLInAcceptedCommandListAttribute_7() + CHIP_ERROR TestSendNumbers7_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput 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 optional command(LaunchURL) in AcceptedCommandList attribute Error: %@", err); + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:39U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers7 Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestSendNumbers8_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput 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); + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:40U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers8 Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 2UL)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class Test_TC_ALOGIN_1_12 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_ALOGIN_1_12() - : TestCommandBridge("Test_TC_ALOGIN_1_12") - , mTestIndex(0) + CHIP_ERROR TestSendNumbers9_9() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_ALOGIN_1_12() {} + __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:41U]; + [cluster sendKeyWithParams:params + completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Send Numbers9 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APPLAUNCHER_3_5 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_APPLAUNCHER_3_5() + : TestCommandBridge("Test_TC_APPLAUNCHER_3_5") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_APPLAUNCHER_3_5() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -33705,11 +33905,11 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ALOGIN_1_12\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_APPLAUNCHER_3_5\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ALOGIN_1_12\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_APPLAUNCHER_3_5\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -33726,24 +33926,14 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 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: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); - break; - case 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: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH reads CatalogList attribute from the DUT and where each entry in the list is a CSA-issued " + "Vendor Id of type unsigned 16 bit integer ranging between 0-65536 for the catalog\n"); + if (ShouldSkip("APPLAUNCHER.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsCatalogListAttributeFromTheDutAndWhereEachEntryInTheListIsACsaIssuedVendorIdOfTypeUnsigned16BitIntegerRangingBetween065536ForTheCatalog_1(); break; } @@ -33762,18 +33952,6 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -33787,7 +33965,7 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 2; chip::Optional mNodeId; chip::Optional mCluster; @@ -33801,122 +33979,144 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR + TestThReadsCatalogListAttributeFromTheDutAndWhereEachEntryInTheListIsACsaIssuedVendorIdOfTypeUnsigned16BitIntegerRangingBetween065536ForTheCatalog_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAccountLogin * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; + MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher 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); + [cluster readAttributeCatalogListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CatalogList attribute from the DUT and where each entry in the list is a CSA-issued Vendor Id of type " + @"unsigned 16 bit integer ranging between 0-65536 for the catalog Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() +class Test_TC_APPLAUNCHER_3_6 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_APPLAUNCHER_3_6() + : TestCommandBridge("Test_TC_APPLAUNCHER_3_6") + , mTestIndex(0) { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAccountLogin * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + ~Test_TC_APPLAUNCHER_3_6() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAccountLogin * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + CHIP_ERROR err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_APPLAUNCHER_3_6\n"); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_APPLAUNCHER_3_6\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + Wait(); - NextTest(); - }]; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH reads CurrentApp attribute from the DUT and Verify the in-focus application attributes, " + "which should include the display Application ID(type:uint16) Catalog Vendor ID(type:string) or Null if there is " + "no current in-focus application\n"); + if (ShouldSkip("APPLAUNCHER.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsCurrentAppAttributeFromTheDutAndVerifyTheInFocusApplicationAttributesWhichShouldIncludeTheDisplayApplicationIDtypeuint16CatalogVendorIDtypestringOrNullIfThereIsNoCurrentInFocusApplication_1(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAccountLogin * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - return CHIP_NO_ERROR; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR + TestThReadsCurrentAppAttributeFromTheDutAndVerifyTheInFocusApplicationAttributesWhichShouldIncludeTheDisplayApplicationIDtypeuint16CatalogVendorIDtypestringOrNullIfThereIsNoCurrentInFocusApplication_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAccountLogin * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; + MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher 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); + [cluster readAttributeCurrentAppWithCompletionHandler:^( + MTRApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentApp attribute from the DUT and Verify the in-focus application attributes, which should " + @"include the display Application ID(type:uint16) Catalog Vendor ID(type:string) or Null if there is no current " + @"in-focus application Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); - NextTest(); }]; @@ -33924,11 +34124,11 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { } }; -class Test_TC_LOWPOWER_2_1 : public TestCommandBridge { +class Test_TC_MEDIAINPUT_3_10 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LOWPOWER_2_1() - : TestCommandBridge("Test_TC_LOWPOWER_2_1") + Test_TC_MEDIAINPUT_3_10() + : TestCommandBridge("Test_TC_MEDIAINPUT_3_10") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -33938,7 +34138,7 @@ class Test_TC_LOWPOWER_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LOWPOWER_2_1() {} + ~Test_TC_MEDIAINPUT_3_10() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -33946,11 +34146,11 @@ class Test_TC_LOWPOWER_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LOWPOWER_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_10\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LOWPOWER_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_10\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -33967,12 +34167,15 @@ class Test_TC_LOWPOWER_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH sends Sleep command to DUT\n"); - if (ShouldSkip("LOWPOWER.S.C00.Rsp")) { + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available and Verify " + "list of available inputs supported by the device is provided, where each entry in the list contains an " + "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)\n"); + if (ShouldSkip("MEDIAINPUT.S.A0000")) { NextTest(); return; } - err = TestThSendsSleepCommandToDut_1(); + err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); break; } @@ -34018,14 +34221,20 @@ class Test_TC_LOWPOWER_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThSendsSleepCommandToDut_1() + CHIP_ERROR + TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLowPower * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster sleepWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Sleep command to DUT Error: %@", err); + [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " + @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " + @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -34036,11 +34245,11 @@ class Test_TC_LOWPOWER_2_1 : public TestCommandBridge { } }; -class Test_TC_KEYPADINPUT_3_2 : public TestCommandBridge { +class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_KEYPADINPUT_3_2() - : TestCommandBridge("Test_TC_KEYPADINPUT_3_2") + Test_TC_MEDIAINPUT_3_11() + : TestCommandBridge("Test_TC_MEDIAINPUT_3_11") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -34050,7 +34259,7 @@ class Test_TC_KEYPADINPUT_3_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_KEYPADINPUT_3_2() {} + ~Test_TC_MEDIAINPUT_3_11() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -34058,11 +34267,11 @@ class Test_TC_KEYPADINPUT_3_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_KEYPADINPUT_3_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_11\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_KEYPADINPUT_3_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_11\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -34079,20 +34288,31 @@ class Test_TC_KEYPADINPUT_3_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH sends CEC Settings Keys(0x0A) to DUT\n"); - if (ShouldSkip("KEYPADINPUT.S.LK")) { + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available and Verify " + "list of available inputs supported by the device is provided, where each entry in the list contains an " + "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)\n"); + if (ShouldSkip("MEDIAINPUT.S.A0000")) { NextTest(); return; } - err = TestThSendsCecSettingsKeys0x0AToDut_1(); + err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends CEC Home Keys(0x09) to DUT\n"); - if (ShouldSkip("KEYPADINPUT.S.LK")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Select Input Command\n"); + if (ShouldSkip("MEDIAINPUT.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsCecHomeKeys0x09ToDut_2(); + err = TestSelectInputCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read current input list\n"); + if (ShouldSkip("MEDIAINPUT.S.A0001 && MEDIAINPUT.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadCurrentInputList_3(); break; } @@ -34114,6 +34334,9 @@ class Test_TC_KEYPADINPUT_3_2 : public TestCommandBridge { case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -34127,7 +34350,7 @@ class Test_TC_KEYPADINPUT_3_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -34141,66 +34364,81 @@ class Test_TC_KEYPADINPUT_3_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThSendsCecSettingsKeys0x0AToDut_1() + CHIP_ERROR + TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:10U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends CEC Settings Keys(0x0A) to DUT Error: %@", err); + [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " + @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " + @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSelectInputCommand_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRMediaInputClusterSelectInputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1U]; + [cluster selectInputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Select Input Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsCecHomeKeys0x09ToDut_2() + CHIP_ERROR TestReadCurrentInputList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:9U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends CEC Home Keys(0x09) to DUT Error: %@", err); + [cluster readAttributeCurrentInputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current input list Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentInput", actualValue, 1U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_KEYPADINPUT_3_3 : public TestCommandBridge { +class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_KEYPADINPUT_3_3() - : TestCommandBridge("Test_TC_KEYPADINPUT_3_3") + Test_TC_MEDIAINPUT_3_12() + : TestCommandBridge("Test_TC_MEDIAINPUT_3_12") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -34210,7 +34448,7 @@ class Test_TC_KEYPADINPUT_3_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_KEYPADINPUT_3_3() {} + ~Test_TC_MEDIAINPUT_3_12() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -34218,11 +34456,11 @@ class Test_TC_KEYPADINPUT_3_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_KEYPADINPUT_3_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_12\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_KEYPADINPUT_3_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_12\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -34239,76 +34477,31 @@ class Test_TC_KEYPADINPUT_3_3 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Numbers1\n"); - if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available and Verify " + "list of available inputs supported by the device is provided, where each entry in the list contains an " + "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)\n"); + if (ShouldSkip("MEDIAINPUT.S.A0000")) { NextTest(); return; } - err = TestSendNumbers1_1(); + err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send Numbers2\n"); - if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Show Input Status Command\n"); + if (ShouldSkip("MEDIAINPUT.S.C01.Rsp")) { NextTest(); return; } - err = TestSendNumbers2_2(); + err = TestShowInputStatusCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send Numbers3\n"); - if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { - NextTest(); - return; - } - err = TestSendNumbers3_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Send Numbers4\n"); - if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { - NextTest(); - return; - } - err = TestSendNumbers4_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send Numbers5\n"); - if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { - NextTest(); - return; - } - err = TestSendNumbers5_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Send Numbers6\n"); - if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { - NextTest(); - return; - } - err = TestSendNumbers6_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Send Numbers7\n"); - if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { - NextTest(); - return; - } - err = TestSendNumbers7_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Send Numbers8\n"); - if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { - NextTest(); - return; - } - err = TestSendNumbers8_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Send Numbers9\n"); - if (ShouldSkip("KEYPADINPUT.S.C00.Rsp && KEYPADINPUT.S.NK")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Hide Input Status Command\n"); + if (ShouldSkip("MEDIAINPUT.S.C02.Rsp")) { NextTest(); return; } - err = TestSendNumbers9_9(); + err = TestHideInputStatusCommand_3(); break; } @@ -34333,24 +34526,6 @@ class Test_TC_KEYPADINPUT_3_3 : public TestCommandBridge { case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -34364,7 +34539,7 @@ class Test_TC_KEYPADINPUT_3_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -34378,255 +34553,73 @@ class Test_TC_KEYPADINPUT_3_3 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestSendNumbers1_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:33U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Numbers1 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSendNumbers2_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:34U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Numbers2 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSendNumbers3_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:35U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Numbers3 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSendNumbers4_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:36U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Numbers4 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSendNumbers5_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:37U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Numbers5 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSendNumbers6_6() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:38U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Numbers6 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSendNumbers7_7() + CHIP_ERROR + TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:39U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Numbers7 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " + @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " + @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", + err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendNumbers8_8() + CHIP_ERROR TestShowInputStatusCommand_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:40U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Numbers8 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster showInputStatusWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Show Input Status Command Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendNumbers9_9() + CHIP_ERROR TestHideInputStatusCommand_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterKeypadInput * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRKeypadInputClusterSendKeyParams alloc] init]; - params.keyCode = [NSNumber numberWithUnsignedChar:41U]; - [cluster sendKeyWithParams:params - completionHandler:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Send Numbers9 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster hideInputStatusWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Hide Input Status Command Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_APPLAUNCHER_3_5 : public TestCommandBridge { +class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_APPLAUNCHER_3_5() - : TestCommandBridge("Test_TC_APPLAUNCHER_3_5") + Test_TC_MEDIAINPUT_3_13() + : TestCommandBridge("Test_TC_MEDIAINPUT_3_13") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -34636,7 +34629,7 @@ class Test_TC_APPLAUNCHER_3_5 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_APPLAUNCHER_3_5() {} + ~Test_TC_MEDIAINPUT_3_13() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -34644,11 +34637,11 @@ class Test_TC_APPLAUNCHER_3_5 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_APPLAUNCHER_3_5\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_13\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_APPLAUNCHER_3_5\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_13\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -34666,13 +34659,31 @@ class Test_TC_APPLAUNCHER_3_5 : public TestCommandBridge { break; case 1: ChipLogProgress(chipTool, - " ***** Test Step 1 : TH reads CatalogList attribute from the DUT and where each entry in the list is a CSA-issued " - "Vendor Id of type unsigned 16 bit integer ranging between 0-65536 for the catalog\n"); - if (ShouldSkip("APPLAUNCHER.S.A0000")) { + " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available and Verify " + "list of available inputs supported by the device is provided, where each entry in the list contains an " + "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)\n"); + if (ShouldSkip("MEDIAINPUT.S.A0000")) { NextTest(); return; } - err = TestThReadsCatalogListAttributeFromTheDutAndWhereEachEntryInTheListIsACsaIssuedVendorIdOfTypeUnsigned16BitIntegerRangingBetween065536ForTheCatalog_1(); + err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Rename Input Command\n"); + if (ShouldSkip("MEDIAINPUT.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestRenameInputCommand_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : TH reads the InputList attribute from the DUT to show list of Inputs available\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAINPUT.S.A0000 && MEDIAINPUT.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_3(); break; } @@ -34691,6 +34702,12 @@ class Test_TC_APPLAUNCHER_3_5 : public TestCommandBridge { case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -34704,7 +34721,7 @@ class Test_TC_APPLAUNCHER_3_5 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -34719,17 +34736,18 @@ class Test_TC_APPLAUNCHER_3_5 : public TestCommandBridge { } CHIP_ERROR - TestThReadsCatalogListAttributeFromTheDutAndWhereEachEntryInTheListIsACsaIssuedVendorIdOfTypeUnsigned16BitIntegerRangingBetween065536ForTheCatalog_1() + TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCatalogListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CatalogList attribute from the DUT and where each entry in the list is a CSA-issued Vendor Id of type " - @"unsigned 16 bit integer ranging between 0-65536 for the catalog Error: %@", + [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " + @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " + @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -34739,13 +34757,45 @@ class Test_TC_APPLAUNCHER_3_5 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestRenameInputCommand_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRMediaInputClusterRenameInputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1U]; + params.name = @"A1"; + [cluster renameInputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Rename Input Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_3() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } }; -class Test_TC_APPLAUNCHER_3_6 : public TestCommandBridge { +class Test_TC_CHANNEL_5_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_APPLAUNCHER_3_6() - : TestCommandBridge("Test_TC_APPLAUNCHER_3_6") + Test_TC_CHANNEL_5_1() + : TestCommandBridge("Test_TC_CHANNEL_5_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -34755,7 +34805,7 @@ class Test_TC_APPLAUNCHER_3_6 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_APPLAUNCHER_3_6() {} + ~Test_TC_CHANNEL_5_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -34763,11 +34813,11 @@ class Test_TC_APPLAUNCHER_3_6 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_APPLAUNCHER_3_6\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CHANNEL_5_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_APPLAUNCHER_3_6\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CHANNEL_5_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -34785,14 +34835,15 @@ class Test_TC_APPLAUNCHER_3_6 : public TestCommandBridge { break; case 1: ChipLogProgress(chipTool, - " ***** Test Step 1 : TH reads CurrentApp attribute from the DUT and Verify the in-focus application attributes, " - "which should include the display Application ID(type:uint16) Catalog Vendor ID(type:string) or Null if there is " - "no current in-focus application\n"); - if (ShouldSkip("APPLAUNCHER.S.A0001")) { + " ***** Test Step 1 : TH reads the ChannelList attribute from the DUT to show list of Inputs available and Verify " + "that the response contains a list of the known TV channels. Each list element should consist of the " + "following,Major number (unsigned 16-bit integer, mandatory),Minor number (unsigned 16-bit integer, " + "mandatory),Name (String, optional),Call sign (String, optional),Affiliate call sign (String, optional)\n"); + if (ShouldSkip("CHANNEL.S.A0000")) { NextTest(); return; } - err = TestThReadsCurrentAppAttributeFromTheDutAndVerifyTheInFocusApplicationAttributesWhichShouldIncludeTheDisplayApplicationIDtypeuint16CatalogVendorIDtypestringOrNullIfThereIsNoCurrentInFocusApplication_1(); + err = TestThReadsTheChannelListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyThatTheResponseContainsAListOfTheKnownTvChannelsEachListElementShouldConsistOfTheFollowingMajorNumberUnsigned16BitIntegerMandatoryMinorNumberUnsigned16BitIntegerMandatoryNameStringOptionalCallSignStringOptionalAffiliateCallSignStringOptional_1(); break; } @@ -34839,19 +34890,17 @@ class Test_TC_APPLAUNCHER_3_6 : public TestCommandBridge { } CHIP_ERROR - TestThReadsCurrentAppAttributeFromTheDutAndVerifyTheInFocusApplicationAttributesWhichShouldIncludeTheDisplayApplicationIDtypeuint16CatalogVendorIDtypestringOrNullIfThereIsNoCurrentInFocusApplication_1() + TestThReadsTheChannelListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyThatTheResponseContainsAListOfTheKnownTvChannelsEachListElementShouldConsistOfTheFollowingMajorNumberUnsigned16BitIntegerMandatoryMinorNumberUnsigned16BitIntegerMandatoryNameStringOptionalCallSignStringOptionalAffiliateCallSignStringOptional_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationLauncher * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentAppWithCompletionHandler:^( - MTRApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentApp attribute from the DUT and Verify the in-focus application attributes, which should " - @"include the display Application ID(type:uint16) Catalog Vendor ID(type:string) or Null if there is no current " - @"in-focus application Error: %@", + [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ChannelList attribute from the DUT to show list of Inputs available and Verify that the response " + @"contains a list of the known TV channels. Each list element should consist of the following,Major number " + @"(unsigned 16-bit integer, mandatory),Minor number (unsigned 16-bit integer, mandatory),Name (String, " + @"optional),Call sign (String, optional),Affiliate call sign (String, optional) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -34863,21 +34912,23 @@ class Test_TC_APPLAUNCHER_3_6 : public TestCommandBridge { } }; -class Test_TC_MEDIAINPUT_3_10 : public TestCommandBridge { +class Test_TC_CHANNEL_5_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAINPUT_3_10() - : TestCommandBridge("Test_TC_MEDIAINPUT_3_10") + Test_TC_CHANNEL_5_2() + : TestCommandBridge("Test_TC_CHANNEL_5_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("majornumber", 0, UINT16_MAX, &mMajornumber); + AddArgument("minornumber", 0, UINT16_MAX, &mMinornumber); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAINPUT_3_10() {} + ~Test_TC_CHANNEL_5_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -34885,11 +34936,11 @@ class Test_TC_MEDIAINPUT_3_10 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_10\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CHANNEL_5_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_10\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CHANNEL_5_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -34906,15 +34957,36 @@ class Test_TC_MEDIAINPUT_3_10 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available and Verify " - "list of available inputs supported by the device is provided, where each entry in the list contains an " - "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)\n"); - if (ShouldSkip("MEDIAINPUT.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the ChannelList attribute\n"); + if (ShouldSkip("CHANNEL.S.A0000")) { NextTest(); return; } - err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); + err = TestReadsTheChannelListAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends a ChangeChannelByNumber command\n"); + if (ShouldSkip("CHANNEL.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAChangeChannelByNumberCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Verify that the channel has changed on the device\n"); + if (ShouldSkip("PICS_USER_PROMPT && CHANNEL.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatTheChannelHasChangedOnTheDevice_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the CurrentChannel attribute\n"); + if (ShouldSkip("CHANNEL.S.A0002 && CHANNEL.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestReadsTheCurrentChannelAttribute_4(); break; } @@ -34933,6 +35005,15 @@ class Test_TC_MEDIAINPUT_3_10 : public TestCommandBridge { case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -34946,11 +35027,13 @@ class Test_TC_MEDIAINPUT_3_10 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mMajornumber; + chip::Optional mMinornumber; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -34960,210 +35043,72 @@ class Test_TC_MEDIAINPUT_3_10 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR - TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() + CHIP_ERROR TestReadsTheChannelListAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " - @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " - @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", - err); + [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the ChannelList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("channelList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAINPUT_3_11() - : TestCommandBridge("Test_TC_MEDIAINPUT_3_11") - , mTestIndex(0) + CHIP_ERROR TestThSendsAChangeChannelByNumberCommand_2() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_MEDIAINPUT_3_11() {} + __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = mMajornumber.HasValue() ? [NSNumber numberWithUnsignedShort:mMajornumber.Value()] + : [NSNumber numberWithUnsignedShort:9U]; + params.minorNumber = mMinornumber.HasValue() ? [NSNumber numberWithUnsignedShort:mMinornumber.Value()] + : [NSNumber numberWithUnsignedShort:1U]; + [cluster changeChannelByNumberWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends a ChangeChannelByNumber command Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatTheChannelHasChangedOnTheDevice_3() { - CHIP_ERROR err = CHIP_NO_ERROR; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please enter 'y' if channel has changed on the devicegarbage: not in length on purpose", 53); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_11\n"); - } + CHIP_ERROR TestReadsTheCurrentChannelAttribute_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_11\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster readAttributeCurrentChannelWithCompletionHandler:^( + MTRChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentChannel attribute Error: %@", err); - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available and Verify " - "list of available inputs supported by the device is provided, where each entry in the list contains an " - "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)\n"); - if (ShouldSkip("MEDIAINPUT.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Select Input Command\n"); - if (ShouldSkip("MEDIAINPUT.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestSelectInputCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read current input list\n"); - if (ShouldSkip("MEDIAINPUT.S.A0001 && MEDIAINPUT.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestReadCurrentInputList_3(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - 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 = 4; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR - TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " - @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " - @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSelectInputCommand_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRMediaInputClusterSelectInputParams alloc] init]; - params.index = [NSNumber numberWithUnsignedChar:1U]; - [cluster selectInputWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Select Input Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadCurrentInputList_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentInputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read current input list Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("CurrentInput", actualValue, 1U)); + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); } NextTest(); @@ -35173,21 +35118,23 @@ class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { } }; -class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { +class Test_TC_CHANNEL_5_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAINPUT_3_12() - : TestCommandBridge("Test_TC_MEDIAINPUT_3_12") + Test_TC_CHANNEL_5_3() + : TestCommandBridge("Test_TC_CHANNEL_5_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("majornumber", 0, UINT16_MAX, &mMajornumber); + AddArgument("minornumber", 0, UINT16_MAX, &mMinornumber); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAINPUT_3_12() {} + ~Test_TC_CHANNEL_5_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -35195,11 +35142,11 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_12\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CHANNEL_5_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_12\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CHANNEL_5_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -35217,30 +35164,53 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { break; case 1: ChipLogProgress(chipTool, - " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available and Verify " - "list of available inputs supported by the device is provided, where each entry in the list contains an " - "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)\n"); - if (ShouldSkip("MEDIAINPUT.S.A0000")) { + " ***** Test Step 1 : TH reads the Lineup attribute from the DUT to show list of Inputs available and Verify that " + "the response contains a lineup info object\n"); + if (ShouldSkip("CHANNEL.S.A0001")) { NextTest(); return; } - err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); + err = TestThReadsTheLineupAttributeFromTheDutToShowListOfInputsAvailableAndVerifyThatTheResponseContainsALineupInfoObject_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Show Input Status Command\n"); - if (ShouldSkip("MEDIAINPUT.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the ChannelList attribute from the DUT\n"); + if (ShouldSkip("CHANNEL.S.A0000")) { NextTest(); return; } - err = TestShowInputStatusCommand_2(); + err = TestReadsTheChannelListAttributeFromTheDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Hide Input Status Command\n"); - if (ShouldSkip("MEDIAINPUT.S.C02.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the CurrentChannel attribute from the DUT\n"); + if (ShouldSkip("CHANNEL.S.A0002")) { NextTest(); return; } - err = TestHideInputStatusCommand_3(); + err = TestReadsTheCurrentChannelAttributeFromTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Sends a SkipChannel command to the DUT\n"); + if (ShouldSkip("CHANNEL.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestSendsASkipChannelCommandToTheDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Verify that the channel has changed on the device\n"); + if (ShouldSkip("PICS_USER_PROMPT && CHANNEL.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatTheChannelHasChangedOnTheDevice_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the CurrentChannel attribute from the DUT\n"); + if (ShouldSkip("CHANNEL.S.A0002 && CHANNEL.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestReadsTheCurrentChannelAttributeFromTheDut_6(); break; } @@ -35265,6 +35235,15 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -35278,11 +35257,13 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mMajornumber; + chip::Optional mMinornumber; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -35293,60 +35274,118 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { } CHIP_ERROR - TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() + TestThReadsTheLineupAttributeFromTheDutToShowListOfInputsAvailableAndVerifyThatTheResponseContainsALineupInfoObject_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " - @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " - @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", - err); + [cluster + readAttributeLineupWithCompletionHandler:^(MTRChannelClusterLineupInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the Lineup attribute from the DUT to show list of Inputs available and Verify that the response " + @"contains a lineup info object Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheChannelListAttributeFromTheDut_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the ChannelList attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("channelList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestShowInputStatusCommand_2() + CHIP_ERROR TestReadsTheCurrentChannelAttributeFromTheDut_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster showInputStatusWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Show Input Status Command Error: %@", err); + [cluster readAttributeCurrentChannelWithCompletionHandler:^( + MTRChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentChannel attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestHideInputStatusCommand_3() + CHIP_ERROR TestSendsASkipChannelCommandToTheDut_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster hideInputStatusWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Hide Input Status Command Error: %@", err); + __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithUnsignedShort:1U]; + [cluster skipChannelWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends a SkipChannel command to the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatTheChannelHasChangedOnTheDevice_5() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please enter 'y' if channel has changed on the devicegarbage: not in length on purpose", 53); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestReadsTheCurrentChannelAttributeFromTheDut_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentChannelWithCompletionHandler:^( + MTRChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentChannel attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + } + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("currentChannel", "ChannelInfo", "ChannelInfo")); + } + NextTest(); }]; @@ -35354,11 +35393,11 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { } }; -class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { +class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAINPUT_3_13() - : TestCommandBridge("Test_TC_MEDIAINPUT_3_13") + Test_TC_MEDIAPLAYBACK_6_1() + : TestCommandBridge("Test_TC_MEDIAPLAYBACK_6_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -35368,7 +35407,7 @@ class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAINPUT_3_13() {} + ~Test_TC_MEDIAPLAYBACK_6_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -35376,11 +35415,11 @@ class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_13\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAPLAYBACK_6_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_13\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAPLAYBACK_6_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -35397,32 +35436,93 @@ class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available and Verify " - "list of available inputs supported by the device is provided, where each entry in the list contains an " - "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)\n"); - if (ShouldSkip("MEDIAINPUT.S.A0000")) { + ChipLogProgress( + chipTool, " ***** Test Step 1 : Precondition: Media content in a paused state at the beginning of the content\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp")) { NextTest(); return; } - err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); + err = TestPreconditionMediaContentInAPausedStateAtTheBeginningOfTheContent_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Rename Input Command\n"); - if (ShouldSkip("MEDIAINPUT.S.C03.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the CurrentState attribute\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C01.Rsp")) { NextTest(); return; } - err = TestRenameInputCommand_2(); + err = TestReadsTheCurrentStateAttribute_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : TH reads the InputList attribute from the DUT to show list of Inputs available\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAINPUT.S.A0000 && MEDIAINPUT.S.C03.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Sends a Play command\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C00.Rsp")) { NextTest(); return; } - err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_3(); + err = TestSendsAPlayCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Verify that the media state is playing\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatTheMediaStateIsPlaying_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the CurrentState attribute\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadsTheCurrentStateAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : sends a Pause command\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestSendsAPauseCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Verify that the media is paused\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatTheMediaIsPaused_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the CurrentState attribute\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp && MEDIAPLAYBACK.S.A0000")) { + NextTest(); + return; + } + err = TestReadsTheCurrentStateAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Sends a Stop command\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestSendsAStopCommand_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Verify that the media is stoped\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatTheMediaIsStoped_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the CurrentState attribute\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestReadsTheCurrentStateAttribute_11(); break; } @@ -35447,6 +35547,30 @@ class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -35460,7 +35584,7 @@ class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -35474,380 +35598,221 @@ class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR - TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() + CHIP_ERROR TestPreconditionMediaContentInAPausedStateAtTheBeginningOfTheContent_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " - @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " - @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", - err); + [cluster pauseWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Precondition: Media content in a paused state at the beginning of the content Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestRenameInputCommand_2() + CHIP_ERROR TestReadsTheCurrentStateAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaInput * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRMediaInputClusterRenameInputParams alloc] init]; - params.index = [NSNumber numberWithUnsignedChar:1U]; - params.name = @"A1"; - [cluster renameInputWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Rename Input Command Error: %@", err); + [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentState attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentState", actualValue, 1U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_3() + CHIP_ERROR TestSendsAPlayCommand_3() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } -}; + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -class Test_TC_CHANNEL_5_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CHANNEL_5_1() - : TestCommandBridge("Test_TC_CHANNEL_5_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_CHANNEL_5_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CHANNEL_5_1\n"); - } + [cluster + playWithCompletionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a Play command Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CHANNEL_5_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - Wait(); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH reads the ChannelList attribute from the DUT to show list of Inputs available and Verify " - "that the response contains a list of the known TV channels. Each list element should consist of the " - "following,Major number (unsigned 16-bit integer, mandatory),Minor number (unsigned 16-bit integer, " - "mandatory),Name (String, optional),Call sign (String, optional),Affiliate call sign (String, optional)\n"); - if (ShouldSkip("CHANNEL.S.A0000")) { NextTest(); - return; - } - err = TestThReadsTheChannelListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyThatTheResponseContainsAListOfTheKnownTvChannelsEachListElementShouldConsistOfTheFollowingMajorNumberUnsigned16BitIntegerMandatoryMinorNumberUnsigned16BitIntegerMandatoryNameStringOptionalCallSignStringOptionalAffiliateCallSignStringOptional_1(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } + }]; - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestVerifyThatTheMediaStateIsPlaying_4() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if media state is playinggarbage: not in length on purpose", 42); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR - TestThReadsTheChannelListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyThatTheResponseContainsAListOfTheKnownTvChannelsEachListElementShouldConsistOfTheFollowingMajorNumberUnsigned16BitIntegerMandatoryMinorNumberUnsigned16BitIntegerMandatoryNameStringOptionalCallSignStringOptionalAffiliateCallSignStringOptional_1() + CHIP_ERROR TestReadsTheCurrentStateAttribute_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ChannelList attribute from the DUT to show list of Inputs available and Verify that the response " - @"contains a list of the known TV channels. Each list element should consist of the following,Major number " - @"(unsigned 16-bit integer, mandatory),Minor number (unsigned 16-bit integer, mandatory),Name (String, " - @"optional),Call sign (String, optional),Affiliate call sign (String, optional) Error: %@", - err); + [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentState attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentState", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } -}; - -class Test_TC_CHANNEL_5_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CHANNEL_5_2() - : TestCommandBridge("Test_TC_CHANNEL_5_2") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("majornumber", 0, UINT16_MAX, &mMajornumber); - AddArgument("minornumber", 0, UINT16_MAX, &mMinornumber); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_CHANNEL_5_2() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestSendsAPauseCommand_6() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CHANNEL_5_2\n"); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CHANNEL_5_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster pauseWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"sends a Pause command Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the ChannelList attribute\n"); - if (ShouldSkip("CHANNEL.S.A0000")) { - NextTest(); - return; - } - err = TestReadsTheChannelListAttribute_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends a ChangeChannelByNumber command\n"); - if (ShouldSkip("CHANNEL.S.C02.Rsp")) { - NextTest(); - return; - } - err = TestThSendsAChangeChannelByNumberCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Verify that the channel has changed on the device\n"); - if (ShouldSkip("PICS_USER_PROMPT && CHANNEL.S.C02.Rsp")) { - NextTest(); - return; - } - err = TestVerifyThatTheChannelHasChangedOnTheDevice_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the CurrentChannel attribute\n"); - if (ShouldSkip("CHANNEL.S.A0002 && CHANNEL.S.C02.Rsp")) { - NextTest(); - return; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); } - err = TestReadsTheCurrentChannelAttribute_4(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } + NextTest(); + }]; - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mMajornumber; - chip::Optional mMinornumber; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestVerifyThatTheMediaIsPaused_7() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if media state is pausedgarbage: not in length on purpose", 41); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestReadsTheChannelListAttribute_1() + CHIP_ERROR TestReadsTheCurrentStateAttribute_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the ChannelList attribute Error: %@", err); + [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentState attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("channelList", "list", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentState", actualValue, 1U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAChangeChannelByNumberCommand_2() + CHIP_ERROR TestSendsAStopCommand_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRChannelClusterChangeChannelByNumberParams alloc] init]; - params.majorNumber = mMajornumber.HasValue() ? [NSNumber numberWithUnsignedShort:mMajornumber.Value()] - : [NSNumber numberWithUnsignedShort:9U]; - params.minorNumber = mMinornumber.HasValue() ? [NSNumber numberWithUnsignedShort:mMinornumber.Value()] - : [NSNumber numberWithUnsignedShort:1U]; - [cluster changeChannelByNumberWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a ChangeChannelByNumber command Error: %@", err); + [cluster stopPlaybackWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a Stop command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatTheChannelHasChangedOnTheDevice_3() + CHIP_ERROR TestVerifyThatTheMediaIsStoped_10() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please enter 'y' if channel has changed on the devicegarbage: not in length on purpose", 53); + value.message = chip::Span("Please enter 'y' if media state is stopedgarbage: not in length on purpose", 41); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR TestReadsTheCurrentChannelAttribute_4() + CHIP_ERROR TestReadsTheCurrentStateAttribute_11() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentChannelWithCompletionHandler:^( - MTRChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentChannel attribute Error: %@", err); + [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentState attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValue("CurrentState", actualValue, 2U)); } NextTest(); @@ -35857,23 +35822,21 @@ class Test_TC_CHANNEL_5_2 : public TestCommandBridge { } }; -class Test_TC_CHANNEL_5_3 : public TestCommandBridge { +class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CHANNEL_5_3() - : TestCommandBridge("Test_TC_CHANNEL_5_3") + Test_TC_MEDIAPLAYBACK_6_2() + : TestCommandBridge("Test_TC_MEDIAPLAYBACK_6_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("majornumber", 0, UINT16_MAX, &mMajornumber); - AddArgument("minornumber", 0, UINT16_MAX, &mMinornumber); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CHANNEL_5_3() {} + ~Test_TC_MEDIAPLAYBACK_6_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -35881,11 +35844,11 @@ class Test_TC_CHANNEL_5_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CHANNEL_5_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAPLAYBACK_6_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CHANNEL_5_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAPLAYBACK_6_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -35902,54 +35865,141 @@ class Test_TC_CHANNEL_5_3 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH reads the Lineup attribute from the DUT to show list of Inputs available and Verify that " - "the response contains a lineup info object\n"); - if (ShouldSkip("CHANNEL.S.A0001")) { + ChipLogProgress( + chipTool, " ***** Test Step 1 : Precondition: Media content in a paused state at the beginning of the content\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp")) { NextTest(); return; } - err = TestThReadsTheLineupAttributeFromTheDutToShowListOfInputsAvailableAndVerifyThatTheResponseContainsALineupInfoObject_1(); + err = TestPreconditionMediaContentInAPausedStateAtTheBeginningOfTheContent_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the ChannelList attribute from the DUT\n"); - if (ShouldSkip("CHANNEL.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the CurrentState attribute from the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C01.Rsp")) { NextTest(); return; } - err = TestReadsTheChannelListAttributeFromTheDut_2(); + err = TestReadsTheCurrentStateAttributeFromTheDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the CurrentChannel attribute from the DUT\n"); - if (ShouldSkip("CHANNEL.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Sends a Play command to the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C00.Rsp")) { NextTest(); return; } - err = TestReadsTheCurrentChannelAttributeFromTheDut_3(); + err = TestSendsAPlayCommandToTheDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Sends a SkipChannel command to the DUT\n"); - if (ShouldSkip("CHANNEL.S.C03.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Verify that the media state is playing\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C00.Rsp")) { NextTest(); return; } - err = TestSendsASkipChannelCommandToTheDut_4(); + err = TestVerifyThatTheMediaStateIsPlaying_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Verify that the channel has changed on the device\n"); - if (ShouldSkip("PICS_USER_PROMPT && CHANNEL.S.C03.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the CurrentState attribute\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C00.Rsp")) { NextTest(); return; } - err = TestVerifyThatTheChannelHasChangedOnTheDevice_5(); + err = TestReadsTheCurrentStateAttribute_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the CurrentChannel attribute from the DUT\n"); - if (ShouldSkip("CHANNEL.S.A0002 && CHANNEL.S.C03.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Sends a StartOver command to the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C03.Rsp")) { NextTest(); return; } - err = TestReadsTheCurrentChannelAttributeFromTheDut_6(); + err = TestSendsAStartOverCommandToTheDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Verify that the media is started over\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatTheMediaIsStartedOver_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Sends a Next command to the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C05.Rsp")) { + NextTest(); + return; + } + err = TestSendsANextCommandToTheDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Verify that the next media item in the queue has been loaded\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C05.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatTheNextMediaItemInTheQueueHasBeenLoaded_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Sends a Previous command to the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C04.Rsp")) { + NextTest(); + return; + } + err = TestSendsAPreviousCommandToTheDut_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Verify that the previous media item in the queue has been loaded\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C04.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatThePreviousMediaItemInTheQueueHasBeenLoaded_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Sends a SkipForward command to the DUT \n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C08.Rsp")) { + NextTest(); + return; + } + err = TestSendsASkipForwardCommandToTheDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Verify that the media has skipped forward 10 seconds\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C08.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatTheMediaHasSkippedForward10Seconds_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the SampledPosition attribute from the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0003 && MEDIAPLAYBACK.S.C08.Rsp")) { + NextTest(); + return; + } + err = TestReadsTheSampledPositionAttributeFromTheDut_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Sends a SkipBackward command to the DUT \n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C09.Rsp")) { + NextTest(); + return; + } + err = TestSendsASkipBackwardCommandToTheDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Verify that the media has skipped backward 10 seconds\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C09.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatTheMediaHasSkippedBackward10Seconds_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Reads the SampledPosition attribute from the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0003 && MEDIAPLAYBACK.S.C09.Rsp")) { + NextTest(); + return; + } + err = TestReadsTheSampledPositionAttributeFromTheDut_17(); break; } @@ -35983,6 +36033,39 @@ class Test_TC_CHANNEL_5_3 : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -35996,13 +36079,11 @@ class Test_TC_CHANNEL_5_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mMajornumber; - chip::Optional mMinornumber; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -36012,60 +36093,130 @@ class Test_TC_CHANNEL_5_3 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR - TestThReadsTheLineupAttributeFromTheDutToShowListOfInputsAvailableAndVerifyThatTheResponseContainsALineupInfoObject_1() + CHIP_ERROR TestPreconditionMediaContentInAPausedStateAtTheBeginningOfTheContent_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeLineupWithCompletionHandler:^(MTRChannelClusterLineupInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the Lineup attribute from the DUT to show list of Inputs available and Verify that the response " - @"contains a lineup info object Error: %@", - err); + [cluster pauseWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Precondition: Media content in a paused state at the beginning of the content Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsTheCurrentStateAttributeFromTheDut_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentState attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentState", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendsAPlayCommandToTheDut_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + playWithCompletionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a Play command to the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheChannelListAttributeFromTheDut_2() + CHIP_ERROR TestVerifyThatTheMediaStateIsPlaying_4() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if media state is playinggarbage: not in length on purpose", 42); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestReadsTheCurrentStateAttribute_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the ChannelList attribute from the DUT Error: %@", err); + [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentState attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("channelList", "list", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentState", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheCurrentChannelAttributeFromTheDut_3() + CHIP_ERROR TestSendsAStartOverCommandToTheDut_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentChannelWithCompletionHandler:^( - MTRChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentChannel attribute from the DUT Error: %@", err); + [cluster startOverWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a StartOver command to the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); } NextTest(); @@ -36074,55 +36225,203 @@ class Test_TC_CHANNEL_5_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsASkipChannelCommandToTheDut_4() + CHIP_ERROR TestVerifyThatTheMediaIsStartedOver_7() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if media is started overgarbage: not in length on purpose", 41); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestSendsANextCommandToTheDut_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRChannelClusterSkipChannelParams alloc] init]; - params.count = [NSNumber numberWithUnsignedShort:1U]; - [cluster skipChannelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends a SkipChannel command to the DUT Error: %@", err); + [cluster + nextWithCompletionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a Next command to the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatTheChannelHasChangedOnTheDevice_5() + CHIP_ERROR TestVerifyThatTheNextMediaItemInTheQueueHasBeenLoaded_9() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please enter 'y' if channel has changed on the devicegarbage: not in length on purpose", 53); + value.message = chip::Span( + "Please enter 'y' if media item in the queue has been loadedgarbage: not in length on purpose", 59); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR TestReadsTheCurrentChannelAttributeFromTheDut_6() + CHIP_ERROR TestSendsAPreviousCommandToTheDut_10() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterChannel * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentChannelWithCompletionHandler:^( - MTRChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentChannel attribute from the DUT Error: %@", err); + [cluster previousWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a Previous command to the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatThePreviousMediaItemInTheQueueHasBeenLoaded_11() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if previous media item in the queue has been loadedgarbage: not in length on purpose", 68); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestSendsASkipForwardCommandToTheDut_12() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRMediaPlaybackClusterSkipForwardParams alloc] init]; + params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:10000ULL]; + [cluster + skipForwardWithParams:params + completionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a SkipForward command to the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatTheMediaHasSkippedForward10Seconds_13() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if media has skipped forward 10 secondsgarbage: not in length on purpose", 56); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestReadsTheSampledPositionAttributeFromTheDut_14() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSampledPositionWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the SampledPosition attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("CurrentChannel", actualValue)); + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); } - if (value != nil) { - VerifyOrReturn(CheckConstraintType("currentChannel", "ChannelInfo", "ChannelInfo")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendsASkipBackwardCommandToTheDut_15() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRMediaPlaybackClusterSkipBackwardParams alloc] init]; + params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:10000ULL]; + [cluster + skipBackwardWithParams:params + completionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a SkipBackward command to the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatTheMediaHasSkippedBackward10Seconds_16() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if media has skipped backward 10 secondsgarbage: not in length on purpose", 57); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestReadsTheSampledPositionAttributeFromTheDut_17() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSampledPositionWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the SampledPosition attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); } NextTest(); @@ -36132,21 +36431,22 @@ class Test_TC_CHANNEL_5_3 : public TestCommandBridge { } }; -class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { +class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAPLAYBACK_6_1() - : TestCommandBridge("Test_TC_MEDIAPLAYBACK_6_1") + Test_TC_MEDIAPLAYBACK_6_3() + : TestCommandBridge("Test_TC_MEDIAPLAYBACK_6_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("SeekPosition", 0, UINT64_MAX, &mSeekPosition); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAPLAYBACK_6_1() {} + ~Test_TC_MEDIAPLAYBACK_6_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -36154,11 +36454,11 @@ class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAPLAYBACK_6_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAPLAYBACK_6_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAPLAYBACK_6_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAPLAYBACK_6_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -36184,84 +36484,70 @@ class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { err = TestPreconditionMediaContentInAPausedStateAtTheBeginningOfTheContent_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the CurrentState attribute\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Sends a Seek command\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C0B.Rsp")) { NextTest(); return; } - err = TestReadsTheCurrentStateAttribute_2(); + err = TestSendsASeekCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Sends a Play command\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C00.Rsp")) { + ChipLogProgress( + chipTool, " ***** Test Step 3 : Verify that the media has moved to 10 seconds from the starting point\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C0B.Rsp")) { NextTest(); return; } - err = TestSendsAPlayCommand_3(); + err = TestVerifyThatTheMediaHasMovedTo10SecondsFromTheStartingPoint_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Verify that the media state is playing\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the SampledPosition attribute\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0003 && MEDIAPLAYBACK.S.C0B.Rsp")) { NextTest(); return; } - err = TestVerifyThatTheMediaStateIsPlaying_4(); + err = TestReadsTheSampledPositionAttribute_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the CurrentState attribute\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads the StartTime attribute from the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0001 && PICS_USER_PROMPT")) { NextTest(); return; } - err = TestReadsTheCurrentStateAttribute_5(); + err = TestThReadsTheStartTimeAttributeFromTheDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : sends a Pause command\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads the SeekRangeEnd attribute from the DUT\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0005")) { NextTest(); return; } - err = TestSendsAPauseCommand_6(); + err = TestThReadsTheSeekRangeEndAttributeFromTheDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Verify that the media is paused\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads the SeekRangeStart attribute from the DUT\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0006")) { NextTest(); return; } - err = TestVerifyThatTheMediaIsPaused_7(); + err = TestThReadsTheSeekRangeStartAttributeFromTheDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the CurrentState attribute\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp && MEDIAPLAYBACK.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads the Duration attribute from the DUT\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0002")) { NextTest(); return; } - err = TestReadsTheCurrentStateAttribute_8(); + err = TestThReadsTheDurationAttributeFromTheDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Sends a Stop command\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C02.Rsp")) { - NextTest(); - return; - } - err = TestSendsAStopCommand_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Verify that the media is stoped\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C02.Rsp")) { - NextTest(); - return; - } - err = TestVerifyThatTheMediaIsStoped_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the CurrentState attribute\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C02.Rsp")) { + ChipLogProgress( + chipTool, " ***** Test Step 9 : Sends a Seek command Position value beyond the furthest valid position\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C0B.Rsp")) { NextTest(); return; } - err = TestReadsTheCurrentStateAttribute_11(); + err = TestSendsASeekCommandPositionValueBeyondTheFurthestValidPosition_9(); break; } @@ -36304,12 +36590,6 @@ class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -36323,11 +36603,12 @@ class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mSeekPosition; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -36362,31 +36643,7 @@ class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheCurrentStateAttribute_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentState attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentState", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSendsAPlayCommand_3() + CHIP_ERROR TestSendsASeekCommand_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -36394,33 +36651,36 @@ class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - playWithCompletionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a Play command Error: %@", err); + __auto_type * params = [[MTRMediaPlaybackClusterSeekParams alloc] init]; + params.position = [NSNumber numberWithUnsignedLongLong:10000ULL]; + [cluster seekWithParams:params + completionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a Seek command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatTheMediaStateIsPlaying_4() + CHIP_ERROR TestVerifyThatTheMediaHasMovedTo10SecondsFromTheStartingPoint_3() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' if media state is playinggarbage: not in length on purpose", 42); + value.message = chip::Span( + "Please enter 'y' if media has moved to 10 seconds from the starting pointgarbage: not in length on purpose", 73); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR TestReadsTheCurrentStateAttribute_5() + CHIP_ERROR TestReadsTheSampledPositionAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -36428,14 +36688,15 @@ class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentState attribute Error: %@", err); + [cluster readAttributeSampledPositionWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the SampledPosition attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("CurrentState", actualValue, 0U)); + VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); } NextTest(); @@ -36444,41 +36705,43 @@ class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsAPauseCommand_6() + CHIP_ERROR TestThReadsTheStartTimeAttributeFromTheDut_5() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster pauseWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"sends a Pause command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } - NextTest(); - }]; + CHIP_ERROR TestThReadsTheSeekRangeEndAttributeFromTheDut_6() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } - return CHIP_NO_ERROR; + CHIP_ERROR TestThReadsTheSeekRangeStartAttributeFromTheDut_7() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestVerifyThatTheMediaIsPaused_7() + CHIP_ERROR TestThReadsTheDurationAttributeFromTheDut_8() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' if media state is pausedgarbage: not in length on purpose", 41); + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR TestReadsTheCurrentStateAttribute_8() + CHIP_ERROR TestSendsASeekCommandPositionValueBeyondTheFurthestValidPosition_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -36486,86 +36749,32 @@ class Test_TC_MEDIAPLAYBACK_6_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentState attribute Error: %@", err); + __auto_type * params = [[MTRMediaPlaybackClusterSeekParams alloc] init]; + params.position = mSeekPosition.HasValue() ? [NSNumber numberWithUnsignedLongLong:mSeekPosition.Value()] + : [NSNumber numberWithUnsignedLongLong:100000000ULL]; + [cluster seekWithParams:params + completionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a Seek command Position value beyond the furthest valid position Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentState", actualValue, 1U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 5U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestSendsAStopCommand_9() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster stopPlaybackWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a Stop command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyThatTheMediaIsStoped_10() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' if media state is stopedgarbage: not in length on purpose", 41); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestReadsTheCurrentStateAttribute_11() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentState attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentState", actualValue, 2U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { +class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAPLAYBACK_6_2() - : TestCommandBridge("Test_TC_MEDIAPLAYBACK_6_2") + Test_TC_MEDIAPLAYBACK_6_4() + : TestCommandBridge("Test_TC_MEDIAPLAYBACK_6_4") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -36575,7 +36784,7 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAPLAYBACK_6_2() {} + ~Test_TC_MEDIAPLAYBACK_6_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -36583,11 +36792,11 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAPLAYBACK_6_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAPLAYBACK_6_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAPLAYBACK_6_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAPLAYBACK_6_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -36621,124 +36830,124 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { err = TestReadsTheCurrentStateAttributeFromTheDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Sends a Play command to the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the PlaybackSpeed attribute from the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C01.Rsp")) { NextTest(); return; } - err = TestSendsAPlayCommandToTheDut_3(); + err = TestReadsThePlaybackSpeedAttributeFromTheDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Verify that the media state is playing\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Sends a FastForward command\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C07.Rsp")) { NextTest(); return; } - err = TestVerifyThatTheMediaStateIsPlaying_4(); + err = TestSendsAFastForwardCommand_4(); break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the CurrentState attribute\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C00.Rsp")) { + if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C07.Rsp")) { NextTest(); return; } err = TestReadsTheCurrentStateAttribute_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Sends a StartOver command to the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C03.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the PlaybackSpeed attribute from the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C07.Rsp")) { NextTest(); return; } - err = TestSendsAStartOverCommandToTheDut_6(); + err = TestReadsThePlaybackSpeedAttributeFromTheDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Verify that the media is started over\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C03.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Sends a FastForward command\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C07.Rsp")) { NextTest(); return; } - err = TestVerifyThatTheMediaIsStartedOver_7(); + err = TestSendsAFastForwardCommand_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Sends a Next command to the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C05.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the PlaybackSpeed attribute from the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C07.Rsp")) { NextTest(); return; } - err = TestSendsANextCommandToTheDut_8(); + err = TestReadsThePlaybackSpeedAttributeFromTheDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Verify that the next media item in the queue has been loaded\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C05.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : Sends a Rewind command to the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C06.Rsp")) { NextTest(); return; } - err = TestVerifyThatTheNextMediaItemInTheQueueHasBeenLoaded_9(); + err = TestSendsARewindCommandToTheDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Sends a Previous command to the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C04.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the CurrentState attribute\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C06.Rsp")) { NextTest(); return; } - err = TestSendsAPreviousCommandToTheDut_10(); + err = TestReadsTheCurrentStateAttribute_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Verify that the previous media item in the queue has been loaded\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C04.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the PlaybackSpeed attribute from the DUT\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) { NextTest(); return; } - err = TestVerifyThatThePreviousMediaItemInTheQueueHasBeenLoaded_11(); + err = TestReadsThePlaybackSpeedAttributeFromTheDut_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Sends a SkipForward command to the DUT \n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C08.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 12 : Sends a Rewind command to the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C06.Rsp")) { NextTest(); return; } - err = TestSendsASkipForwardCommandToTheDut_12(); + err = TestSendsARewindCommandToTheDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Verify that the media has skipped forward 10 seconds\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C08.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the PlaybackSpeed attribute from the DUT\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) { NextTest(); return; } - err = TestVerifyThatTheMediaHasSkippedForward10Seconds_13(); + err = TestReadsThePlaybackSpeedAttributeFromTheDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the SampledPosition attribute from the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0003 && MEDIAPLAYBACK.S.C08.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 14 : Sends a Play command\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.C00.Rsp")) { NextTest(); return; } - err = TestReadsTheSampledPositionAttributeFromTheDut_14(); + err = TestSendsAPlayCommand_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Sends a SkipBackward command to the DUT \n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C09.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : Reads the PlaybackSpeed attribute from the DUT\n"); + if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C00.Rsp")) { NextTest(); return; } - err = TestSendsASkipBackwardCommandToTheDut_15(); + err = TestReadsThePlaybackSpeedAttributeFromTheDut_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Verify that the media has skipped backward 10 seconds\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C09.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 16 : Sends consecutive FastForward commands\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C07.Rsp")) { NextTest(); return; } - err = TestVerifyThatTheMediaHasSkippedBackward10Seconds_16(); + err = TestSendsConsecutiveFastForwardCommands_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Reads the SampledPosition attribute from the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0003 && MEDIAPLAYBACK.S.C09.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 17 : Sends consecutive Rewind commands\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C06.Rsp")) { NextTest(); return; } - err = TestReadsTheSampledPositionAttributeFromTheDut_17(); + err = TestSendsConsecutiveRewindCommands_17(); break; } @@ -36881,7 +37090,7 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsAPlayCommandToTheDut_3() + CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -36889,30 +37098,45 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - playWithCompletionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a Play command to the DUT Error: %@", err); + [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 0.0f)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatTheMediaStateIsPlaying_4() + CHIP_ERROR TestSendsAFastForwardCommand_4() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' if media state is playinggarbage: not in length on purpose", 42); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster fastForwardWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a FastForward command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestReadsTheCurrentStateAttribute_5() @@ -36939,7 +37163,7 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsAStartOverCommandToTheDut_6() + CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -36947,15 +37171,14 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster startOverWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a StartOver command to the DUT Error: %@", err); + [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); + id actualValue = value; + VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 1.0f)); } NextTest(); @@ -36964,16 +37187,7 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatTheMediaIsStartedOver_7() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' if media is started overgarbage: not in length on purpose", 41); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestSendsANextCommandToTheDut_8() + CHIP_ERROR TestSendsAFastForwardCommand_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -36981,34 +37195,48 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - nextWithCompletionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a Next command to the DUT Error: %@", err); + [cluster fastForwardWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a FastForward command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatTheNextMediaItemInTheQueueHasBeenLoaded_9() + CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_8() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span( - "Please enter 'y' if media item in the queue has been loadedgarbage: not in length on purpose", 59); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 2.0f)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsAPreviousCommandToTheDut_10() + CHIP_ERROR TestSendsARewindCommandToTheDut_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -37016,9 +37244,9 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster previousWithCompletionHandler:^( + [cluster rewindWithCompletionHandler:^( MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a Previous command to the DUT Error: %@", err); + NSLog(@"Sends a Rewind command to the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -37033,17 +37261,7 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatThePreviousMediaItemInTheQueueHasBeenLoaded_11() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span( - "Please enter 'y' if previous media item in the queue has been loadedgarbage: not in length on purpose", 68); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestSendsASkipForwardCommandToTheDut_12() + CHIP_ERROR TestReadsTheCurrentStateAttribute_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -37051,37 +37269,33 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRMediaPlaybackClusterSkipForwardParams alloc] init]; - params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:10000ULL]; - [cluster - skipForwardWithParams:params - completionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a SkipForward command to the DUT Error: %@", err); + [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentState attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentState", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatTheMediaHasSkippedForward10Seconds_13() + CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_11() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span( - "Please enter 'y' if media has skipped forward 10 secondsgarbage: not in length on purpose", 56); + value.message + = chip::Span("Please enter 'y' if PlaybackSpeed value is -1garbage: not in length on purpose", 45); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR TestReadsTheSampledPositionAttributeFromTheDut_14() + CHIP_ERROR TestSendsARewindCommandToTheDut_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -37089,15 +37303,15 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSampledPositionWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the SampledPosition attribute from the DUT Error: %@", err); + [cluster rewindWithCompletionHandler:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a Rewind command to the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); } NextTest(); @@ -37106,7 +37320,17 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsASkipBackwardCommandToTheDut_15() + CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_13() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please enter 'y' if PlaybackSpeed value is -2garbage: not in length on purpose", 45); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestSendsAPlayCommand_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -37114,37 +37338,24 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRMediaPlaybackClusterSkipBackwardParams alloc] init]; - params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:10000ULL]; [cluster - skipBackwardWithParams:params - completionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a SkipBackward command to the DUT Error: %@", err); + playWithCompletionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a Play command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatTheMediaHasSkippedBackward10Seconds_16() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span( - "Please enter 'y' if media has skipped backward 10 secondsgarbage: not in length on purpose", 57); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestReadsTheSampledPositionAttributeFromTheDut_17() + CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device @@ -37152,15 +37363,14 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSampledPositionWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the SampledPosition attribute from the DUT Error: %@", err); + [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 1.0f)); } NextTest(); @@ -37168,24 +37378,41 @@ class Test_TC_MEDIAPLAYBACK_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestSendsConsecutiveFastForwardCommands_16() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestSendsConsecutiveRewindCommands_17() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } }; -class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { +class Test_TC_AUDIOOUTPUT_7_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAPLAYBACK_6_3() - : TestCommandBridge("Test_TC_MEDIAPLAYBACK_6_3") + Test_TC_AUDIOOUTPUT_7_1() + : TestCommandBridge("Test_TC_AUDIOOUTPUT_7_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("SeekPosition", 0, UINT64_MAX, &mSeekPosition); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAPLAYBACK_6_3() {} + ~Test_TC_AUDIOOUTPUT_7_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -37193,11 +37420,11 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAPLAYBACK_6_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_AUDIOOUTPUT_7_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAPLAYBACK_6_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_AUDIOOUTPUT_7_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -37214,79 +37441,28 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : Precondition: Media content in a paused state at the beginning of the content\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the OutputList attribute\n"); + if (ShouldSkip("AUDIOOUTPUT.S.A0000")) { NextTest(); return; } - err = TestPreconditionMediaContentInAPausedStateAtTheBeginningOfTheContent_1(); + err = TestReadsTheOutputListAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Sends a Seek command\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C0B.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Sends a SelectAudioOutput command\n"); + if (ShouldSkip("AUDIOOUTPUT.S.C00.Rsp")) { NextTest(); return; } - err = TestSendsASeekCommand_2(); + err = TestSendsASelectAudioOutputCommand_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : Verify that the media has moved to 10 seconds from the starting point\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C0B.Rsp")) { - NextTest(); - return; - } - err = TestVerifyThatTheMediaHasMovedTo10SecondsFromTheStartingPoint_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the SampledPosition attribute\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0003 && MEDIAPLAYBACK.S.C0B.Rsp")) { - NextTest(); - return; - } - err = TestReadsTheSampledPositionAttribute_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads the StartTime attribute from the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0001 && PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestThReadsTheStartTimeAttributeFromTheDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads the SeekRangeEnd attribute from the DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0005")) { - NextTest(); - return; - } - err = TestThReadsTheSeekRangeEndAttributeFromTheDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads the SeekRangeStart attribute from the DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0006")) { - NextTest(); - return; - } - err = TestThReadsTheSeekRangeStartAttributeFromTheDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads the Duration attribute from the DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0002")) { - NextTest(); - return; - } - err = TestThReadsTheDurationAttributeFromTheDut_8(); - break; - case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : Sends a Seek command Position value beyond the furthest valid position\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C0B.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the CurrentOutput attribute\n"); + if (ShouldSkip("AUDIOOUTPUT.S.A0001 && AUDIOOUTPUT.S.C00.Rsp")) { NextTest(); return; } - err = TestSendsASeekCommandPositionValueBeyondTheFurthestValidPosition_9(); + err = TestReadsTheCurrentOutputAttribute_3(); break; } @@ -37311,24 +37487,6 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -37342,12 +37500,11 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mSeekPosition; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -37357,85 +37514,64 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestPreconditionMediaContentInAPausedStateAtTheBeginningOfTheContent_1() + CHIP_ERROR TestReadsTheOutputListAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster pauseWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Precondition: Media content in a paused state at the beginning of the content Error: %@", err); + [cluster readAttributeOutputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OutputList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - + VerifyOrReturn(CheckConstraintType("outputList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsASeekCommand_2() + CHIP_ERROR TestSendsASelectAudioOutputCommand_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRMediaPlaybackClusterSeekParams alloc] init]; - params.position = [NSNumber numberWithUnsignedLongLong:10000ULL]; - [cluster seekWithParams:params - completionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a Seek command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRAudioOutputClusterSelectOutputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1U]; + [cluster selectOutputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends a SelectAudioOutput command Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatTheMediaHasMovedTo10SecondsFromTheStartingPoint_3() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span( - "Please enter 'y' if media has moved to 10 seconds from the starting pointgarbage: not in length on purpose", 73); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestReadsTheSampledPositionAttribute_4() + CHIP_ERROR TestReadsTheCurrentOutputAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSampledPositionWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the SampledPosition attribute Error: %@", err); + [cluster readAttributeCurrentOutputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentOutput attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValueNonNull("SampledPosition", actualValue)); + VerifyOrReturn(CheckValue("CurrentOutput", actualValue, 1U)); } NextTest(); @@ -37443,87 +37579,201 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestThReadsTheStartTimeAttributeFromTheDut_5() +class Test_TC_AUDIOOUTPUT_7_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_AUDIOOUTPUT_7_2() + : TestCommandBridge("Test_TC_AUDIOOUTPUT_7_2") + , mTestIndex(0) { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - CHIP_ERROR TestThReadsTheSeekRangeEndAttributeFromTheDut_6() + ~Test_TC_AUDIOOUTPUT_7_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_AUDIOOUTPUT_7_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_AUDIOOUTPUT_7_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the OutputList attribute from the DUT\n"); + if (ShouldSkip("AUDIOOUTPUT.S.A0000")) { + NextTest(); + return; + } + err = TestReadsTheOutputListAttributeFromTheDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Sends a RenameOutput command\n"); + if (ShouldSkip("AUDIOOUTPUT.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestSendsARenameOutputCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Reads the OutputList attribute from the DUT Verify that the output at the index provided in " + "step 2 has the name CertTest\n"); + if (ShouldSkip("PICS_USER_PROMPT && AUDIOOUTPUT.S.A0001 && AUDIOOUTPUT.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestReadsTheOutputListAttributeFromTheDutVerifyThatTheOutputAtTheIndexProvidedInStep2HasTheNameCertTest_3(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestThReadsTheSeekRangeStartAttributeFromTheDut_7() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); } - CHIP_ERROR TestThReadsTheDurationAttributeFromTheDut_8() + chip::System::Clock::Timeout GetWaitDuration() const override { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } - CHIP_ERROR TestSendsASeekCommandPositionValueBeyondTheFurthestValidPosition_9() +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSArray * _Nonnull audioOutputListValues; + + CHIP_ERROR TestReadsTheOutputListAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRMediaPlaybackClusterSeekParams alloc] init]; - params.position = mSeekPosition.HasValue() ? [NSNumber numberWithUnsignedLongLong:mSeekPosition.Value()] - : [NSNumber numberWithUnsignedLongLong:100000000ULL]; - [cluster seekWithParams:params - completionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a Seek command Position value beyond the furthest valid position Error: %@", err); + [cluster readAttributeOutputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the OutputList attribute from the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 5U)); - } + VerifyOrReturn(CheckConstraintType("outputList", "list", "list")); + { + audioOutputListValues = value; + } - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendsARenameOutputCommand_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRAudioOutputClusterRenameOutputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1U]; + params.name = @"CertTest"; + [cluster renameOutputWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends a RenameOutput command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadsTheOutputListAttributeFromTheDutVerifyThatTheOutputAtTheIndexProvidedInStep2HasTheNameCertTest_3() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } }; -class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { +class Test_TC_TGTNAV_8_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAPLAYBACK_6_4() - : TestCommandBridge("Test_TC_MEDIAPLAYBACK_6_4") + Test_TC_TGTNAV_8_1() + : TestCommandBridge("Test_TC_TGTNAV_8_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("targetvalue1", 0, UINT8_MAX, &mTargetvalue1); + AddArgument("targetvalue2", 0, UINT8_MAX, &mTargetvalue2); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAPLAYBACK_6_4() {} + ~Test_TC_TGTNAV_8_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -37531,11 +37781,11 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAPLAYBACK_6_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TGTNAV_8_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAPLAYBACK_6_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TGTNAV_8_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -37552,141 +37802,36 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : Precondition: Media content in a paused state at the beginning of the content\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the CurrentTarget attribute\n"); + if (ShouldSkip("TGTNAV.S.A0001")) { NextTest(); return; } - err = TestPreconditionMediaContentInAPausedStateAtTheBeginningOfTheContent_1(); + err = TestReadsTheCurrentTargetAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the CurrentState attribute from the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the TargetList attribute\n"); + if (ShouldSkip("TGTNAV.S.A0000")) { NextTest(); return; } - err = TestReadsTheCurrentStateAttributeFromTheDut_2(); + err = TestReadsTheTargetListAttribute_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the PlaybackSpeed attribute from the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Sends a NavigateTarget command\n"); + if (ShouldSkip("TGTNAV.S.C00.Rsp")) { NextTest(); return; } - err = TestReadsThePlaybackSpeedAttributeFromTheDut_3(); + err = TestSendsANavigateTargetCommand_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Sends a FastForward command\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestSendsAFastForwardCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the CurrentState attribute\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestReadsTheCurrentStateAttribute_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the PlaybackSpeed attribute from the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestReadsThePlaybackSpeedAttributeFromTheDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Sends a FastForward command\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestSendsAFastForwardCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the PlaybackSpeed attribute from the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestReadsThePlaybackSpeedAttributeFromTheDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Sends a Rewind command to the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestSendsARewindCommandToTheDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the CurrentState attribute\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0000 && MEDIAPLAYBACK.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestReadsTheCurrentStateAttribute_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the PlaybackSpeed attribute from the DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestReadsThePlaybackSpeedAttributeFromTheDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Sends a Rewind command to the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestSendsARewindCommandToTheDut_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the PlaybackSpeed attribute from the DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestReadsThePlaybackSpeedAttributeFromTheDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Sends a Play command\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestSendsAPlayCommand_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Reads the PlaybackSpeed attribute from the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestReadsThePlaybackSpeedAttributeFromTheDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Sends consecutive FastForward commands\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C07.Rsp")) { - NextTest(); - return; - } - err = TestSendsConsecutiveFastForwardCommands_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Sends consecutive Rewind commands\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.C06.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the CurrentTarget attribute\n"); + if (ShouldSkip("TGTNAV.S.A0001 && TGTNAV.S.C00.Rsp")) { NextTest(); return; } - err = TestSendsConsecutiveRewindCommands_17(); + err = TestReadsTheCurrentTargetAttribute_4(); break; } @@ -37714,45 +37859,6 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -37766,11 +37872,13 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mTargetvalue1; + chip::Optional mTargetvalue2; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -37780,47 +37888,46 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestPreconditionMediaContentInAPausedStateAtTheBeginningOfTheContent_1() + CHIP_ERROR TestReadsTheCurrentTargetAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster pauseWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Precondition: Media content in a paused state at the beginning of the content Error: %@", err); + [cluster readAttributeCurrentTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentTarget attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + VerifyOrReturn(CheckConstraintType("currentTarget", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("currentTarget", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentTarget", [value unsignedCharValue], 255U)); NextTest(); }]; return CHIP_NO_ERROR; } + NSArray * _Nonnull TargetListValues; - CHIP_ERROR TestReadsTheCurrentStateAttributeFromTheDut_2() + CHIP_ERROR TestReadsTheTargetListAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentState attribute from the DUT Error: %@", err); + [cluster readAttributeTargetListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the TargetList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("targetList", "list", "list")); { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentState", actualValue, 1U)); + TargetListValues = value; } NextTest(); @@ -37829,47 +37936,46 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_3() + CHIP_ERROR TestSendsANavigateTargetCommand_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRTargetNavigatorClusterNavigateTargetParams alloc] init]; + params.target = mTargetvalue1.HasValue() ? [NSNumber numberWithUnsignedChar:mTargetvalue1.Value()] + : [NSNumber numberWithUnsignedChar:1U]; + [cluster navigateTargetWithParams:params + completionHandler:^( + MTRTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Sends a NavigateTarget command Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 0.0f)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsAFastForwardCommand_4() + CHIP_ERROR TestReadsTheCurrentTargetAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster fastForwardWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a FastForward command Error: %@", err); + [cluster readAttributeCurrentTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the CurrentTarget attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentTarget", actualValue, mTargetvalue1.HasValue() ? mTargetvalue1.Value() : 1U)); } NextTest(); @@ -37877,122 +37983,257 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadsTheCurrentStateAttribute_5() +class Test_TC_APBSC_9_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_APBSC_9_1() + : TestCommandBridge("Test_TC_APBSC_9_1") + , mTestIndex(0) { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentState attribute Error: %@", err); + ~Test_TC_APBSC_9_1() {} - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentState", actualValue, 0U)); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_APBSC_9_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_APBSC_9_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the VendorName attribute\n"); + if (ShouldSkip("APBSC.S.A0000")) { + NextTest(); + return; + } + err = TestReadsTheVendorNameAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the VendorID attribute\n"); + if (ShouldSkip("APBSC.S.A0001")) { + NextTest(); + return; + } + err = TestReadsTheVendorIDAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the ApplicationName attribute\n"); + if (ShouldSkip("APBSC.S.A0002")) { + NextTest(); + return; + } + err = TestReadsTheApplicationNameAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the ProductID attribute\n"); + if (ShouldSkip("APBSC.S.A0003")) { + NextTest(); + return; + } + err = TestReadsTheProductIDAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the Application attribute\n"); + if (ShouldSkip("APBSC.S.A0004")) { + NextTest(); + return; + } + err = TestReadsTheApplicationAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the Status attribute\n"); + if (ShouldSkip("APBSC.S.A0005")) { + NextTest(); + return; + } + err = TestReadsTheStatusAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Reads the ApplicationVersion attribute\n"); + if (ShouldSkip("APBSC.S.A0006")) { + NextTest(); + return; + } + err = TestReadsTheApplicationVersionAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the AllowedVendorList attribute\n"); + if (ShouldSkip("APBSC.S.A0007")) { + NextTest(); + return; } + err = TestReadsTheAllowedVendorListAttribute_8(); + break; + } - NextTest(); - }]; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - return CHIP_NO_ERROR; + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); } - CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_6() + 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 = 9; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadsTheVendorNameAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); + [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the VendorName attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 1.0f)); - } - + VerifyOrReturn(CheckConstraintType("vendorName", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("vendorName", value, 32)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsAFastForwardCommand_7() + CHIP_ERROR TestReadsTheVendorIDAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster fastForwardWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a FastForward command Error: %@", err); + [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the VendorID attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - + VerifyOrReturn(CheckConstraintType("vendorID", "vendor_id", "vendor_id")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_8() + CHIP_ERROR TestReadsTheApplicationNameAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); + [cluster readAttributeApplicationNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the ApplicationName attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 2.0f)); - } - + VerifyOrReturn(CheckConstraintType("applicationName", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("applicationName", value, 256)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsARewindCommandToTheDut_9() + CHIP_ERROR TestReadsTheProductIDAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster rewindWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a Rewind command to the DUT Error: %@", err); + [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the ProductID attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + VerifyOrReturn(CheckConstraintType("productID", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("productID", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("productID", [value unsignedShortValue], 65535U)); NextTest(); }]; @@ -38000,58 +38241,42 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheCurrentStateAttribute_10() + CHIP_ERROR TestReadsTheApplicationAttribute_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentState attribute Error: %@", err); + [cluster readAttributeApplicationWithCompletionHandler:^( + MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the Application attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentState", actualValue, 0U)); - } - + VerifyOrReturn(CheckConstraintType("application", "ApplicationBasicApplication", "ApplicationBasicApplication")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_11() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please enter 'y' if PlaybackSpeed value is -1garbage: not in length on purpose", 45); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestSendsARewindCommandToTheDut_12() + CHIP_ERROR TestReadsTheStatusAttribute_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster rewindWithCompletionHandler:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a Rewind command to the DUT Error: %@", err); + [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the Status attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + VerifyOrReturn(CheckConstraintMinValue("status", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("status", [value unsignedCharValue], 3U)); NextTest(); }]; @@ -38059,89 +38284,53 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_13() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please enter 'y' if PlaybackSpeed value is -2garbage: not in length on purpose", 45); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestSendsAPlayCommand_14() + CHIP_ERROR TestReadsTheApplicationVersionAttribute_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - playWithCompletionHandler:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a Play command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster readAttributeApplicationVersionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the ApplicationVersion attribute Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("applicationVersion", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("applicationVersion", value, 32)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_15() + CHIP_ERROR TestReadsTheAllowedVendorListAttribute_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterMediaPlayback * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device + endpoint:3 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); + [cluster readAttributeAllowedVendorListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the AllowedVendorList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, 1.0f)); - } - + VerifyOrReturn(CheckConstraintType("allowedVendorList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - - CHIP_ERROR TestSendsConsecutiveFastForwardCommands_16() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestSendsConsecutiveRewindCommands_17() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } }; -class Test_TC_AUDIOOUTPUT_7_1 : public TestCommandBridge { +class Test_TC_CONTENTLAUNCHER_10_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_AUDIOOUTPUT_7_1() - : TestCommandBridge("Test_TC_AUDIOOUTPUT_7_1") + Test_TC_CONTENTLAUNCHER_10_1() + : TestCommandBridge("Test_TC_CONTENTLAUNCHER_10_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -38151,7 +38340,7 @@ class Test_TC_AUDIOOUTPUT_7_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_AUDIOOUTPUT_7_1() {} + ~Test_TC_CONTENTLAUNCHER_10_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -38159,11 +38348,11 @@ class Test_TC_AUDIOOUTPUT_7_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_AUDIOOUTPUT_7_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CONTENTLAUNCHER_10_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_AUDIOOUTPUT_7_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CONTENTLAUNCHER_10_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -38180,28 +38369,20 @@ class Test_TC_AUDIOOUTPUT_7_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the OutputList attribute\n"); - if (ShouldSkip("AUDIOOUTPUT.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the AcceptHeader attribute from the DUT\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.A0000")) { NextTest(); return; } - err = TestReadsTheOutputListAttribute_1(); + err = TestThReadsTheAcceptHeaderAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Sends a SelectAudioOutput command\n"); - if (ShouldSkip("AUDIOOUTPUT.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestSendsASelectAudioOutputCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the CurrentOutput attribute\n"); - if (ShouldSkip("AUDIOOUTPUT.S.A0001 && AUDIOOUTPUT.S.C00.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the SupportedStreamingProtocols attribute from the DUT\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.A0001")) { NextTest(); return; } - err = TestReadsTheCurrentOutputAttribute_3(); + err = TestThReadsTheSupportedStreamingProtocolsAttributeFromTheDut_2(); break; } @@ -38223,9 +38404,6 @@ class Test_TC_AUDIOOUTPUT_7_1 : public TestCommandBridge { case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -38239,7 +38417,7 @@ class Test_TC_AUDIOOUTPUT_7_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -38253,78 +38431,53 @@ class Test_TC_AUDIOOUTPUT_7_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadsTheOutputListAttribute_1() + CHIP_ERROR TestThReadsTheAcceptHeaderAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOutputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OutputList attribute Error: %@", err); + [cluster readAttributeAcceptHeaderWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the AcceptHeader attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("outputList", "list", "list")); + VerifyOrReturn(CheckConstraintType("acceptHeader", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsASelectAudioOutputCommand_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRAudioOutputClusterSelectOutputParams alloc] init]; - params.index = [NSNumber numberWithUnsignedChar:1U]; - [cluster selectOutputWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends a SelectAudioOutput command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsTheCurrentOutputAttribute_3() + CHIP_ERROR TestThReadsTheSupportedStreamingProtocolsAttributeFromTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentOutputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentOutput attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster + readAttributeSupportedStreamingProtocolsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the SupportedStreamingProtocols attribute from the DUT Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentOutput", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("supportedStreamingProtocols", "bitmap32", "bitmap32")); + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_AUDIOOUTPUT_7_2 : public TestCommandBridge { +class Test_TC_MOD_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_AUDIOOUTPUT_7_2() - : TestCommandBridge("Test_TC_AUDIOOUTPUT_7_2") + Test_TC_MOD_1_1() + : TestCommandBridge("Test_TC_MOD_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -38334,7 +38487,7 @@ class Test_TC_AUDIOOUTPUT_7_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_AUDIOOUTPUT_7_2() {} + ~Test_TC_MOD_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -38342,11 +38495,11 @@ class Test_TC_AUDIOOUTPUT_7_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_AUDIOOUTPUT_7_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MOD_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_AUDIOOUTPUT_7_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MOD_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -38363,30 +38516,54 @@ class Test_TC_AUDIOOUTPUT_7_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the OutputList attribute from the DUT\n"); - if (ShouldSkip("AUDIOOUTPUT.S.A0000")) { - NextTest(); - return; - } - err = TestReadsTheOutputListAttributeFromTheDut_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 : Sends a RenameOutput command\n"); - if (ShouldSkip("AUDIOOUTPUT.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); + if (ShouldSkip("MOD.S.F00")) { NextTest(); return; } - err = TestSendsARenameOutputCommand_2(); + err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : Reads the OutputList attribute from the DUT Verify that the output at the index provided in " - "step 2 has the name CertTest\n"); - if (ShouldSkip("PICS_USER_PROMPT && AUDIOOUTPUT.S.A0001 && AUDIOOUTPUT.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the FeatureMap attribute from the DUT\n"); + if (ShouldSkip(" !MOD.S.F00 ")) { NextTest(); return; } - err = TestReadsTheOutputListAttributeFromTheDutVerifyThatTheOutputAtTheIndexProvidedInStep2HasTheNameCertTest_3(); + err = TestThReadsTheFeatureMapAttributeFromTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads the AttributeList attribute from the DUT\n"); + err = TestThReadsTheAttributeListAttributeFromTheDut_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : TH reads the optional attribute(StartUpMode) in AttributeList from the DUT\n"); + if (ShouldSkip("MOD.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsTheOptionalAttributeStartUpModeInAttributeListFromTheDut_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : TH reads the optional attribute(OnMode) in AttributeList from the DUT\n"); + if (ShouldSkip("MOD.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsTheOptionalAttributeOnModeInAttributeListFromTheDut_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; } @@ -38411,6 +38588,21 @@ class Test_TC_AUDIOOUTPUT_7_2 : public TestCommandBridge { case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -38424,7 +38616,7 @@ class Test_TC_AUDIOOUTPUT_7_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -38437,237 +38629,149 @@ class Test_TC_AUDIOOUTPUT_7_2 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSArray * _Nonnull audioOutputListValues; - CHIP_ERROR TestReadsTheOutputListAttributeFromTheDut_1() + CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOutputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the OutputList attribute from the DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("outputList", "list", "list")); { - audioOutputListValues = value; + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); } + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsARenameOutputCommand_2() + CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAudioOutput * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRAudioOutputClusterRenameOutputParams alloc] init]; - params.index = [NSNumber numberWithUnsignedChar:1U]; - params.name = @"CertTest"; - [cluster renameOutputWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends a RenameOutput command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - return CHIP_NO_ERROR; - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); + } - CHIP_ERROR TestReadsTheOutputListAttributeFromTheDutVerifyThatTheOutputAtTheIndexProvidedInStep2HasTheNameCertTest_3() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } -}; + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; -class Test_TC_TGTNAV_8_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TGTNAV_8_1() - : TestCommandBridge("Test_TC_TGTNAV_8_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("targetvalue1", 0, UINT8_MAX, &mTargetvalue1); - AddArgument("targetvalue2", 0, UINT8_MAX, &mTargetvalue2); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_TGTNAV_8_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_3() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TGTNAV_8_1\n"); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TGTNAV_8_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the CurrentTarget attribute\n"); - if (ShouldSkip("TGTNAV.S.A0001")) { - NextTest(); - return; - } - err = TestReadsTheCurrentTargetAttribute_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the TargetList attribute\n"); - if (ShouldSkip("TGTNAV.S.A0000")) { - NextTest(); - return; - } - err = TestReadsTheTargetListAttribute_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Sends a NavigateTarget command\n"); - if (ShouldSkip("TGTNAV.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestSendsANavigateTargetCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the CurrentTarget attribute\n"); - if (ShouldSkip("TGTNAV.S.A0001 && TGTNAV.S.C00.Rsp")) { - NextTest(); - return; + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } - err = TestReadsTheCurrentTargetAttribute_4(); - break; - } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestThReadsTheAttributeListAttributeFromTheDut_4() { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTargetvalue1; - chip::Optional mTargetvalue2; - chip::Optional mTimeout; + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheCurrentTargetAttribute_1() + CHIP_ERROR TestThReadsTheOptionalAttributeStartUpModeInAttributeListFromTheDut_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentTarget attribute Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the optional attribute(StartUpMode) in AttributeList from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("currentTarget", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("currentTarget", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentTarget", [value unsignedCharValue], 255U)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); NextTest(); }]; return CHIP_NO_ERROR; } - NSArray * _Nonnull TargetListValues; - CHIP_ERROR TestReadsTheTargetListAttribute_2() + CHIP_ERROR TestThReadsTheOptionalAttributeOnModeInAttributeListFromTheDut_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTargetListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the TargetList attribute Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the optional attribute(OnMode) in AttributeList from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("targetList", "list", "list")); - { - TargetListValues = value; - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); NextTest(); }]; @@ -38675,48 +38779,47 @@ class Test_TC_TGTNAV_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsANavigateTargetCommand_3() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRTargetNavigatorClusterNavigateTargetParams alloc] init]; - params.target = mTargetvalue1.HasValue() ? [NSNumber numberWithUnsignedChar:mTargetvalue1.Value()] - : [NSNumber numberWithUnsignedChar:1U]; - [cluster navigateTargetWithParams:params - completionHandler:^( - MTRTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Sends a NavigateTarget command Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheCurrentTargetAttribute_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterTargetNavigator * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the CurrentTarget attribute Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("CurrentTarget", actualValue, mTargetvalue1.HasValue() ? mTargetvalue1.Value() : 1U)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -38724,21 +38827,29 @@ class Test_TC_TGTNAV_8_1 : public TestCommandBridge { } }; -class Test_TC_APBSC_9_1 : public TestCommandBridge { +class OTA_SuccessfulTransfer : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_APBSC_9_1() - : TestCommandBridge("Test_TC_APBSC_9_1") + OTA_SuccessfulTransfer() + : TestCommandBridge("OTA_SuccessfulTransfer") , mTestIndex(0) { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("requestorNodeId", 0, UINT64_MAX, &mRequestorNodeId); + AddArgument("providerNodeId", 0, UINT64_MAX, &mProviderNodeId); + AddArgument("providerPayload", &mProviderPayload); + AddArgument("providerDiscriminator", 0, UINT16_MAX, &mProviderDiscriminator); + AddArgument("providerPort", 0, UINT16_MAX, &mProviderPort); + AddArgument("providerKvs", &mProviderKvs); + AddArgument("otaImageFilePath", &mOtaImageFilePath); + AddArgument("rawImageFilePath", &mRawImageFilePath); + AddArgument("rawImageContent", &mRawImageContent); + AddArgument("downloadImageFilePath", &mDownloadImageFilePath); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_APBSC_9_1() {} + ~OTA_SuccessfulTransfer() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -38746,11 +38857,11 @@ class Test_TC_APBSC_9_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_APBSC_9_1\n"); + ChipLogProgress(chipTool, " **** Test Start: OTA_SuccessfulTransfer\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_APBSC_9_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: OTA_SuccessfulTransfer\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -38763,72 +38874,48 @@ class Test_TC_APBSC_9_1 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Create OTA image\n"); + err = TestCreateOtaImage_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the VendorName attribute\n"); - if (ShouldSkip("APBSC.S.A0000")) { - NextTest(); - return; - } - err = TestReadsTheVendorNameAttribute_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Start the provider with an image\n"); + err = TestStartTheProviderWithAnImage_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the VendorID attribute\n"); - if (ShouldSkip("APBSC.S.A0001")) { - NextTest(); - return; - } - err = TestReadsTheVendorIDAttribute_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Commission the provider from alpha\n"); + err = TestCommissionTheProviderFromAlpha_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads the ApplicationName attribute\n"); - if (ShouldSkip("APBSC.S.A0002")) { - NextTest(); - return; - } - err = TestReadsTheApplicationNameAttribute_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Wait for the commissioned provider to be retrieved for alpha\n"); + err = TestWaitForTheCommissionedProviderToBeRetrievedForAlpha_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the ProductID attribute\n"); - if (ShouldSkip("APBSC.S.A0003")) { - NextTest(); - return; - } - err = TestReadsTheProductIDAttribute_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Install ACL for QueryImage\n"); + err = TestInstallAclForQueryImage_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the Application attribute\n"); - if (ShouldSkip("APBSC.S.A0004")) { - NextTest(); - return; - } - err = TestReadsTheApplicationAttribute_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Stop the requestor\n"); + err = TestStopTheRequestor_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the Status attribute\n"); - if (ShouldSkip("APBSC.S.A0005")) { - NextTest(); - return; - } - err = TestReadsTheStatusAttribute_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Start the requestor with an OTA download path\n"); + err = TestStartTheRequestorWithAnOtaDownloadPath_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads the ApplicationVersion attribute\n"); - if (ShouldSkip("APBSC.S.A0006")) { - NextTest(); - return; - } - err = TestReadsTheApplicationVersionAttribute_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait for the commissioned requestor to be retrieved for alpha\n"); + err = TestWaitForTheCommissionedRequestorToBeRetrievedForAlpha_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the AllowedVendorList attribute\n"); - if (ShouldSkip("APBSC.S.A0007")) { - NextTest(); - return; - } - err = TestReadsTheAllowedVendorListAttribute_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Send an announce OTA provider command to the requestor\n"); + err = TestSendAnAnnounceOtaProviderCommandToTheRequestor_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait for transfer complete message\n"); + err = TestWaitForTransferCompleteMessage_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Compare original file to downloaded file\n"); + err = TestCompareOriginalFileToDownloadedFile_10(); break; } @@ -38868,6 +38955,12 @@ class Test_TC_APBSC_9_1 : public TestCommandBridge { case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -38881,195 +38974,189 @@ class Test_TC_APBSC_9_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 11; - chip::Optional mNodeId; - chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mRequestorNodeId; + chip::Optional mProviderNodeId; + chip::Optional mProviderPayload; + chip::Optional mProviderDiscriminator; + chip::Optional mProviderPort; + chip::Optional mProviderKvs; + chip::Optional mOtaImageFilePath; + chip::Optional mRawImageFilePath; + chip::Optional mRawImageContent; + chip::Optional mDownloadImageFilePath; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestCreateOtaImage_0() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + chip::app::Clusters::SystemCommands::Commands::CreateOtaImage::Type value; + value.otaImageFilePath + = mOtaImageFilePath.HasValue() ? mOtaImageFilePath.Value() : chip::Span("/tmp/otaImage", 13); + value.rawImageFilePath + = mRawImageFilePath.HasValue() ? mRawImageFilePath.Value() : chip::Span("/tmp/rawImage", 13); + value.rawImageContent + = mRawImageContent.HasValue() ? mRawImageContent.Value() : chip::Span("Have a hootenanny!", 18); + return CreateOtaImage("alpha", value); } - CHIP_ERROR TestReadsTheVendorNameAttribute_1() + CHIP_ERROR TestStartTheProviderWithAnImage_1() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the VendorName attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("vendorName", "char_string", "char_string")); - VerifyOrReturn(CheckConstraintMaxLength("vendorName", value, 32)); - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("chip-ota-provider-appgarbage: not in length on purpose", 21); + value.discriminator.Emplace(); + value.discriminator.Value() = mProviderDiscriminator.HasValue() ? mProviderDiscriminator.Value() : 50U; + value.port.Emplace(); + value.port.Value() = mProviderPort.HasValue() ? mProviderPort.Value() : 5560U; + value.kvs.Emplace(); + value.kvs.Value() = mProviderKvs.HasValue() ? mProviderKvs.Value() : chip::Span("/tmp/chip_kvs_provider", 22); + value.filepath.Emplace(); + value.filepath.Value() + = mOtaImageFilePath.HasValue() ? mOtaImageFilePath.Value() : chip::Span("/tmp/otaImage", 13); + return Start("alpha", value); } - CHIP_ERROR TestReadsTheVendorIDAttribute_2() + CHIP_ERROR TestCommissionTheProviderFromAlpha_2() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the VendorID attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("vendorID", "vendor_id", "vendor_id")); - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mProviderNodeId.HasValue() ? mProviderNodeId.Value() : 12648430ULL; + value.payload + = mProviderPayload.HasValue() ? mProviderPayload.Value() : chip::Span("MT:-24J0IX4122-.548G00", 22); + return PairWithCode("alpha", value); } - CHIP_ERROR TestReadsTheApplicationNameAttribute_3() + CHIP_ERROR TestWaitForTheCommissionedProviderToBeRetrievedForAlpha_3() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeApplicationNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the ApplicationName attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("applicationName", "char_string", "char_string")); - VerifyOrReturn(CheckConstraintMaxLength("applicationName", value, 256)); - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mProviderNodeId.HasValue() ? mProviderNodeId.Value() : 12648430ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadsTheProductIDAttribute_4() + CHIP_ERROR TestInstallAclForQueryImage_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; + MTRBaseClusterAccessControl * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the ProductID attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("productID", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("productID", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("productID", [value unsignedShortValue], 65535U)); - - NextTest(); - }]; + id aclArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterAccessControlEntry alloc] init]; + ((MTRAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5U]; + ((MTRAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2U]; + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [NSNumber numberWithUnsignedLongLong:112233ULL]; + ((MTRAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = temp_3; + } + ((MTRAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil; + ((MTRAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1U]; - return CHIP_NO_ERROR; - } + temp_0[1] = [[MTRAccessControlClusterAccessControlEntry alloc] init]; + ((MTRAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:3U]; + ((MTRAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2U]; + ((MTRAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = nil; + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[MTRAccessControlClusterTarget alloc] init]; + ((MTRAccessControlClusterTarget *) temp_3[0]).cluster = [NSNumber numberWithUnsignedInt:41UL]; + ((MTRAccessControlClusterTarget *) temp_3[0]).endpoint = nil; + ((MTRAccessControlClusterTarget *) temp_3[0]).deviceType = nil; - CHIP_ERROR TestReadsTheApplicationAttribute_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + ((MTRAccessControlClusterAccessControlEntry *) temp_0[1]).targets = temp_3; + } + ((MTRAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1U]; - [cluster readAttributeApplicationWithCompletionHandler:^( - MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the Application attribute Error: %@", err); + aclArgument = temp_0; + } + [cluster writeAttributeAclWithValue:aclArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Install ACL for QueryImage Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("application", "ApplicationBasicApplication", "ApplicationBasicApplication")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheStatusAttribute_6() + CHIP_ERROR TestStopTheRequestor_5() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the Status attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintMinValue("status", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("status", [value unsignedCharValue], 3U)); + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop("alpha", value); + } - NextTest(); - }]; + CHIP_ERROR TestStartTheRequestorWithAnOtaDownloadPath_6() + { + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.otaDownloadPath.Emplace(); + value.otaDownloadPath.Value() = mDownloadImageFilePath.HasValue() ? mDownloadImageFilePath.Value() + : chip::Span("/tmp/downloadedImage", 20); + return Start("alpha", value); + } - return CHIP_NO_ERROR; + CHIP_ERROR TestWaitForTheCommissionedRequestorToBeRetrievedForAlpha_7() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mRequestorNodeId.HasValue() ? mRequestorNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadsTheApplicationVersionAttribute_7() + CHIP_ERROR TestSendAnAnnounceOtaProviderCommandToTheRequestor_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; + MTRBaseClusterOtaSoftwareUpdateRequestor * cluster = + [[MTRBaseClusterOtaSoftwareUpdateRequestor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeApplicationVersionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the ApplicationVersion attribute Error: %@", err); + __auto_type * params = [[MTROtaSoftwareUpdateRequestorClusterAnnounceOtaProviderParams alloc] init]; + params.providerNodeId = mProviderNodeId.HasValue() ? [NSNumber numberWithUnsignedLongLong:mProviderNodeId.Value()] + : [NSNumber numberWithUnsignedLongLong:12648430ULL]; + params.vendorId = [NSNumber numberWithUnsignedShort:0U]; + params.announcementReason = [NSNumber numberWithUnsignedChar:0U]; + params.endpoint + = mEndpoint.HasValue() ? [NSNumber numberWithUnsignedShort:mEndpoint.Value()] : [NSNumber numberWithUnsignedShort:0U]; + [cluster announceOtaProviderWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Send an announce OTA provider command to the requestor Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("applicationVersion", "char_string", "char_string")); - VerifyOrReturn(CheckConstraintMaxLength("applicationVersion", value, 32)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAllowedVendorListAttribute_8() + CHIP_ERROR TestWaitForTransferCompleteMessage_9() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterApplicationBasic * cluster = [[MTRBaseClusterApplicationBasic alloc] initWithDevice:device - endpoint:3 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAllowedVendorListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads the AllowedVendorList attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("allowedVendorList", "list", "list")); - NextTest(); - }]; + chip::app::Clusters::DelayCommands::Commands::WaitForMessage::Type value; + value.registerKey.Emplace(); + value.registerKey.Value() = chip::Span("defaultgarbage: not in length on purpose", 7); + value.message = chip::Span("OTA image downloadedgarbage: not in length on purpose", 20); + return WaitForMessage("alpha", value); + } - return CHIP_NO_ERROR; + CHIP_ERROR TestCompareOriginalFileToDownloadedFile_10() + { + chip::app::Clusters::SystemCommands::Commands::CompareFiles::Type value; + value.file1 = mRawImageFilePath.HasValue() ? mRawImageFilePath.Value() : chip::Span("/tmp/rawImage", 13); + value.file2 = mDownloadImageFilePath.HasValue() ? mDownloadImageFilePath.Value() + : chip::Span("/tmp/downloadedImage", 20); + return CompareFiles("alpha", value); } }; -class Test_TC_CONTENTLAUNCHER_10_1 : public TestCommandBridge { +class Test_TC_OCC_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CONTENTLAUNCHER_10_1() - : TestCommandBridge("Test_TC_CONTENTLAUNCHER_10_1") + Test_TC_OCC_1_1() + : TestCommandBridge("Test_TC_OCC_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -39079,7 +39166,7 @@ class Test_TC_CONTENTLAUNCHER_10_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CONTENTLAUNCHER_10_1() {} + ~Test_TC_OCC_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -39087,11 +39174,11 @@ class Test_TC_CONTENTLAUNCHER_10_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CONTENTLAUNCHER_10_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CONTENTLAUNCHER_10_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -39108,20 +39195,24 @@ class Test_TC_CONTENTLAUNCHER_10_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the AcceptHeader attribute from the DUT\n"); - if (ShouldSkip("CONTENTLAUNCHER.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsTheAcceptHeaderAttributeFromTheDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the SupportedStreamingProtocols attribute from the DUT\n"); - if (ShouldSkip("CONTENTLAUNCHER.S.A0001")) { - NextTest(); - return; - } - err = TestThReadsTheSupportedStreamingProtocolsAttributeFromTheDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 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: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); break; } @@ -39143,6 +39234,15 @@ class Test_TC_CONTENTLAUNCHER_10_1 : public TestCommandBridge { case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -39156,7 +39256,7 @@ class Test_TC_CONTENTLAUNCHER_10_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; @@ -39170,53 +39270,141 @@ class Test_TC_CONTENTLAUNCHER_10_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsTheAcceptHeaderAttributeFromTheDut_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptHeaderWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AcceptHeader attribute from the DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptHeader", "list", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheSupportedStreamingProtocolsAttributeFromTheDut_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterContentLauncher * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeSupportedStreamingProtocolsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the SupportedStreamingProtocols attribute from the DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("supportedStreamingProtocols", "bitmap32", "bitmap32")); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing 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 ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing 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 ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing 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 ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_MOD_1_1 : public TestCommandBridge { +class Test_TC_OCC_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MOD_1_1() - : TestCommandBridge("Test_TC_MOD_1_1") + Test_TC_OCC_2_1() + : TestCommandBridge("Test_TC_OCC_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -39226,7 +39414,7 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MOD_1_1() {} + ~Test_TC_OCC_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -39234,11 +39422,11 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MOD_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MOD_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -39255,54 +39443,104 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); - err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads mandatory attribute constrains: Occupancy\n"); + if (ShouldSkip("OCC.S.A0000")) { + NextTest(); + return; + } + err = TestReadsMandatoryAttributeConstrainsOccupancy_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); - if (ShouldSkip("MOD.S.F00")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads mandatory attribute constrains: OccupancySensorType\n"); + if (ShouldSkip("OCC.S.A0001")) { NextTest(); return; } - err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); + err = TestReadsMandatoryAttributeConstrainsOccupancySensorType_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the FeatureMap attribute from the DUT\n"); - if (ShouldSkip(" !MOD.S.F00 ")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads mandatory attribute constrains: OccupancySensorTypeBitmap\n"); + if (ShouldSkip("OCC.S.A0002")) { NextTest(); return; } - err = TestThReadsTheFeatureMapAttributeFromTheDut_3(); + err = TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads the AttributeList attribute from the DUT\n"); - err = TestThReadsTheAttributeListAttributeFromTheDut_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads optional attribute: PIROccupiedToUnoccupiedDelay\n"); + if (ShouldSkip("OCC.S.A0010")) { + NextTest(); + return; + } + err = TestReadsOptionalAttributePIROccupiedToUnoccupiedDelay_4(); break; case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : TH reads the optional attribute(StartUpMode) in AttributeList from the DUT\n"); - if (ShouldSkip("MOD.S.A0004")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads optional attribute constrains: PIRUnoccupiedToOccupiedDelay\n"); + if (ShouldSkip("OCC.S.A0011")) { NextTest(); return; } - err = TestThReadsTheOptionalAttributeStartUpModeInAttributeListFromTheDut_5(); + err = TestReadsOptionalAttributeConstrainsPIRUnoccupiedToOccupiedDelay_5(); break; case 6: ChipLogProgress( - chipTool, " ***** Test Step 6 : TH reads the optional attribute(OnMode) in AttributeList from the DUT\n"); - if (ShouldSkip("MOD.S.A0005")) { + chipTool, " ***** Test Step 6 : Reads optional attribute constrains: PIRUnoccupiedToOccupiedThreshold\n"); + if (ShouldSkip("OCC.S.A0012")) { NextTest(); return; } - err = TestThReadsTheOptionalAttributeOnModeInAttributeListFromTheDut_6(); + err = TestReadsOptionalAttributeConstrainsPIRUnoccupiedToOccupiedThreshold_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read optional attribute: UltrasonicOccupiedToUnoccupiedDelay\n"); + if (ShouldSkip("OCC.S.A0020")) { + NextTest(); + return; + } + err = TestReadOptionalAttributeUltrasonicOccupiedToUnoccupiedDelay_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute: UltrasonicUnoccupiedToOccupiedDelay\n"); + if (ShouldSkip("OCC.S.A0021")) { + NextTest(); + return; + } + err = TestReadAttributeUltrasonicUnoccupiedToOccupiedDelay_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute: UltrasonicUnoccupiedToOccupiedThreshold\n"); + if (ShouldSkip("OCC.S.A0022")) { + NextTest(); + return; + } + err = TestReadAttributeUltrasonicUnoccupiedToOccupiedThreshold_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Reads optional attribute constrains: PhysicalContactOccupiedToUnoccupiedDelay\n"); + if (ShouldSkip("OCC.S.A0030")) { + NextTest(); + return; + } + err = TestReadsOptionalAttributeConstrainsPhysicalContactOccupiedToUnoccupiedDelay_10(); + break; + case 11: + ChipLogProgress( + chipTool, " ***** Test Step 11 : Reads optional attribute constrains: PhysicalContactUnoccupiedToOccupiedDelay\n"); + if (ShouldSkip("OCC.S.A0031")) { + NextTest(); + return; + } + err = TestReadsOptionalAttributeConstrainsPhysicalContactUnoccupiedToOccupiedDelay_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Reads optional attribute constrains: PhysicalContactUnoccupiedToOccupiedThreshold\n"); + if (ShouldSkip("OCC.S.A0032")) { + NextTest(); + return; + } + err = TestReadsOptionalAttributeConstrainsPhysicalContactUnoccupiedToOccupiedThreshold_12(); break; } @@ -39342,6 +39580,18 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -39355,7 +39605,7 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 13; chip::Optional mNodeId; chip::Optional mCluster; @@ -39369,104 +39619,117 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() + CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancy_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); + [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads mandatory attribute constrains: Occupancy Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintType("occupancy", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("occupancy", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("occupancy", [value unsignedCharValue], 1U)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_2() + CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorType_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); + [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads mandatory attribute constrains: OccupancySensorType Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); - } + VerifyOrReturn(CheckConstraintType("occupancySensorType", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("occupancySensorType", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("occupancySensorType", [value unsignedCharValue], 3U)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_3() + CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); + [cluster + readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads mandatory attribute constrains: OccupancySensorTypeBitmap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("occupancySensorTypeBitmap", "bitmap8", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("occupancySensorTypeBitmap", [value unsignedCharValue], 1U)); + VerifyOrReturn(CheckConstraintMaxValue("occupancySensorTypeBitmap", [value unsignedCharValue], 273U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsOptionalAttributePIROccupiedToUnoccupiedDelay_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePirOccupiedToUnoccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads optional attribute: PIROccupiedToUnoccupiedDelay Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } + VerifyOrReturn(CheckConstraintType("pirOccupiedToUnoccupiedDelay", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("pirOccupiedToUnoccupiedDelay", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("pirOccupiedToUnoccupiedDelay", [value unsignedShortValue], 65535U)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheAttributeListAttributeFromTheDut_4() + CHIP_ERROR TestReadsOptionalAttributeConstrainsPIRUnoccupiedToOccupiedDelay_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); + [cluster readAttributePirUnoccupiedToOccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads optional attribute constrains: PIRUnoccupiedToOccupiedDelay Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintType("pirUnoccupiedToOccupiedDelay", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("pirUnoccupiedToOccupiedDelay", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("pirUnoccupiedToOccupiedDelay", [value unsignedShortValue], 65535U)); NextTest(); }]; @@ -39474,21 +39737,23 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheOptionalAttributeStartUpModeInAttributeListFromTheDut_5() + CHIP_ERROR TestReadsOptionalAttributeConstrainsPIRUnoccupiedToOccupiedThreshold_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the optional attribute(StartUpMode) in AttributeList from the DUT Error: %@", err); + [cluster readAttributePirUnoccupiedToOccupiedThresholdWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads optional attribute constrains: PIRUnoccupiedToOccupiedThreshold Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintType("pirUnoccupiedToOccupiedThreshold", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("pirUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 1U)); + VerifyOrReturn(CheckConstraintMaxValue("pirUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 254U)); NextTest(); }]; @@ -39496,21 +39761,25 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheOptionalAttributeOnModeInAttributeListFromTheDut_6() + CHIP_ERROR TestReadOptionalAttributeUltrasonicOccupiedToUnoccupiedDelay_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the optional attribute(OnMode) in AttributeList from the DUT Error: %@", err); + [cluster readAttributeUltrasonicOccupiedToUnoccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read optional attribute: UltrasonicOccupiedToUnoccupiedDelay Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintType("ultrasonicOccupiedToUnoccupiedDelay", "int16u", "int16u")); + VerifyOrReturn( + CheckConstraintMinValue("ultrasonicOccupiedToUnoccupiedDelay", [value unsignedShortValue], 0U)); + VerifyOrReturn( + CheckConstraintMaxValue("ultrasonicOccupiedToUnoccupiedDelay", [value unsignedShortValue], 65535U)); NextTest(); }]; @@ -39518,21 +39787,25 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadAttributeUltrasonicUnoccupiedToOccupiedDelay_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing 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 readAttributeUltrasonicUnoccupiedToOccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute: UltrasonicUnoccupiedToOccupiedDelay Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintType("ultrasonicUnoccupiedToOccupiedDelay", "int16u", "int16u")); + VerifyOrReturn( + CheckConstraintMinValue("ultrasonicUnoccupiedToOccupiedDelay", [value unsignedShortValue], 0U)); + VerifyOrReturn( + CheckConstraintMaxValue("ultrasonicUnoccupiedToOccupiedDelay", [value unsignedShortValue], 65535U)); NextTest(); }]; @@ -39540,25 +39813,104 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadAttributeUltrasonicUnoccupiedToOccupiedThreshold_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterModeSelect * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing 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); + [cluster readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute: UltrasonicUnoccupiedToOccupiedThreshold Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintType("ultrasonicUnoccupiedToOccupiedThreshold", "int8u", "int8u")); + VerifyOrReturn( + CheckConstraintMinValue("ultrasonicUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 1U)); + VerifyOrReturn( + CheckConstraintMaxValue("ultrasonicUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 254U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsOptionalAttributeConstrainsPhysicalContactOccupiedToUnoccupiedDelay_10() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads optional attribute constrains: PhysicalContactOccupiedToUnoccupiedDelay Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("physicalContactOccupiedToUnoccupiedDelay", "int16u", "int16u")); + VerifyOrReturn( + CheckConstraintMinValue("physicalContactOccupiedToUnoccupiedDelay", [value unsignedShortValue], 0U)); + VerifyOrReturn( + CheckConstraintMaxValue("physicalContactOccupiedToUnoccupiedDelay", [value unsignedShortValue], 65535U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsOptionalAttributeConstrainsPhysicalContactUnoccupiedToOccupiedDelay_11() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads optional attribute constrains: PhysicalContactUnoccupiedToOccupiedDelay Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("physicalContactUnoccupiedToOccupiedDelay", "int16u", "int16u")); + VerifyOrReturn( + CheckConstraintMinValue("physicalContactUnoccupiedToOccupiedDelay", [value unsignedShortValue], 0U)); + VerifyOrReturn( + CheckConstraintMaxValue("physicalContactUnoccupiedToOccupiedDelay", [value unsignedShortValue], 65535U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsOptionalAttributeConstrainsPhysicalContactUnoccupiedToOccupiedThreshold_12() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePhysicalContactUnoccupiedToOccupiedThresholdWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads optional attribute constrains: PhysicalContactUnoccupiedToOccupiedThreshold Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("physicalContactUnoccupiedToOccupiedThreshold", "int8u", "int8u")); + VerifyOrReturn( + CheckConstraintMinValue("physicalContactUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 1U)); + VerifyOrReturn( + CheckConstraintMaxValue("physicalContactUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 254U)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -39566,29 +39918,21 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { } }; -class OTA_SuccessfulTransfer : public TestCommandBridge { +class Test_TC_OO_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - OTA_SuccessfulTransfer() - : TestCommandBridge("OTA_SuccessfulTransfer") + Test_TC_OO_1_1() + : TestCommandBridge("Test_TC_OO_1_1") , mTestIndex(0) { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("requestorNodeId", 0, UINT64_MAX, &mRequestorNodeId); - AddArgument("providerNodeId", 0, UINT64_MAX, &mProviderNodeId); - AddArgument("providerPayload", &mProviderPayload); - AddArgument("providerDiscriminator", 0, UINT16_MAX, &mProviderDiscriminator); - AddArgument("providerPort", 0, UINT16_MAX, &mProviderPort); - AddArgument("providerKvs", &mProviderKvs); - AddArgument("otaImageFilePath", &mOtaImageFilePath); - AddArgument("rawImageFilePath", &mRawImageFilePath); - AddArgument("rawImageContent", &mRawImageContent); - AddArgument("downloadImageFilePath", &mDownloadImageFilePath); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~OTA_SuccessfulTransfer() {} + ~Test_TC_OO_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -39596,11 +39940,11 @@ class OTA_SuccessfulTransfer : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: OTA_SuccessfulTransfer\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: OTA_SuccessfulTransfer\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -39613,48 +39957,57 @@ class OTA_SuccessfulTransfer : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Create OTA image\n"); - err = TestCreateOtaImage_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Start the provider with an image\n"); - err = TestStartTheProviderWithAnImage_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Commission the provider from alpha\n"); - err = TestCommissionTheProviderFromAlpha_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip("OO.S.F00")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Wait for the commissioned provider to be retrieved for alpha\n"); - err = TestWaitForTheCommissionedProviderToBeRetrievedForAlpha_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !OO.S.F00 ")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Install ACL for QueryImage\n"); - err = TestInstallAclForQueryImage_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Stop the requestor\n"); - err = TestStopTheRequestor_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the feature dependent(OO.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("OO.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentOOSF00AttributeInAttributeList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Start the requestor with an OTA download path\n"); - err = TestStartTheRequestorWithAnOtaDownloadPath_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Wait for the commissioned requestor to be retrieved for alpha\n"); - err = TestWaitForTheCommissionedRequestorToBeRetrievedForAlpha_7(); + ChipLogProgress( + chipTool, " ***** Test Step 7 : Read the feature dependent(OO.S.F00) commands in AcceptedCommandList\n"); + if (ShouldSkip("OO.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentOOSF00CommandsInAcceptedCommandList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Send an announce OTA provider command to the requestor\n"); - err = TestSendAnAnnounceOtaProviderCommandToTheRequestor_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Wait for transfer complete message\n"); - err = TestWaitForTransferCompleteMessage_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Compare original file to downloaded file\n"); - err = TestCompareOriginalFileToDownloadedFile_10(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); break; } @@ -39694,12 +40047,6 @@ class OTA_SuccessfulTransfer : public TestCommandBridge { case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -39713,189 +40060,210 @@ class OTA_SuccessfulTransfer : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 9; + chip::Optional mNodeId; + chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mRequestorNodeId; - chip::Optional mProviderNodeId; - chip::Optional mProviderPayload; - chip::Optional mProviderDiscriminator; - chip::Optional mProviderPort; - chip::Optional mProviderKvs; - chip::Optional mOtaImageFilePath; - chip::Optional mRawImageFilePath; - chip::Optional mRawImageContent; - chip::Optional mDownloadImageFilePath; chip::Optional mTimeout; - CHIP_ERROR TestCreateOtaImage_0() - { - chip::app::Clusters::SystemCommands::Commands::CreateOtaImage::Type value; - value.otaImageFilePath - = mOtaImageFilePath.HasValue() ? mOtaImageFilePath.Value() : chip::Span("/tmp/otaImage", 13); - value.rawImageFilePath - = mRawImageFilePath.HasValue() ? mRawImageFilePath.Value() : chip::Span("/tmp/rawImage", 13); - value.rawImageContent - = mRawImageContent.HasValue() ? mRawImageContent.Value() : chip::Span("Have a hootenanny!", 18); - return CreateOtaImage("alpha", value); - } - - CHIP_ERROR TestStartTheProviderWithAnImage_1() - { - chip::app::Clusters::SystemCommands::Commands::Start::Type value; - value.registerKey.Emplace(); - value.registerKey.Value() = chip::Span("chip-ota-provider-appgarbage: not in length on purpose", 21); - value.discriminator.Emplace(); - value.discriminator.Value() = mProviderDiscriminator.HasValue() ? mProviderDiscriminator.Value() : 50U; - value.port.Emplace(); - value.port.Value() = mProviderPort.HasValue() ? mProviderPort.Value() : 5560U; - value.kvs.Emplace(); - value.kvs.Value() = mProviderKvs.HasValue() ? mProviderKvs.Value() : chip::Span("/tmp/chip_kvs_provider", 22); - value.filepath.Emplace(); - value.filepath.Value() - = mOtaImageFilePath.HasValue() ? mOtaImageFilePath.Value() : chip::Span("/tmp/otaImage", 13); - return Start("alpha", value); - } - - CHIP_ERROR TestCommissionTheProviderFromAlpha_2() - { - chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; - value.nodeId = mProviderNodeId.HasValue() ? mProviderNodeId.Value() : 12648430ULL; - value.payload - = mProviderPayload.HasValue() ? mProviderPayload.Value() : chip::Span("MT:-24J0IX4122-.548G00", 22); - return PairWithCode("alpha", value); - } - - CHIP_ERROR TestWaitForTheCommissionedProviderToBeRetrievedForAlpha_3() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mProviderNodeId.HasValue() ? mProviderNodeId.Value() : 12648430ULL; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestInstallAclForQueryImage_4() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterAccessControl * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id aclArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[MTRAccessControlClusterAccessControlEntry alloc] init]; - ((MTRAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5U]; - ((MTRAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2U]; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [NSNumber numberWithUnsignedLongLong:112233ULL]; - ((MTRAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = temp_3; - } - ((MTRAccessControlClusterAccessControlEntry *) temp_0[0]).targets = nil; - ((MTRAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); - temp_0[1] = [[MTRAccessControlClusterAccessControlEntry alloc] init]; - ((MTRAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:3U]; - ((MTRAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2U]; - ((MTRAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = nil; - { - NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; - temp_3[0] = [[MTRAccessControlClusterTarget alloc] init]; - ((MTRAccessControlClusterTarget *) temp_3[0]).cluster = [NSNumber numberWithUnsignedInt:41UL]; - ((MTRAccessControlClusterTarget *) temp_3[0]).endpoint = nil; - ((MTRAccessControlClusterTarget *) temp_3[0]).deviceType = nil; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - ((MTRAccessControlClusterAccessControlEntry *) temp_0[1]).targets = temp_3; + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); } - ((MTRAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1U]; - - aclArgument = temp_0; - } - [cluster writeAttributeAclWithValue:aclArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Install ACL for QueryImage Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStopTheRequestor_5() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { - chip::app::Clusters::SystemCommands::Commands::Stop::Type value; - return Stop("alpha", value); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestStartTheRequestorWithAnOtaDownloadPath_6() - { - chip::app::Clusters::SystemCommands::Commands::Start::Type value; - value.otaDownloadPath.Emplace(); - value.otaDownloadPath.Value() = mDownloadImageFilePath.HasValue() ? mDownloadImageFilePath.Value() - : chip::Span("/tmp/downloadedImage", 20); - return Start("alpha", value); - } + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); - CHIP_ERROR TestWaitForTheCommissionedRequestorToBeRetrievedForAlpha_7() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mRequestorNodeId.HasValue() ? mRequestorNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestSendAnAnnounceOtaProviderCommandToTheRequestor_8() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOtaSoftwareUpdateRequestor * cluster = - [[MTRBaseClusterOtaSoftwareUpdateRequestor alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTROtaSoftwareUpdateRequestorClusterAnnounceOtaProviderParams alloc] init]; - params.providerNodeId = mProviderNodeId.HasValue() ? [NSNumber numberWithUnsignedLongLong:mProviderNodeId.Value()] - : [NSNumber numberWithUnsignedLongLong:12648430ULL]; - params.vendorId = [NSNumber numberWithUnsignedShort:0U]; - params.announcementReason = [NSNumber numberWithUnsignedChar:0U]; - params.endpoint - = mEndpoint.HasValue() ? [NSNumber numberWithUnsignedShort:mEndpoint.Value()] : [NSNumber numberWithUnsignedShort:0U]; - [cluster announceOtaProviderWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send an announce OTA provider command to the requestor Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWaitForTransferCompleteMessage_9() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() { - chip::app::Clusters::DelayCommands::Commands::WaitForMessage::Type value; - value.registerKey.Emplace(); - value.registerKey.Value() = chip::Span("defaultgarbage: not in length on purpose", 7); - value.message = chip::Span("OTA image downloadedgarbage: not in length on purpose", 20); - return WaitForMessage("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestCompareOriginalFileToDownloadedFile_10() + CHIP_ERROR TestReadTheFeatureDependentOOSF00AttributeInAttributeList_5() { - chip::app::Clusters::SystemCommands::Commands::CompareFiles::Type value; - value.file1 = mRawImageFilePath.HasValue() ? mRawImageFilePath.Value() : chip::Span("/tmp/rawImage", 13); - value.file2 = mDownloadImageFilePath.HasValue() ? mDownloadImageFilePath.Value() - : chip::Span("/tmp/downloadedImage", 20); - return CompareFiles("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 feature dependent(OO.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16384UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16385UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16386UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16387UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentOOSF00CommandsInAcceptedCommandList_7() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 feature dependent(OO.S.F00) commands in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 64UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 65UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 66UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } }; -class Test_TC_OCC_1_1 : public TestCommandBridge { +class Test_TC_OO_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OCC_1_1() - : TestCommandBridge("Test_TC_OCC_1_1") + Test_TC_OO_2_1() + : TestCommandBridge("Test_TC_OO_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -39905,7 +40273,7 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_OCC_1_1() {} + ~Test_TC_OO_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -39913,11 +40281,11 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -39934,24 +40302,44 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the mandatory attribute: OnOff\n"); + if (ShouldSkip("OO.S.A0000")) { + NextTest(); + return; + } + err = TestReadTheMandatoryAttributeOnOff_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read LT attribute: GlobalSceneControl\n"); + if (ShouldSkip("OO.S.A4000")) { + NextTest(); + return; + } + err = TestReadLtAttributeGlobalSceneControl_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read LT attribute: OnTime\n"); + if (ShouldSkip("OO.S.A4001")) { + NextTest(); + return; + } + err = TestReadLtAttributeOnTime_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read LT attribute: OffWaitTime\n"); + if (ShouldSkip("OO.S.A4002")) { + NextTest(); + return; + } + err = TestReadLtAttributeOffWaitTime_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read LT attribute: StartUpOnOff\n"); + if (ShouldSkip("OO.S.A4003")) { + NextTest(); + return; + } + err = TestReadLtAttributeStartUpOnOff_5(); break; } @@ -40009,78 +40397,56 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestReadTheMandatoryAttributeOnOff_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute: OnOff Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintType("onOff", "boolean", "boolean")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestReadLtAttributeGlobalSceneControl_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 global attribute: FeatureMap Error: %@", err); + [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read LT attribute: GlobalSceneControl Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintType("globalSceneControl", "boolean", "boolean")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestReadLtAttributeOnTime_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read LT attribute: OnTime Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintType("onTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("onTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("onTime", [value unsignedShortValue], 65535U)); NextTest(); }]; @@ -40088,50 +40454,43 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestReadLtAttributeOffWaitTime_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read LT attribute: OffWaitTime Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintType("offWaitTime", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("offWaitTime", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("offWaitTime", [value unsignedShortValue], 65535U)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestReadLtAttributeStartUpOnOff_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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); + [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read LT attribute: StartUpOnOff Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("startUpOnOff", "enum8", "enum8")); } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -40139,11 +40498,11 @@ class Test_TC_OCC_1_1 : public TestCommandBridge { } }; -class Test_TC_OCC_2_1 : public TestCommandBridge { +class Test_TC_OO_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OCC_2_1() - : TestCommandBridge("Test_TC_OCC_2_1") + Test_TC_OO_2_2() + : TestCommandBridge("Test_TC_OO_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -40153,7 +40512,7 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_OCC_2_1() {} + ~Test_TC_OO_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -40161,11 +40520,11 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -40182,104 +40541,172 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads mandatory attribute constrains: Occupancy\n"); - if (ShouldSkip("OCC.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Send Off Command\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestReadsMandatoryAttributeConstrainsOccupancy_1(); + err = TestSendOffCommand_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads mandatory attribute constrains: OccupancySensorType\n"); - if (ShouldSkip("OCC.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestReadsMandatoryAttributeConstrainsOccupancySensorType_2(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads mandatory attribute constrains: OccupancySensorTypeBitmap\n"); - if (ShouldSkip("OCC.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Send On Command\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_3(); + err = TestSendOnCommand_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads optional attribute: PIROccupiedToUnoccupiedDelay\n"); - if (ShouldSkip("OCC.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is true after on command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestReadsOptionalAttributePIROccupiedToUnoccupiedDelay_4(); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads optional attribute constrains: PIRUnoccupiedToOccupiedDelay\n"); - if (ShouldSkip("OCC.S.A0011")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Send On Command\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestReadsOptionalAttributeConstrainsPIRUnoccupiedToOccupiedDelay_5(); + err = TestSendOnCommand_5(); break; case 6: - ChipLogProgress( - chipTool, " ***** Test Step 6 : Reads optional attribute constrains: PIRUnoccupiedToOccupiedThreshold\n"); - if (ShouldSkip("OCC.S.A0012")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is true after on command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestReadsOptionalAttributeConstrainsPIRUnoccupiedToOccupiedThreshold_6(); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read optional attribute: UltrasonicOccupiedToUnoccupiedDelay\n"); - if (ShouldSkip("OCC.S.A0020")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Send Off Command\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestReadOptionalAttributeUltrasonicOccupiedToUnoccupiedDelay_7(); + err = TestSendOffCommand_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read attribute: UltrasonicUnoccupiedToOccupiedDelay\n"); - if (ShouldSkip("OCC.S.A0021")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestReadAttributeUltrasonicUnoccupiedToOccupiedDelay_8(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read attribute: UltrasonicUnoccupiedToOccupiedThreshold\n"); - if (ShouldSkip("OCC.S.A0022")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : Send Off Command\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestReadAttributeUltrasonicUnoccupiedToOccupiedThreshold_9(); + err = TestSendOffCommand_9(); break; case 10: - ChipLogProgress( - chipTool, " ***** Test Step 10 : Reads optional attribute constrains: PhysicalContactOccupiedToUnoccupiedDelay\n"); - if (ShouldSkip("OCC.S.A0030")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestReadsOptionalAttributeConstrainsPhysicalContactOccupiedToUnoccupiedDelay_10(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); break; case 11: - ChipLogProgress( - chipTool, " ***** Test Step 11 : Reads optional attribute constrains: PhysicalContactUnoccupiedToOccupiedDelay\n"); - if (ShouldSkip("OCC.S.A0031")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : Send Toggle Command\n"); + if (ShouldSkip("OO.S.C02.Rsp")) { NextTest(); return; } - err = TestReadsOptionalAttributeConstrainsPhysicalContactUnoccupiedToOccupiedDelay_11(); + err = TestSendToggleCommand_11(); break; case 12: - ChipLogProgress(chipTool, - " ***** Test Step 12 : Reads optional attribute constrains: PhysicalContactUnoccupiedToOccupiedThreshold\n"); - if (ShouldSkip("OCC.S.A0032")) { + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 1000ms\n"); + err = TestWait1000ms_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Check on/off attribute value is true after toggle command\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestReadsOptionalAttributeConstrainsPhysicalContactUnoccupiedToOccupiedThreshold_12(); + err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Send Toggle Command\n"); + if (ShouldSkip("OO.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestSendToggleCommand_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 1000ms\n"); + err = TestWait1000ms_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Check on/off attribute value is false after toggle command\n"); + if (ShouldSkip("OO.S.A0000")) { + NextTest(); + return; + } + err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Operate on device to set OnOff attribute manually to on\n"); + if (ShouldSkip("PICS_USER_PROMPT && OO.M.ManuallyControlled && OO.S.A0000")) { + NextTest(); + return; + } + err = TestOperateOnDeviceToSetOnOffAttributeManuallyToOn_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Check on/off attribute value is true after on command\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && OO.S.A0000 && OO.M.ManuallyControlled")) { + NextTest(); + return; + } + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Operate on device to set OnOff attribute manually to off\n"); + if (ShouldSkip("PICS_USER_PROMPT && OO.M.ManuallyControlled && OO.S.A0000")) { + NextTest(); + return; + } + err = TestOperateOnDeviceToSetOnOffAttributeManuallyToOff_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && OO.S.A0000 && OO.M.ManuallyControlled")) { + NextTest(); + return; + } + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Reset Off Command\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestResetOffCommand_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("OO.S.A0000")) { + NextTest(); + return; + } + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22(); break; } @@ -40331,6 +40758,36 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -40344,7 +40801,7 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 13; + const uint16_t mTestCount = 23; chip::Optional mNodeId; chip::Optional mCluster; @@ -40358,45 +40815,38 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancy_1() + CHIP_ERROR TestSendOffCommand_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute constrains: Occupancy Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("occupancy", "bitmap8", "bitmap8")); - VerifyOrReturn(CheckConstraintMinValue("occupancy", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("occupancy", [value unsignedCharValue], 1U)); - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorType_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute constrains: OccupancySensorType Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("occupancySensorType", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("occupancySensorType", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("occupancySensorType", [value unsignedCharValue], 3U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } NextTest(); }]; @@ -40404,71 +40854,38 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_3() + CHIP_ERROR TestSendOnCommand_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads mandatory attribute constrains: OccupancySensorTypeBitmap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send On Command Error: %@", err); - VerifyOrReturn(CheckConstraintType("occupancySensorTypeBitmap", "bitmap8", "bitmap8")); - VerifyOrReturn(CheckConstraintMinValue("occupancySensorTypeBitmap", [value unsignedCharValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue("occupancySensorTypeBitmap", [value unsignedCharValue], 273U)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOptionalAttributePIROccupiedToUnoccupiedDelay_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributePirOccupiedToUnoccupiedDelayWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads optional attribute: PIROccupiedToUnoccupiedDelay Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("pirOccupiedToUnoccupiedDelay", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("pirOccupiedToUnoccupiedDelay", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("pirOccupiedToUnoccupiedDelay", [value unsignedShortValue], 65535U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadsOptionalAttributeConstrainsPIRUnoccupiedToOccupiedDelay_5() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePirUnoccupiedToOccupiedDelayWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads optional attribute constrains: PIRUnoccupiedToOccupiedDelay Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("pirUnoccupiedToOccupiedDelay", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("pirUnoccupiedToOccupiedDelay", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("pirUnoccupiedToOccupiedDelay", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } NextTest(); }]; @@ -40476,49 +40893,38 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOptionalAttributeConstrainsPIRUnoccupiedToOccupiedThreshold_6() + CHIP_ERROR TestSendOnCommand_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePirUnoccupiedToOccupiedThresholdWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads optional attribute constrains: PIRUnoccupiedToOccupiedThreshold Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send On Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("pirUnoccupiedToOccupiedThreshold", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("pirUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue("pirUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 254U)); - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadOptionalAttributeUltrasonicOccupiedToUnoccupiedDelay_7() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeUltrasonicOccupiedToUnoccupiedDelayWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read optional attribute: UltrasonicOccupiedToUnoccupiedDelay Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("ultrasonicOccupiedToUnoccupiedDelay", "int16u", "int16u")); - VerifyOrReturn( - CheckConstraintMinValue("ultrasonicOccupiedToUnoccupiedDelay", [value unsignedShortValue], 0U)); - VerifyOrReturn( - CheckConstraintMaxValue("ultrasonicOccupiedToUnoccupiedDelay", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } NextTest(); }]; @@ -40526,51 +40932,38 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeUltrasonicUnoccupiedToOccupiedDelay_8() + CHIP_ERROR TestSendOffCommand_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeUltrasonicUnoccupiedToOccupiedDelayWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute: UltrasonicUnoccupiedToOccupiedDelay Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("ultrasonicUnoccupiedToOccupiedDelay", "int16u", "int16u")); - VerifyOrReturn( - CheckConstraintMinValue("ultrasonicUnoccupiedToOccupiedDelay", [value unsignedShortValue], 0U)); - VerifyOrReturn( - CheckConstraintMaxValue("ultrasonicUnoccupiedToOccupiedDelay", [value unsignedShortValue], 65535U)); - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeUltrasonicUnoccupiedToOccupiedThreshold_9() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute: UltrasonicUnoccupiedToOccupiedThreshold Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("ultrasonicUnoccupiedToOccupiedThreshold", "int8u", "int8u")); - VerifyOrReturn( - CheckConstraintMinValue("ultrasonicUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 1U)); - VerifyOrReturn( - CheckConstraintMaxValue("ultrasonicUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 254U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } NextTest(); }]; @@ -40578,51 +40971,38 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOptionalAttributeConstrainsPhysicalContactOccupiedToUnoccupiedDelay_10() + CHIP_ERROR TestSendOffCommand_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads optional attribute constrains: PhysicalContactOccupiedToUnoccupiedDelay Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("physicalContactOccupiedToUnoccupiedDelay", "int16u", "int16u")); - VerifyOrReturn( - CheckConstraintMinValue("physicalContactOccupiedToUnoccupiedDelay", [value unsignedShortValue], 0U)); - VerifyOrReturn( - CheckConstraintMaxValue("physicalContactOccupiedToUnoccupiedDelay", [value unsignedShortValue], 65535U)); - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOptionalAttributeConstrainsPhysicalContactUnoccupiedToOccupiedDelay_11() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads optional attribute constrains: PhysicalContactUnoccupiedToOccupiedDelay Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("physicalContactUnoccupiedToOccupiedDelay", "int16u", "int16u")); - VerifyOrReturn( - CheckConstraintMinValue("physicalContactUnoccupiedToOccupiedDelay", [value unsignedShortValue], 0U)); - VerifyOrReturn( - CheckConstraintMaxValue("physicalContactUnoccupiedToOccupiedDelay", [value unsignedShortValue], 65535U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } NextTest(); }]; @@ -40630,299 +41010,122 @@ class Test_TC_OCC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOptionalAttributeConstrainsPhysicalContactUnoccupiedToOccupiedThreshold_12() + CHIP_ERROR TestSendToggleCommand_11() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOccupancySensing * cluster = [[MTRBaseClusterOccupancySensing alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePhysicalContactUnoccupiedToOccupiedThresholdWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads optional attribute constrains: PhysicalContactUnoccupiedToOccupiedThreshold Error: %@", err); + [cluster toggleWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Toggle Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("physicalContactUnoccupiedToOccupiedThreshold", "int8u", "int8u")); - VerifyOrReturn( - CheckConstraintMinValue("physicalContactUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 1U)); - VerifyOrReturn( - CheckConstraintMaxValue("physicalContactUnoccupiedToOccupiedThreshold", [value unsignedCharValue], 254U)); - NextTest(); }]; return CHIP_NO_ERROR; } -}; - -class Test_TC_OO_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OO_1_1() - : TestCommandBridge("Test_TC_OO_1_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_OO_1_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_1_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 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: FeatureMap\n"); - if (ShouldSkip("OO.S.F00")) { - NextTest(); - return; - } - err = TestReadTheGlobalAttributeFeatureMap_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !OO.S.F00 ")) { - NextTest(); - return; - } - err = TestReadTheGlobalAttributeFeatureMap_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the feature dependent(OO.S.F00) attribute in AttributeList\n"); - if (ShouldSkip("OO.S.F00")) { - NextTest(); - return; - } - err = TestReadTheFeatureDependentOOSF00AttributeInAttributeList_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 feature dependent(OO.S.F00) commands in AcceptedCommandList\n"); - if (ShouldSkip("OO.S.F00")) { - NextTest(); - return; - } - err = TestReadTheFeatureDependentOOSF00CommandsInAcceptedCommandList_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - 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 = 9; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestWait1000ms_12() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after toggle command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); } - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestSendToggleCommand_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 global attribute: FeatureMap Error: %@", err); + [cluster toggleWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Toggle Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_3() + CHIP_ERROR TestWait1000ms_15() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 global attribute: FeatureMap Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after toggle command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() + CHIP_ERROR TestOperateOnDeviceToSetOnOffAttributeManuallyToOn_17() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestReadTheFeatureDependentOOSF00AttributeInAttributeList_5() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_18() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 feature dependent(OO.S.F00) attribute in AttributeList Error: %@", err); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16384UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16385UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16386UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16387UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } NextTest(); }]; @@ -40930,21 +41133,30 @@ class Test_TC_OO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() + CHIP_ERROR TestOperateOnDeviceToSetOnOffAttributeManuallyToOff_19() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } NextTest(); }]; @@ -40952,45 +41164,39 @@ class Test_TC_OO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheFeatureDependentOOSF00CommandsInAcceptedCommandList_7() + CHIP_ERROR TestResetOffCommand_21() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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 feature dependent(OO.S.F00) commands in AcceptedCommandList Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Reset Off Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 64UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 65UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 66UL)); - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff 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); + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -40998,11 +41204,11 @@ class Test_TC_OO_1_1 : public TestCommandBridge { } }; -class Test_TC_OO_2_1 : public TestCommandBridge { +class Test_TC_OO_2_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OO_2_1() - : TestCommandBridge("Test_TC_OO_2_1") + Test_TC_OO_2_4() + : TestCommandBridge("Test_TC_OO_2_4") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -41012,7 +41218,7 @@ class Test_TC_OO_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_OO_2_1() {} + ~Test_TC_OO_2_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -41020,11 +41226,11 @@ class Test_TC_OO_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -41041,411 +41247,220 @@ class Test_TC_OO_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the mandatory attribute: OnOff\n"); - if (ShouldSkip("OO.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestReadTheMandatoryAttributeOnOff_1(); + err = TestThSendsOnCommandToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read LT attribute: GlobalSceneControl\n"); - if (ShouldSkip("OO.S.A4000")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : TH writes a value of 0 to StartUpOnOff attribute of DUT\n"); + if (ShouldSkip("OO.S.A4003")) { NextTest(); return; } - err = TestReadLtAttributeGlobalSceneControl_2(); + err = TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read LT attribute: OnTime\n"); - if (ShouldSkip("OO.S.A4001")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { NextTest(); return; } - err = TestReadLtAttributeOnTime_3(); + err = TestRebootTargetDevice_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read LT attribute: OffWaitTime\n"); - if (ShouldSkip("OO.S.A4002")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestReadLtAttributeOffWaitTime_4(); + err = TestRebootTargetDeviceDUT_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read LT attribute: StartUpOnOff\n"); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads the OnOff attribute from the DUT\n"); + if (ShouldSkip("OO.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsTheOnOffAttributeFromTheDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH writes a value of 1 to StartUpOnOff attribute of DUT\n"); if (ShouldSkip("OO.S.A4003")) { NextTest(); return; } - err = TestReadLtAttributeStartUpOnOff_5(); + err = TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7(); break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - 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 = 6; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestReadTheMandatoryAttributeOnOff_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: OnOff Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("onOff", "boolean", "boolean")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadLtAttributeGlobalSceneControl_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read LT attribute: GlobalSceneControl Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("globalSceneControl", "boolean", "boolean")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadLtAttributeOnTime_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read LT attribute: OnTime Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("onTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("onTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onTime", [value unsignedShortValue], 65535U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadLtAttributeOffWaitTime_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read LT attribute: OffWaitTime Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("offWaitTime", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("offWaitTime", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("offWaitTime", [value unsignedShortValue], 65535U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadLtAttributeStartUpOnOff_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read LT attribute: StartUpOnOff Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("startUpOnOff", "enum8", "enum8")); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_OO_2_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OO_2_2() - : TestCommandBridge("Test_TC_OO_2_2") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_OO_2_2() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_2\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Send Off Command\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { NextTest(); return; } - err = TestSendOffCommand_1(); + err = TestRebootTargetDevice_8(); break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_2(); + err = TestRebootTargetDeviceDUT_9(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Send On Command\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestSendOnCommand_3(); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_10(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check on/off attribute value is true after on command\n"); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads the OnOff attribute from the DUT\n"); if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4(); + err = TestThReadsTheOnOffAttributeFromTheDut_11(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send On Command\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH writes a value of 2 to StartUpOnOff attribute of DUT\n"); + if (ShouldSkip("OO.S.A4003")) { NextTest(); return; } - err = TestSendOnCommand_5(); + err = TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_12(); break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is true after on command\n"); - if (ShouldSkip("OO.S.A0000")) { + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_6(); + err = TestRebootTargetDevice_13(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Send Off Command\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestSendOffCommand_7(); + err = TestRebootTargetDeviceDUT_14(); break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_15(); break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Send Off Command\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads the OnOff attribute from the DUT\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestSendOffCommand_9(); + err = TestThReadsTheOnOffAttributeFromTheDut_16(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("OO.S.A0000")) { + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); + err = TestRebootTargetDevice_17(); break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Send Toggle Command\n"); - if (ShouldSkip("OO.S.C02.Rsp")) { + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestSendToggleCommand_11(); + err = TestRebootTargetDeviceDUT_18(); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 1000ms\n"); - err = TestWait1000ms_12(); + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_19(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Check on/off attribute value is true after toggle command\n"); + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads the OnOff attribute from the DUT\n"); if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_13(); + err = TestThReadsTheOnOffAttributeFromTheDut_20(); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Send Toggle Command\n"); - if (ShouldSkip("OO.S.C02.Rsp")) { + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : TH writes NULL to StartUpOnOff attribute of DUT\n"); + if (ShouldSkip("OO.S.A4003")) { NextTest(); return; } - err = TestSendToggleCommand_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 1000ms\n"); - err = TestWait1000ms_15(); + err = TestThWritesNullToStartUpOnOffAttributeOfDut_21(); break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Check on/off attribute value is false after toggle command\n"); - if (ShouldSkip("OO.S.A0000")) { + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_16(); + err = TestRebootTargetDevice_22(); break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Operate on device to set OnOff attribute manually to on\n"); - if (ShouldSkip("PICS_USER_PROMPT && OO.M.ManuallyControlled && OO.S.A0000")) { + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestOperateOnDeviceToSetOnOffAttributeManuallyToOn_17(); + err = TestRebootTargetDeviceDUT_23(); break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Check on/off attribute value is true after on command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && OO.S.A0000 && OO.M.ManuallyControlled")) { + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads the OnOff attribute from the DUT\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_18(); + err = TestThReadsTheOnOffAttributeFromTheDut_25(); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Operate on device to set OnOff attribute manually to off\n"); - if (ShouldSkip("PICS_USER_PROMPT && OO.M.ManuallyControlled && OO.S.A0000")) { + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : TH sends Off command to DUT\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestOperateOnDeviceToSetOnOffAttributeManuallyToOff_19(); + err = TestThSendsOffCommandToDut_26(); break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Check on/off attribute value is false after off command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && OO.S.A0000 && OO.M.ManuallyControlled")) { + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20(); + err = TestRebootTargetDevice_27(); break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Reset Off Command\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestResetOffCommand_21(); + err = TestRebootTargetDeviceDUT_28(); break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Check on/off attribute value is false after off command\n"); + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : TH reads the OnOff attribute from the DUT\n"); if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22(); + err = TestThReadsTheOnOffAttributeFromTheDut_30(); break; } @@ -41527,6 +41542,30 @@ class Test_TC_OO_2_2 : public TestCommandBridge { case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -41540,7 +41579,7 @@ class Test_TC_OO_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 23; + const uint16_t mTestCount = 31; chip::Optional mNodeId; chip::Optional mCluster; @@ -41554,14 +41593,14 @@ class Test_TC_OO_2_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestSendOffCommand_1() + CHIP_ERROR TestThSendsOnCommandToDut_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends On command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -41571,59 +41610,63 @@ class Test_TC_OO_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_2() + CHIP_ERROR TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:0U]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 0 to StartUpOnOff attribute of DUT Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOnCommand_3() + CHIP_ERROR TestRebootTargetDevice_3() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } - NextTest(); - }]; + CHIP_ERROR TestRebootTargetDeviceDUT_4() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } - return CHIP_NO_ERROR; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_5() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_4() + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); } NextTest(); @@ -41632,31 +41675,57 @@ class Test_TC_OO_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOnCommand_5() + CHIP_ERROR TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send On Command Error: %@", err); + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:1U]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 1 to StartUpOnOff attribute of DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_6() + CHIP_ERROR TestRebootTargetDevice_8() + { + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } + + CHIP_ERROR TestRebootTargetDeviceDUT_9() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_10() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -41671,70 +41740,57 @@ class Test_TC_OO_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendOffCommand_7() + CHIP_ERROR TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); + id startUpOnOffArgument; + startUpOnOffArgument = [NSNumber numberWithUnsignedChar:2U]; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 2 to StartUpOnOff attribute of DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() + CHIP_ERROR TestRebootTargetDevice_13() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); } - CHIP_ERROR TestSendOffCommand_9() + CHIP_ERROR TestRebootTargetDeviceDUT_14() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Off Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } - return CHIP_NO_ERROR; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_15() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -41749,38 +41805,37 @@ class Test_TC_OO_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendToggleCommand_11() + CHIP_ERROR TestRebootTargetDevice_17() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster toggleWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Toggle Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } - return CHIP_NO_ERROR; + CHIP_ERROR TestRebootTargetDeviceDUT_18() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } - CHIP_ERROR TestWait1000ms_12() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_19() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 1000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_13() + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_20() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after toggle command Error: %@", err); + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -41795,69 +41850,57 @@ class Test_TC_OO_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendToggleCommand_14() + CHIP_ERROR TestThWritesNullToStartUpOnOffAttributeOfDut_21() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster toggleWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Toggle Command Error: %@", err); + id startUpOnOffArgument; + startUpOnOffArgument = nil; + [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes NULL to StartUpOnOff attribute of DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait1000ms_15() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 1000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_16() + CHIP_ERROR TestRebootTargetDevice_22() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after toggle command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); } - CHIP_ERROR TestOperateOnDeviceToSetOnOffAttributeManuallyToOn_17() + CHIP_ERROR TestRebootTargetDeviceDUT_23() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_18() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_24() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_25() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -41872,62 +41915,54 @@ class Test_TC_OO_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestOperateOnDeviceToSetOnOffAttributeManuallyToOff_19() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20() + CHIP_ERROR TestThSendsOffCommandToDut_26() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Off command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestResetOffCommand_21() + CHIP_ERROR TestRebootTargetDevice_27() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Reset Off Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } - NextTest(); - }]; + CHIP_ERROR TestRebootTargetDeviceDUT_28() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } - return CHIP_NO_ERROR; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_29() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22() + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_30() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -41943,11 +41978,11 @@ class Test_TC_OO_2_2 : public TestCommandBridge { } }; -class Test_TC_OO_2_4 : public TestCommandBridge { +class Test_TC_PS_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OO_2_4() - : TestCommandBridge("Test_TC_OO_2_4") + Test_TC_PS_1_1() + : TestCommandBridge("Test_TC_PS_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -41957,7 +41992,7 @@ class Test_TC_OO_2_4 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_OO_2_4() {} + ~Test_TC_PS_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -41965,11 +42000,11 @@ class Test_TC_OO_2_4 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -41986,220 +42021,63 @@ class Test_TC_OO_2_4 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH sends On command to DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestThSendsOnCommandToDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH writes a value of 0 to StartUpOnOff attribute of DUT\n"); - if (ShouldSkip("OO.S.A4003")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip("PS.S.F00 || PS.S.F01 || PS.S.F02 || PS.S.F03")) { NextTest(); return; } - err = TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2(); + err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestRebootTargetDevice_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress( + chipTool, " ***** Test Step 4 : Read the Feature dependent(PS.S.F00-WIRED) attribute in AttributeList\n"); + if (ShouldSkip("PS.S.F00")) { NextTest(); return; } - err = TestRebootTargetDeviceDUT_4(); + err = TestReadTheFeatureDependentPSSF00WiredAttributeInAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the Feature dependent(PS.S.F01-BAT) attribute in AttributeList\n"); + if (ShouldSkip("PS.S.F01")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentPSSF01BatAttributeInAttributeList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads the OnOff attribute from the DUT\n"); - if (ShouldSkip("OO.S.A0000")) { + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the Feature dependent(PS.S.F02-RECHG) attribute in AttributeList\n"); + if (ShouldSkip("PS.S.F02")) { NextTest(); return; } - err = TestThReadsTheOnOffAttributeFromTheDut_6(); + err = TestReadTheFeatureDependentPSSF02RechgAttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH writes a value of 1 to StartUpOnOff attribute of DUT\n"); - if (ShouldSkip("OO.S.A4003")) { + ChipLogProgress( + chipTool, " ***** Test Step 7 : Read the Feature dependent(PS.S.F03-REPLC) attribute in AttributeList\n"); + if (ShouldSkip("PS.S.F03")) { NextTest(); return; } - err = TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7(); + err = TestReadTheFeatureDependentPSSF03ReplcAttributeInAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestRebootTargetDevice_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestRebootTargetDeviceDUT_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads the OnOff attribute from the DUT\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsTheOnOffAttributeFromTheDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH writes a value of 2 to StartUpOnOff attribute of DUT\n"); - if (ShouldSkip("OO.S.A4003")) { - NextTest(); - return; - } - err = TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestRebootTargetDevice_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestRebootTargetDeviceDUT_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads the OnOff attribute from the DUT\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsTheOnOffAttributeFromTheDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestRebootTargetDevice_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestRebootTargetDeviceDUT_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads the OnOff attribute from the DUT\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsTheOnOffAttributeFromTheDut_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : TH writes NULL to StartUpOnOff attribute of DUT\n"); - if (ShouldSkip("OO.S.A4003")) { - NextTest(); - return; - } - err = TestThWritesNullToStartUpOnOffAttributeOfDut_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestRebootTargetDevice_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestRebootTargetDeviceDUT_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads the OnOff attribute from the DUT\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsTheOnOffAttributeFromTheDut_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : TH sends Off command to DUT\n"); - if (ShouldSkip("OO.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsOffCommandToDut_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestRebootTargetDevice_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestRebootTargetDeviceDUT_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : TH reads the OnOff attribute from the DUT\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsTheOnOffAttributeFromTheDut_30(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_9(); break; } @@ -42242,69 +42120,6 @@ class Test_TC_OO_2_4 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 25: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 26: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -42318,7 +42133,7 @@ class Test_TC_OO_2_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 31; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -42332,81 +42147,47 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThSendsOnCommandToDut_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends On command to DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesAValueOf0ToStartUpOnOffAttributeOfDut_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id startUpOnOffArgument; - startUpOnOffArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes a value of 0 to StartUpOnOff attribute of DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestRebootTargetDevice_3() - { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestRebootTargetDeviceDUT_4() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_5() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_6() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 15UL)); NextTest(); }]; @@ -42414,64 +42195,28 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesAValueOf1ToStartUpOnOffAttributeOfDut_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id startUpOnOffArgument; - startUpOnOffArgument = [NSNumber numberWithUnsignedChar:1U]; - [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes a value of 1 to StartUpOnOff attribute of DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestRebootTargetDevice_8() - { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestRebootTargetDeviceDUT_9() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_10() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_11() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -42479,64 +42224,21 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesAValueOf2ToStartUpOnOffAttributeOfDut_12() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id startUpOnOffArgument; - startUpOnOffArgument = [NSNumber numberWithUnsignedChar:2U]; - [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes a value of 2 to StartUpOnOff attribute of DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestRebootTargetDevice_13() - { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestRebootTargetDeviceDUT_14() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_15() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_16() + CHIP_ERROR TestReadTheFeatureDependentPSSF00WiredAttributeInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the Feature dependent(PS.S.F00-WIRED) attribute in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); NextTest(); }]; @@ -42544,44 +42246,23 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDevice_17() - { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestRebootTargetDeviceDUT_18() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_19() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_20() + CHIP_ERROR TestReadTheFeatureDependentPSSF01BatAttributeInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the Feature dependent(PS.S.F01-BAT) attribute in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 14UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); NextTest(); }]; @@ -42589,64 +42270,45 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesNullToStartUpOnOffAttributeOfDut_21() + CHIP_ERROR TestReadTheFeatureDependentPSSF02RechgAttributeInAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id startUpOnOffArgument; - startUpOnOffArgument = nil; - [cluster writeAttributeStartUpOnOffWithValue:startUpOnOffArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes NULL to StartUpOnOff attribute of DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the Feature dependent(PS.S.F02-RECHG) attribute in AttributeList Error: %@", err); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestRebootTargetDevice_22() - { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 26UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 28UL)); - CHIP_ERROR TestRebootTargetDeviceDUT_23() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_24() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_25() + CHIP_ERROR TestReadTheFeatureDependentPSSF03ReplcAttributeInAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the Feature dependent(PS.S.F03-REPLC) attribute in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 25UL)); NextTest(); }]; @@ -42654,62 +42316,50 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOffCommandToDut_26() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Off command to DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDevice_27() - { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestRebootTargetDeviceDUT_28() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_29() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_30() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -42717,11 +42367,11 @@ class Test_TC_OO_2_4 : public TestCommandBridge { } }; -class Test_TC_PS_1_1 : public TestCommandBridge { +class Test_TC_PS_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PS_1_1() - : TestCommandBridge("Test_TC_PS_1_1") + Test_TC_PS_2_1() + : TestCommandBridge("Test_TC_PS_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -42731,7 +42381,7 @@ class Test_TC_PS_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_PS_1_1() {} + ~Test_TC_PS_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -42739,11 +42389,11 @@ class Test_TC_PS_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -42760,541 +42410,152 @@ class Test_TC_PS_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Test Harness Client reads Status attribute from Server DUT\n"); + if (ShouldSkip("PS.S.A0000")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsStatusAttributeFromServerDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip("PS.S.F00 || PS.S.F01 || PS.S.F02 || PS.S.F03")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Test Harness Client reads Order attribute from Server DUT\n"); + if (ShouldSkip("PS.S.A0001")) { NextTest(); return; } - err = TestReadTheGlobalAttributeFeatureMap_2(); + err = TestTestHarnessClientReadsOrderAttributeFromServerDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Test Harness Client reads Description attribute from Server DUT\n"); + if (ShouldSkip("PS.S.A0002")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsDescriptionAttributeFromServerDut_3(); break; case 4: ChipLogProgress( - chipTool, " ***** Test Step 4 : Read the Feature dependent(PS.S.F00-WIRED) attribute in AttributeList\n"); - if (ShouldSkip("PS.S.F00")) { + chipTool, " ***** Test Step 4 : Test Harness Client reads WiredAssessedInputVoltage attribue from Server DUT\n"); + if (ShouldSkip("PS.S.A0003")) { NextTest(); return; } - err = TestReadTheFeatureDependentPSSF00WiredAttributeInAttributeList_4(); + err = TestTestHarnessClientReadsWiredAssessedInputVoltageAttribueFromServerDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the Feature dependent(PS.S.F01-BAT) attribute in AttributeList\n"); - if (ShouldSkip("PS.S.F01")) { + ChipLogProgress( + chipTool, " ***** Test Step 5 : Test Harness Client reads WiredAssessedInputFrequency attribute from Server DUT\n"); + if (ShouldSkip("PS.S.A0004")) { NextTest(); return; } - err = TestReadTheFeatureDependentPSSF01BatAttributeInAttributeList_5(); + err = TestTestHarnessClientReadsWiredAssessedInputFrequencyAttributeFromServerDut_5(); break; case 6: ChipLogProgress( - chipTool, " ***** Test Step 6 : Read the Feature dependent(PS.S.F02-RECHG) attribute in AttributeList\n"); - if (ShouldSkip("PS.S.F02")) { + chipTool, " ***** Test Step 6 : Test Harness Client reads WiredCurrentType attribute from Server DUT\n"); + if (ShouldSkip("PS.S.A0005")) { NextTest(); return; } - err = TestReadTheFeatureDependentPSSF02RechgAttributeInAttributeList_6(); + err = TestTestHarnessClientReadsWiredCurrentTypeAttributeFromServerDut_6(); break; case 7: ChipLogProgress( - chipTool, " ***** Test Step 7 : Read the Feature dependent(PS.S.F03-REPLC) attribute in AttributeList\n"); - if (ShouldSkip("PS.S.F03")) { + chipTool, " ***** Test Step 7 : Test Harness Client reads WiredAssessedCurrent attribute from Server DUT\n"); + if (ShouldSkip("PS.S.A0006")) { NextTest(); return; } - err = TestReadTheFeatureDependentPSSF03ReplcAttributeInAttributeList_7(); + err = TestTestHarnessClientReadsWiredAssessedCurrentAttributeFromServerDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Test Harness Client reads WiredNominalVoltage from Server DUT\n"); + if (ShouldSkip("PS.S.A0007")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsWiredNominalVoltageFromServerDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_9(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + ChipLogProgress(chipTool, " ***** Test Step 9 : Test Harness Client reads WiredMaximumCurrent from Server DUT\n"); + if (ShouldSkip("PS.S.A0008")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsWiredMaximumCurrentFromServerDut_9(); break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Test Harness Client reads WiredPresent from Server DUT\n"); + if (ShouldSkip("PS.S.A0009")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsWiredPresentFromServerDut_10(); break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Test Harness Client reads ActiveWiredFaults from Server DUT\n"); + if (ShouldSkip("PS.S.A000a")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsActiveWiredFaultsFromServerDut_11(); break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Test Harness Client reads BatVoltage from Server DUT\n"); + if (ShouldSkip("PS.S.A000b")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatVoltageFromServerDut_12(); break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Test Harness Client reads BatPercentRemaining from Server DUT\n"); + if (ShouldSkip("PS.S.A000c")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatPercentRemainingFromServerDut_13(); break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Test Harness Client reads BatTimeRemaining from Server DUT\n"); + if (ShouldSkip("PS.S.A000d")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatTimeRemainingFromServerDut_14(); break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Test Harness Client reads BatChargeLevel from Server DUT\n"); + if (ShouldSkip("PS.S.A000e")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatChargeLevelFromServerDut_15(); break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Test Harness Client reads BatReplacementNeeded from Server DUT\n"); + if (ShouldSkip("PS.S.A000f")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatReplacementNeededFromServerDut_16(); break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Test Harness Client reads BatReplaceability from Server DUT\n"); + if (ShouldSkip("PS.S.A0010")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatReplaceabilityFromServerDut_17(); break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - 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 = 10; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource 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 ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource 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 global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 15UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource 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 ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheFeatureDependentPSSF00WiredAttributeInAttributeList_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource 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 Feature dependent(PS.S.F00-WIRED) attribute in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheFeatureDependentPSSF01BatAttributeInAttributeList_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource 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 Feature dependent(PS.S.F01-BAT) attribute in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 14UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheFeatureDependentPSSF02RechgAttributeInAttributeList_6() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource 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 Feature dependent(PS.S.F02-RECHG) attribute in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 26UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 28UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheFeatureDependentPSSF03ReplcAttributeInAttributeList_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource 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 Feature dependent(PS.S.F03-REPLC) attribute in AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 25UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource 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 ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_9() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterPowerSource * cluster = [[MTRBaseClusterPowerSource 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 ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_PS_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PS_2_1() - : TestCommandBridge("Test_TC_PS_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_PS_2_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PS_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PS_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Test Harness Client reads Status attribute from Server DUT\n"); - if (ShouldSkip("PS.S.A0000")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsStatusAttributeFromServerDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Test Harness Client reads Order attribute from Server DUT\n"); - if (ShouldSkip("PS.S.A0001")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsOrderAttributeFromServerDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Test Harness Client reads Description attribute from Server DUT\n"); - if (ShouldSkip("PS.S.A0002")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsDescriptionAttributeFromServerDut_3(); - break; - case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : Test Harness Client reads WiredAssessedInputVoltage attribue from Server DUT\n"); - if (ShouldSkip("PS.S.A0003")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsWiredAssessedInputVoltageAttribueFromServerDut_4(); - break; - case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : Test Harness Client reads WiredAssessedInputFrequency attribute from Server DUT\n"); - if (ShouldSkip("PS.S.A0004")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsWiredAssessedInputFrequencyAttributeFromServerDut_5(); - break; - case 6: - ChipLogProgress( - chipTool, " ***** Test Step 6 : Test Harness Client reads WiredCurrentType attribute from Server DUT\n"); - if (ShouldSkip("PS.S.A0005")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsWiredCurrentTypeAttributeFromServerDut_6(); - break; - case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : Test Harness Client reads WiredAssessedCurrent attribute from Server DUT\n"); - if (ShouldSkip("PS.S.A0006")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsWiredAssessedCurrentAttributeFromServerDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Test Harness Client reads WiredNominalVoltage from Server DUT\n"); - if (ShouldSkip("PS.S.A0007")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsWiredNominalVoltageFromServerDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Test Harness Client reads WiredMaximumCurrent from Server DUT\n"); - if (ShouldSkip("PS.S.A0008")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsWiredMaximumCurrentFromServerDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Test Harness Client reads WiredPresent from Server DUT\n"); - if (ShouldSkip("PS.S.A0009")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsWiredPresentFromServerDut_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Test Harness Client reads ActiveWiredFaults from Server DUT\n"); - if (ShouldSkip("PS.S.A000a")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsActiveWiredFaultsFromServerDut_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Test Harness Client reads BatVoltage from Server DUT\n"); - if (ShouldSkip("PS.S.A000b")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsBatVoltageFromServerDut_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Test Harness Client reads BatPercentRemaining from Server DUT\n"); - if (ShouldSkip("PS.S.A000c")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsBatPercentRemainingFromServerDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Test Harness Client reads BatTimeRemaining from Server DUT\n"); - if (ShouldSkip("PS.S.A000d")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsBatTimeRemainingFromServerDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Test Harness Client reads BatChargeLevel from Server DUT\n"); - if (ShouldSkip("PS.S.A000e")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsBatChargeLevelFromServerDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Test Harness Client reads BatReplacementNeeded from Server DUT\n"); - if (ShouldSkip("PS.S.A000f")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsBatReplacementNeededFromServerDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Test Harness Client reads BatReplaceability from Server DUT\n"); - if (ShouldSkip("PS.S.A0010")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsBatReplaceabilityFromServerDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Test Harness Client reads BatPresent from Server DUT\n"); - if (ShouldSkip("PS.S.A0011")) { - NextTest(); - return; - } - err = TestTestHarnessClientReadsBatPresentFromServerDut_18(); + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Test Harness Client reads BatPresent from Server DUT\n"); + if (ShouldSkip("PS.S.A0011")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatPresentFromServerDut_18(); break; case 19: ChipLogProgress(chipTool, " ***** Test Step 19 : Test Harness Client readsActiveBatFaults from Server DUT\n"); @@ -57592,6 +56853,262 @@ class Test_TC_TSUIC_2_2 : public TestCommandBridge { } }; +class Test_TC_DGTHREAD_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DGTHREAD_1_1() + : TestCommandBridge("Test_TC_DGTHREAD_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_DGTHREAD_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGTHREAD_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGTHREAD_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision from DUT\n"); + err = TestThReadsTheClusterRevisionFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap from DUT\n"); + if (ShouldSkip("DGTHREAD.S.F00 || DGTHREAD.S.F01 || DGTHREAD.S.F02 || DGTHREAD.S.F03")) { + NextTest(); + return; + } + err = TestThReadsTheFeatureMapFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AttributeList from DUT\n"); + err = TestThReadsAttributeListFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads AcceptedCommandList from DUT\n"); + err = TestThReadsAcceptedCommandListFromDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads GeneratedCommandList from DUT\n"); + err = TestThReadsGeneratedCommandListFromDut_5(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + 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 = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThreadNetworkDiagnostics * cluster = + [[MTRBaseClusterThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThreadNetworkDiagnostics * cluster = + [[MTRBaseClusterThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 31UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAttributeListFromDut_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThreadNetworkDiagnostics * cluster = + [[MTRBaseClusterThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 11UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 12UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 13UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 59UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 60UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 61UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 62UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAcceptedCommandListFromDut_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThreadNetworkDiagnostics * cluster = + [[MTRBaseClusterThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AcceptedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsGeneratedCommandListFromDut_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThreadNetworkDiagnostics * cluster = + [[MTRBaseClusterThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads GeneratedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_ULABEL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -100729,11 +100246,11 @@ class TestMultiAdmin : public TestCommandBridge { } }; -class Test_TC_DGSW_2_1 : public TestCommandBridge { +class Test_TC_DGSW_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGSW_2_1() - : TestCommandBridge("Test_TC_DGSW_2_1") + Test_TC_DGSW_1_1() + : TestCommandBridge("Test_TC_DGSW_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -100743,7 +100260,7 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DGSW_2_1() {} + ~Test_TC_DGSW_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -100751,11 +100268,11 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGSW_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGSW_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGSW_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGSW_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -100772,36 +100289,69 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Reads a list of ThreadMetrics struct non-global attribute from DUT.\n"); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision from DUT\n"); + err = TestThReadsTheClusterRevisionFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap from DUT\n"); + err = TestThReadsTheFeatureMapFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AttributeList from DUT\n"); + err = TestThReadsAttributeListFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads optional attribute(ThreadMetrics) in AttributeList\n"); if (ShouldSkip("DGSW.S.A0000")) { NextTest(); return; } - err = TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1(); + err = TestThReadsOptionalAttributeThreadMetricsInAttributeList_4(); break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapFree non-global attribute value from DUT\n"); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads optional attribute(CurrentHeapFree) in AttributeList\n"); if (ShouldSkip("DGSW.S.A0001")) { NextTest(); return; } - err = TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2(); + err = TestThReadsOptionalAttributeCurrentHeapFreeInAttributeList_5(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapUsed non-global attribute value from DUT\n"); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads optional attribute(CurrentHeapUsed) in AttributeList\n"); if (ShouldSkip("DGSW.S.A0002")) { NextTest(); return; } - err = TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3(); + err = TestThReadsOptionalAttributeCurrentHeapUsedInAttributeList_6(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads CurrentHeapHighWaterMark non-global attribute value from DUT\n"); - if (ShouldSkip("DGSW.S.A0003")) { + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : TH reads Feature dependent attribute(CurrentHeapHighWatermark) in AttributeList\n"); + if (ShouldSkip("DGSW.S.F00 || DGSW.S.A0003")) { NextTest(); return; } - err = TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4(); + err = TestThReadsFeatureDependentAttributeCurrentHeapHighWatermarkInAttributeList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads AcceptedCommandList from DUT\n"); + if (ShouldSkip("DGSW.S.F00")) { + NextTest(); + return; + } + err = TestThReadsAcceptedCommandListFromDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads AcceptedCommandList from DUT\n"); + if (ShouldSkip(" !DGSW.S.F00 ")) { + NextTest(); + return; + } + err = TestThReadsAcceptedCommandListFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads GeneratedCommandList from DUT\n"); + err = TestThReadsGeneratedCommandListFromDut_10(); break; } @@ -100829,6 +100379,24 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -100842,7 +100410,7 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 11; chip::Optional mNodeId; chip::Optional mCluster; @@ -100856,7 +100424,7 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1() + CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device @@ -100864,19 +100432,24 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads a list of ThreadMetrics struct non-global attribute from DUT. Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("threadMetrics", "list", "list")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2() + CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device @@ -100884,19 +100457,22 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapFree non-global attribute value from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("currentHeapFree", "int64u", "int64u")); + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 1UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3() + CHIP_ERROR TestThReadsAttributeListFromDut_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device @@ -100904,19 +100480,25 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapUsed non-global attribute value from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AttributeList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("currentHeapUsed", "int64u", "int64u")); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4() + CHIP_ERROR TestThReadsOptionalAttributeThreadMetricsInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device @@ -100924,12 +100506,152 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHeapHighWaterMark non-global attribute value from DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ThreadMetrics) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "int64u", "int64u")); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeCurrentHeapFreeInAttributeList_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(CurrentHeapFree) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeCurrentHeapUsedInAttributeList_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(CurrentHeapUsed) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFeatureDependentAttributeCurrentHeapHighWatermarkInAttributeList_7() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent attribute(CurrentHeapHighWatermark) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAcceptedCommandListFromDut_8() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AcceptedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAcceptedCommandListFromDut_9() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AcceptedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsGeneratedCommandListFromDut_10() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads GeneratedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -100937,11 +100659,11 @@ class Test_TC_DGSW_2_1 : public TestCommandBridge { } }; -class Test_TC_DGSW_2_2 : public TestCommandBridge { +class Test_TC_DGSW_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGSW_2_2() - : TestCommandBridge("Test_TC_DGSW_2_2") + Test_TC_DGSW_2_1() + : TestCommandBridge("Test_TC_DGSW_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -100951,7 +100673,7 @@ class Test_TC_DGSW_2_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DGSW_2_2() {} + ~Test_TC_DGSW_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -100959,11 +100681,11 @@ class Test_TC_DGSW_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGSW_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGSW_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGSW_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGSW_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -100980,14 +100702,36 @@ class Test_TC_DGSW_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : Reads a list of SoftwareFault struct from DUT and data type in each field of the struct must " - "match the value listed in spec\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGSW.S.E00")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads a list of ThreadMetrics struct non-global attribute from DUT.\n"); + if (ShouldSkip("DGSW.S.A0000")) { NextTest(); return; } - err = TestReadsAListOfSoftwareFaultStructFromDutAndDataTypeInEachFieldOfTheStructMustMatchTheValueListedInSpec_1(); + err = TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapFree non-global attribute value from DUT\n"); + if (ShouldSkip("DGSW.S.A0001")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapUsed non-global attribute value from DUT\n"); + if (ShouldSkip("DGSW.S.A0002")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads CurrentHeapHighWaterMark non-global attribute value from DUT\n"); + if (ShouldSkip("DGSW.S.A0003")) { + NextTest(); + return; + } + err = TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4(); break; } @@ -101006,6 +100750,15 @@ class Test_TC_DGSW_2_2 : public TestCommandBridge { case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -101019,7 +100772,7 @@ class Test_TC_DGSW_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; @@ -101033,18 +100786,195 @@ class Test_TC_DGSW_2_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadsAListOfSoftwareFaultStructFromDutAndDataTypeInEachFieldOfTheStructMustMatchTheValueListedInSpec_1() + CHIP_ERROR TestReadsAListOfThreadMetricsStructNonGlobalAttributeFromDut_1() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter '0' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("0garbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } -}; + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -class Test_TC_DGSW_2_3 : public TestCommandBridge { -public: + [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads a list of ThreadMetrics struct non-global attribute from DUT. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("threadMetrics", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentHeapFreeNonGlobalAttributeValueFromDut_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapFree non-global attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("currentHeapFree", "int64u", "int64u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapUsed non-global attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("currentHeapUsed", "int64u", "int64u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterSoftwareDiagnostics * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHeapHighWaterMark non-global attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "int64u", "int64u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DGSW_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DGSW_2_2() + : TestCommandBridge("Test_TC_DGSW_2_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_DGSW_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGSW_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGSW_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : Reads a list of SoftwareFault struct from DUT and data type in each field of the struct must " + "match the value listed in spec\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGSW.S.E00")) { + NextTest(); + return; + } + err = TestReadsAListOfSoftwareFaultStructFromDutAndDataTypeInEachFieldOfTheStructMustMatchTheValueListedInSpec_1(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + 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 = 2; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadsAListOfSoftwareFaultStructFromDutAndDataTypeInEachFieldOfTheStructMustMatchTheValueListedInSpec_1() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter '0' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("0garbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } +}; + +class Test_TC_DGSW_2_3 : public TestCommandBridge { +public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced Test_TC_DGSW_2_3() : TestCommandBridge("Test_TC_DGSW_2_3") @@ -110421,133 +110351,1141 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfTotalUsersSupported; + NSNumber * _Nonnull NumberOfTotalUsersSupported; + + CHIP_ERROR TestGetNumberOfSupportedUsers_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get number of supported users Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("NumberOfTotalUsersSupported", actualValue, 10U)); + } + { + NumberOfTotalUsersSupported = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull NumberOfWeekDaySchedulesSupportedPerUser; + + CHIP_ERROR TestGetMaxNumberOfWeekDaySchedulesForUserAndVerifyDefaultValue_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get Max number of Week Day schedules for user and verify default value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("NumberOfWeekDaySchedulesSupportedPerUser", actualValue, 10U)); + } + { + NumberOfWeekDaySchedulesSupportedPerUser = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull NumberOfYearDaySchedulesSupportedPerUser; + + CHIP_ERROR TestGetMaxNumberOfYearDaySchedulesForUserAndVerifyDefaultValue_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get Max number of Year Day schedules for user and verify default value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("NumberOfYearDaySchedulesSupportedPerUser", actualValue, 10U)); + } + { + NumberOfYearDaySchedulesSupportedPerUser = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull NumberOfHolidaySchedulesSupported; + + CHIP_ERROR TestGetMaxNumberOfHolidaySchedulesAndVerifyDefaultValue_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNumberOfHolidaySchedulesSupportedWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get Max number of Holiday schedules and verify default value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("NumberOfHolidaySchedulesSupported", actualValue, 10U)); + } + { + NumberOfHolidaySchedulesSupported = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWith0Index_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with 0 index Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWithOutOfBoundsIndex_7() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with out-of-bounds index Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWith0UserIndex_8() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:0U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with 0 user index Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWithOutOfBoundsUserIndex_9() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with out-of-bounds user index Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleForNonExistingUser_10() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule for non-existing user Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWith0DaysMask_11() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:0U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with 0 days mask Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleForSundayAndMonday_12() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:3U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule for Sunday and Monday Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleForSundayWednesdayAndSaturday_13() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:73U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule for Sunday Wednesday and Saturday Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWithInvalidStartHour_14() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:24U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with invalid start hour Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWithInvalidStartMinute_15() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:60U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with invalid start minute Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWithInvalidEndHour_16() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:24U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with invalid end hour Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWithInvalidEndMinute_17() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:60U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with invalid end minute Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWithStartHourLaterThatEndHour_18() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:19U]; + params.startMinute = [NSNumber numberWithUnsignedChar:16U]; + params.endHour = [NSNumber numberWithUnsignedChar:18U]; + params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with start hour later that end hour Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWithStartMinuteLaterThatEndMinuteWhenHoursAreEqual_19() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; + params.startMinute = [NSNumber numberWithUnsignedChar:50U]; + params.endHour = [NSNumber numberWithUnsignedChar:15U]; + params.endMinute = [NSNumber numberWithUnsignedChar:49U]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with start minute later that end minute when hours are equal Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureThatPreviousOperationsDidNotCreateASchedule_20() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that previous operations did not create a schedule Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetWeekDayScheduleWith0Index_21() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Week Day schedule with 0 index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 0U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetWeekDayScheduleWithOutOfBoundsIndex_22() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Week Day schedule with out-of-bounds index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, + [NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetWeekDayScheduleWith0UserIndex_23() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:0U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Week Day schedule with 0 user index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 0U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetWeekDayScheduleWithOutOfBoundsUserIndex_24() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Week Day schedule with out-of-bounds user index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue( + "userIndex", actualValue, [NumberOfTotalUsersSupported unsignedShortValue] + 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetWeekDayScheduleWithNonExistingUserIndex_25() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Week Day schedule with non-existing user index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateYearDayScheduleWith0Index_26() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + [cluster + setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Year Day schedule with 0 index Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateYearDayScheduleWithOutOfBoundsIndex_27() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + [cluster + setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Year Day schedule with out-of-bounds index Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateYearDayScheduleWith0UserIndex_28() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:0U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + [cluster + setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Year Day schedule with 0 user index Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateYearDayScheduleWithOutOfBoundsUserIndex_29() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + [cluster + setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Year Day schedule with out-of-bounds user index Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateYearDayScheduleForNonExistingUser_30() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + [cluster + setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Year Day schedule for non-existing user Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateYearDayScheduleWithStartHourLaterThatEndHour_31() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345689UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345688UL]; + [cluster + setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Year Day schedule with start hour later that end hour Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureThatPreviousOperationsDidNotCreateASchedule_32() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that previous operations did not create a schedule Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetYearDayScheduleWith0Index_33() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Year Day schedule with 0 index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 0U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } - CHIP_ERROR TestGetNumberOfSupportedUsers_2() + CHIP_ERROR TestGetYearDayScheduleWithOutOfBoundsIndex_34() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Get number of supported users Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Year Day schedule with out-of-bounds index Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("NumberOfTotalUsersSupported", actualValue, 10U)); - } - { - NumberOfTotalUsersSupported = value; - } + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, + [NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U)); + } - NextTest(); - }]; + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfWeekDaySchedulesSupportedPerUser; - CHIP_ERROR TestGetMaxNumberOfWeekDaySchedulesForUserAndVerifyDefaultValue_3() + CHIP_ERROR TestGetYearDayScheduleWith0UserIndex_35() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Get Max number of Week Day schedules for user and verify default value Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:0U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Year Day schedule with 0 user index Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("NumberOfWeekDaySchedulesSupportedPerUser", actualValue, 10U)); - } - { - NumberOfWeekDaySchedulesSupportedPerUser = value; - } + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + } - NextTest(); - }]; + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 0U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfYearDaySchedulesSupportedPerUser; - CHIP_ERROR TestGetMaxNumberOfYearDaySchedulesForUserAndVerifyDefaultValue_4() + CHIP_ERROR TestGetYearDayScheduleWithOutOfBoundsUserIndex_36() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Get Max number of Year Day schedules for user and verify default value Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Year Day schedule with out-of-bounds user index Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("NumberOfYearDaySchedulesSupportedPerUser", actualValue, 10U)); - } - { - NumberOfYearDaySchedulesSupportedPerUser = value; - } + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + } - NextTest(); - }]; + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue( + "userIndex", actualValue, [NumberOfTotalUsersSupported unsignedShortValue] + 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfHolidaySchedulesSupported; - CHIP_ERROR TestGetMaxNumberOfHolidaySchedulesAndVerifyDefaultValue_5() + CHIP_ERROR TestGetYearDayScheduleWithNonExistingUserIndex_37() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNumberOfHolidaySchedulesSupportedWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Get Max number of Holiday schedules and verify default value Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Year Day schedule with non-existing user index Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("NumberOfHolidaySchedulesSupported", actualValue, 10U)); - } - { - NumberOfHolidaySchedulesSupported = value; - } + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + } - NextTest(); - }]; + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 1U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWith0Index_6() + CHIP_ERROR TestCreateHolidayScheduleWith0Index_38() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:0U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:0U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; [cluster - setWeekDayScheduleWithParams:params + setHolidayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with 0 index Error: %@", err); + NSLog(@"Create Holiday schedule with 0 index Error: %@", err); VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) @@ -110559,24 +111497,21 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWithOutOfBoundsIndex_7() + CHIP_ERROR TestCreateHolidayScheduleWithOutOfBoundsIndex_39() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfHolidaySchedulesSupported unsignedCharValue] + 1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; [cluster - setWeekDayScheduleWithParams:params + setHolidayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with out-of-bounds index Error: %@", err); + NSLog(@"Create Holiday schedule with out-of-bounds index Error: %@", err); VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) @@ -110588,24 +111523,21 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWith0UserIndex_8() + CHIP_ERROR TestCreateHolidayScheduleWithStartHourLaterThatEndHour_40() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:0U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345689UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345688UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; [cluster - setWeekDayScheduleWithParams:params + setHolidayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with 0 user index Error: %@", err); + NSLog(@"Create Holiday schedule with start hour later that end hour Error: %@", err); VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) @@ -110617,24 +111549,21 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWithOutOfBoundsUserIndex_9() + CHIP_ERROR TestCreateHolidayScheduleWithInvalidOperatingMode_41() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:5U]; [cluster - setWeekDayScheduleWithParams:params + setHolidayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with out-of-bounds user index Error: %@", err); + NSLog(@"Create Holiday schedule with invalid operating mode Error: %@", err); VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) @@ -110646,239 +111575,170 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleForNonExistingUser_10() + CHIP_ERROR TestMakeSureThatPreviousOperationsDidNotCreateASchedule_42() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule for non-existing user Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that previous operations did not create a schedule Error: %@", err); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestCreateWeekDayScheduleWith0DaysMask_11() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); + } - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:0U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with 0 days mask Error: %@", err); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleForSundayAndMonday_12() + CHIP_ERROR TestGetHolidayScheduleWith0Index_43() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:3U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule for Sunday and Monday Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:0U]; + [cluster getHolidayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Holiday schedule with 0 index Error: %@", err); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestCreateWeekDayScheduleForSundayWednesdayAndSaturday_13() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 0U)); + } - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:73U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule for Sunday Wednesday and Saturday Error: %@", err); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWithInvalidStartHour_14() + CHIP_ERROR TestGetHolidayScheduleWithOutOfBoundsIndex_44() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:24U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with invalid start hour Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfHolidaySchedulesSupported unsignedCharValue] + 1U]; + [cluster getHolidayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Get Holiday schedule with out-of-bounds index Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue( + "holidayIndex", actualValue, [NumberOfHolidaySchedulesSupported unsignedCharValue] + 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWithInvalidStartMinute_15() + CHIP_ERROR TestCreateHolidayScheduleWithValidParameters_45() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:60U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with invalid start minute Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; + [cluster setHolidayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Holiday schedule with valid parameters Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWithInvalidEndHour_16() + CHIP_ERROR TestVerifyCreatedSchedule_46() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:24U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with invalid end hour Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Verify created schedule Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - return CHIP_NO_ERROR; - } + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); + } - CHIP_ERROR TestCreateWeekDayScheduleWithInvalidEndMinute_17() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:60U]; - [cluster - setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with invalid end minute Error: %@", err); + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + } - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + } + + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWithStartHourLaterThatEndHour_18() + CHIP_ERROR TestCreateWeekDayScheduleWithValidParameters_47() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -110888,56 +111748,23 @@ class DL_Schedules : public TestCommandBridge { params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:19U]; + params.startHour = [NSNumber numberWithUnsignedChar:15U]; params.startMinute = [NSNumber numberWithUnsignedChar:16U]; params.endHour = [NSNumber numberWithUnsignedChar:18U]; params.endMinute = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with start hour later that end hour Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCreateWeekDayScheduleWithStartMinuteLaterThatEndMinuteWhenHoursAreEqual_19() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + [cluster setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with valid parameters Error: %@", err); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:50U]; - params.endHour = [NSNumber numberWithUnsignedChar:15U]; - params.endMinute = [NSNumber numberWithUnsignedChar:49U]; - [cluster - setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with start minute later that end minute when hours are equal Error: %@", - err); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatPreviousOperationsDidNotCreateASchedule_20() + CHIP_ERROR TestVerifyCreatedSchedule_48() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -110949,7 +111776,7 @@ class DL_Schedules : public TestCommandBridge { [cluster getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that previous operations did not create a schedule Error: %@", err); + NSLog(@"Verify created schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -110965,7 +111792,32 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.daysMask; + VerifyOrReturn(CheckValue("daysMask", actualValue, 1U)); + } + + { + id actualValue = values.startHour; + VerifyOrReturn(CheckValue("startHour", actualValue, 15U)); + } + + { + id actualValue = values.startMinute; + VerifyOrReturn(CheckValue("startMinute", actualValue, 16U)); + } + + { + id actualValue = values.endHour; + VerifyOrReturn(CheckValue("endHour", actualValue, 18U)); + } + + { + id actualValue = values.endMinute; + VerifyOrReturn(CheckValue("endMinute", actualValue, 0U)); } NextTest(); @@ -110974,25 +111826,48 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestGetWeekDayScheduleWith0Index_21() + CHIP_ERROR TestCreateYearDayScheduleWithValidParameters_49() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:0U]; + __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getWeekDayScheduleWithParams:params + params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + [cluster setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Year Day schedule with valid parameters Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCreatedSchedule_50() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Week Day schedule with 0 index Error: %@", err); + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Verify created schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 0U)); + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); } { @@ -111002,7 +111877,17 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + } + + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); } NextTest(); @@ -111011,45 +111896,127 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestGetWeekDayScheduleWithOutOfBoundsIndex_22() + CHIP_ERROR TestClearWeekDayScheduleWith0Index_51() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Week Day schedule with 0 index Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestClearWeekDayScheduleWithOutOfBoundsIndex_52() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; params.weekDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getWeekDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Week Day schedule with out-of-bounds index Error: %@", err); + [cluster clearWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Week Day schedule with out-of-bounds index Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; - { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, - [NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + CHIP_ERROR TestClearWeekDayScheduleWith0UserIndex_53() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); - } + __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:0U]; + [cluster clearWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Week Day schedule with 0 user index Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestGetWeekDayScheduleWith0UserIndex_23() + CHIP_ERROR TestClearWeekDayScheduleWithOutOfBoundsUserIndex_54() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + [cluster clearWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Week Day schedule with out-of-bounds user index Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestClearWeekDayScheduleWithNonExistingUser_55() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster clearWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Week Day schedule with non-existing user Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureThatWeekDayScheduleWasNotDeleted_56() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111057,11 +112024,11 @@ class DL_Schedules : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Week Day schedule with 0 user index Error: %@", err); + NSLog(@"Make sure that week day schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111072,12 +112039,37 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 0U)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.daysMask; + VerifyOrReturn(CheckValue("daysMask", actualValue, 1U)); + } + + { + id actualValue = values.startHour; + VerifyOrReturn(CheckValue("startHour", actualValue, 15U)); + } + + { + id actualValue = values.startMinute; + VerifyOrReturn(CheckValue("startMinute", actualValue, 16U)); + } + + { + id actualValue = values.endHour; + VerifyOrReturn(CheckValue("endHour", actualValue, 18U)); + } + + { + id actualValue = values.endMinute; + VerifyOrReturn(CheckValue("endMinute", actualValue, 0U)); } NextTest(); @@ -111086,36 +112078,45 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestGetWeekDayScheduleWithOutOfBoundsUserIndex_24() + CHIP_ERROR TestMakeSureThatYearDayScheduleWasNotDeleted_57() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; - [cluster getWeekDayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Week Day schedule with out-of-bounds user index Error: %@", err); + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that year day schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); } { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue( - "userIndex", actualValue, [NumberOfTotalUsersSupported unsignedShortValue] + 1U)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + } + + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); } NextTest(); @@ -111124,35 +112125,44 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestGetWeekDayScheduleWithNonExistingUserIndex_25() + CHIP_ERROR TestMakeSureThatHolidayScheduleWasNotDeleted_58() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - [cluster getWeekDayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Week Day schedule with non-existing user index Error: %@", err); + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that holiday schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); } { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); } { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 1U)); + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + } + + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + } + + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); } NextTest(); @@ -111161,181 +112171,145 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateYearDayScheduleWith0Index_26() + CHIP_ERROR TestClearYearDayScheduleWith0Index_59() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:0U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; - [cluster - setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule with 0 index Error: %@", err); + [cluster clearYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Year Day schedule with 0 index Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateYearDayScheduleWithOutOfBoundsIndex_27() + CHIP_ERROR TestClearYearDayScheduleWithOutOfBoundsIndex_60() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; - [cluster - setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule with out-of-bounds index Error: %@", err); + [cluster clearYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Year Day schedule with out-of-bounds index Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateYearDayScheduleWith0UserIndex_28() + CHIP_ERROR TestClearYearDayScheduleWith0UserIndex_61() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:0U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; - [cluster - setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule with 0 user index Error: %@", err); + [cluster clearYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Year Day schedule with 0 user index Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateYearDayScheduleWithOutOfBoundsUserIndex_29() + CHIP_ERROR TestClearYearDayScheduleWithOutOfBoundsUserIndex_62() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; - [cluster - setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule with out-of-bounds user index Error: %@", err); + [cluster clearYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Year Day schedule with out-of-bounds user index Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateYearDayScheduleForNonExistingUser_30() + CHIP_ERROR TestClearYearDayScheduleWithNonExistingUser_63() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; - [cluster - setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule for non-existing user Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCreateYearDayScheduleWithStartHourLaterThatEndHour_31() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345689UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345688UL]; - [cluster - setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule with start hour later that end hour Error: %@", err); + [cluster clearYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Year Day schedule with non-existing user Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_COMMAND)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatPreviousOperationsDidNotCreateASchedule_32() + CHIP_ERROR TestMakeSureThatWeekDayScheduleWasNotDeleted_64() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params + [cluster getWeekDayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that previous operations did not create a schedule Error: %@", err); + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that week day schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); } { @@ -111345,44 +112319,32 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); + VerifyOrReturn(CheckValue("status", actualValue, 0U)); } - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestGetYearDayScheduleWith0Index_33() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:0U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Year Day schedule with 0 index Error: %@", err); + { + id actualValue = values.daysMask; + VerifyOrReturn(CheckValue("daysMask", actualValue, 1U)); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.startHour; + VerifyOrReturn(CheckValue("startHour", actualValue, 15U)); + } { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 0U)); + id actualValue = values.startMinute; + VerifyOrReturn(CheckValue("startMinute", actualValue, 16U)); } { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + id actualValue = values.endHour; + VerifyOrReturn(CheckValue("endHour", actualValue, 18U)); } { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); + id actualValue = values.endMinute; + VerifyOrReturn(CheckValue("endMinute", actualValue, 0U)); } NextTest(); @@ -111391,26 +112353,25 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestGetYearDayScheduleWithOutOfBoundsIndex_34() + CHIP_ERROR TestMakeSureThatYearDayScheduleWasNotDeleted_65() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Year Day schedule with out-of-bounds index Error: %@", err); + NSLog(@"Make sure that year day schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, - [NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U)); + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); } { @@ -111420,44 +112381,17 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestGetYearDayScheduleWith0UserIndex_35() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:0U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Year Day schedule with 0 user index Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + VerifyOrReturn(CheckValue("status", actualValue, 0U)); } { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 0U)); + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); } { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); } NextTest(); @@ -111466,73 +112400,44 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestGetYearDayScheduleWithOutOfBoundsUserIndex_36() + CHIP_ERROR TestMakeSureThatHolidayScheduleWasNotDeleted_66() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; - [cluster getYearDayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Year Day schedule with out-of-bounds user index Error: %@", err); + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that holiday schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue( - "userIndex", actualValue, [NumberOfTotalUsersSupported unsignedShortValue] + 1U)); + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); } { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); + VerifyOrReturn(CheckValue("status", actualValue, 0U)); } - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestGetYearDayScheduleWithNonExistingUserIndex_37() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Year Day schedule with non-existing user index Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); } { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); } { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 1U)); + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); } NextTest(); @@ -111541,164 +112446,106 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateHolidayScheduleWith0Index_38() + CHIP_ERROR TestClearHolidayScheduleWith0Index_67() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; params.holidayIndex = [NSNumber numberWithUnsignedChar:0U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; - params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Holiday schedule with 0 index Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCreateHolidayScheduleWithOutOfBoundsIndex_39() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfHolidaySchedulesSupported unsignedCharValue] + 1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; - params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Holiday schedule with out-of-bounds index Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCreateHolidayScheduleWithStartHourLaterThatEndHour_40() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345689UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345688UL]; - params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Holiday schedule with start hour later that end hour Error: %@", err); + [cluster clearHolidayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Holiday schedule with 0 index Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateHolidayScheduleWithInvalidOperatingMode_41() + CHIP_ERROR TestClearHolidayScheduleWithOutOfBoundsIndex_68() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; - params.operatingMode = [NSNumber numberWithUnsignedChar:5U]; - [cluster - setHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Holiday schedule with invalid operating mode Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + [cluster clearHolidayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear Holiday schedule with out-of-bounds index Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_FIELD)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatPreviousOperationsDidNotCreateASchedule_42() + CHIP_ERROR TestMakeSureThatWeekDayScheduleWasNotDeleted_69() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; - [cluster getHolidayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getWeekDayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that previous operations did not create a schedule Error: %@", err); + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that week day schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); } { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - CHIP_ERROR TestGetHolidayScheduleWith0Index_43() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.daysMask; + VerifyOrReturn(CheckValue("daysMask", actualValue, 1U)); + } - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:0U]; - [cluster getHolidayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Holiday schedule with 0 index Error: %@", err); + { + id actualValue = values.startHour; + VerifyOrReturn(CheckValue("startHour", actualValue, 15U)); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.startMinute; + VerifyOrReturn(CheckValue("startMinute", actualValue, 16U)); + } { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 0U)); + id actualValue = values.endHour; + VerifyOrReturn(CheckValue("endHour", actualValue, 18U)); } { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); + id actualValue = values.endMinute; + VerifyOrReturn(CheckValue("endMinute", actualValue, 0U)); } NextTest(); @@ -111707,54 +112554,46 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestGetHolidayScheduleWithOutOfBoundsIndex_44() + CHIP_ERROR TestMakeSureThatYearDayScheduleWasNotDeleted_70() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfHolidaySchedulesSupported unsignedCharValue] + 1U]; - [cluster getHolidayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Holiday schedule with out-of-bounds index Error: %@", err); + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that year day schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue( - "holidayIndex", actualValue, [NumberOfHolidaySchedulesSupported unsignedCharValue] + 1U)); + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); } { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCreateHolidayScheduleWithValidParameters_45() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; - params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; - [cluster setHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Holiday schedule with valid parameters Error: %@", err); + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + } NextTest(); }]; @@ -111762,7 +112601,7 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedSchedule_46() + CHIP_ERROR TestMakeSureThatHolidayScheduleWasNotDeleted_71() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111773,7 +112612,7 @@ class DL_Schedules : public TestCommandBridge { [cluster getHolidayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created schedule Error: %@", err); + NSLog(@"Make sure that holiday schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111808,23 +112647,23 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWithValidParameters_47() + CHIP_ERROR TestCreateAnotherWeekDayScheduleWithValidParameters_72() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:2U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:15U]; - params.startMinute = [NSNumber numberWithUnsignedChar:16U]; - params.endHour = [NSNumber numberWithUnsignedChar:18U]; - params.endMinute = [NSNumber numberWithUnsignedChar:0U]; + params.daysMask = [NSNumber numberWithUnsignedChar:2U]; + params.startHour = [NSNumber numberWithUnsignedChar:0U]; + params.startMinute = [NSNumber numberWithUnsignedChar:0U]; + params.endHour = [NSNumber numberWithUnsignedChar:23U]; + params.endMinute = [NSNumber numberWithUnsignedChar:59U]; [cluster setWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with valid parameters Error: %@", err); + NSLog(@"Create another Week Day schedule with valid parameters Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111834,25 +112673,25 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedSchedule_48() + CHIP_ERROR TestVerifyCreatedWeekDaySchedule_73() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:2U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created schedule Error: %@", err); + NSLog(@"Verify created week day schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 2U)); } { @@ -111867,27 +112706,27 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.daysMask; - VerifyOrReturn(CheckValue("daysMask", actualValue, 1U)); + VerifyOrReturn(CheckValue("daysMask", actualValue, 2U)); } { id actualValue = values.startHour; - VerifyOrReturn(CheckValue("startHour", actualValue, 15U)); + VerifyOrReturn(CheckValue("startHour", actualValue, 0U)); } { id actualValue = values.startMinute; - VerifyOrReturn(CheckValue("startMinute", actualValue, 16U)); + VerifyOrReturn(CheckValue("startMinute", actualValue, 0U)); } { id actualValue = values.endHour; - VerifyOrReturn(CheckValue("endHour", actualValue, 18U)); + VerifyOrReturn(CheckValue("endHour", actualValue, 23U)); } { id actualValue = values.endMinute; - VerifyOrReturn(CheckValue("endMinute", actualValue, 0U)); + VerifyOrReturn(CheckValue("endMinute", actualValue, 59U)); } NextTest(); @@ -111896,20 +112735,20 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateYearDayScheduleWithValidParameters_49() + CHIP_ERROR TestCreateAnotherYearDayScheduleWithValidParameters_74() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; + params.localStartTime = [NSNumber numberWithUnsignedInt:9000UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:888888888UL]; [cluster setYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule with valid parameters Error: %@", err); + NSLog(@"Create another Year Day schedule with valid parameters Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111919,30 +112758,94 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedSchedule_50() + CHIP_ERROR TestVerifyCreatedYearDaySchedule_75() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created schedule Error: %@", err); + NSLog(@"Verify created year day schedule Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 9000UL)); + } + + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 888888888UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateAnotherHolidayScheduleWithValidParameters_76() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:123456UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:1234567UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:1U]; + [cluster setHolidayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create another Holiday schedule with valid parameters Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCreatedHolidaySchedule_77() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; + [cluster getHolidayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Verify created holiday schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 2U)); } { @@ -111952,12 +112855,17 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + VerifyOrReturn(CheckValue("localStartTime", actualValue, 123456UL)); } { id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + VerifyOrReturn(CheckValue("localEndTime", actualValue, 1234567UL)); + } + + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("operatingMode", actualValue, 1U)); } NextTest(); @@ -111966,145 +112874,104 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearWeekDayScheduleWith0Index_51() + CHIP_ERROR TestClearASingleWeekDayScheduleForTheFirstUser_78() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:0U]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster clearWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Week Day schedule with 0 index Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestClearWeekDayScheduleWithOutOfBoundsIndex_52() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + NSLog(@"Clear a single week day schedule for the first user Error: %@", err); - __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster clearWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Week Day schedule with out-of-bounds index Error: %@", err); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestClearWeekDayScheduleWith0UserIndex_53() + CHIP_ERROR TestVerifyClearedWeekDaySchedule_79() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:0U]; - [cluster clearWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Week Day schedule with 0 user index Error: %@", err); + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Verify cleared week day schedule Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - return CHIP_NO_ERROR; - } + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + } - CHIP_ERROR TestClearWeekDayScheduleWithOutOfBoundsUserIndex_54() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } - __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; - [cluster clearWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Week Day schedule with out-of-bounds user index Error: %@", err); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestClearWeekDayScheduleWithNonExistingUser_55() + CHIP_ERROR TestClearAllRemainingWeekDaySchedulesForTheFirstUser_80() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:254U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster clearWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Week Day schedule with non-existing user Error: %@", err); + NSLog(@"Clear all remaining week day schedules for the first user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_FAILURE)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatWeekDayScheduleWasNotDeleted_56() + CHIP_ERROR TestVerifyClearedWeekSchedule_81() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:2U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that week day schedule was not deleted Error: %@", err); + NSLog(@"Verify cleared week schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 2U)); } { @@ -112114,32 +112981,54 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); + VerifyOrReturn(CheckValue("status", actualValue, 139U)); } + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureThatFirstYearDayScheduleWasNotDeleted_82() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that first year day schedule was not deleted Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { - id actualValue = values.daysMask; - VerifyOrReturn(CheckValue("daysMask", actualValue, 1U)); + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); } { - id actualValue = values.startHour; - VerifyOrReturn(CheckValue("startHour", actualValue, 15U)); + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } { - id actualValue = values.startMinute; - VerifyOrReturn(CheckValue("startMinute", actualValue, 16U)); + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); } { - id actualValue = values.endHour; - VerifyOrReturn(CheckValue("endHour", actualValue, 18U)); + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); } { - id actualValue = values.endMinute; - VerifyOrReturn(CheckValue("endMinute", actualValue, 0U)); + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); } NextTest(); @@ -112148,25 +113037,25 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatYearDayScheduleWasNotDeleted_57() + CHIP_ERROR TestMakeSureThatSecondYearDayScheduleWasNotDeleted_83() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that year day schedule was not deleted Error: %@", err); + NSLog(@"Make sure that second year day schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2U)); } { @@ -112181,12 +113070,12 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + VerifyOrReturn(CheckValue("localStartTime", actualValue, 9000UL)); } { id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + VerifyOrReturn(CheckValue("localEndTime", actualValue, 888888888UL)); } NextTest(); @@ -112195,7 +113084,7 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatHolidayScheduleWasNotDeleted_58() + CHIP_ERROR TestMakeSureThatFirstHolidayScheduleWasNotDeleted_84() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112206,7 +113095,7 @@ class DL_Schedules : public TestCommandBridge { [cluster getHolidayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that holiday schedule was not deleted Error: %@", err); + NSLog(@"Make sure that first holiday schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -112241,103 +113130,79 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearYearDayScheduleWith0Index_59() + CHIP_ERROR TestMakeSureThatSecondHolidayScheduleWasNotDeleted_85() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:0U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster clearYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Year Day schedule with 0 index Error: %@", err); - - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; + [cluster getHolidayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that second holiday schedule was not deleted Error: %@", err); - CHIP_ERROR TestClearYearDayScheduleWithOutOfBoundsIndex_60() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster clearYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Year Day schedule with out-of-bounds index Error: %@", err); + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 2U)); + } - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } - return CHIP_NO_ERROR; - } + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 123456UL)); + } - CHIP_ERROR TestClearYearDayScheduleWith0UserIndex_61() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 1234567UL)); + } - __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:0U]; - [cluster clearYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Year Day schedule with 0 user index Error: %@", err); + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("operatingMode", actualValue, 1U)); + } - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestClearYearDayScheduleWithOutOfBoundsUserIndex_62() + CHIP_ERROR TestCreateAnotherWeekDayScheduleWithValidParameters_86() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; - [cluster clearYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Year Day schedule with out-of-bounds user index Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:2U]; + params.startHour = [NSNumber numberWithUnsignedChar:0U]; + params.startMinute = [NSNumber numberWithUnsignedChar:0U]; + params.endHour = [NSNumber numberWithUnsignedChar:23U]; + params.endMinute = [NSNumber numberWithUnsignedChar:59U]; + [cluster setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create another Week Day schedule with valid parameters Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestClearYearDayScheduleWithNonExistingUser_63() + CHIP_ERROR TestClearASingleYearDayScheduleForTheFirstUser_87() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112345,41 +113210,38 @@ class DL_Schedules : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster clearYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Year Day schedule with non-existing user Error: %@", err); + NSLog(@"Clear a single year day schedule for the first user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_FAILURE)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatWeekDayScheduleWasNotDeleted_64() + CHIP_ERROR TestVerifyClearedYearDaySchedule_88() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getWeekDayScheduleWithParams:params + [cluster getYearDayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that week day schedule was not deleted Error: %@", err); + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Verify cleared year day schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); } { @@ -112389,59 +113251,55 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); + VerifyOrReturn(CheckValue("status", actualValue, 139U)); } - { - id actualValue = values.daysMask; - VerifyOrReturn(CheckValue("daysMask", actualValue, 1U)); - } + NextTest(); + }]; - { - id actualValue = values.startHour; - VerifyOrReturn(CheckValue("startHour", actualValue, 15U)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.startMinute; - VerifyOrReturn(CheckValue("startMinute", actualValue, 16U)); - } + CHIP_ERROR TestClearAllRemainingYearSchedulesForTheFirstUser_89() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.endHour; - VerifyOrReturn(CheckValue("endHour", actualValue, 18U)); - } + __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:254U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear all remaining year schedules for the first user Error: %@", err); - { - id actualValue = values.endMinute; - VerifyOrReturn(CheckValue("endMinute", actualValue, 0U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatYearDayScheduleWasNotDeleted_65() + CHIP_ERROR TestVerifyThatSecondYearDayScheduleWasCleared_90() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that year day schedule was not deleted Error: %@", err); + NSLog(@"Verify that second year day schedule was cleared Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2U)); } { @@ -112451,17 +113309,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); - } - - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + VerifyOrReturn(CheckValue("status", actualValue, 139U)); } NextTest(); @@ -112470,24 +113318,30 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatHolidayScheduleWasNotDeleted_66() + CHIP_ERROR TestVerifyCreatedWeekDaySchedule_91() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; - [cluster getHolidayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getWeekDayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that holiday schedule was not deleted Error: %@", err); + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Verify created week day schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } { @@ -112496,18 +113350,28 @@ class DL_Schedules : public TestCommandBridge { } { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + id actualValue = values.daysMask; + VerifyOrReturn(CheckValue("daysMask", actualValue, 2U)); } { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + id actualValue = values.startHour; + VerifyOrReturn(CheckValue("startHour", actualValue, 0U)); } { - id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); + id actualValue = values.startMinute; + VerifyOrReturn(CheckValue("startMinute", actualValue, 0U)); + } + + { + id actualValue = values.endHour; + VerifyOrReturn(CheckValue("endHour", actualValue, 23U)); + } + + { + id actualValue = values.endMinute; + VerifyOrReturn(CheckValue("endMinute", actualValue, 59U)); } NextTest(); @@ -112516,53 +113380,80 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearHolidayScheduleWith0Index_67() + CHIP_ERROR TestClearAllRemainingWeekDaySchedulesForTheFirstUser_92() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:0U]; - [cluster clearHolidayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:254U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Holiday schedule with 0 index Error: %@", err); + NSLog(@"Clear all remaining week day schedules for the first user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestClearHolidayScheduleWithOutOfBoundsIndex_68() + CHIP_ERROR TestCreateNewUserWithoutCredentialSoWeCanAddMoreSchedulesToIt_93() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; - [cluster clearHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear Holiday schedule with out-of-bounds index Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + params.userName = nil; + params.userUniqueId = nil; + params.userStatus = nil; + params.userType = nil; + params.credentialRule = nil; + [cluster setUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create new user without credential so we can add more schedules to it Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code - : EMBER_ZCL_STATUS_FAILURE) - : 0, - EMBER_ZCL_STATUS_INVALID_FIELD)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleWithValidParametersForFirstUser_94() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; + params.startHour = [NSNumber numberWithUnsignedChar:0U]; + params.startMinute = [NSNumber numberWithUnsignedChar:0U]; + params.endHour = [NSNumber numberWithUnsignedChar:23U]; + params.endMinute = [NSNumber numberWithUnsignedChar:59U]; + [cluster setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Week Day schedule with valid parameters for first user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatWeekDayScheduleWasNotDeleted_69() + CHIP_ERROR TestVerifyCreatedWeekDayScheduleForFirstUser_95() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112574,7 +113465,7 @@ class DL_Schedules : public TestCommandBridge { [cluster getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that week day schedule was not deleted Error: %@", err); + NSLog(@"Verify created week day schedule for first user Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -112600,22 +113491,22 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.startHour; - VerifyOrReturn(CheckValue("startHour", actualValue, 15U)); + VerifyOrReturn(CheckValue("startHour", actualValue, 0U)); } { id actualValue = values.startMinute; - VerifyOrReturn(CheckValue("startMinute", actualValue, 16U)); + VerifyOrReturn(CheckValue("startMinute", actualValue, 0U)); } { id actualValue = values.endHour; - VerifyOrReturn(CheckValue("endHour", actualValue, 18U)); + VerifyOrReturn(CheckValue("endHour", actualValue, 23U)); } { id actualValue = values.endMinute; - VerifyOrReturn(CheckValue("endMinute", actualValue, 0U)); + VerifyOrReturn(CheckValue("endMinute", actualValue, 59U)); } NextTest(); @@ -112624,71 +113515,53 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatYearDayScheduleWasNotDeleted_70() + CHIP_ERROR TestCreateYearDayScheduleForFirstUser_96() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:4U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that year day schedule was not deleted Error: %@", err); + params.localStartTime = [NSNumber numberWithUnsignedInt:9000UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:888888888UL]; + [cluster setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Year Day schedule for first user Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); - } - - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatHolidayScheduleWasNotDeleted_71() + CHIP_ERROR TestVerifyCreatedYearDayScheduleForFirst_97() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; - [cluster getHolidayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:4U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that holiday schedule was not deleted Error: %@", err); + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Verify created year day schedule for first Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 4U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } { @@ -112698,17 +113571,12 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + VerifyOrReturn(CheckValue("localStartTime", actualValue, 9000UL)); } { id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); - } - - { - id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); + VerifyOrReturn(CheckValue("localEndTime", actualValue, 888888888UL)); } NextTest(); @@ -112717,23 +113585,23 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateAnotherWeekDayScheduleWithValidParameters_72() + CHIP_ERROR TestCreateWeekDayScheduleWithValidParametersForSecondUser_98() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:2U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:2U]; - params.startHour = [NSNumber numberWithUnsignedChar:0U]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:4U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + params.daysMask = [NSNumber numberWithUnsignedChar:64U]; + params.startHour = [NSNumber numberWithUnsignedChar:23U]; params.startMinute = [NSNumber numberWithUnsignedChar:0U]; params.endHour = [NSNumber numberWithUnsignedChar:23U]; params.endMinute = [NSNumber numberWithUnsignedChar:59U]; [cluster setWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create another Week Day schedule with valid parameters Error: %@", err); + NSLog(@"Create Week Day schedule with valid parameters for second user Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -112743,30 +113611,30 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedWeekDaySchedule_73() + CHIP_ERROR TestVerifyCreatedWeekDayScheduleForFirstUser_99() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:2U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:4U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; [cluster getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created week day schedule Error: %@", err); + NSLog(@"Verify created week day schedule for first user Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 2U)); + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 4U)); } { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); } { @@ -112776,12 +113644,12 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.daysMask; - VerifyOrReturn(CheckValue("daysMask", actualValue, 2U)); + VerifyOrReturn(CheckValue("daysMask", actualValue, 64U)); } { id actualValue = values.startHour; - VerifyOrReturn(CheckValue("startHour", actualValue, 0U)); + VerifyOrReturn(CheckValue("startHour", actualValue, 23U)); } { @@ -112805,20 +113673,20 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateAnotherYearDayScheduleWithValidParameters_74() + CHIP_ERROR TestCreateYearDayScheduleForSecondUser_100() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:9000UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:888888888UL]; + params.localStartTime = [NSNumber numberWithUnsignedInt:55555UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:7777777UL]; [cluster setYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create another Year Day schedule with valid parameters Error: %@", err); + NSLog(@"Create Year Day schedule for second user Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -112828,25 +113696,25 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedYearDaySchedule_75() + CHIP_ERROR TestVerifyCreatedYearDayScheduleForFirst_101() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created year day schedule Error: %@", err); + NSLog(@"Verify created year day schedule for first Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2U)); + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); } { @@ -112861,12 +113729,12 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 9000UL)); + VerifyOrReturn(CheckValue("localStartTime", actualValue, 55555UL)); } { id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 888888888UL)); + VerifyOrReturn(CheckValue("localEndTime", actualValue, 7777777UL)); } NextTest(); @@ -112875,67 +113743,55 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateAnotherHolidayScheduleWithValidParameters_76() + CHIP_ERROR TestCleanupTheUser_102() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:123456UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:1234567UL]; - params.operatingMode = [NSNumber numberWithUnsignedChar:1U]; - [cluster setHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create another Holiday schedule with valid parameters Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:65534U]; + [cluster clearUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Cleanup the user Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedHolidaySchedule_77() + CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedWeekDaySchedules_103() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; - [cluster getHolidayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getWeekDayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created holiday schedule Error: %@", err); + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing first user also cleared week day schedules Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 2U)); - } - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 123456UL)); + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); } { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 1234567UL)); + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } { - id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("operatingMode", actualValue, 1U)); + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 1U)); } NextTest(); @@ -112944,46 +113800,25 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearASingleWeekDayScheduleForTheFirstUser_78() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster clearWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear a single week day schedule for the first user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyClearedWeekDaySchedule_79() + CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedYearDaySchedules_104() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:4U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getWeekDayScheduleWithParams:params + [cluster getYearDayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify cleared week day schedule Error: %@", err); + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing first user also cleared year day schedules Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 4U)); } { @@ -112993,7 +113828,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); + VerifyOrReturn(CheckValue("status", actualValue, 1U)); } NextTest(); @@ -113002,56 +113837,35 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAllRemainingWeekDaySchedulesForTheFirstUser_80() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:254U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster clearWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear all remaining week day schedules for the first user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyClearedWeekSchedule_81() + CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedWeekDaySchedules_105() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:2U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:4U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; [cluster getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify cleared week schedule Error: %@", err); + NSLog(@"Make sure clearing second user also cleared week day schedules Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 2U)); + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 4U)); } { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); } { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); + VerifyOrReturn(CheckValue("status", actualValue, 1U)); } NextTest(); @@ -113060,7 +113874,7 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatFirstYearDayScheduleWasNotDeleted_82() + CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedYearDaySchedules_106() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -113068,11 +113882,11 @@ class DL_Schedules : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that first year day schedule was not deleted Error: %@", err); + NSLog(@"Make sure clearing second user also cleared year day schedules Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -113083,22 +113897,12 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); } { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); - } - - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + VerifyOrReturn(CheckValue("status", actualValue, 1U)); } NextTest(); @@ -113107,30 +113911,24 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatSecondYearDayScheduleWasNotDeleted_83() + CHIP_ERROR TestMakeSureThatFirstHolidayScheduleWasNotDeleted_107() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that second year day schedule was not deleted Error: %@", err); + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that first holiday schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2U)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); } { @@ -113140,12 +113938,17 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 9000UL)); + VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); } { id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 888888888UL)); + VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + } + + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); } NextTest(); @@ -113154,24 +113957,24 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatFirstHolidayScheduleWasNotDeleted_84() + CHIP_ERROR TestMakeSureThatSecondHolidayScheduleWasNotDeleted_108() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; [cluster getHolidayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that first holiday schedule was not deleted Error: %@", err); + NSLog(@"Make sure that second holiday schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 2U)); } { @@ -113181,17 +113984,17 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + VerifyOrReturn(CheckValue("localStartTime", actualValue, 123456UL)); } { id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + VerifyOrReturn(CheckValue("localEndTime", actualValue, 1234567UL)); } { id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); + VerifyOrReturn(CheckValue("operatingMode", actualValue, 1U)); } NextTest(); @@ -113200,24 +114003,47 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatSecondHolidayScheduleWasNotDeleted_85() + CHIP_ERROR TestCreateAnotherHolidayScheduleAtTheLastSlot_109() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; + params.localStartTime = [NSNumber numberWithUnsignedInt:1UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:100UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:4U]; + [cluster setHolidayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create another Holiday schedule at the last slot Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCreatedHolidaySchedule_110() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; + params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; [cluster getHolidayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that second holiday schedule was not deleted Error: %@", err); + NSLog(@"Verify Created Holiday Schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 2U)); + VerifyOrReturn(CheckValue("holidayIndex", actualValue, NumberOfHolidaySchedulesSupported)); } { @@ -113227,17 +114053,17 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 123456UL)); + VerifyOrReturn(CheckValue("localStartTime", actualValue, 1UL)); } { id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 1234567UL)); + VerifyOrReturn(CheckValue("localEndTime", actualValue, 100UL)); } { id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("operatingMode", actualValue, 1U)); + VerifyOrReturn(CheckValue("operatingMode", actualValue, 4U)); } NextTest(); @@ -113246,7 +114072,53 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateAnotherWeekDayScheduleWithValidParameters_86() + CHIP_ERROR TestCreateNewPinCredentialAndScheduleUser_111() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and schedule user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateWeekDayScheduleForFirstUser_112() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -113255,14 +114127,14 @@ class DL_Schedules : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:2U]; + params.daysMask = [NSNumber numberWithUnsignedChar:1U]; params.startHour = [NSNumber numberWithUnsignedChar:0U]; params.startMinute = [NSNumber numberWithUnsignedChar:0U]; params.endHour = [NSNumber numberWithUnsignedChar:23U]; params.endMinute = [NSNumber numberWithUnsignedChar:59U]; [cluster setWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create another Week Day schedule with valid parameters Error: %@", err); + NSLog(@"Create Week Day schedule for first user Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -113272,18 +114144,40 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearASingleYearDayScheduleForTheFirstUser_87() + CHIP_ERROR TestCreateYearDayScheduleForFirstUser_113() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster clearYearDayScheduleWithParams:params + params.localStartTime = [NSNumber numberWithUnsignedInt:9000UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:888888888UL]; + [cluster setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Year Day schedule for first user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestClearASingleHolidaySchedule_114() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; + [cluster clearHolidayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear a single year day schedule for the first user Error: %@", err); + NSLog(@"Clear a single holiday schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -113293,30 +114187,70 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyClearedYearDaySchedule_88() + CHIP_ERROR TestMakeSureThatFirstHolidayScheduleWasNotDeleted_115() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify cleared year day schedule Error: %@", err); + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that first holiday schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); } { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); + } + + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); + } + + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureThatSecondHolidayScheduleWasDeleted_116() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; + [cluster getHolidayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that second holiday schedule was deleted Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 2U)); } { @@ -113330,56 +114264,44 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAllRemainingYearSchedulesForTheFirstUser_89() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:254U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster clearYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear all remaining year schedules for the first user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyThatSecondYearDayScheduleWasCleared_90() + CHIP_ERROR TestMakeSureThatThirdHolidayScheduleWasNotDeleted_117() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; + [cluster getHolidayScheduleWithParams:params completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify that second year day schedule was cleared Error: %@", err); + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that third holiday schedule was not deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2U)); + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, NumberOfHolidaySchedulesSupported)); } { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); } { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 1UL)); + } + + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 100UL)); + } + + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("operatingMode", actualValue, 4U)); } NextTest(); @@ -113388,7 +114310,7 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedWeekDaySchedule_91() + CHIP_ERROR TestMakeSureClearingHolidayScheduleDidNotClearWeekDaySchedule_118() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -113400,7 +114322,7 @@ class DL_Schedules : public TestCommandBridge { [cluster getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created week day schedule Error: %@", err); + NSLog(@"Make sure clearing holiday schedule did not clear week day schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -113421,7 +114343,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.daysMask; - VerifyOrReturn(CheckValue("daysMask", actualValue, 2U)); + VerifyOrReturn(CheckValue("daysMask", actualValue, 1U)); } { @@ -113450,18 +114372,64 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAllRemainingWeekDaySchedulesForTheFirstUser_92() + CHIP_ERROR TestMakeSureClearingHolidayScheduleDidNotClearYearDaySchedule_119() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:254U]; + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster clearWeekDayScheduleWithParams:params + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing holiday schedule did not clear year day schedule Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 9000UL)); + } + + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 888888888UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestClearAllRemainingHolidaySchedules_120() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:254U]; + [cluster clearHolidayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear all remaining week day schedules for the first user Error: %@", err); + NSLog(@"Clear all remaining holiday schedules Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -113471,59 +114439,100 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewUserWithoutCredentialSoWeCanAddMoreSchedulesToIt_93() + CHIP_ERROR TestMakeSureThatFirstHolidayIsStillDeleted_121() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - params.userName = nil; - params.userUniqueId = nil; - params.userStatus = nil; - params.userType = nil; - params.credentialRule = nil; - [cluster setUserWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create new user without credential so we can add more schedules to it Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that first holiday is still deleted Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWithValidParametersForFirstUser_94() + CHIP_ERROR TestMakeSureThatSecondHolidayScheduleWasDeleted_122() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:0U]; - params.startMinute = [NSNumber numberWithUnsignedChar:0U]; - params.endHour = [NSNumber numberWithUnsignedChar:23U]; - params.endMinute = [NSNumber numberWithUnsignedChar:59U]; - [cluster setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with valid parameters for first user Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; + [cluster getHolidayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that second holiday schedule was deleted Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 2U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedWeekDayScheduleForFirstUser_95() + CHIP_ERROR TestMakeSureThatThirdHolidayScheduleWasNotDeleted_123() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; + [cluster getHolidayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure that third holiday schedule was not deleted Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, NumberOfHolidaySchedulesSupported)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureClearingHolidayScheduleDidNotClearWeekDaySchedule_124() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -113535,7 +114544,7 @@ class DL_Schedules : public TestCommandBridge { [cluster getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created week day schedule for first user Error: %@", err); + NSLog(@"Make sure clearing holiday schedule did not clear week day schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -113585,48 +114594,25 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateYearDayScheduleForFirstUser_96() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:4U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:9000UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:888888888UL]; - [cluster setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule for first user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestVerifyCreatedYearDayScheduleForFirst_97() + CHIP_ERROR TestMakeSureClearingHolidayScheduleDidNotClearYearDaySchedule_125() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:4U]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created year day schedule for first Error: %@", err); + NSLog(@"Make sure clearing holiday schedule did not clear year day schedule Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 4U)); + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); } { @@ -113655,1078 +114641,1105 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleWithValidParametersForSecondUser_98() + CHIP_ERROR TestFinalCleanup_126() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:4U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - params.daysMask = [NSNumber numberWithUnsignedChar:64U]; - params.startHour = [NSNumber numberWithUnsignedChar:23U]; - params.startMinute = [NSNumber numberWithUnsignedChar:0U]; - params.endHour = [NSNumber numberWithUnsignedChar:23U]; - params.endMinute = [NSNumber numberWithUnsignedChar:59U]; - [cluster setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule with valid parameters for second user Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:65534U]; + [cluster clearUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Final Cleanup Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestVerifyCreatedWeekDayScheduleForFirstUser_99() +class Test_TC_DRLK_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DRLK_1_1() + : TestCommandBridge("Test_TC_DRLK_1_1") + , mTestIndex(0) { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:4U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - [cluster getWeekDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created week day schedule for first user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 4U)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); - } - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - { - id actualValue = values.daysMask; - VerifyOrReturn(CheckValue("daysMask", actualValue, 64U)); - } + ~Test_TC_DRLK_1_1() {} - { - id actualValue = values.startHour; - VerifyOrReturn(CheckValue("startHour", actualValue, 23U)); - } + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - { - id actualValue = values.startMinute; - VerifyOrReturn(CheckValue("startMinute", actualValue, 0U)); - } + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DRLK_1_1\n"); + } - { - id actualValue = values.endHour; - VerifyOrReturn(CheckValue("endHour", actualValue, 23U)); - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DRLK_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - { - id actualValue = values.endMinute; - VerifyOrReturn(CheckValue("endMinute", actualValue, 59U)); - } + Wait(); - NextTest(); - }]; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision from DUT\n"); + err = TestThReadsTheClusterRevisionFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap from DUT\n"); + if (ShouldSkip("DRLK.S.F00 || DRLK.S.F01 || DRLK.S.F02 || DRLK.S.F04 || DRLK.S.F05 || DRLK.S.F06 || DRLK.S.F07 || " + "DRLK.S.F08 || DRLK.S.F10 || DRLK.S.F11")) { + NextTest(); + return; + } + err = TestThReadsTheFeatureMapFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AttributeList from DUT\n"); + err = TestThReadsAttributeListFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads Feature dependent(DRLK.S.F08) attributes in AttributeList\n"); + if (ShouldSkip("DRLK.S.F08")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentDRLKSF08AttributesInAttributeList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads Feature dependent(DRLK.S.F00) attributes in AttributeList\n"); + if (ShouldSkip("DRLK.S.F00")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentDRLKSF00AttributesInAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads Feature dependent(DRLK.S.F01) attributes in AttributeList\n"); + if (ShouldSkip("DRLK.S.F01")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentDRLKSF01AttributesInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads Feature dependent(DRLK.S.F04) attribute in AttributeList\n"); + if (ShouldSkip("DRLK.S.F04")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentDRLKSF04AttributeInAttributeList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads Feature dependent(DRLK.S.F10) attribute in AttributeList\n"); + if (ShouldSkip("DRLK.S.F10")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentDRLKSF10AttributeInAttributeList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads Feature dependent(DRLK.S.F11) attribute in AttributeList\n"); + if (ShouldSkip("DRLK.S.F11")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentDRLKSF11AttributeInAttributeList_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : TH reads Feature dependent(DRLK.S.F00 or DRLK.S.F01) attributes in AttributeList\n"); + if (ShouldSkip("DRLK.S.F00 || DRLK.S.F01")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentDRLKSF00OrDrlksf01AttributesInAttributeList_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : TH reads Feature dependent(DRLK.S.F07 or DRLK.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("DRLK.S.F07 || DRLK.S.F00")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentDRLKSF07OrDrlksf00AttributeInAttributeList_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads optional attribute(Language) in AttributeList\n"); + if (ShouldSkip("DRLK.S.A0021")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeLanguageInAttributeList_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads optional attribute(LEDSettings) in AttributeList\n"); + if (ShouldSkip("DRLK.S.A0022")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeLEDSettingsInAttributeList_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads optional attribute(AutoRelockTime) in AttributeList\n"); + if (ShouldSkip("DRLK.S.A0023")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeAutoRelockTimeInAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads optional attribute(SoundVolume) in AttributeList\n"); + if (ShouldSkip("DRLK.S.A0024")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeSoundVolumeInAttributeList_15(); + break; + case 16: + ChipLogProgress( + chipTool, " ***** Test Step 16 : TH reads optional attribute(DefaultConfigurationRegister) in AttributeList\n"); + if (ShouldSkip("DRLK.S.A0027")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeDefaultConfigurationRegisterInAttributeList_16(); + break; + case 17: + ChipLogProgress( + chipTool, " ***** Test Step 17 : TH reads optional attribute(EnableLocalProgramming) in AttributeList\n"); + if (ShouldSkip("DRLK.S.A0028")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeEnableLocalProgrammingInAttributeList_17(); + break; + case 18: + ChipLogProgress( + chipTool, " ***** Test Step 18 : TH reads optional attribute(EnableOneTouchLocking) in AttributeList\n"); + if (ShouldSkip("DRLK.S.A0029")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeEnableOneTouchLockingInAttributeList_18(); + break; + case 19: + ChipLogProgress( + chipTool, " ***** Test Step 19 : TH reads optional attribute(EnableInsideStatusLED) in AttributeList\n"); + if (ShouldSkip("DRLK.S.A002a")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeEnableInsideStatusLEDInAttributeList_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : TH reads optional attribute(EnablePrivacyModeButton) in AttributeList\n"); + if (ShouldSkip("DRLK.S.A002b")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeEnablePrivacyModeButtonInAttributeList_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : TH reads optional attribute(LocalProgrammingFeatures) in AttributeList\n"); + if (ShouldSkip("DRLK.S.A002c")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeLocalProgrammingFeaturesInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads AcceptedCommandList from DUT\n"); + err = TestThReadsAcceptedCommandListFromDut_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : TH reads Feature dependent commands(DRLK.S.F04) in AcceptedCommandList\n"); + if (ShouldSkip("DRLK.S.F04")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentCommandsDRLKSF04InAcceptedCommandList_23(); + break; + case 24: + ChipLogProgress( + chipTool, " ***** Test Step 24 : TH reads Feature dependent commands(DRLK.S.F10) in AcceptedCommandList\n"); + if (ShouldSkip("DRLK.S.F10")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentCommandsDRLKSF10InAcceptedCommandList_24(); + break; + case 25: + ChipLogProgress( + chipTool, " ***** Test Step 25 : TH reads Feature dependent commands(DRLK.S.F11) in AcceptedCommandList\n"); + if (ShouldSkip("DRLK.S.F11")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentCommandsDRLKSF11InAcceptedCommandList_25(); + break; + case 26: + ChipLogProgress( + chipTool, " ***** Test Step 26 : TH reads Feature dependent commands(DRLK.S.F08) in AcceptedCommandList\n"); + if (ShouldSkip("DRLK.S.F08")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentCommandsDRLKSF08InAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : TH reads optional commands(DRLK.S.C03.Rsp) in AcceptedCommandList\n"); + if (ShouldSkip("DRLK.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestThReadsOptionalCommandsDRLKSC03RspInAcceptedCommandList_27(); + break; + case 28: + ChipLogProgress( + chipTool, " ***** Test Step 28 : TH reads Feature dependent command(DRLK.S.F04) in GeneratedCommandList\n"); + if (ShouldSkip("DRLK.S.F04")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentCommandDRLKSF04InGeneratedCommandList_28(); + break; + case 29: + ChipLogProgress( + chipTool, " ***** Test Step 29 : TH reads Feature dependent command(DRLK.S.F10) in GeneratedCommandList\n"); + if (ShouldSkip("DRLK.S.F10")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentCommandDRLKSF10InGeneratedCommandList_29(); + break; + case 30: + ChipLogProgress( + chipTool, " ***** Test Step 30 : TH reads Feature dependent command(DRLK.S.F11) in GeneratedCommandList\n"); + if (ShouldSkip("DRLK.S.F11")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentCommandDRLKSF11InGeneratedCommandList_30(); + break; + case 31: + ChipLogProgress( + chipTool, " ***** Test Step 31 : TH reads Feature dependent command(DRLK.S.F08) in GeneratedCommandList\n"); + if (ShouldSkip("DRLK.S.F08")) { + NextTest(); + return; + } + err = TestThReadsFeatureDependentCommandDRLKSF08InGeneratedCommandList_31(); + break; + } - return CHIP_NO_ERROR; + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestCreateYearDayScheduleForSecondUser_100() + void OnStatusUpdate(const chip::app::StatusIB & status) override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:55555UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:7777777UL]; - [cluster setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule for second user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - return CHIP_NO_ERROR; + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); } - CHIP_ERROR TestVerifyCreatedYearDayScheduleForFirst_101() + chip::System::Clock::Timeout GetWaitDuration() const override { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created year day schedule for first Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 55555UL)); - } + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 7777777UL)); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 32; - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - return CHIP_NO_ERROR; + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestCleanupTheUser_102() + CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; - params.userIndex = [NSNumber numberWithUnsignedShort:65534U]; - [cluster clearUserWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Cleanup the user Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 6U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedWeekDaySchedules_103() + CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getWeekDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing first user also cleared week day schedules Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); - } + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 4095UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedYearDaySchedules_104() + CHIP_ERROR TestThReadsAttributeListFromDut_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:4U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing first user also cleared year day schedules Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 4U)); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AttributeList from DUT Error: %@", err); - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 37UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 38UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedWeekDaySchedules_105() + CHIP_ERROR TestThReadsFeatureDependentDRLKSF08AttributesInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:4U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - [cluster getWeekDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing second user also cleared week day schedules Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 4U)); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent(DRLK.S.F08) attributes in AttributeList Error: %@", err); - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 27UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 28UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedYearDaySchedules_106() + CHIP_ERROR TestThReadsFeatureDependentDRLKSF00AttributesInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing second user also cleared year day schedules Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent(DRLK.S.F00) attributes in AttributeList Error: %@", err); - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 23UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 24UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatFirstHolidayScheduleWasNotDeleted_107() + CHIP_ERROR TestThReadsFeatureDependentDRLKSF01AttributesInAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; - [cluster getHolidayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that first holiday schedule was not deleted Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); - } - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent(DRLK.S.F01) attributes in AttributeList Error: %@", err); - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 25UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 26UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatSecondHolidayScheduleWasNotDeleted_108() + CHIP_ERROR TestThReadsFeatureDependentDRLKSF04AttributeInAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; - [cluster getHolidayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that second holiday schedule was not deleted Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 2U)); - } - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 123456UL)); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent(DRLK.S.F04) attribute in AttributeList Error: %@", err); - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 1234567UL)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("operatingMode", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 20UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateAnotherHolidayScheduleAtTheLastSlot_109() + CHIP_ERROR TestThReadsFeatureDependentDRLKSF10AttributeInAttributeList_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; - params.localStartTime = [NSNumber numberWithUnsignedInt:1UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:100UL]; - params.operatingMode = [NSNumber numberWithUnsignedChar:4U]; - [cluster setHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create another Holiday schedule at the last slot Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent(DRLK.S.F10) attribute in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 21UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedHolidaySchedule_110() + CHIP_ERROR TestThReadsFeatureDependentDRLKSF11AttributeInAttributeList_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; - [cluster getHolidayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify Created Holiday Schedule Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, NumberOfHolidaySchedulesSupported)); - } - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 1UL)); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent(DRLK.S.F11) attribute in AttributeList Error: %@", err); - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 100UL)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("operatingMode", actualValue, 4U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 22UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinCredentialAndScheduleUser_111() + CHIP_ERROR TestThReadsFeatureDependentDRLKSF00OrDrlksf01AttributesInAttributeList_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0U]; - params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = nil; - params.userStatus = nil; - params.userType = nil; - [cluster - setCredentialWithParams:params - completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Create new PIN credential and schedule user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent(DRLK.S.F00 or DRLK.S.F01) attributes in AttributeList Error: %@", err); - { - id actualValue = values.nextCredentialIndex; - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); - VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 48UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 49UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateWeekDayScheduleForFirstUser_112() + CHIP_ERROR TestThReadsFeatureDependentDRLKSF07OrDrlksf00AttributeInAttributeList_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.daysMask = [NSNumber numberWithUnsignedChar:1U]; - params.startHour = [NSNumber numberWithUnsignedChar:0U]; - params.startMinute = [NSNumber numberWithUnsignedChar:0U]; - params.endHour = [NSNumber numberWithUnsignedChar:23U]; - params.endMinute = [NSNumber numberWithUnsignedChar:59U]; - [cluster setWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Week Day schedule for first user Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent(DRLK.S.F07 or DRLK.S.F00) attribute in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 51UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateYearDayScheduleForFirstUser_113() + CHIP_ERROR TestThReadsOptionalAttributeLanguageInAttributeList_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:9000UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:888888888UL]; - [cluster setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule for first user Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(Language) in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 33UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestClearASingleHolidaySchedule_114() + CHIP_ERROR TestThReadsOptionalAttributeLEDSettingsInAttributeList_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; - [cluster clearHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear a single holiday schedule Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(LEDSettings) in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 34UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatFirstHolidayScheduleWasNotDeleted_115() + CHIP_ERROR TestThReadsOptionalAttributeAutoRelockTimeInAttributeList_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; - [cluster getHolidayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that first holiday schedule was not deleted Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(AutoRelockTime) in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 35UL)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + NextTest(); + }]; - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 12345UL)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 12345689UL)); - } + CHIP_ERROR TestThReadsOptionalAttributeSoundVolumeInAttributeList_15() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SoundVolume) in AttributeList Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 36UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatSecondHolidayScheduleWasDeleted_116() + CHIP_ERROR TestThReadsOptionalAttributeDefaultConfigurationRegisterInAttributeList_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; - [cluster getHolidayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that second holiday schedule was deleted Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(DefaultConfigurationRegister) in AttributeList Error: %@", err); - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 2U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 39UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatThirdHolidayScheduleWasNotDeleted_117() + CHIP_ERROR TestThReadsOptionalAttributeEnableLocalProgrammingInAttributeList_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; - [cluster getHolidayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that third holiday schedule was not deleted Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(EnableLocalProgramming) in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, NumberOfHolidaySchedulesSupported)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 40UL)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + NextTest(); + }]; - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 1UL)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 100UL)); - } + CHIP_ERROR TestThReadsOptionalAttributeEnableOneTouchLockingInAttributeList_18() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("operatingMode", actualValue, 4U)); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(EnableOneTouchLocking) in AttributeList Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 41UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingHolidayScheduleDidNotClearWeekDaySchedule_118() + CHIP_ERROR TestThReadsOptionalAttributeEnableInsideStatusLEDInAttributeList_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getWeekDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing holiday schedule did not clear week day schedule Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(EnableInsideStatusLED) in AttributeList Error: %@", err); - { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 42UL)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + NextTest(); + }]; - { - id actualValue = values.daysMask; - VerifyOrReturn(CheckValue("daysMask", actualValue, 1U)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.startHour; - VerifyOrReturn(CheckValue("startHour", actualValue, 0U)); - } + CHIP_ERROR TestThReadsOptionalAttributeEnablePrivacyModeButtonInAttributeList_20() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.startMinute; - VerifyOrReturn(CheckValue("startMinute", actualValue, 0U)); - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(EnablePrivacyModeButton) in AttributeList Error: %@", err); - { - id actualValue = values.endHour; - VerifyOrReturn(CheckValue("endHour", actualValue, 23U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.endMinute; - VerifyOrReturn(CheckValue("endMinute", actualValue, 59U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 43UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingHolidayScheduleDidNotClearYearDaySchedule_119() + CHIP_ERROR TestThReadsOptionalAttributeLocalProgrammingFeaturesInAttributeList_21() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing holiday schedule did not clear year day schedule Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(LocalProgrammingFeatures) in AttributeList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 44UL)); - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + NextTest(); + }]; - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 9000UL)); - } + CHIP_ERROR TestThReadsAcceptedCommandListFromDut_22() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 888888888UL)); - } + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AcceptedCommandList from DUT Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAllRemainingHolidaySchedules_120() + CHIP_ERROR TestThReadsFeatureDependentCommandsDRLKSF04InAcceptedCommandList_23() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:254U]; - [cluster clearHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear all remaining holiday schedules Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent commands(DRLK.S.F04) in AcceptedCommandList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 11UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 12UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 13UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatFirstHolidayIsStillDeleted_121() + CHIP_ERROR TestThReadsFeatureDependentCommandsDRLKSF10InAcceptedCommandList_24() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; - [cluster getHolidayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that first holiday is still deleted Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent commands(DRLK.S.F10) in AcceptedCommandList Error: %@", err); - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 14UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 16UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatSecondHolidayScheduleWasDeleted_122() + CHIP_ERROR TestThReadsFeatureDependentCommandsDRLKSF11InAcceptedCommandList_25() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:2U]; - [cluster getHolidayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that second holiday schedule was deleted Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent commands(DRLK.S.F11) in AcceptedCommandList Error: %@", err); - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, 2U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 18UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 19UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureThatThirdHolidayScheduleWasNotDeleted_123() + CHIP_ERROR TestThReadsFeatureDependentCommandsDRLKSF08InAcceptedCommandList_26() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; - [cluster getHolidayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that third holiday schedule was not deleted Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent commands(DRLK.S.F08) in AcceptedCommandList Error: %@", err); - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("holidayIndex", actualValue, NumberOfHolidaySchedulesSupported)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 26UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 27UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 29UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 34UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 36UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 38UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingHolidayScheduleDidNotClearWeekDaySchedule_124() + CHIP_ERROR TestThReadsOptionalCommandsDRLKSC03RspInAcceptedCommandList_27() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getWeekDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing holiday schedule did not clear week day schedule Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional commands(DRLK.S.C03.Rsp) in AcceptedCommandList Error: %@", err); - { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + NextTest(); + }]; - { - id actualValue = values.daysMask; - VerifyOrReturn(CheckValue("daysMask", actualValue, 1U)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.startHour; - VerifyOrReturn(CheckValue("startHour", actualValue, 0U)); - } + CHIP_ERROR TestThReadsFeatureDependentCommandDRLKSF04InGeneratedCommandList_28() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.startMinute; - VerifyOrReturn(CheckValue("startMinute", actualValue, 0U)); - } + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent command(DRLK.S.F04) in GeneratedCommandList Error: %@", err); - { - id actualValue = values.endHour; - VerifyOrReturn(CheckValue("endHour", actualValue, 23U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.endMinute; - VerifyOrReturn(CheckValue("endMinute", actualValue, 59U)); - } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 12UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingHolidayScheduleDidNotClearYearDaySchedule_125() + CHIP_ERROR TestThReadsFeatureDependentCommandDRLKSF10InGeneratedCommandList_29() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing holiday schedule did not clear year day schedule Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent command(DRLK.S.F10) in GeneratedCommandList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 15UL)); - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + NextTest(); + }]; - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 9000UL)); - } + CHIP_ERROR TestThReadsFeatureDependentCommandDRLKSF11InGeneratedCommandList_30() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 888888888UL)); - } + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent command(DRLK.S.F11) in GeneratedCommandList Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 18UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestFinalCleanup_126() + CHIP_ERROR TestThReadsFeatureDependentCommandDRLKSF08InGeneratedCommandList_31() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; - params.userIndex = [NSNumber numberWithUnsignedShort:65534U]; - [cluster clearUserWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Final Cleanup Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads Feature dependent command(DRLK.S.F08) in GeneratedCommandList Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 28UL)); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 35UL)); + + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -121195,9 +122208,13 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -121210,14 +122227,12 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), - make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -121302,6 +122317,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -121361,6 +122377,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -121368,6 +122385,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),