diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index 50f8ce2e3add50..fa2baf9081e469 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -6,6 +6,7 @@ "TestEvents", "TestDiscovery", "TestGroupMessaging", + "Test_TC_BRBINFO_2_1", "Test_TC_DGTHREAD_2_1", "Test_TC_DGTHREAD_2_2", "Test_TC_DGTHREAD_2_3", diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index ddcda6eb8271ed..cffcba6784369e 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -3714,10 +3714,10 @@ PICS: id: DGTHREAD.S.A0039 - label: "Does the DUT-server support the Delay attribute?" - id: DGTHREAD.S.A003A + id: DGTHREAD.S.A003a - label: "Does the DUT-server support the SecurityPolicy attribute?" - id: DGTHREAD.S.A003B + id: DGTHREAD.S.A003b - label: "Does the DUT-server support the ChannelPage0Mask attribute?" id: DGTHREAD.S.A003c @@ -4589,6 +4589,16 @@ PICS: - label: "Does the DUT(server) support the ReachableChanged event?" id: BINFO.S.E03 + #Features + - label: "Does the device implement the Wi-Fi related features ?" + id: CNET.S.F00 + + - label: "Does the device implement the Thread related features" + id: CNET.S.F01 + + - label: "Does the device implement the Ethernet related features ?" + id: CNET.S.F02 + #Client Attributes - label: "Does the DUT(Client) support the DataModelRevision attribute?" id: BINFO.C.A0000 diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml index ee68e0c2b5de21..7ef1ba418e17c4 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml @@ -20,158 +20,82 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Access Control" endpoint: 0 + D_OK_EMPTY: + type: octet_string + defaultValue: "hex:1718" + D_OK_SINGLE: + type: octet_string + defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" + D_OK_FULL: + type: octet_string + defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018" + D_BAD_LENGTH: + type: octet_string + defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018" + D_BAD_STRUCT: + type: octet_string + defaultValue: "hex:1518" + D_BAD_LIST: + type: octet_string + defaultValue: "hex:3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" + D_BAD_ELEM: + type: octet_string + defaultValue: "hex:17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" + D_BAD_OVERFLOW: + type: octet_string + defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018FF" + D_BAD_UNDERFLOW: + type: octet_string + defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700" + D_BAD_NONE: + type: octet_string + defaultValue: "" tests: - - label: "Pre-Conditions" - verification: | - Notes - - 1.N1 is the node ID of TH1 - - 2.D_OK_EMPTY:"1718" which is an octstr of length 2 containing valid TLV: - - - top-level anonymous list (empty) - - 3.D_OK_SINGLE:"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" which is an octstr of length 50-100 containing valid TLV: - - - top-level anonymous list, containing - one element with profile-specific tag in fully-qualified form - - 4.D_OK_FULL:"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018" which is an octstr of length 128 containing valid TLV: - - - top-level anonymous list, containing - two elements with profile-specific tag in fully-qualified form - - 5.D_BAD_LENGTH:"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018" which is an octstr of length 129 containing valid TLV: - - - top-level anonymous list, containing - one element with profile-specific tag in fully-qualified form - - 6 .D_BAD_STRUCT: "1518" which is an octstr of length 2 containing valid TLV: - - - top-level anonymous struct, empty - - 7.D_BAD_LIST:"3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" which is an octstr of length 50-100 containing valid TLV: - - - top-level list with context-specific tag, containing - one element with profile-specific tag in fully-qualified form - - 8.D_BAD_ELEM:"17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" which is an octstr of length 50-100 containing valid TLV: - - - top-level anonymous list, containing - one element with anonymous tag - - 9 .D_BAD_OVERFLOW: "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018FF" which is an octstr of length 50-100 containing valid TLV: - - - top-level anonymous list, containing - one element with profile-specific tag in fully-qualified form - but having extra bytes after the top level list end-of-container - - 10.D_BAD_UNDERFLOW:"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700" which is an octstr of length 50-100 containing invalid TLV: - - - top-level anonymous list, containing - one element with profile-specific tag in fully-qualified form - but lacking the top-level list end-of-container - - 11.D_BAD_NONE: "" which is an octstr of length 0 - disabled: true - - - label: "TH1 commissions DUT using admin node ID N1" - verification: | - DUT - sudo ./chip-all-clusters-app --wifi - - TH1 - ./chip-tool pairing ble-wifi 1 zigbee-thread matter123 20202021 3841 - 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 Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute" - verification: | - ./chip-tool operationalcredentials read current-fabric-index 1 0 - - On TH1(Chiptool), verify the CurrentFabricIndex attribute of operationalCredential cluster as 1 - - [1658323393.451141][2316:2321] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0005 DataVersion: 3882577299 - [1658323393.465921][2316:2321] CHIP:TOO: CurrentFabricIndex: 1 - disabled: true + cluster: "Operational Credentials" + command: "readAttribute" + attribute: "CurrentFabricIndex" + response: + saveAs: CurrentFabricIndex - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - - On TH1(Chiptool) , Verify the extension attribute contains an empty list - - [1657116435.352869][2667:2672] CHIP:DMG: SuppressResponse = true, - [1657116435.352904][2667:2672] CHIP:DMG: InteractionModelRevision = 1 - [1657116435.352935][2667:2672] CHIP:DMG: } - [1657116435.353245][2667:2672] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 368386360 - [1657116435.353328][2667:2672] CHIP:TOO: Extension: 0 entries - [1657116435.353439][2667:2672] CHIP:EM: Sending Standalone Ack for MessageCounter:265691167 on exchange 19854i - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [] - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element 1. struct: Data field: D_OK_EMPTY : 1718" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"1718"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is Success when writing the AccessControl cluster Extension attribute - - [1656416335.284463][3747:3752] CHIP:DMG: WriteResponseMessage = - [1656416335.284498][3747:3752] CHIP:DMG: { - [1656416335.284539][3747:3752] CHIP:DMG: AttributeStatusIBs = - [1656416335.284581][3747:3752] CHIP:DMG: [ - [1656416335.284626][3747:3752] CHIP:DMG: AttributeStatusIB = - [1656416335.284663][3747:3752] CHIP:DMG: { - [1656416335.284709][3747:3752] CHIP:DMG: AttributePathIB = - [1656416335.284763][3747:3752] CHIP:DMG: { - [1656416335.284807][3747:3752] CHIP:DMG: Endpoint = 0x0, - [1656416335.284861][3747:3752] CHIP:DMG: Cluster = 0x1f, - [1656416335.284907][3747:3752] CHIP:DMG: Attribute = 0x0000_0001, - [1656416335.284961][3747:3752] CHIP:DMG: } - [1656416335.285018][3747:3752] CHIP:DMG: - [1656416335.285058][3747:3752] CHIP:DMG: StatusIB = - [1656416335.285109][3747:3752] CHIP:DMG: { - [1656416335.285150][3747:3752] CHIP:DMG: status = 0x00 (SUCCESS), - [1656416335.285203][3747:3752] CHIP:DMG: }, - [1656416335.285255][3747:3752] CHIP:DMG: - [1656416335.285290][3747:3752] CHIP:DMG: }, - [1656416335.285349][3747:3752] CHIP:DMG: - [1656416335.285382][3747:3752] CHIP:DMG: AttributeStatusIB = - [1656416335.285432][3747:3752] CHIP:DMG: { - [1656416335.285466][3747:3752] CHIP:DMG: AttributePathIB = - [1656416335.285516][3747:3752] CHIP:DMG: { - [1656416335.285557][3747:3752] CHIP:DMG: Endpoint = 0x0, - [1656416335.285617][3747:3752] CHIP:DMG: Cluster = 0x1f, - [1656416335.285662][3747:3752] CHIP:DMG: Attribute = 0x0000_0001, - [1656416335.285705][3747:3752] CHIP:DMG: ListIndex = Null, - [1656416335.285746][3747:3752] CHIP:DMG: } - [1656416335.285790][3747:3752] CHIP:DMG: - [1656416335.285829][3747:3752] CHIP:DMG: StatusIB = - [1656416335.285867][3747:3752] CHIP:DMG: { - [1656416335.285907][3747:3752] CHIP:DMG: status = 0x00 (SUCCESS), - [1656416335.285948][3747:3752] CHIP:DMG: }, - [1656416335.285988][3747:3752] CHIP:DMG: - [1656416335.286021][3747:3752] CHIP:DMG: }, - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - - On TH1(Chiptool) , Verify value is list of AccessControlExtensionStruct containing 1 element . Data field: D_OK_EMPTY : "1718" and - FabricIndex field: F1 - - - [1657278638.723927][9030:9035] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 525362695 - [1657278638.724004][9030:9035] CHIP:TOO: Extension: 1 entries - [1657278638.724072][9030:9035] CHIP:TOO: [1]: { - [1657278638.724106][9030:9035] CHIP:TOO: Data: 1718 - [1657278638.724151][9030:9035] CHIP:TOO: FabricIndex: 1 - [1657278638.724180][9030:9035] CHIP:TOO: } - [1657278638.724307][9030:9035] CHIP:EM: Sending Standalone Ack for MessageCounter:131793781 on exchange 9203i - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -179,246 +103,37 @@ tests: 1.struct Data field: D_OK_SINGLE :17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is success when writing the AccessControl cluster Extension attribute. - - - [1656416899.781899][3814:3819] CHIP:DMG: WriteResponseMessage = - - [1656416899.781952][3814:3819] CHIP:DMG: { - [1656416899.781998][3814:3819] CHIP:DMG: AttributeStatusIBs = - [1656416899.782062][3814:3819] CHIP:DMG: [ - [1656416899.782114][3814:3819] CHIP:DMG: AttributeStatusIB = - [1656416899.782181][3814:3819] CHIP:DMG: { - [1656416899.782236][3814:3819] CHIP:DMG: AttributePathIB = - [1656416899.782301][3814:3819] CHIP:DMG: { - [1656416899.782369][3814:3819] CHIP:DMG: Endpoint = 0x0, - [1656416899.782442][3814:3819] CHIP:DMG: Cluster = 0x1f, - [1656416899.782512][3814:3819] CHIP:DMG: Attribute = 0x0000_0001, - [1656416899.782583][3814:3819] CHIP:DMG: } - [1656416899.782656][3814:3819] CHIP:DMG: - [1656416899.782718][3814:3819] CHIP:DMG: StatusIB = - [1656416899.782782][3814:3819] CHIP:DMG: { - [1656416899.782850][3814:3819] CHIP:DMG: status = 0x00 (SUCCESS), - [1656416899.782916][3814:3819] CHIP:DMG: }, - [1656416899.782981][3814:3819] CHIP:DMG: - [1656416899.783035][3814:3819] CHIP:DMG: }, - [1656416899.783107][3814:3819] CHIP:DMG: - [1656416899.783159][3814:3819] CHIP:DMG: AttributeStatusIB = - [1656416899.783215][3814:3819] CHIP:DMG: { - [1656416899.783269][3814:3819] CHIP:DMG: AttributePathIB = - [1656416899.783331][3814:3819] CHIP:DMG: { - [1656416899.783396][3814:3819] CHIP:DMG: Endpoint = 0x0, - [1656416899.783466][3814:3819] CHIP:DMG: Cluster = 0x1f, - [1656416899.783536][3814:3819] CHIP:DMG: Attribute = 0x0000_0001, - [1656416899.783603][3814:3819] CHIP:DMG: ListIndex = Null, - [1656416899.783669][3814:3819] CHIP:DMG: } - [1656416899.783740][3814:3819] CHIP:DMG: - [1656416899.783802][3814:3819] CHIP:DMG: StatusIB = - [1656416899.783864][3814:3819] CHIP:DMG: { - [1656416899.783928][3814:3819] CHIP:DMG: status = 0x00 (SUCCESS), - [1656416899.784031][3814:3819] CHIP:DMG: }, - [1656416899.784099][3814:3819] CHIP:DMG: - [1656416899.784152][3814:3819] CHIP:DMG: }, - [1656416899.784215][3814:3819] CHIP:DMG: - [1656416899.784265][3814:3819] CHIP:DMG: ], - [1656416899.784333][3814:3819] CHIP:DMG: - [1656416899.784384][3814:3819] CHIP:DMG: InteractionModelRevision = 1 - [1656416899.784434][3814:3819] CHIP:DMG: } - [1656416899.784620][3814:3819] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1656416899.784719][3814:3819] CHIP:EM: Sending Standalone Ack for MessageCounter:116771897 on exchange 19604i - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }] - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - - On TH1(Chiptool) , Verify the AccessControlExtensionStruct containing 1 element - Data field: D_OK_SINGLE :"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" and FabricIndex field : F1 - - [1657278788.400832][9048:9053] CHIP:DMG: ReportDataMessage = - [1657278788.400863][9048:9053] CHIP:DMG: { - [1657278788.400887][9048:9053] CHIP:DMG: AttributeReportIBs = - [1657278788.400920][9048:9053] CHIP:DMG: [ - [1657278788.400947][9048:9053] CHIP:DMG: AttributeReportIB = - [1657278788.400985][9048:9053] CHIP:DMG: { - [1657278788.401039][9048:9053] CHIP:DMG: AttributeDataIB = - [1657278788.401090][9048:9053] CHIP:DMG: { - [1657278788.401136][9048:9053] CHIP:DMG: DataVersion = 0x1f506609, - [1657278788.401181][9048:9053] CHIP:DMG: AttributePathIB = - [1657278788.401242][9048:9053] CHIP:DMG: { - [1657278788.401299][9048:9053] CHIP:DMG: Endpoint = 0x0, - [1657278788.401348][9048:9053] CHIP:DMG: Cluster = 0x1f, - [1657278788.401406][9048:9053] CHIP:DMG: Attribute = 0x0000_0001, - [1657278788.401462][9048:9053] CHIP:DMG: } - [1657278788.401527][9048:9053] CHIP:DMG: - [1657278788.401587][9048:9053] CHIP:DMG: Data = [ - [1657278788.401646][9048:9053] CHIP:DMG: - [1657278788.401707][9048:9053] CHIP:DMG: ], - [1657278788.401765][9048:9053] CHIP:DMG: }, - [1657278788.401821][9048:9053] CHIP:DMG: - [1657278788.401867][9048:9053] CHIP:DMG: }, - [1657278788.401911][9048:9053] CHIP:DMG: - [1657278788.401945][9048:9053] CHIP:DMG: AttributeReportIB = - [1657278788.402001][9048:9053] CHIP:DMG: { - [1657278788.402031][9048:9053] CHIP:DMG: AttributeDataIB = - [1657278788.402082][9048:9053] CHIP:DMG: { - [1657278788.402119][9048:9053] CHIP:DMG: DataVersion = 0x1f506609, - [1657278788.402163][9048:9053] CHIP:DMG: AttributePathIB = - [1657278788.402200][9048:9053] CHIP:DMG: { - [1657278788.402247][9048:9053] CHIP:DMG: Endpoint = 0x0, - [1657278788.402295][9048:9053] CHIP:DMG: Cluster = 0x1f, - [1657278788.402334][9048:9053] CHIP:DMG: Attribute = 0x0000_0001, - [1657278788.402371][9048:9053] CHIP:DMG: ListIndex = Null, - [1657278788.402407][9048:9053] CHIP:DMG: } - [1657278788.402446][9048:9053] CHIP:DMG: - [1657278788.402481][9048:9053] CHIP:DMG: Data = - [1657278788.402514][9048:9053] CHIP:DMG: { - [1657278788.402574][9048:9053] CHIP:DMG: 0x1 = [ - [1657278788.402634][9048:9053] CHIP:DMG: 0x17, 0xd0, 0x0, 0x0, 0xf1, 0xff, 0x1, 0x0, 0x3d, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x69, 0x76, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x63, 0x68, 0x61, 0x72, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x0, 0x18, - [1657278788.402678][9048:9053] CHIP:DMG: ] - [1657278788.402716][9048:9053] CHIP:DMG: 0xfe = 1, - [1657278788.402755][9048:9053] CHIP:DMG: }, - [1657278788.402785][9048:9053] CHIP:DMG: }, - [1657278788.402824][9048:9053] CHIP:DMG: - [1657278788.402851][9048:9053] CHIP:DMG: }, - [1657278788.402886][9048:9053] CHIP:DMG: - [1657278788.402910][9048:9053] CHIP:DMG: ], - [1657278788.402946][9048:9053] CHIP:DMG: - [1657278788.402972][9048:9053] CHIP:DMG: SuppressResponse = true, - [1657278788.402996][9048:9053] CHIP:DMG: InteractionModelRevision = 1 - [1657278788.403019][9048:9053] CHIP:DMG: } - [1657278788.403304][9048:9053] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 525362697 - [1657278788.403374][9048:9053] CHIP:TOO: Extension: 1 entries - [1657278788.403426][9048:9053] CHIP:TOO: [1]: { - [1657278788.403457][9048:9053] CHIP:TOO: Data: 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018 - [1657278788.403509][9048:9053] CHIP:TOO: FabricIndex: 1 - [1657278788.403543][9048:9053] CHIP:TOO: } - [1657278788.403642][9048:9053] CHIP:EM: Sending Standalone Ack for MessageCounter:90870339 on exchange 24533i - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }] - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_FULL - :17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018 - which is an octstr of length 128 containing valid TLV:" + :17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is success when writing the AccessControl cluster Extension attribute - [1656417544.279572][3888:3893] CHIP:DMG: WriteResponseMessage = - [1656417544.279598][3888:3893] CHIP:DMG: { - [1656417544.279620][3888:3893] CHIP:DMG: AttributeStatusIBs = - [1656417544.279651][3888:3893] CHIP:DMG: [ - [1656417544.279676][3888:3893] CHIP:DMG: AttributeStatusIB = - [1656417544.279710][3888:3893] CHIP:DMG: { - [1656417544.279739][3888:3893] CHIP:DMG: AttributePathIB = - [1656417544.279773][3888:3893] CHIP:DMG: { - [1656417544.279808][3888:3893] CHIP:DMG: Endpoint = 0x0, - [1656417544.279842][3888:3893] CHIP:DMG: Cluster = 0x1f, - [1656417544.279877][3888:3893] CHIP:DMG: Attribute = 0x0000_0001, - [1656417544.279908][3888:3893] CHIP:DMG: } - [1656417544.279944][3888:3893] CHIP:DMG: - [1656417544.279985][3888:3893] CHIP:DMG: StatusIB = - [1656417544.280012][3888:3893] CHIP:DMG: { - [1656417544.280041][3888:3893] CHIP:DMG: status = 0x00 (SUCCESS), - [1656417544.280072][3888:3893] CHIP:DMG: }, - [1656417544.280104][3888:3893] CHIP:DMG: - [1656417544.280130][3888:3893] CHIP:DMG: }, - [1656417544.280165][3888:3893] CHIP:DMG: - [1656417544.280189][3888:3893] CHIP:DMG: AttributeStatusIB = - [1656417544.280216][3888:3893] CHIP:DMG: { - [1656417544.280242][3888:3893] CHIP:DMG: AttributePathIB = - [1656417544.280272][3888:3893] CHIP:DMG: { - [1656417544.280304][3888:3893] CHIP:DMG: Endpoint = 0x0, - [1656417544.280337][3888:3893] CHIP:DMG: Cluster = 0x1f, - [1656417544.280371][3888:3893] CHIP:DMG: Attribute = 0x0000_0001, - [1656417544.280404][3888:3893] CHIP:DMG: ListIndex = Null, - [1656417544.280435][3888:3893] CHIP:DMG: } - [1656417544.280470][3888:3893] CHIP:DMG: - [1656417544.280500][3888:3893] CHIP:DMG: StatusIB = - [1656417544.280530][3888:3893] CHIP:DMG: { - [1656417544.280562][3888:3893] CHIP:DMG: status = 0x00 (SUCCESS), - [1656417544.280593][3888:3893] CHIP:DMG: }, - [1656417544.280624][3888:3893] CHIP:DMG: - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_OK_FULL, FabricIndex: CurrentFabricIndex }] - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - On TH1(Chiptool) , Verify AccessControlExtensionStructcontaining 1 element - Data field: - D_OK_FULL :"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018" and FabricIndex field : F1 - - - 1657278905.391846][9065:9070] CHIP:DMG: ReportDataMessage = - [1657278905.391878][9065:9070] CHIP:DMG: { - [1657278905.391906][9065:9070] CHIP:DMG: AttributeReportIBs = - [1657278905.391951][9065:9070] CHIP:DMG: [ - [1657278905.391986][9065:9070] CHIP:DMG: AttributeReportIB = - [1657278905.392036][9065:9070] CHIP:DMG: { - [1657278905.392068][9065:9070] CHIP:DMG: AttributeDataIB = - [1657278905.392108][9065:9070] CHIP:DMG: { - [1657278905.392153][9065:9070] CHIP:DMG: DataVersion = 0x1f50660b, - [1657278905.392198][9065:9070] CHIP:DMG: AttributePathIB = - [1657278905.392279][9065:9070] CHIP:DMG: { - [1657278905.392328][9065:9070] CHIP:DMG: Endpoint = 0x0, - [1657278905.392381][9065:9070] CHIP:DMG: Cluster = 0x1f, - [1657278905.392430][9065:9070] CHIP:DMG: Attribute = 0x0000_0001, - [1657278905.392470][9065:9070] CHIP:DMG: } - [1657278905.392517][9065:9070] CHIP:DMG: - [1657278905.392561][9065:9070] CHIP:DMG: Data = [ - [1657278905.392604][9065:9070] CHIP:DMG: - [1657278905.392650][9065:9070] CHIP:DMG: ], - [1657278905.392693][9065:9070] CHIP:DMG: }, - [1657278905.392739][9065:9070] CHIP:DMG: - [1657278905.392773][9065:9070] CHIP:DMG: }, - [1657278905.392823][9065:9070] CHIP:DMG: - [1657278905.392857][9065:9070] CHIP:DMG: AttributeReportIB = - [1657278905.392901][9065:9070] CHIP:DMG: { - [1657278905.392936][9065:9070] CHIP:DMG: AttributeDataIB = - [1657278905.392976][9065:9070] CHIP:DMG: { - [1657278905.393016][9065:9070] CHIP:DMG: DataVersion = 0x1f50660b, - [1657278905.393060][9065:9070] CHIP:DMG: AttributePathIB = - [1657278905.393100][9065:9070] CHIP:DMG: { - [1657278905.393135][9065:9070] CHIP:DMG: Endpoint = 0x0, - [1657278905.393170][9065:9070] CHIP:DMG: Cluster = 0x1f, - [1657278905.393207][9065:9070] CHIP:DMG: Attribute = 0x0000_0001, - [1657278905.393252][9065:9070] CHIP:DMG: ListIndex = Null, - [1657278905.393296][9065:9070] CHIP:DMG: } - [1657278905.393343][9065:9070] CHIP:DMG: - [1657278905.393385][9065:9070] CHIP:DMG: Data = - [1657278905.393429][9065:9070] CHIP:DMG: { - [1657278905.393505][9065:9070] CHIP:DMG: 0x1 = [ - [1657278905.393605][9065:9070] CHIP:DMG: 0x17, 0xd0, 0x0, 0x0, 0xf1, 0xff, 0x1, 0x0, 0x3d, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x69, 0x76, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x63, 0x68, 0x61, 0x72, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x0, 0xd0, 0x0, 0x0, 0xf1, 0xff, 0x2, 0x0, 0x31, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x0, 0x18, - [1657278905.393670][9065:9070] CHIP:DMG: ] - [1657278905.393718][9065:9070] CHIP:DMG: 0xfe = 1, - [1657278905.393765][9065:9070] CHIP:DMG: }, - [1657278905.393810][9065:9070] CHIP:DMG: }, - [1657278905.393862][9065:9070] CHIP:DMG: - [1657278905.393899][9065:9070] CHIP:DMG: }, - [1657278905.393942][9065:9070] CHIP:DMG: - [1657278905.393974][9065:9070] CHIP:DMG: ], - [1657278905.394023][9065:9070] CHIP:DMG: - [1657278905.394058][9065:9070] CHIP:DMG: SuppressResponse = true, - [1657278905.394091][9065:9070] CHIP:DMG: InteractionModelRevision = 1 - [1657278905.394122][9065:9070] CHIP:DMG: } - [1657278905.394435][9065:9070] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 525362699 - [1657278905.394508][9065:9070] CHIP:TOO: Extension: 1 entries - [1657278905.394573][9065:9070] CHIP:TOO: [1]: { - [1657278905.394618][9065:9070] CHIP:TOO: Data: 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018 - [1657278905.394671][9065:9070] CHIP:TOO: FabricIndex: 1 - [1657278905.394703][9065:9070] CHIP:TOO: } - [1657278905.394800][9065:9070] CHIP:EM: Sending Standalone Ack for MessageCounter:35167907 on exchange 47841i - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [{ Data: D_OK_FULL, FabricIndex: CurrentFabricIndex }] - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -426,53 +141,24 @@ tests: .struct Data field: D_BAD_LENGTH :17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018"}]' 1 0 - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - [1657279033.591694][9081:9086] CHIP:DMG: StatusIB = - [1657279033.591739][9081:9086] CHIP:DMG: { - [1657279033.591784][9081:9086] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657279033.591830][9081:9086] CHIP:DMG: }, - [1657279033.591876][9081:9086] CHIP:DMG: - [1657279033.591915][9081:9086] CHIP:DMG: }, - [1657279033.591961][9081:9086] CHIP:DMG: - [1657279033.591998][9081:9086] CHIP:DMG: ], - [1657279033.592046][9081:9086] CHIP:DMG: - [1657279033.592081][9081:9086] CHIP:DMG: InteractionModelRevision = 1 - [1657279033.592115][9081:9086] CHIP:DMG: } - [1657279033.592290][9081:9086] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657279033.592341][9081:9086] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1657279033.592418][9081:9086] CHIP:EM: Sending Standalone Ack for MessageCounter:30643689 on exchange 27853i - [1657279033.592517][9081:9086] CHIP:IN: Prepared secure message 0xffff8efdd9d8 to 0x0000000000000001 (1) of type 0x10 and protocolId (0, 0) on exchange 27853i with MessageCounter:149398748. - [1657279033.592572][9081:9086] CHIP:IN: Sending encrypted msg 0xffff8efdd9d8 with MessageCounter:149398748 to 0x0000000000000001 (1) at monotonic time: 000000000083ABDC msec - [1657279033.592744][9081:9086] CHIP:EM: Flushed pending ack for MessageCounter:30643689 on exchange 27853i - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_LENGTH, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_STRUCT : 1518" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"1518"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - [1657609094.515713][8195:8200] CHIP:DMG: StatusIB = - [1657609094.515754][8195:8200] CHIP:DMG: { - [1657609094.515797][8195:8200] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609094.515840][8195:8200] CHIP:DMG: }, - [1657609094.515882][8195:8200] CHIP:DMG: - [1657609094.515919][8195:8200] CHIP:DMG: }, - [1657609094.515970][8195:8200] CHIP:DMG: - [1657609094.516004][8195:8200] CHIP:DMG: ], - [1657609094.516051][8195:8200] CHIP:DMG: - [1657609094.516086][8195:8200] CHIP:DMG: InteractionModelRevision = 1 - [1657609094.516121][8195:8200] CHIP:DMG: } - [1657609094.516266][8195:8200] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609094.516312][8195:8200] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_STRUCT, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -480,25 +166,12 @@ tests: struct Data field: D_BAD_LIST :3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - [1657609434.915033][8206:8211] CHIP:DMG: StatusIB = - [1657609434.915073][8206:8211] CHIP:DMG: { - [1657609434.915115][8206:8211] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609434.915152][8206:8211] CHIP:DMG: }, - [1657609434.915193][8206:8211] CHIP:DMG: - [1657609434.915226][8206:8211] CHIP:DMG: }, - [1657609434.915264][8206:8211] CHIP:DMG: - [1657609434.915293][8206:8211] CHIP:DMG: ], - [1657609434.915333][8206:8211] CHIP:DMG: - [1657609434.915362][8206:8211] CHIP:DMG: InteractionModelRevision = 1 - [1657609434.915391][8206:8211] CHIP:DMG: } - [1657609434.915511][8206:8211] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609434.915549][8206:8211] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_LIST, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -506,27 +179,12 @@ tests: struct Data field: D_BAD_ELEM :17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - - [1657609579.494576][8215:8220] CHIP:DMG: - [1657609579.494615][8215:8220] CHIP:DMG: StatusIB = - [1657609579.494656][8215:8220] CHIP:DMG: { - [1657609579.494697][8215:8220] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609579.494735][8215:8220] CHIP:DMG: }, - [1657609579.494772][8215:8220] CHIP:DMG: - [1657609579.494803][8215:8220] CHIP:DMG: }, - [1657609579.494838][8215:8220] CHIP:DMG: - [1657609579.494867][8215:8220] CHIP:DMG: ], - [1657609579.494906][8215:8220] CHIP:DMG: - [1657609579.494935][8215:8220] CHIP:DMG: InteractionModelRevision = 1 - [1657609579.494963][8215:8220] CHIP:DMG: } - [1657609579.495080][8215:8220] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609579.495119][8215:8220] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_ELEM, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -534,26 +192,12 @@ tests: .struct Data field: D_BAD_OVERFLOW : 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018FF" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018FF"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - [1657609625.259137][8223:8228] CHIP:DMG: - [1657609625.259168][8223:8228] CHIP:DMG: StatusIB = - [1657609625.259200][8223:8228] CHIP:DMG: { - [1657609625.259233][8223:8228] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609625.259268][8223:8228] CHIP:DMG: }, - [1657609625.259301][8223:8228] CHIP:DMG: - [1657609625.259329][8223:8228] CHIP:DMG: }, - [1657609625.259361][8223:8228] CHIP:DMG: - [1657609625.259386][8223:8228] CHIP:DMG: ], - [1657609625.259420][8223:8228] CHIP:DMG: - [1657609625.259445][8223:8228] CHIP:DMG: InteractionModelRevision = 1 - [1657609625.259471][8223:8228] CHIP:DMG: } - [1657609625.259571][8223:8228] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609625.259605][8223:8228] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_OVERFLOW, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -561,52 +205,24 @@ tests: struct Data field: D_BAD_UNDERFLOW :17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - [1657609654.299668][8229:8234] CHIP:DMG: StatusIB = - [1657609654.299712][8229:8234] CHIP:DMG: { - [1657609654.299758][8229:8234] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609654.299808][8229:8234] CHIP:DMG: }, - [1657609654.299852][8229:8234] CHIP:DMG: - [1657609654.299892][8229:8234] CHIP:DMG: }, - [1657609654.299935][8229:8234] CHIP:DMG: - [1657609654.299969][8229:8234] CHIP:DMG: ], - [1657609654.300017][8229:8234] CHIP:DMG: - [1657609654.300053][8229:8234] CHIP:DMG: InteractionModelRevision = 1 - [1657609654.300088][8229:8234] CHIP:DMG: } - [1657609654.300230][8229:8234] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609654.300275][8229:8234] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_UNDERFLOW, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element 1.struct Data field: D_BAD_NONE" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":""}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - - [1657609694.046042][8236:8241] CHIP:DMG: - [1657609694.046078][8236:8241] CHIP:DMG: StatusIB = - [1657609694.046115][8236:8241] CHIP:DMG: { - [1657609694.046154][8236:8241] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609694.046192][8236:8241] CHIP:DMG: }, - [1657609694.046229][8236:8241] CHIP:DMG: - [1657609694.046260][8236:8241] CHIP:DMG: }, - [1657609694.046296][8236:8241] CHIP:DMG: - [1657609694.046325][8236:8241] CHIP:DMG: ], - [1657609694.046390][8236:8241] CHIP:DMG: - [1657609694.046423][8236:8241] CHIP:DMG: InteractionModelRevision = 1 - [1657609694.046452][8236:8241] CHIP:DMG: } - [1657609694.046574][8236:8241] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609694.046614][8236:8241] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_NONE, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -616,123 +232,38 @@ tests: contains Data field: D_OK_SINGLE 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"1718"},{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is success for first element and CONSTRAINT_ERROR (0x87) for second element when writing the AccessControl cluster Extension attribute - - [1657609694.044950][8236:8241] CHIP:DMG: WriteResponseMessage = - [1657609694.044980][8236:8241] CHIP:DMG: { - [1657609694.045008][8236:8241] CHIP:DMG: AttributeStatusIBs = - [1657609694.045049][8236:8241] CHIP:DMG: [ - [1657609694.045080][8236:8241] CHIP:DMG: AttributeStatusIB = - [1657609694.045117][8236:8241] CHIP:DMG: { - [1657609694.045149][8236:8241] CHIP:DMG: AttributePathIB = - [1657609694.045187][8236:8241] CHIP:DMG: { - [1657609694.045232][8236:8241] CHIP:DMG: Endpoint = 0x0, - [1657609694.045277][8236:8241] CHIP:DMG: Cluster = 0x1f, - [1657609694.045318][8236:8241] CHIP:DMG: Attribute = 0x0000_0001, - [1657609694.045355][8236:8241] CHIP:DMG: } - [1657609694.045397][8236:8241] CHIP:DMG: - [1657609694.045434][8236:8241] CHIP:DMG: StatusIB = - [1657609694.045472][8236:8241] CHIP:DMG: { - [1657609694.045513][8236:8241] CHIP:DMG: status = 0x00 (SUCCESS), - [1657609694.045552][8236:8241] CHIP:DMG: }, - [1657609694.045594][8236:8241] CHIP:DMG: - [1657609694.045627][8236:8241] CHIP:DMG: }, - [1657609694.045670][8236:8241] CHIP:DMG: - [1657609694.045701][8236:8241] CHIP:DMG: AttributeStatusIB = - [1657609694.045733][8236:8241] CHIP:DMG: { - [1657609694.045765][8236:8241] CHIP:DMG: AttributePathIB = - [1657609694.045801][8236:8241] CHIP:DMG: { - [1657609694.045840][8236:8241] CHIP:DMG: Endpoint = 0x0, - [1657609694.045880][8236:8241] CHIP:DMG: Cluster = 0x1f, - [1657609694.045922][8236:8241] CHIP:DMG: Attribute = 0x0000_0001, - [1657609694.045962][8236:8241] CHIP:DMG: ListIndex = Null, - [1657609694.046000][8236:8241] CHIP:DMG: } - [1657279798.809590][9208:9213] CHIP:DMG: - [1657279798.809629][9208:9213] CHIP:DMG: StatusIB = - [1657279798.809666][9208:9213] CHIP:DMG: { - [1657279798.809702][9208:9213] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657279798.809740][9208:9213] CHIP:DMG: }, - [1657279798.809778][9208:9213] CHIP:DMG: - [1657279798.809808][9208:9213] CHIP:DMG: }, - [1657279798.809843][9208:9213] CHIP:DMG: - [1657279798.809873][9208:9213] CHIP:DMG: ], - [1657279798.809917][9208:9213] CHIP:DMG: - [1657279798.809946][9208:9213] CHIP:DMG: InteractionModelRevision = 1 - [1657279798.809974][9208:9213] CHIP:DMG: } - [1657279798.810132][9208:9213] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657279798.810171][9208:9213] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1657279798.810454][9208:9213] CHIP:EM: Sending Standalone Ack for MessageCounter:192339176 on exchange 15705i - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: + [ + { Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }, + { Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }, + ] + response: + error: CONSTRAINT_ERROR - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - - On TH1(Chiptool) , Verify Successfully the list of AccessControlExtensionStruct containing Data field: D_OK_EMPTY :"1718" and - FabricIndex field: F1. - - - [1657279968.698117][9221:9226] CHIP:DMG: - [1657279968.698149][9221:9226] CHIP:DMG: SuppressResponse = true, - [1657279968.698193][9221:9226] CHIP:DMG: InteractionModelRevision = 1 - [1657279968.698224][9221:9226] CHIP:DMG: } - [1657279968.698540][9221:9226] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 525362718 - [1657279968.698608][9221:9226] CHIP:TOO: Extension: 1 entries - [1657279968.698668][9221:9226] CHIP:TOO: [1]: { - [1657279968.698715][9221:9226] CHIP:TOO: Data: 1718 - [1657279968.698761][9221:9226] CHIP:TOO: FabricIndex: 1 - [1657279968.698804][9221:9226] CHIP:TOO: } - [1657279968.698905][9221:9226] CHIP:EM: Sending Standalone Ack for MessageCounter:261322624 on exchange 15524i - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is an empty list" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[]' 1 0 - - On TH1(Chiptool) , Verify that the status is success when writing the AccessControl cluster Extension attribute - - 7625][1521:1526] CHIP:DMG: AttributeStatusIB = - [1657692723.227673][1521:1526] CHIP:DMG: { - [1657692723.227725][1521:1526] CHIP:DMG: AttributePathIB = - [1657692723.227780][1521:1526] CHIP:DMG: { - [1657692723.227834][1521:1526] CHIP:DMG: Endpoint = 0x0, - [1657692723.227897][1521:1526] CHIP:DMG: Cluster = 0x1f, - [1657692723.227956][1521:1526] CHIP:DMG: Attribute = 0x0000_0001, - [1657692723.228012][1521:1526] CHIP:DMG: } - [1657692723.228073][1521:1526] CHIP:DMG: - [1657692723.228125][1521:1526] CHIP:DMG: StatusIB = - [1657692723.228182][1521:1526] CHIP:DMG: { - [1657692723.228238][1521:1526] CHIP:DMG: status = 0x00 (SUCCESS), - [1657692723.228294][1521:1526] CHIP:DMG: }, - [1657692723.228349][1521:1526] CHIP:DMG: - [1657692723.228397][1521:1526] CHIP:DMG: }, - [1657692723.228449][1521:1526] CHIP:DMG: - [1657692723.228492][1521:1526] CHIP:DMG: ], - [1657692723.228551][1521:1526] CHIP:DMG: - [1657692723.228582][1521:1526] CHIP:DMG: InteractionModelRevision = 1 - [1657692723.228608][1521:1526] CHIP:DMG: } - [1657692723.228738][1521:1526] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657692723.228802][1521:1526] CHIP:EM: Sending Standalone Ack for MessageCounter:57305662 on exchange 27543i - [1657692723.228869][1521:1526] CHIP:IN: Prepared secure message 0xffff9fffd9d8 to 0x0000000000000001 (1) of type 0x10 and protocolId (0, 0) on exchange 27543i with MessageCounter:9219504. - [1657692723.228909][1521:1526] - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [] - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - - On TH1(Chiptool) , Verify AccessControl cluster Extension attribute, value is an empty list - - [1660223145.427219][80697:80702] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 2385810240 - [1660223145.427227][80697:80702] CHIP:TOO: Extension: 0 entries - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [] diff --git a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml index a00d3e2b34d7d6..a480adf18fcb4e 100644 --- a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml @@ -20,74 +20,77 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Account Login" + endpoint: 3 + TempAccountIdentifier: + type: char_string + defaultValue: "1111" + catalogVendorId: + type: int16u + defaultValue: 123 + applicationId: + type: char_string + defaultValue: "exampleid" tests: - - label: "Precondition" - verification: | - Test Setup: Commission DUT to TH, if not done so already. In some cases, such as with a Casting Video Player, the DUT commissions the TH (eg. tv-casting-app). - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - - label: - "Make sure there is a Content App endpoint implementing the Account - Login cluster. Product maker may provide pre-setup steps" - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner). - - The following command on the example tv-app will launch a content app on endpoint 4: - ./chip-tool applicationlauncher launch-app "{"catalogVendorId": 123, "applicationId": "exampleid"}" 1 1 - ./chip-tv-casting-app applicationlauncher launch-app "{"catalogVendorId": 123, "applicationId": "exampleid"}" 1 1 - - Verify in TH Log: - [1654004240716] [9799:7814889] CHIP: [DMG] Received Command Response Data, Endpoint=1 Cluster=0x0000_050C Command=0x0000_0003 - [1654004240717] [9799:7814889] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_050C Command 0x0000_0003 - [1654004240717] [9799:7814889] CHIP: [TOO] LauncherResponse: { - [1654004240717] [9799:7814889] CHIP: [TOO] status: 0 - [1654004240717] [9799:7814889] CHIP: [TOO] data: 64617461 - [1654004240717] [9799:7814889] CHIP: [TOO] } - disabled: true + - label: "Launch an app with the provided a application ID" + PICS: APPLAUNCHER.S.C00.Rsp + cluster: "Application Launcher" + command: "LaunchApp" + arguments: + values: + - name: "Data" + value: "Hello World" + - name: "application" + value: + { + catalogVendorId: catalogVendorId, + applicationId: applicationId, + } + response: + values: + - name: "status" + value: 0 - label: "TH sends a GetSetupPIN command to the DUT with test values provided by the product maker." PICS: ALOGIN.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool accountlogin get-setup-pin 1111 1 4 --timedInteractionTimeoutMs 1000 - ./chip-tv-casting-app accountlogin get-setup-pin 1111 1 4 --timedInteractionTimeoutMs 1000 - - On TH Verify that the DUT responds with a valid GetSetupPINResponse. - [1654004273684] [9851:7821178] CHIP: [DMG] Received Command Response Data, Endpoint=4 Cluster=0x0000_050E Command=0x0000_0001 - [1654004273684] [9851:7821178] CHIP: [TOO] Endpoint: 6 Cluster: 0x0000_050E Command 0x0000_0001 - [1654004273684] [9851:7821178] CHIP: [TOO] GetSetupPINResponse: { - [1654004273684] [9851:7821178] CHIP: [TOO] setupPIN: 34567890 - [1654004273684] [9851:7821178] CHIP: [TOO] } - disabled: true + command: "GetSetupPIN" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "TempAccountIdentifier" + value: TempAccountIdentifier + response: + values: + - name: "setupPIN" + saveAs: setupPIN - label: "TH sends a Login command to the DUT with test values provided by the product maker." PICS: ALOGIN.S.C02.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool accountlogin login 11111 34567890 1 4 --timedInteractionTimeoutMs 1000 - ./chip-tv-casting-app accountlogin login 11111 34567890 1 4 --timedInteractionTimeoutMs 1000 - - On TH Verify that the DUT responds with a standard command response. - [1654004350009] [9951:7836487] CHIP: [DMG] Received Command Response Status for Endpoint=4 Cluster=0x0000_050E Command=0x0000_0002 Status=0x0 - disabled: true + command: "Login" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "tempAccountIdentifier" + value: TempAccountIdentifier + - name: "setupPIN" + value: setupPIN - label: "TH sends a Logout command to the DUT with test values provided by the product maker." PICS: ALOGIN.S.C03.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool accountlogin logout 1 4 --timedInteractionTimeoutMs 1000 - ./chip-tv-casting-app accountlogin logout 1 4 --timedInteractionTimeoutMs 1000 - - On TH Verify that the DUT responds with a standard command response. - - [1654004400892] [9988:7841997] CHIP: [DMG] Received Command Response Status for Endpoint=4 Cluster=0x0000_050E Command=0x0000_0003 Status=0x0 - disabled: true + command: "Logout" + timedInteractionTimeoutMs: 10000 diff --git a/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml index f4eebc4d1089df..44705b9932bdc0 100644 --- a/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml @@ -14,96 +14,202 @@ # 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-BRBINFO-1.1] Global Attributes for Bridged Device Basic + 130.1.1. [TC-BRBINFO-1.1] Global Attributes for Bridged Device Basic Information Cluster Cluster [DUT-Server] config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Bridged Device Basic" + endpoint: 3 tests: - - label: "" - verification: | - Validate these PICS items of attributes which are not allowed in this server cluster implementation - these PICS items should all be FALSE, if any of them is TRUE then FAIL the test - - BRBINFO.S.A0000(DataModelRevision) - - BRBINFO.S.A0004(ProductID) - - BRBINFO.S.A0006(Location) - - BRBINFO.S.A0010(LocalConfigDisabled) - - BRBINFO.S.A0013(CapabilityMinima) - disabled: true - - - label: "Commission DUT to TH (if not already done)" - 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 bridgeddevicebasic read cluster-revision 1 3 - - On TH(chip-tool), verify DUT responsds ClusterRevision attribute has value 1 - - [1657695910.794487][15411:15416] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFFD DataVersion: 2577979325 - [1657695910.794568][15411:15416] 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 bridgeddevicebasic read feature-map 1 3 - - On TH(chip-tool), verify at DUT responds Featuremap value as 0 - - [1658749277.166884][10254:10259] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFFC DataVersion: 3297319126 - [1658749277.166945][10254:10259] CHIP:TOO: FeatureMap: 0 - [1658749277.167033][10254:10259] CHIP:EM: Sending Standalone Ack for MessageCounter:190389852 on exchange 39565i - disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 - label: "TH reads AttributeList from DUT" - verification: | - ./chip-tool bridgeddevicebasic read attribute-list 1 3 - - On TH(chip-tool), verify TH(chip-tool)at DUT responds as list of supported attributes as entries matching TH(chip-tool)e PICS items (see column F) - - [1658833518.065647][9014:9019] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFFB DataVersion: 270848876 - [1658833518.065723][9014:9019] CHIP:TOO: AttributeList: 7 entries - [1658833518.065773][9014:9019] CHIP:TOO: [1]: 5 - [1658833518.065804][9014:9019] CHIP:TOO: [2]: 17 - [1658833518.065833][9014:9019] CHIP:TOO: [3]: 65528 - [1658833518.065862][9014:9019] CHIP:TOO: [4]: 65529 - [1658833518.065891][9014:9019] CHIP:TOO: [5]: 65531 - [1658833518.065919][9014:9019] CHIP:TOO: [6]: 65532 - [1658833518.065949][9014:9019] CHIP:TOO: [7]: 65533 - disabled: true - - - label: "TH reads EventList from DUT" - verification: | - NEED SDK Implementation - - Out of scope for V1 - disabled: true - - - label: "TH reads AcceptedCommandList from DUT" - verification: | - ./chip-tool bridgeddevicebasic read accepted-command-list 1 3 - - On TH(chip-tool), verify DUT responds as list of Accepted Commands as 0 entries - - [1657696300.165081][15447:15452] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFF9 DataVersion: 2577979325 - [1657696300.165174][15447:15452] CHIP:TOO: AcceptedCommandList: 0 entries - disabled: true - - - label: "TH reads GeneratedCommandList from DUT" - verification: | - ./chip-tool bridgeddevicebasic read generated-command-list 1 3 - - On TH(chip-tool), verify that DUT responds as list of GeneratedCommands as 0 entries - - [1657696328.889936][15454:15459] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFF8 DataVersion: 2577979325 - [1657696328.890017][15454:15459] CHIP:TOO: GeneratedCommandList: 0 entries - disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [17, 65528, 65529, 65531, 65532, 65533] + + - label: "TH reads optional attribute(VendorName) in AttributeList" + PICS: BRBINFO.S.A0001 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [1] + + - label: "TH reads optional attribute(VendorID) in AttributeList" + PICS: BRBINFO.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] + + - label: "TH reads optional attribute(ProductName) in AttributeList" + PICS: BRBINFO.S.A0003 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + + - label: "TH reads optional attribute(NodeLabel) in AttributeList" + PICS: BRBINFO.S.A0005 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [5] + + - label: "TH reads optional attribute(HardwareVersion) in AttributeList" + PICS: BRBINFO.S.A0007 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [7] + + - label: + "TH reads optional attribute(HardwareVersionString) in AttributeList" + PICS: BRBINFO.S.A0008 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [8] + + - label: "TH reads optional attribute(SoftwareVersion) in AttributeList" + PICS: BRBINFO.S.A0009 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [9] + + - label: + "TH reads optional attribute(SoftwareVersionString) in AttributeList" + PICS: BRBINFO.S.A000a + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [10] + + - label: "TH reads optional attribute(ManufacturingDate) in AttributeList" + PICS: BRBINFO.S.A000b + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [11] + + - label: "TH reads optional attribute(PartNumber) in AttributeList" + PICS: BRBINFO.S.A000c + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [12] + + - label: "TH reads optional attribute(ProductURL) in AttributeList" + PICS: BRBINFO.S.A000d + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [13] + + - label: "TH reads optional attribute(ProductLabel) in AttributeList" + PICS: BRBINFO.S.A000e + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [14] + + - label: "TH reads optional attribute(SerialNumber) in AttributeList" + PICS: BRBINFO.S.A000f + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [15] + + - label: "TH reads optional attribute(UniqueID) in AttributeList" + PICS: BRBINFO.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_BRBINFO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml index 81ca10425f3bd0..6592da0b8d116b 100644 --- a/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml @@ -13,127 +13,128 @@ # 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.2.1. [TC-BRBINFO-2.1] Attributes [DUT-Server] +name: 130.2.1. [TC-BRBINFO-2.1] Attributes [DUT-Server] config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Bridged Device Basic" + endpoint: 3 tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "TH reads VendorName from the DUT." PICS: BRBINFO.S.A0001 - verification: | - ./chip-tool bridgeddevicebasic read vendor-name 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495199.434300][2158:2163] CHIP:TOO: VendorName: TEST_VENDOR - disabled: true - - - label: "TH writes VendorName as sample" + command: "readAttribute" + attribute: "VendorName" + response: + saveAs: VendorNameValue + constraints: + type: char_string + maxLength: 32 + + - label: "TH writes VendorName from the DUT." PICS: BRBINFO.S.A0001 - verification: | - ./chip-tool bridgeddevicebasic write vendor-name sample 1 3 + command: "writeAttribute" + attribute: "VendorName" + arguments: + value: "sample" + response: + error: UNSUPPORTED_WRITE - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads VendorName" + - label: "TH reads VendorName from the DUT." PICS: BRBINFO.S.A0001 - verification: | - ./chip-tool bridgeddevicebasic read vendor-name 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495199.434300][2158:2163] CHIP:TOO: VendorName: TEST_VENDOR - disabled: true + command: "readAttribute" + attribute: "VendorName" + response: + value: VendorNameValue - label: "TH reads VendorID from the DUT." PICS: BRBINFO.S.A0002 - verification: | - ./chip-tool bridgeddevicebasic read vendor-id 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE + command: "readAttribute" + attribute: "VendorID" + response: + saveAs: VendorIDValue + constraints: + type: vendor_id + minValue: 1 + maxValue: 65521 - Example Log: - [1656495322.252171][2177:2182] CHIP:TOO: VendorID: 65521 - disabled: true - - - label: "TH writes VendorID as 0x0011" + - label: + "Verify that VendorID matches the value assigned to this manufacturer" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && BRBINFO.S.A0002 + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH writes VendorID from the DUT." PICS: BRBINFO.S.A0002 - verification: | - ./chip-tool bridgeddevicebasic write vendor-name 0x0011 1 3 + command: "writeAttribute" + attribute: "VendorID" + arguments: + value: 0x0011 + response: + error: UNSUPPORTED_WRITE - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads VendorID" + - label: "TH reads VendorID from the DUT." PICS: BRBINFO.S.A0002 - verification: | - ./chip-tool bridgeddevicebasic read vendor-id 1 3 + command: "readAttribute" + attribute: "VendorID" + response: + value: VendorIDValue - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495322.252171][2177:2182] CHIP:TOO: VendorID: 65521 - disabled: true - - - label: "TH reads ProductName from the DUT." + - label: "TH reads ProductName from the DUT" PICS: BRBINFO.S.A0003 - verification: | - ./chip-tool bridgeddevicebasic read product-name 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495708.412745][2200:2205] CHIP:TOO: ProductName: TEST_PRODUCT - disabled: true - - - label: "TH writes ProductName as newproduct" + command: "readAttribute" + attribute: "ProductName" + response: + saveAs: ProductNameValue + constraints: + type: char_string + maxLength: 32 + + - label: "TH writes ProductName from the DUT." PICS: BRBINFO.S.A0003 - verification: | - ./chip-tool bridgeddevicebasic write vendor-name ""newproduct"" 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - NOTE the quotes: single-quote/double-quote/string/double-quote/single-quote - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads ProductName" + command: "writeAttribute" + attribute: "ProductName" + arguments: + value: "newproduct" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads ProductName from the DUT" PICS: BRBINFO.S.A0003 - verification: | - ./chip-tool bridgeddevicebasic read product-name 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495708.412745][2200:2205] CHIP:TOO: ProductName: TEST_PRODUCT - disabled: true + command: "readAttribute" + attribute: "ProductName" + response: + value: ProductNameValue - label: "TH reads NodeLabel from the DUT" PICS: BRBINFO.S.A0005 - verification: | - ./chip-tool bridgeddevicebasic read node-label 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE + command: "readAttribute" + attribute: "NodeLabel" + response: + saveAs: NodeLabelValue + constraints: + type: char_string + maxLength: 32 - Example Log: - [1657696463.081741][15476:15481] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_0005 DataVersion: 2577979325 - [1657696463.081791][15476:15481] CHIP:TOO: NodeLabel: Light 1 - disabled: true - - - label: "TH writes newnode to NodeLabel" - PICS: BRBINFO.S.A0005 + #Issue https://github.com/project-chip/connectedhomeip/issues/23509 + - label: "TH writes NodeLabel from the DUT." + PICS: BRBINFO.S.A0005 && PICS_USER_PROMPT verification: | - ./chip-tool bridgeddevicebasic write node-label ""newnode"" 1 3 + ./chip-tool bridgeddevicebasic write node-label '"newnode"' 1 3 Verify response has unsupported write on TH(chip-tool) Log: @@ -148,10 +149,17 @@ tests: [1660839701.840827][2444:2449] CHIP:DMG: }, [1660839701.840905][2444:2449] CHIP:DMG: [1660839701.840973][2444:2449] CHIP:DMG: }, - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" - - label: "TH reads NodeLabel" - PICS: BRBINFO.S.A0005 + - label: "TH reads NodeLabel from the DUT" + PICS: BRBINFO.S.A0005 && PICS_USER_PROMPT verification: | ./chip-tool bridgeddevicebasic read node-label 1 3 @@ -159,370 +167,342 @@ tests: [1657696463.081741][15476:15481] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_0005 DataVersion: 2577979325 [1657696463.081791][15476:15481] CHIP:TOO: NodeLabel: newnode - disabled: true - - - label: "TH reads HardwareVersion from the DUT." + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "TH reads HardwareVersion from the DUT" PICS: BRBINFO.S.A0007 - verification: | - ./chip-tool bridgeddevicebasic read hardware-version 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496175.564718][2302:2307] CHIP:TOO: HardwareVersion: 0 - disabled: true - - - label: "TH writes HardwareVersion as 0x4531" + command: "readAttribute" + attribute: "HardwareVersion" + response: + saveAs: HardwareVersionValue + constraints: + type: int16u + minValue: 0 + maxValue: 65534 + + - label: "TH writes HardwareVersion from the DUT." PICS: BRBINFO.S.A0007 - verification: | - ./chip-tool bridgeddevicebasic write hardware-version-string 0x4531 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads HardwareVersion" + command: "writeAttribute" + attribute: "HardwareVersion" + arguments: + value: 0x4531 + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads HardwareVersion from the DUT" PICS: BRBINFO.S.A0007 - verification: | - ./chip-tool bridgeddevicebasic write hardware-version-string 0x4531 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496175.564718][2302:2307] CHIP:TOO: HardwareVersion: 0 - disabled: true + command: "readAttribute" + attribute: "HardwareVersion" + response: + value: HardwareVersionValue - label: "TH reads HardwareVersionString from the DUT." PICS: BRBINFO.S.A0008 - verification: | - ./chip-tool bridgeddevicebasic read hardware-version-string 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496257.298675][2315:2320] CHIP:TOO: HardwareVersionString: TEST_VERSION - disabled: true - - - label: "TH writes HardwareVersionString as newhardwareversion" + command: "readAttribute" + attribute: "HardwareVersionString" + response: + saveAs: HardwareVersionStringValue + constraints: + type: char_string + minLength: 1 + maxLength: 64 + + - label: "TH writes HardwareVersionString from the DUT." PICS: BRBINFO.S.A0008 - verification: | - ./chip-tool bridgeddevicebasic write hardware-version-string newhardwareversion 1 3 + command: "writeAttribute" + attribute: "HardwareVersionString" + arguments: + value: "newhardwareversion" + response: + error: UNSUPPORTED_WRITE - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads HardwareVersionString" + - label: "TH reads HardwareVersionString from the DUT." PICS: BRBINFO.S.A0008 - verification: | - ./chip-tool bridgeddevicebasic read hardware-version-string 1 3 + command: "readAttribute" + attribute: "HardwareVersionString" + response: + value: HardwareVersionStringValue - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496257.298675][2315:2320] CHIP:TOO: HardwareVersionString: TEST_VERSION - disabled: true - - - label: "TH reads SoftwareVersion from the DUT." + - label: "TH reads SoftwareVersion from the DUT" PICS: BRBINFO.S.A0009 - verification: | - ./chip-tool bridgeddevicebasic read software-version 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496411.609866][2348:2353] CHIP:TOO: SoftwareVersion: 1 - disabled: true - - - label: "TH writes SoftwareVersion as 0x8213" + command: "readAttribute" + attribute: "SoftwareVersion" + response: + saveAs: SoftwareVersionValue + constraints: + minValue: 0 + maxValue: 4294967294 + + - label: "TH writes SoftwareVersion from the DUT." PICS: BRBINFO.S.A0009 - verification: | - ./chip-tool bridgeddevicebasic write software-version 0x8213 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads SoftwareVersion" + command: "writeAttribute" + attribute: "SoftwareVersion" + arguments: + value: 0x8213 + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads SoftwareVersion from the DUT" PICS: BRBINFO.S.A0009 - verification: | - ./chip-tool bridgeddevicebasic read software-version 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496411.609866][2348:2353] CHIP:TOO: SoftwareVersion: 1 - disabled: true + command: "readAttribute" + attribute: "SoftwareVersion" + response: + value: SoftwareVersionValue - - label: "TH reads SoftwareVersionString from the DUT." + - label: "TH reads SoftwareVersionString from the DUT" PICS: BRBINFO.S.A000a - verification: | - ./chip-tool bridgeddevicebasic read software-version-string 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496498.568951][2362:2367] CHIP:TOO: SoftwareVersionString: 1.0 - disabled: true - - - label: "TH writes SoftwareVersionString as 1.0" + command: "readAttribute" + attribute: "SoftwareVersionString" + response: + saveAs: SoftwareVersionStringValue + constraints: + minLength: 1 + maxLength: 64 + + - label: "TH writes SoftwareVersionString from the DUT." PICS: BRBINFO.S.A000a - verification: | - ./chip-tool bridgeddevicebasic write software-version 1.0 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads SoftwareVersionString" + command: "writeAttribute" + attribute: "SoftwareVersionString" + arguments: + value: "1.0" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads SoftwareVersionString from the DUT" PICS: BRBINFO.S.A000a - verification: | - ./chip-tool bridgeddevicebasic read software-version-string 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496498.568951][2362:2367] CHIP:TOO: SoftwareVersionString: 1.0 - disabled: true + command: "readAttribute" + attribute: "SoftwareVersionString" + response: + value: SoftwareVersionStringValue - label: "TH reads ManufacturingDate from the DUT." PICS: BRBINFO.S.A000b - verification: | - ./chip-tool bridgeddevicebasic read manufacturing-date 1 3 + command: "readAttribute" + attribute: "ManufacturingDate" + response: + saveAs: ManufacturingDateValue + constraints: + type: char_string + minLength: 8 + maxLength: 16 - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496661.777852][2388:2393] CHIP:TOO: ManufacturingDate: 20200101 - disabled: true - - - label: "TH writes ManufacturingDate as 20210814789452IN" + - label: + "Verify if the first 8 characters specify date according to ISO 8601, + i.e, YYYYMMDD." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && BRBINFO.S.A000b + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH writes ManufacturingDate from the DUT." PICS: BRBINFO.S.A000b - verification: | - ./chip-tool bridgeddevicebasic write manufacturing-date 20210814789452IN 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: + command: "writeAttribute" + attribute: "ManufacturingDate" + arguments: + value: "20210814789452IN" + response: + error: UNSUPPORTED_WRITE - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads ManufacturingDate" + - label: "TH reads ManufacturingDate from the DUT." PICS: BRBINFO.S.A000b - verification: | - ./chip-tool bridgeddevicebasic read manufacturing-date 1 3 + command: "readAttribute" + attribute: "ManufacturingDate" + response: + value: ManufacturingDateValue - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496661.777852][2388:2393] CHIP:TOO: ManufacturingDate: 20200101 - disabled: true - - - label: "TH reads PartNumber from the DUT." + - label: "TH reads PartNumber from the DUT" PICS: BRBINFO.S.A000c - verification: | - ./chip-tool bridgeddevicebasic read part-number 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - - [1656496800.941788][2405:2410] CHIP:TOO: PartNumber: 1234 - disabled: true - - - label: "TH writes PartNumber as newpart" + command: "readAttribute" + attribute: "PartNumber" + response: + saveAs: PartNumberValue + constraints: + type: char_string + maxLength: 32 + + - label: "TH writes PartNumber from the DUT." PICS: BRBINFO.S.A000c - verification: | - ./chip-tool bridgeddevicebasic write part-number newpart 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads PartNumber" + command: "writeAttribute" + attribute: "PartNumber" + arguments: + value: "newpart" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads PartNumber from the DUT" PICS: BRBINFO.S.A000c - verification: | - ./chip-tool bridgeddevicebasic read part-number 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE + command: "readAttribute" + attribute: "PartNumber" + response: + value: PartNumberValue - Example Log: - [1656496800.941788][2405:2410] CHIP:TOO: PartNumber: 1234 - disabled: true - - - label: "TH reads ProductURL from the DUT." + - label: "TH reads ProductURL from the DUT" PICS: BRBINFO.S.A000d - verification: | - ./chip-tool bridgeddevicebasic read product-url 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - - [1656497181.118653][2436:2441] CHIP:TOO: ProductURL: https://example.com/myproduct - disabled: true + command: "readAttribute" + attribute: "ProductURL" + response: + saveAs: ProductURLValue + constraints: + type: long_char_string + maxLength: 256 - - label: "TH writes ProductURL as https://www.example.com" + - label: + "Verify that it specifies a link to a specific web page, Verify that + it follows the syntax rules specified in RFC 3986." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && BRBINFO.S.A000d + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH writes ProductURL from the DUT." PICS: BRBINFO.S.A000d - verification: | - ./chip-tool bridgeddevicebasic write product-url https://www.example.com 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads ProductURL" + command: "writeAttribute" + attribute: "ProductURL" + arguments: + value: "https://www.example.com" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads ProductURL from the DUT" PICS: BRBINFO.S.A000d - verification: | - ./chip-tool bridgeddevicebasic read product-url 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656497181.118653][2436:2441] CHIP:TOO: ProductURL: https://example.com/myproduct - disabled: true + command: "readAttribute" + attribute: "ProductURL" + response: + value: ProductURLValue - label: "TH reads ProductLabel from the DUT." PICS: BRBINFO.S.A000e - verification: | - ./chip-tool bridgeddevicebasic read product-label 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE + command: "readAttribute" + attribute: "ProductLabel" + response: + saveAs: ProductLabelValue + constraints: + type: char_string + maxLength: 64 - Example Log: - - [1656501313.811305][2602:2607] CHIP:TOO: ProductLabel: ABCD - disabled: true - - - label: "TH writes ProductLabel as newproductlabel" + - label: + "Verify that it does not include the name of the vendor as defined + within the VendorName attribute" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && BRBINFO.S.A000e + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH writes ProductLabel from the DUT." PICS: BRBINFO.S.A000e - verification: | - ./chip-tool bridgeddevicebasic write product-label newproductlabel 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true + command: "writeAttribute" + attribute: "ProductLabel" + arguments: + value: "newproductlabel" + response: + error: UNSUPPORTED_WRITE - - label: "TH reads ProductLabel" + - label: "TH reads ProductLabel from the DUT." PICS: BRBINFO.S.A000e - verification: | - ./chip-tool bridgeddevicebasic read product-label 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656501313.811305][2602:2607] CHIP:TOO: ProductLabel: ABCD - disabled: true + command: "readAttribute" + attribute: "ProductLabel" + response: + value: ProductLabelValue - label: "TH reads SerialNumber from the DUT." PICS: BRBINFO.S.A000f - verification: | - ./chip-tool bridgeddevicebasic read serial-number 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - - [1656501452.183890][2624:2630] CHIP:TOO: SerialNumber: 5678 - disabled: true - - - label: "TH writes SerialNumber_test as newserialnumber" + command: "readAttribute" + attribute: "SerialNumber" + response: + saveAs: SerialNumberValue + constraints: + type: char_string + maxLength: 32 + + - label: "TH writes SerialNumber from the DUT." PICS: BRBINFO.S.A000f - verification: | - ./chip-tool bridgeddevicebasic write serial-number newserialnumber 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: + command: "writeAttribute" + attribute: "SerialNumber" + arguments: + value: "newserialnumber" + response: + error: UNSUPPORTED_WRITE - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads SerialNumber" + - label: "TH reads SerialNumber from the DUT." PICS: BRBINFO.S.A000f - verification: | - ./chip-tool bridgeddevicebasic read serial-number 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656501452.183890][2624:2630] CHIP:TOO: SerialNumber: 5678 - disabled: true + command: "readAttribute" + attribute: "SerialNumber" + response: + value: SerialNumberValue - label: "TH reads Reachable from the DUT." PICS: BRBINFO.S.A0011 - verification: | - ./chip-tool bridgeddevicebasic read reachable 1 3 - - Verify value of reachable is type of bool and its true in TH Log: - - [1659012746.234251][8169:8174] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_0011 DataVersion: 1363291551 - [1659012746.234309][8169:8174] CHIP:TOO: Reachable: TRUE - [1659012746.234420][8169:8174] CHIP:EM: Sending Standalone Ack for MessageCounter:92645971 on exchange 389i - disabled: true + command: "readAttribute" + attribute: "Reachable" + response: + value: true + constraints: + type: boolean - label: "TH sends Write request message to DUT to change value of Reachable to - false." + false" PICS: BRBINFO.S.A0011 - verification: | - ./chip-tool bridgeddevicebasic write-by-id 17 false 1 3 - - - - On TH verify that, TH receives UNSUPPORTED_WRITE response as status - [1656496372.884955][2340:2345] CHIP:DMG: } - [1656496372.885085][2340:2345] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1656496372.885148][2340:2345] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - [1656496372.885242][2340:2345] CHIP:EM: Sending Standalone Ack for MessageCounter:201795946 on exchange 27637ihe attribute is optional so no example log can be provided. - disabled: true + command: "writeAttribute" + attribute: "Reachable" + arguments: + value: false + response: + error: UNSUPPORTED_WRITE - label: "TH reads Reachable from the DUT." PICS: BRBINFO.S.A0011 - verification: | - ./chip-tool bridgeddevicebasic read reachable 1 3 - On TH verify that the value of reachable is type is same as 51 - - [1659012746.234251][8169:8174] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_0011 DataVersion: 1363291551 - [1659012746.234309][8169:8174] CHIP:TOO: Reachable: TRUE - [1659012746.234420][8169:8174] CHIP:EM: Sending Standalone Ack for MessageCounter:92645971 on exchange 389i - disabled: true + command: "readAttribute" + attribute: "Reachable" + response: + value: true + constraints: + type: boolean - label: "TH reads UniqueID from the DUT." PICS: BRBINFO.S.A0012 - verification: | - ./chip-tool bridgeddevicebasic read unique-id 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - - [1656501734.253827][2673:2679] CHIP:TOO: UniqueID: 30789FE4FCF832C9 - disabled: true - - - label: "TH writes UniqueID as newid" + command: "readAttribute" + attribute: "UniqueID" + response: + saveAs: UniqueIDValue + constraints: + type: char_string + maxLength: 32 + + - label: "TH writes UniqueID from the DUT." PICS: BRBINFO.S.A0012 - verification: | - ./chip-tool bridgeddevicebasic write unique-id newid 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: + command: "writeAttribute" + attribute: "UniqueID" + arguments: + value: "newid" + response: + error: UNSUPPORTED_WRITE - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads UniqueID" + - label: "TH reads UniqueID from the DUT." PICS: BRBINFO.S.A0012 - verification: | - ./chip-tool bridgeddevicebasic read unique-id 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656501734.253827][2673:2679] CHIP:TOO: UniqueID: 30789FE4FCF832C9 - disabled: true + command: "readAttribute" + attribute: "UniqueID" + response: + value: UniqueIDValue diff --git a/src/app/tests/suites/certification/Test_TC_CNET_1_3.yaml b/src/app/tests/suites/certification/Test_TC_CNET_1_3.yaml index 3c5936b993798d..8e167b434b01b1 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_1_3.yaml @@ -11,7 +11,6 @@ # 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: 12.1.3. [TC-CNET-1.3] Global Attributes for Networking commissioning cluster @@ -22,209 +21,165 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Network Commissioning" endpoint: 0 tests: - - label: "Commission TH and DUT over BLE to setup the Wi-Fi" - verification: | - - disabled: true - - - label: "TH reads the ClusterRevision from DUT" - verification: | - ./chip-tool networkcommissioning read cluster-revision 1 0 - - Verify "ClusterRevision: 1" on the TH(Chip-tool) Log: - - [1649244866.275684][30440:30446] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFD DataVersion: 2702518944 - [1649244866.277721][30440:30446] CHIP:TOO: ClusterRevision: 1 - [1649244866.277827][30440:30446] CHIP:EM: Sending Standalone Ack for MessageCounter:10092551 on exchange 64234i - disabled: true - - - label: "TH reads the FeatureMap from DUT" - verification: | - (WiFi) - ./chip-tool networkcommissioning read feature-map 1 0 - - Verify "FeatureMap" on the TH(Chip-tool) Log: - - [1651215443.195852][3285:3290] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 2584224280 - [1651215443.195939][3285:3290] CHIP:TOO: FeatureMap: 1 - - (Ethernet) - ./chip-tool networkcommissioning read feature-map 1 0 - - Verify "FeatureMap" on the TH(Chip-tool) Log: - - [1660315515.081759][32315:32320] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 4034679103 - [1660315515.081895][32315:32320] CHIP:TOO: FeatureMap: 4 - - (Thread) - ./chip-tool networkcommissioning read feature-map 1 0 - - Verify "FeatureMap" on the TH(Chip-tool) Log: - - [1660315948.250922][3101:3106] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 1122474754 - [1660315948.261520][3101:3106] CHIP:TOO: FeatureMap: 2 - disabled: true - - - label: "TH reads AttributeList from DUT" - verification: | - (WiFi) - ./chip-tool networkcommissioning read attribute-list 1 0 - - Verify "AttributeList" on the TH(Chip-tool) Log: - - [1651215479.539148][3293:3298] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFB DataVersion: 2584224280 - [1651215479.539230][3293:3298] CHIP:TOO: AttributeList: 13 entries - [1651215479.539262][3293:3298] CHIP:TOO: [1]: 0 - [1651215479.539288][3293:3298] CHIP:TOO: [2]: 1 - [1651215479.539323][3293:3298] CHIP:TOO: [3]: 2 - [1651215479.539348][3293:3298] CHIP:TOO: [4]: 3 - [1651215479.539373][3293:3298] CHIP:TOO: [5]: 4 - [1651215479.539397][3293:3298] CHIP:TOO: [6]: 5 - [1651215479.539420][3293:3298] CHIP:TOO: [7]: 6 - [1651215479.539444][3293:3298] CHIP:TOO: [8]: 7 - [1651215479.539468][3293:3298] CHIP:TOO: [9]: 65528 - [1651215479.539493][3293:3298] CHIP:TOO: [10]: 65529 - [1651215479.539517][3293:3298] CHIP:TOO: [11]: 65531 - [1651215479.539541][3293:3298] CHIP:TOO: [12]: 65532 - [1651215479.539564][3293:3298] CHIP:TOO: [13]: 65533 - - - (Ethernet) - - ./chip-tool networkcommissioning read attribute-list 1 0 - - Verify "AttributeList" on the TH(Chip-tool) Log: - - [1660315522.163640][32321:32326] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFB DataVersion: 4034679103 - [1660315522.163797][32321:32326] CHIP:TOO: AttributeList: 13 entries - [1660315522.163880][32321:32326] CHIP:TOO: [1]: 0 - [1660315522.163945][32321:32326] CHIP:TOO: [2]: 1 - [1660315522.164009][32321:32326] CHIP:TOO: [3]: 2 - [1660315522.164106][32321:32326] CHIP:TOO: [4]: 3 - [1660315522.164174][32321:32326] CHIP:TOO: [5]: 4 - [1660315522.164260][32321:32326] CHIP:TOO: [6]: 5 - [1660315522.164328][32321:32326] CHIP:TOO: [7]: 6 - [1660315522.164393][32321:32326] CHIP:TOO: [8]: 7 - [1660315522.164482][32321:32326] CHIP:TOO: [9]: 65528 - [1660315522.164549][32321:32326] CHIP:TOO: [10]: 65529 - [1660315522.164636][32321:32326] CHIP:TOO: [11]: 65531 - [1660315522.164708][32321:32326] CHIP:TOO: [12]: 65532 - [1660315522.164778][32321:32326] CHIP:TOO: [13]: 65533 - - (Thread) - - ./chip-tool networkcommissioning read attribute-list 1 0 - - Verify "AttributeList" on the TH(Chip-tool) Log: - - [1660316011.016650][3112:3117] CHIP:TOO: AttributeList: 13 entries - [1660316011.016678][3112:3117] CHIP:TOO: [1]: 0 - [1660316011.016700][3112:3117] CHIP:TOO: [2]: 1 - [1660316011.016721][3112:3117] CHIP:TOO: [3]: 2 - [1660316011.016741][3112:3117] CHIP:TOO: [4]: 3 - [1660316011.016762][3112:3117] CHIP:TOO: [5]: 4 - [1660316011.016782][3112:3117] CHIP:TOO: [6]: 5 - [1660316011.016803][3112:3117] CHIP:TOO: [7]: 6 - [1660316011.016823][3112:3117] CHIP:TOO: [8]: 7 - [1660316011.016844][3112:3117] CHIP:TOO: [9]: 65528 - [1660316011.016865][3112:3117] CHIP:TOO: [10]: 65529 - [1660316011.016887][3112:3117] CHIP:TOO: [11]: 65531 - [1660316011.016908][3112:3117] CHIP:TOO: [12]: 65532 - [1660316011.016929][3112:3117] CHIP:TOO: [13]: 65533 - [1660316011.017068][3112:3117] CHIP:EM: Sending Standalone Ack for MessageCounter:239150268 on exchange 45209i - disabled: true - - - label: "TH reads EventList from the DUT" - verification: | - out of scope for V1.0 - disabled: true - - - label: "TH reads AcceptedCommandList from DUT" - verification: | - (WiFi) - ./chip-tool networkcommissioning read accepted-command-list 1 0 - - Verify "AcceptedCommandList" on the TH(Chip-tool) Log: - - [1653909914.972854][3424:3429] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF9 DataVersion: 880539056 - [1653909914.973027][3424:3429] CHIP:TOO: AcceptedCommandList: 5 entries - [1653909914.973102][3424:3429] CHIP:TOO: [1]: 0 - [1653909914.973166][3424:3429] CHIP:TOO: [2]: 2 - [1653909914.973228][3424:3429] CHIP:TOO: [3]: 4 - [1653909914.973289][3424:3429] CHIP:TOO: [4]: 6 - [1653909914.973350][3424:3429] CHIP:TOO: [5]: 8 - [1653909914.973574][3424:3429] CHIP:EM: Sending Standalone Ack for MessageCounter:4589161 on exchange 55554i - - - (Ethernet) - ./chip-tool networkcommissioning read accepted-command-list 1 0 - - Verify "AcceptedCommandList" on the TH(Chip-tool) Log: - - [1660315536.068512][32327:32332] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF9 DataVersion: 4034679103 - [1660315536.068654][32327:32332] CHIP:TOO: AcceptedCommandList: 0 entries - - (Thread) - ./chip-tool networkcommissioning read accepted-command-list 1 0 - - Verify "AcceptedCommandList" on the TH(Chip-tool) Log: - - [1660316038.564553][3121:3126] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF9 DataVersion: 1122474754 - [1660316038.564671][3121:3126] CHIP:TOO: AcceptedCommandList: 5 entries - [1660316038.564702][3121:3126] CHIP:TOO: [1]: 0 - [1660316038.564725][3121:3126] CHIP:TOO: [2]: 3 - [1660316038.564747][3121:3126] CHIP:TOO: [3]: 4 - [1660316038.564769][3121:3126] CHIP:TOO: [4]: 6 - [1660316038.564853][3121:3126] CHIP:TOO: [5]: 8 - [1660316038.564991][3121:3126] CHIP:EM: Sending Standalone Ack for MessageCounter:232731891 on exchange 30329i - disabled: true - - - label: "TH reads GeneratedCommandList from DUT" - verification: | - ( WiFi) - ./chip-tool networkcommissioning read generated-command-list 1 0 - - - Verify "GeneratedCommandList" on the TH(Chip-tool) Log: - - [1650370123.417759][42418:42423] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF8 DataVersion: 3182776035 - [1650370123.417866][42418:42423] CHIP:TOO: GeneratedCommandList: 3 entries - [1650370123.417938][42418:42423] CHIP:TOO: [1]: 1 - [1650370123.417977][42418:42423] CHIP:TOO: [2]: 5 - [1650370123.418013][42418:42423] CHIP:TOO: [3]: 7 - [1650370123.418143][42418:42423] CHIP:EM: Sending Standalone Ack for MessageCounter:759910 on exchange 25409i - - - - (Ethernet) - ./chip-tool networkcommissioning read generated-command-list 1 0 - - Verify "GeneratedCommandList" on the TH(Chip-tool) Log: - - [1660315548.937195][32333:32338] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF8 DataVersion: 4034679103 - [1660315548.937327][32333:32338] CHIP:TOO: GeneratedCommandList: 0 entries - - - ( Thread ) - ./chip-tool networkcommissioning read generated-command-list 51 0 - - - Verify "GeneratedCommandList" on the TH(Chip-tool) Log: - - [1650370342.693373][7450:7455] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF8 DataVersion: 1032683896 - [1650370342.693536][7450:7455] CHIP:TOO: GeneratedCommandList: 2 entries - 1650370123.417938][42418:42423] CHIP:TOO: [1]: 1 - [1650370123.417977][42418:42423] CHIP:TOO: [2]: 5 - [1650370123.418013][42418:42423] CHIP:TOO: [3]: 7 - [1650370342.693995][7450:7455] CHIP:EM: Sending Standalone Ack for MessageCounter:2345375 on exchange 25146i - disabled: true - - - label: "NOTE" - verification: | - Repeat the test case by Commission DUT to TH on the Thread and - Ethernet setups - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + PICS: " !CNET.S.F00 && !CNET.S.F01 && !CNET.S.F02 " + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the global attribute: FeatureMap when CNET.S.F00 is set" + PICS: CNET.S.F00 + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 1 + + - label: "Read the global attribute: FeatureMap when CNET.S.F01 is set" + PICS: CNET.S.F01 + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 2 + + - label: "Read the global attribute: FeatureMap when CNET.S.F02 is set" + PICS: CNET.S.F02 + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 4 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [65528, 65529, 65531, 65532, 65533] + + - label: + "Read mandatory attributes in AttributeList if + CNET.S.F00(WI)/CNET.S.F01(TH)/CNET.S.F02(ET) is true" + PICS: CNET.S.F00 || CNET.S.F01 || CNET.S.F02 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 4, 5, 6, 7] + + - label: "Read the optional attribute(ScanMaxTimeSeconds): AttributeList" + PICS: CNET.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] + + - label: + "Reading optional attribute(ConnectMaxTimeSeconds) in AttributeList" + PICS: CNET.S.A0003 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + + - label: + "Read AcceptedCommandList If DUT supports Wi-Fi/Thread related + features CNET.S.F00(WI),CNET.S.F01(TH)" + PICS: CNET.S.F00 || CNET.S.F01 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0, 4, 6, 8] + + - label: + "Read AcceptedCommandList If DUT supports Wi-Fi related features + (CNET.S.F00(WI) is true)" + PICS: CNET.S.F00 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [2] + + - label: + "Read AcceptedCommandList If DUT supports Thread related + features(CNET.S.F01(TH) is true)" + PICS: CNET.S.F01 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [3] + + - label: + "Read AcceptedCommandList If DUT supports Ethernet related + features(CNET.S.F02(TH) is true)" + PICS: CNET.S.F02 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + + - label: + "Read the GeneratedCommandList If DUT supports Wi-Fi/Thread related + features(CNET.S.F00(WI) or CNET.S.F01(TH) is true)" + PICS: CNET.S.F00 || CNET.S.F01 + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [1, 5, 7] + + - label: + "Read the GeneratedCommandList If DUT supports Ethernet related + features(CNET.S.F02(ET) must be true)" + PICS: CNET.S.F02 + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + #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 8f86d07f252121..e6d2e2a0ba58e9 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 @@ -536,7 +536,7 @@ tests: contains: [55] - label: "Read the optional attribute (ActiveTimestamp) in AttributeList" - PICS: DGTHREAD.S.A0039 + PICS: DGTHREAD.S.A0038 command: "readAttribute" attribute: "AttributeList" response: @@ -545,7 +545,7 @@ tests: contains: [56] - label: "Read the optional attribute (PendingTimestamp) in AttributeList" - PICS: DGTHREAD.S.A003A + PICS: DGTHREAD.S.A0039 command: "readAttribute" attribute: "AttributeList" response: @@ -554,7 +554,7 @@ tests: contains: [57] - label: "Read the optional attribute (Delay) in AttributeList" - PICS: DGTHREAD.S.A003B + PICS: DGTHREAD.S.A003a command: "readAttribute" attribute: "AttributeList" response: diff --git a/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml index a204f2abfa3943..269677250dae0d 100644 --- a/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml @@ -414,7 +414,7 @@ tests: type: int64u - label: "TH reads Delay attribute value from DUT" - PICS: DGTHREAD.S.A003A + PICS: DGTHREAD.S.A003a command: "readAttribute" attribute: "Delay" response: @@ -441,7 +441,7 @@ tests: [1649825860.867921][3472:3477] CHIP:TOO: } cluster: "LogCommands" command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGTHREAD.S.A003B + PICS: PICS_USER_PROMPT && DGTHREAD.S.A003b arguments: values: - name: "message" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml index bffd1db40b6a6d..1761022dd8014e 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml @@ -11,196 +11,146 @@ # 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: - 116.2.6. [TC-DRLK-2.6] Verification for the following Commands - Set Holiday - Schedule, Get Holiday Schedule, Get Holiday Schedule Response , Clear - Holiday Schedule [DUT-Server] + 111.2.7. [TC-DRLK-2.6] Verification for the following Commands - Set Year + Schedule, Get Year Schedule, Get Year Day Schedule Response and Clear Year + Day Schedule[DUT-Server] PICS: - DRLK.S config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Door Lock" + endpoint: 1 tests: - - label: "Pre-Conditions" - verification: | - DUT as server - disabled: true + - label: "Wait for commissionee" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH reads NumberOfHoliday SchedulesSupported and saves for future use." PICS: DRLK.S.F0b && DRLK.S.A0016 - verification: | - ./chip-tool doorlock read number-of-holiday-schedules-supported 1 1 - Verify " NumberOfHoliDay SchedulesSuppored" on the TH(Chip-tool) Log: - - [1654691068.446440][4655:4660] CHIP:DMG: - [1654691068.446465][4655:4660] CHIP:DMG: SuppressResponse = true, - [1654691068.446492][4655:4660] CHIP:DMG: InteractionModelRevision = 1 - [1654691068.446515][4655:4660] CHIP:DMG: } - [1654691068.446648][4655:4660] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Attribute 0x0000_0016 DataVersion: 1413324060 - [1654691068.446726][4655:4660] CHIP:TOO: NumberOfHolidaySchedulesSupported: 10 - disabled: true - - - label: - "TH sends Set Holiday Schedule Command to DUT with the following - values: HolidayIndex as 1 LocalStartTime as 20 Seconds LocalEndTime as - 30 Seconds OperatingMode as 0" + command: "readAttribute" + attribute: "NumberOfHolidaySchedulesSupported" + response: + saveAs: NumberOfHolidaySchedulesSupported + constraints: + minValue: 0 + maxValue: 255 + + - label: "Create Holiday schedule with 1 index" PICS: DRLK.S.F0b && DRLK.S.C11.Rsp - verification: | - ./chip-tool doorlock set-holiday-schedule 1 20 30 0 1 1 - Verify " DUT send SUCCESS response." on the TH(Chip-tool) Log: - - [1654691200.905091][4669:4674] CHIP:DMG: StatusIB = - [1654691200.905122][4669:4674] CHIP:DMG: { - [1654691200.905162][4669:4674] CHIP:DMG: status = 0x00 (SUCCESS), - [1654691200.905198][4669:4674] CHIP:DMG: }, - [1654691200.905236][4669:4674] CHIP:DMG: - [1654691200.905266][4669:4674] CHIP:DMG: }, - [1654691200.905301][4669:4674] CHIP:DMG: - [1654691200.905326][4669:4674] CHIP:DMG: }, - [1654691200.905356][4669:4674] CHIP:DMG: - [1654691200.905380][4669:4674] CHIP:DMG: ], - [1654691200.905410][4669:4674] CHIP:DMG: - [1654691200.905434][4669:4674] CHIP:DMG: InteractionModelRevision = 1 - [1654691200.905463][4669:4674] CHIP:DMG: }, - disabled: true - - - label: - "TH sends Get Holiday Schedule Command to DUT with HolidayIndex as 1" + command: "SetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 1 + - name: "localStartTime" + value: 20 + - name: "localEndTime" + value: 30 + - name: "operatingMode" + value: 0 + + - label: "Get Holiday Schedule with HolidayIndex as 1" PICS: DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx - verification: | - ./chip-tool doorlock get-holiday-schedule 1 1 1 - Verify " DUT responds with Get Holiday Schedule Response" on the TH(Chip-tool) Log: - - [1654691299.545647][4678:4683] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1654691299.545701][4678:4683] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0012 - [1654691299.545769][4678:4683] CHIP:TOO: GetHolidayScheduleResponse: { - [1654691299.545807][4678:4683] CHIP:TOO: holidayIndex: 1 - [1654691299.545830][4678:4683] CHIP:TOO: status: 0 - [1654691299.545853][4678:4683] CHIP:TOO: localStartTime: 20 - [1654691299.545876][4678:4683] CHIP:TOO: localEndTime: 30 - [1654691299.545898][4678:4683] CHIP:TOO: operatingMode: 0 - [1654691299.545922][4678:4683] CHIP:TOO: } - disabled: true - - - label: - "TH sends Set Holiday Schedule Command to DUT with the following - values: HolidayIndex as 1 LocalStartTime as 20 LocalEndTime as 30 - OperatingMode as 5(Invalid value)" + command: "GetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 1 + response: + values: + - name: "holidayIndex" + value: 1 + - name: "status" + value: 0x0 + - name: "localStartTime" + value: 20 + - name: "localEndTime" + value: 30 + constraints: + minValue: 21 + - name: "operatingMode" + value: 0 + + - label: "Create Holiday schedule with invalid operating mode" PICS: DRLK.S.C11.Rsp - verification: | - ./chip-tool doorlock set-holiday-schedule 1 20 30 5 1 1 - Verify " DUT sends INVALID_COMMAND response" on the TH(Chip-tool) Log: - - [1655373066.616542][2571:2576] CHIP:DMG: { - [1655373066.616583][2571:2576] CHIP:DMG: suppressResponse = false, - [1655373066.616624][2571:2576] CHIP:DMG: InvokeResponseIBs = - [1655373066.616692][2571:2576] CHIP:DMG: [ - [1655373066.616732][2571:2576] CHIP:DMG: InvokeResponseIB = - [1655373066.616799][2571:2576] CHIP:DMG: { - [1655373066.616854][2571:2576] CHIP:DMG: CommandStatusIB = - [1655373066.616913][2571:2576] CHIP:DMG: { - [1655373066.616981][2571:2576] CHIP:DMG: CommandPathIB = - [1655373066.617046][2571:2576] CHIP:DMG: { - [1655373066.617118][2571:2576] CHIP:DMG: EndpointId = 0x1, - [1655373066.617200][2571:2576] CHIP:DMG: ClusterId = 0x101, - [1655373066.617264][2571:2576] CHIP:DMG: CommandId = 0x11, - [1655373066.617338][2571:2576] CHIP:DMG: }, - [1655373066.617412][2571:2576] CHIP:DMG: - [1655373066.617463][2571:2576] CHIP:DMG: StatusIB = - [1655373066.617538][2571:2576] CHIP:DMG: { - [1655373066.617612][2571:2576] CHIP:DMG: status = 0x85 (INVALID_COMMAND), - [1655373066.617672][2571:2576] CHIP:DMG: }, - [1655373066.617745][2571:2576] CHIP:DMG: - [1655373066.617806][2571:2576] CHIP:DMG: }, - [1655373066.617863][2571:2576] CHIP:DMG: - [1655373066.617921][2571:2576] CHIP:DMG: }, - [1655373066.617970][2571:2576] CHIP:DMG: - [1655373066.618024][2571:2576] CHIP:DMG: ], - [1655373066.618073][2571:2576] CHIP:DMG: - [1655373066.618127][2571:2576] CHIP:DMG: InteractionModelRevision = 1 - [1655373066.618166][2571:2576] CHIP:DMG: }, - disabled: true - - - label: - "TH sends Get Holiday Schedule Command to DUT with Invalid - HolidayIndex as 15." + command: "SetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 1 + - name: "localStartTime" + value: 20 + - name: "localEndTime" + value: 30 + - name: "operatingMode" + value: 5 + response: + error: INVALID_COMMAND + + - label: "Get Holiday Schedule with Invalid HolidayIndex 15." PICS: DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx - verification: | - ./chip-tool doorlock get-holiday-schedule 15 1 1 - Verify " DUT sends INVALID_COMMAND response" on the TH(Chip-tool) Log: - - [1654691634.513667][4728:4733] CHIP:DMG: }, - [1654691634.513979][4728:4733] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1654691634.514168][4728:4733] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0012 - [1658471936.478043][2537:2542] CHIP:DMG: }, - [1658471936.478124][2537:2542] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1658471936.478183][2537:2542] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0012 - [1658471936.478270][2537:2542] CHIP:TOO: GetHolidayScheduleResponse: { - [1658471936.478316][2537:2542] CHIP:TOO: holidayIndex: 15 - [1658471936.478363][2537:2542] CHIP:TOO: status: 133 - [1658471936.478395][2537:2542] CHIP:TOO: } - [1654691634.514670][4728:4733] CHIP:TOO: } - disabled: true - - - label: - "TH sends Get Holiday Schedule Command to DUT with the HolidayIndex as - 10 (value is in the the range of step 1 but Holiday Schedule entry not - available)" + command: "GetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 15 + response: + values: + - name: "holidayIndex" + value: 15 + - name: "status" + value: 133 + + - label: "Get Holiday Schedule with the Non-scheduled HolidayIndex" PICS: DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx - verification: | - ./chip-tool doorlock get-holiday-schedule 10 1 1 - Verify " DUT sends a NOT_FOUND status" on the TH(Chip-tool) Log: - - [1654691928.900652][4772:4777] CHIP:DMG: }, - [1654691928.900762][4772:4777] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1654691928.900844][4772:4777] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0012 - [1654691928.900944][4772:4777] CHIP:TOO: GetHolidayScheduleResponse: { - [1654691928.901003][4772:4777] CHIP:TOO: holidayIndex: 10 - [1654691928.901047][4772:4777] CHIP:TOO: status: 139 - [1654691928.901093][4772:4777] CHIP:TOO: } - disabled: true - - - label: - "TH send Clear Holiday Schedule Command to DUT with HolidayIndex as 1" + command: "GetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 10 + response: + values: + - name: "holidayIndex" + value: 10 + - name: "status" + value: 139 + + - label: "Clear Holiday schedule with 1 index" PICS: DRLK.S.F0b && DRLK.S.C13.Rsp - verification: | - ./chip-tool doorlock clear-holiday-schedule 1 1 1 - Verify " DUT sends SUCCESS response" on the TH(Chip-tool) Log: - - [1654692125.827938][4791:4796] CHIP:DMG: StatusIB = - [1654692125.828009][4791:4796] CHIP:DMG: { - [1654692125.828080][4791:4796] CHIP:DMG: status = 0x00 (SUCCESS), - [1654692125.828156][4791:4796] CHIP:DMG: }, - [1654692125.828233][4791:4796] CHIP:DMG: - [1654692125.828296][4791:4796] CHIP:DMG: }, - [1654692125.828367][4791:4796] CHIP:DMG: - [1654692125.828424][4791:4796] CHIP:DMG: }, - [1654692125.828488][4791:4796] CHIP:DMG: - [1654692125.828538][4791:4796] CHIP:DMG: ], - [1654692125.828601][4791:4796] CHIP:DMG: - [1654692125.828652][4791:4796] CHIP:DMG: InteractionModelRevision = 1 - [1654692125.828701][4791:4796] CHIP:DMG: }, - disabled: true + command: "ClearHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 1 - - label: - "TH sends Get Holiday Schedule Command to DUT with HolidayIndex as 1." + - label: "Make sure that holiday schedule was deleted" PICS: DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx - verification: | - ./chip-tool doorlock get-holiday-schedule 1 1 1 - Verify " DUT sends a NOT_FOUND status" on the TH(Chip-tool) Log: - - [1658472025.923305][2560:2565] CHIP:DMG: }, - [1658472025.923366][2560:2565] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1658472025.923417][2560:2565] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0012 - [1658472025.923491][2560:2565] CHIP:TOO: GetHolidayScheduleResponse: { - [1658472025.923528][2560:2565] CHIP:TOO: holidayIndex: 1 - [1658472025.923565][2560:2565] CHIP:TOO: status: 139 - [1658472025.923590][2560:2565] CHIP:TOO: } - disabled: true + command: "GetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 1 + response: + values: + - name: "holidayIndex" + value: 1 + - name: "status" + value: 139 + + - label: "Cleanup the created user" + command: "ClearUser" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "userIndex" + value: 1 diff --git a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml index 3ad64bad5263c0..ade30fa0aa5996 100644 --- a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml @@ -20,62 +20,32 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Wake on LAN" + endpoint: 1 tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "TH reads the MACAddress attribute from the DUT" PICS: WAKEONLAN.S.A0000 - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool wakeonlan read macaddress 1 1 - ./chip-tv-casting-app wakeonlan read macaddress 1 1 - - On TH Verify that the response contains a 48-bit MAC Address. Record the MAC address. - [1654248817.394846][3637:3643] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0503 Attribute 0x0000_0000 DataVersion: 3900236652 - [1654248817.394895][3637:3643] CHIP:TOO: MACAddress: e4:5f:01:69:61:b1 - [1654248817.394982][3637:3643] CHIP:EM: Sending Standalone Ack for MessageCounter:15292555 on exchange 12123i - disabled: true + command: "readAttribute" + attribute: "MACAddress" + response: + constraints: + minLength: 12 - label: "TH sends a Sleep command to DUT" PICS: LOWPOWER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool lowpower sleep 1 1 - ./chip-tv-casting-app lowpower sleep 1 1 - - On TH verify the success response received from DUT - [1646101689.826629][3009:3014] CHIP:DMG: InvokeResponseMessage = - [1646101689.826665][3009:3014] CHIP:DMG: { - [1646101689.826697][3009:3014] CHIP:DMG: suppressResponse = false, - [1646101689.826727][3009:3014] CHIP:DMG: InvokeResponseIBs = - [1646101689.826769][3009:3014] CHIP:DMG: [ - [1646101689.826804][3009:3014] CHIP:DMG: InvokeResponseIB = - [1646101689.826848][3009:3014] CHIP:DMG: { - [1646101689.826882][3009:3014] CHIP:DMG: CommandStatusIB = - [1646101689.826922][3009:3014] CHIP:DMG: { - [1646101689.826954][3009:3014] CHIP:DMG: CommandPathIB = - [1646101689.826989][3009:3014] CHIP:DMG: { - [1646101689.827031][3009:3014] CHIP:DMG: EndpointId = 0x1, - [1646101689.827082][3009:3014] CHIP:DMG: ClusterId = 0x508, - [1646101689.827127][3009:3014] CHIP:DMG: CommandId = 0x0, - [1646101689.827172][3009:3014] CHIP:DMG: }, - [1646101689.827223][3009:3014] CHIP:DMG: - [1646101689.827260][3009:3014] CHIP:DMG: StatusIB = - [1646101689.827311][3009:3014] CHIP:DMG: { - [1646101689.827360][3009:3014] CHIP:DMG: status = 0x0, - [1646101689.827411][3009:3014] CHIP:DMG: }, - [1646101689.827457][3009:3014] CHIP:DMG: - [1646101689.827498][3009:3014] CHIP:DMG: }, - [1646101689.827540][3009:3014] CHIP:DMG: - [1646101689.827607][3009:3014] CHIP:DMG: }, - [1646101689.827658][3009:3014] CHIP:DMG: - [1646101689.827689][3009:3014] CHIP:DMG: ], - [1646101689.827730][3009:3014] CHIP:DMG: - [1646101689.827761][3009:3014] CHIP:DMG: InteractionModelRevision = 1 - [1646101689.827792][3009:3014] CHIP:DMG: }, - [1646101689.827875][3009:3014] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0508 Command=0x0000_0000 Status=0x0 - disabled: true + cluster: "Low Power" + command: "Sleep" + response: + error: 0 - label: "TH sends a Wake-On LAN magic packet containing the MAC address from @@ -90,4 +60,12 @@ tests: [1654248854.491994][3652:3657] CHIP:TOO: AcceptedCommandList: 1 entries [1654248854.492040][3652:3657] CHIP:TOO: [1]: 0 [1654248854.492157][3652:3657] CHIP:EM: Sending Standalone Ack for MessageCounter:15063522 on exchange 51389i - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' after 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 f7ea6ee0e55372..5c616c535dd52d 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1033,8 +1033,8 @@ DGTHREAD.S.A0036=1 DGTHREAD.S.A0037=1 DGTHREAD.S.A0038=1 DGTHREAD.S.A0039=1 -DGTHREAD.S.A003A=1 -DGTHREAD.S.A003B=1 +DGTHREAD.S.A003a=1 +DGTHREAD.S.A003b=1 DGTHREAD.S.A003c=1 DGTHREAD.S.A003d=1 DGTHREAD.S.A003e=1 @@ -1358,6 +1358,11 @@ CNET.S.A0005=1 CNET.S.A0006=1 CNET.S.A0007=1 +#Features +CNET.S.F00=0 +CNET.S.F01=0 +CNET.S.F02=1 + #Server Commands CNET.S.C00.Rsp=1 CNET.S.C01.Tx=1 @@ -1573,26 +1578,26 @@ MCORE.SC.ADV=1 #Bridged Device Basic Information #server -BRBINFO.S.A0000=1 -BRBINFO.S.A0001=1 -BRBINFO.S.A0002=1 -BRBINFO.S.A0003=1 -BRBINFO.S.A0004=1 +BRBINFO.S.A0000=0 +BRBINFO.S.A0001=0 +BRBINFO.S.A0002=0 +BRBINFO.S.A0003=0 +BRBINFO.S.A0004=0 BRBINFO.S.A0005=1 -BRBINFO.S.A0006=1 -BRBINFO.S.A0007=1 -BRBINFO.S.A0008=1 -BRBINFO.S.A0009=1 -BRBINFO.S.A000a=1 -BRBINFO.S.A000b=1 -BRBINFO.S.A000c=1 -BRBINFO.S.A000d=1 -BRBINFO.S.A000e=1 -BRBINFO.S.A000f=1 -BRBINFO.S.A0010=1 +BRBINFO.S.A0006=0 +BRBINFO.S.A0007=0 +BRBINFO.S.A0008=0 +BRBINFO.S.A0009=0 +BRBINFO.S.A000a=0 +BRBINFO.S.A000b=0 +BRBINFO.S.A000c=0 +BRBINFO.S.A000d=0 +BRBINFO.S.A000e=0 +BRBINFO.S.A000f=0 +BRBINFO.S.A0010=0 BRBINFO.S.A0011=1 -BRBINFO.S.A0012=1 -BRBINFO.S.A0013=1 +BRBINFO.S.A0012=0 +BRBINFO.S.A0013=0 #Events BRBINFO.S.E00=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 58a3bd5145cb3c..8e02636bd76894 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -3,10 +3,15 @@ "TestAccessControlCluster", "Test_TC_ACL_1_1", "Test_TC_ACL_2_1", - "Test_TC_ACL_2_2" + "Test_TC_ACL_2_2", + "Test_TC_ACL_2_3" ], "BooleanState": ["Test_TC_BOOL_1_1", "Test_TC_BOOL_2_1"], "Binding": ["Test_TC_BIND_1_1"], + "BridgedDeviceBasicInformation": [ + "Test_TC_BRBINFO_1_1", + "Test_TC_BRBINFO_2_1" + ], "Actions": ["Test_TC_ACT_1_1"], "ColorControl": [ "Test_TC_CC_1_1", @@ -90,6 +95,7 @@ "Test_TC_APBSC_1_10", "Test_TC_CONTENTLAUNCHER_1_11", "Test_TC_ALOGIN_1_12", + "Test_TC_ALOGIN_12_1", "Test_TC_LOWPOWER_2_1", "Test_TC_KEYPADINPUT_3_2", "Test_TC_KEYPADINPUT_3_3", @@ -102,6 +108,7 @@ "Test_TC_MEDIAINPUT_3_11", "Test_TC_MEDIAINPUT_3_12", "Test_TC_MEDIAINPUT_3_13", + "Test_TC_WAKEONLAN_4_1", "Test_TC_CHANNEL_5_1", "Test_TC_CHANNEL_5_2", "Test_TC_CHANNEL_5_3", @@ -240,6 +247,7 @@ "Test_TC_DRLK_2_3", "Test_TC_DRLK_2_4", "Test_TC_DRLK_2_5", + "Test_TC_DRLK_2_6", "Test_TC_DRLK_2_7", "Test_TC_DRLK_2_9" ], @@ -253,6 +261,7 @@ "collection": [ "AccessControl", "BooleanState", + "BridgedDeviceBasicInformation", "Actions", "Binding", "ColorControl", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index fb755f1f72b12e..1835bb8cf21eac 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -137,7 +137,6 @@ "Test_TC_MEDIAINPUT_3_15", "Test_TC_MEDIAINPUT_3_16", "Test_TC_MEDIAINPUT_3_17", - "Test_TC_WAKEONLAN_4_1", "Test_TC_CHANNEL_5_4", "Test_TC_CHANNEL_5_5", "Test_TC_CHANNEL_5_6", @@ -152,7 +151,6 @@ "Test_TC_CONTENTLAUNCHER_10_7", "Test_TC_MC_11_1", "Test_TC_MC_11_2", - "Test_TC_ALOGIN_12_1", "Test_TC_ALOGIN_12_2" ], "MultipleFabrics": [ @@ -277,7 +275,6 @@ ], "DoorLock": [ "Test_TC_DRLK_2_1", - "Test_TC_DRLK_2_6", "Test_TC_DRLK_2_8", "Test_TC_DRLK_2_10", "Test_TC_DRLK_3_1", @@ -327,7 +324,6 @@ ], "PumpConfigurationControl": ["Test_TC_PCC_3_1"], "AccessControl": [ - "Test_TC_ACL_2_3", "Test_TC_ACL_2_4", "Test_TC_ACL_2_5", "Test_TC_ACL_2_6", @@ -338,8 +334,6 @@ ], "UserLabel": ["Test_TC_ULABEL_3_1"], "BridgedDeviceBasicInformation": [ - "Test_TC_BRBINFO_1_1", - "Test_TC_BRBINFO_2_1", "Test_TC_BRBINFO_2_2", "Test_TC_BRBINFO_2_3" ], diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 796a968a9bbed7..c3d4aa04ac2527 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -39,8 +39,11 @@ class TestList : public Command 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_BOOL_1_1\n"); printf("Test_TC_BOOL_2_1\n"); + printf("Test_TC_BRBINFO_1_1\n"); + printf("Test_TC_BRBINFO_2_1\n"); printf("Test_TC_ACT_1_1\n"); printf("Test_TC_BIND_1_1\n"); printf("Test_TC_CC_1_1\n"); @@ -108,6 +111,7 @@ class TestList : public Command printf("Test_TC_APBSC_1_10\n"); printf("Test_TC_CONTENTLAUNCHER_1_11\n"); printf("Test_TC_ALOGIN_1_12\n"); + printf("Test_TC_ALOGIN_12_1\n"); printf("Test_TC_LOWPOWER_2_1\n"); printf("Test_TC_KEYPADINPUT_3_2\n"); printf("Test_TC_KEYPADINPUT_3_3\n"); @@ -120,6 +124,7 @@ class TestList : public Command printf("Test_TC_MEDIAINPUT_3_11\n"); printf("Test_TC_MEDIAINPUT_3_12\n"); printf("Test_TC_MEDIAINPUT_3_13\n"); + printf("Test_TC_WAKEONLAN_4_1\n"); printf("Test_TC_CHANNEL_5_1\n"); printf("Test_TC_CHANNEL_5_2\n"); printf("Test_TC_CHANNEL_5_3\n"); @@ -244,6 +249,7 @@ class TestList : public Command printf("Test_TC_DRLK_2_3\n"); printf("Test_TC_DRLK_2_4\n"); printf("Test_TC_DRLK_2_5\n"); + printf("Test_TC_DRLK_2_6\n"); printf("Test_TC_DRLK_2_7\n"); printf("Test_TC_DRLK_2_9\n"); printf("TestGroupMessaging\n"); @@ -390,7 +396,6 @@ class ManualTestList : public Command printf("Test_TC_MEDIAINPUT_3_15\n"); printf("Test_TC_MEDIAINPUT_3_16\n"); printf("Test_TC_MEDIAINPUT_3_17\n"); - printf("Test_TC_WAKEONLAN_4_1\n"); printf("Test_TC_CHANNEL_5_4\n"); printf("Test_TC_CHANNEL_5_5\n"); printf("Test_TC_CHANNEL_5_6\n"); @@ -405,7 +410,6 @@ class ManualTestList : public Command printf("Test_TC_CONTENTLAUNCHER_10_7\n"); printf("Test_TC_MC_11_1\n"); printf("Test_TC_MC_11_2\n"); - printf("Test_TC_ALOGIN_12_1\n"); printf("Test_TC_ALOGIN_12_2\n"); printf("Test_TC_CADMIN_1_1\n"); printf("Test_TC_CADMIN_1_2\n"); @@ -517,7 +521,6 @@ class ManualTestList : public Command printf("Test_TC_CC_9_2\n"); printf("Test_TC_CC_9_3\n"); printf("Test_TC_DRLK_2_1\n"); - printf("Test_TC_DRLK_2_6\n"); printf("Test_TC_DRLK_2_8\n"); printf("Test_TC_DRLK_2_10\n"); printf("Test_TC_DRLK_3_1\n"); @@ -567,7 +570,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_2_3\n"); printf("Test_TC_ACL_2_4\n"); printf("Test_TC_ACL_2_5\n"); printf("Test_TC_ACL_2_6\n"); @@ -576,8 +578,6 @@ class ManualTestList : public Command printf("Test_TC_ACL_2_9\n"); printf("Test_TC_ACL_2_10\n"); printf("Test_TC_ULABEL_3_1\n"); - printf("Test_TC_BRBINFO_1_1\n"); - printf("Test_TC_BRBINFO_2_1\n"); printf("Test_TC_BRBINFO_2_2\n"); printf("Test_TC_BRBINFO_2_3\n"); printf("Test_TC_ACE_1_1\n"); @@ -2264,18 +2264,28 @@ class Test_TC_ACL_2_2Suite : public TestCommand } }; -class Test_TC_BOOL_1_1Suite : public TestCommand +class Test_TC_ACL_2_3Suite : public TestCommand { public: - Test_TC_BOOL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_1_1", 6, credsIssuerConfig) + Test_TC_ACL_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_3", 20, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("D_OK_EMPTY", &mDOkEmpty); + AddArgument("D_OK_SINGLE", &mDOkSingle); + AddArgument("D_OK_FULL", &mDOkFull); + AddArgument("D_BAD_LENGTH", &mDBadLength); + AddArgument("D_BAD_STRUCT", &mDBadStruct); + AddArgument("D_BAD_LIST", &mDBadList); + AddArgument("D_BAD_ELEM", &mDBadElem); + AddArgument("D_BAD_OVERFLOW", &mDBadOverflow); + AddArgument("D_BAD_UNDERFLOW", &mDBadUnderflow); + AddArgument("D_BAD_NONE", &mDBadNone); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BOOL_1_1Suite() {} + ~Test_TC_ACL_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -2286,8 +2296,20 @@ class Test_TC_BOOL_1_1Suite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mDOkEmpty; + chip::Optional mDOkSingle; + chip::Optional mDOkFull; + chip::Optional mDBadLength; + chip::Optional mDBadStruct; + chip::Optional mDBadList; + chip::Optional mDBadElem; + chip::Optional mDBadOverflow; + chip::Optional mDBadUnderflow; + chip::Optional mDBadNone; chip::Optional mTimeout; + uint8_t CurrentFabricIndex; + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } // @@ -2307,57 +2329,154 @@ class Test_TC_BOOL_1_1Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); - VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + CurrentFabricIndex = value; } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint32_t value; + chip::app::DataModel::DecodableList + value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("featureMap", value, 0UL)); - VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 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)); { - chip::app::DataModel::DecodableList value; + 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)); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } } break; - case 4: + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: 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(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64" + "\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65" + "\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63" + "\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); } - VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 5: + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: 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("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkFull.HasValue() + ? mDOkFull.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54" + "\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74" + "\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67" + "\x00\xD0\x00\x00\xF1\xFF\x02\x00\x31\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54" + "\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74" + "\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x00\x18"), + 128))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + 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))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + 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))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 0)); } - VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; default: @@ -2383,39 +2502,382 @@ 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, - true, chip::NullOptional); + LogStep(1, "TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::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, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::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); + LogStep(3, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct: Data field: D_OK_EMPTY : 1718"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, 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, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::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, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_SINGLE " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_FULL " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656" + "C656D656E7420616761696E2E2E2E2E2E0018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDOkFull.HasValue() + ? mDOkFull.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20" + "\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65" + "\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72" + "\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x31\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C" + "\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C" + "\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x00\x18"), + 128); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_LENGTH " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656" + "C656D656E7420616761696E2E2E2E2E2E2E0018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadLength.HasValue() + ? mDBadLength.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20" + "\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65" + "\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72" + "\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x32\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C" + "\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C" + "\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x2E\x00\x18"), + 129); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_STRUCT : 1518"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDBadStruct.HasValue() ? mDBadStruct.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x15\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 11: { + LogStep(11, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_LIST " + ":3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672" + "0617320612063686172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadList.HasValue() + ? mDBadList.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x37\x01\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69" + "\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 72); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_ELEM " + ":17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206173206120636" + "86172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadElem.HasValue() + ? mDBadElem.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\x10\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69" + "\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 65); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_OVERFLOW : " + "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061" + "7320612063686172737472696E670018FF"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadOverflow.HasValue() + ? mDBadOverflow.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18\xFF"), + 72); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_UNDERFLOW " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E6700"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadUnderflow.HasValue() + ? mDBadUnderflow.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00"), + 70); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_BAD_NONE"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDBadNone.HasValue() ? mDBadNone.Value() : chip::ByteSpan(chip::Uint8::from_const_char(""), 0); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep( + 16, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 2 elements . value is list of AccessControlExtensionStruct containing 2 " + "elements . first element contains Data field: D_OK_EMPTY 1718 . second element contains Data field: D_OK_SINGLE " + "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320" + "612063686172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 17: { + LogStep(17, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is an empty list"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 19: { + LogStep(19, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); } } return CHIP_NO_ERROR; } }; -class Test_TC_BOOL_2_1Suite : public TestCommand +class Test_TC_BOOL_1_1Suite : public TestCommand { public: - Test_TC_BOOL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_2_1", 2, 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); @@ -2423,7 +2885,155 @@ class Test_TC_BOOL_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BOOL_2_1Suite() {} + ~Test_TC_BOOL_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, "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 { @@ -2493,6 +3103,1281 @@ class Test_TC_BOOL_2_1Suite : public TestCommand } }; +class Test_TC_BRBINFO_1_1Suite : public TestCommand +{ +public: + Test_TC_BRBINFO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BRBINFO_1_1", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BRBINFO_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, 17UL)); + 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, 1UL)); + } + 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, 2UL)); + } + 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, 3UL)); + } + 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, 5UL)); + } + 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, 7UL)); + } + 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, 8UL)); + } + 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, 9UL)); + } + 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, 10UL)); + } + 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, 11UL)); + } + 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, 12UL)); + } + 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, 13UL)); + } + 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, 14UL)); + } + 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, 15UL)); + } + 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, 18UL)); + } + 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))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + 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))); + { + 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(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads AttributeList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads optional attribute(VendorName) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads optional attribute(VendorID) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads optional attribute(ProductName) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads optional attribute(NodeLabel) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads optional attribute(HardwareVersion) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads optional attribute(HardwareVersionString) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads optional attribute(SoftwareVersion) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads optional attribute(SoftwareVersionString) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "TH reads optional attribute(ManufacturingDate) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "TH reads optional attribute(PartNumber) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "TH reads optional attribute(ProductURL) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads optional attribute(ProductLabel) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "TH reads optional attribute(SerialNumber) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "TH reads optional attribute(UniqueID) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "TH1 reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "TH1 reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BRBINFO_2_1Suite : public TestCommand +{ +public: + Test_TC_BRBINFO_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BRBINFO_2_1", 50, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BRBINFO_2_1Suite() + { + if (VendorNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(VendorNameValueBuffer); + VendorNameValueBuffer = nullptr; + } + if (ProductNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductNameValueBuffer); + ProductNameValueBuffer = nullptr; + } + if (NodeLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(NodeLabelValueBuffer); + NodeLabelValueBuffer = nullptr; + } + if (HardwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(HardwareVersionStringValueBuffer); + HardwareVersionStringValueBuffer = nullptr; + } + if (SoftwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SoftwareVersionStringValueBuffer); + SoftwareVersionStringValueBuffer = nullptr; + } + if (ManufacturingDateValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ManufacturingDateValueBuffer); + ManufacturingDateValueBuffer = nullptr; + } + if (PartNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(PartNumberValueBuffer); + PartNumberValueBuffer = nullptr; + } + if (ProductURLValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductURLValueBuffer); + ProductURLValueBuffer = nullptr; + } + if (ProductLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductLabelValueBuffer); + ProductLabelValueBuffer = nullptr; + } + if (SerialNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SerialNumberValueBuffer); + SerialNumberValueBuffer = nullptr; + } + if (UniqueIDValueBuffer != nullptr) + { + chip::Platform::MemoryFree(UniqueIDValueBuffer); + UniqueIDValueBuffer = nullptr; + } + } + + 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; + + char * VendorNameValueBuffer = nullptr; + chip::CharSpan VendorNameValue; + chip::VendorId VendorIDValue; + char * ProductNameValueBuffer = nullptr; + chip::CharSpan ProductNameValue; + char * NodeLabelValueBuffer = nullptr; + chip::CharSpan NodeLabelValue; + uint16_t HardwareVersionValue; + char * HardwareVersionStringValueBuffer = nullptr; + chip::CharSpan HardwareVersionStringValue; + uint32_t SoftwareVersionValue; + char * SoftwareVersionStringValueBuffer = nullptr; + chip::CharSpan SoftwareVersionStringValue; + char * ManufacturingDateValueBuffer = nullptr; + chip::CharSpan ManufacturingDateValue; + char * PartNumberValueBuffer = nullptr; + chip::CharSpan PartNumberValue; + char * ProductURLValueBuffer = nullptr; + chip::CharSpan ProductURLValue; + char * ProductLabelValueBuffer = nullptr; + chip::CharSpan ProductLabelValue; + char * SerialNumberValueBuffer = nullptr; + chip::CharSpan SerialNumberValue; + char * UniqueIDValueBuffer = nullptr; + chip::CharSpan UniqueIDValue; + + 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::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (VendorNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(VendorNameValueBuffer); + } + VendorNameValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(VendorNameValueBuffer, value.data(), value.size()); + VendorNameValue = chip::CharSpan(VendorNameValueBuffer, value.size()); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("vendorName", value, VendorNameValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "vendor_id", "vendor_id")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65521U)); + VendorIDValue = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorID", value, VendorIDValue)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (ProductNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductNameValueBuffer); + } + ProductNameValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductNameValueBuffer, value.data(), value.size()); + ProductNameValue = chip::CharSpan(ProductNameValueBuffer, value.size()); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productName", value, ProductNameValue)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (NodeLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(NodeLabelValueBuffer); + } + NodeLabelValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(NodeLabelValueBuffer, value.data(), value.size()); + NodeLabelValue = chip::CharSpan(NodeLabelValueBuffer, value.size()); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + 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, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + HardwareVersionValue = value; + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hardwareVersion", value, HardwareVersionValue)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMinLength("value", value, 1)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 64)); + if (HardwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(HardwareVersionStringValueBuffer); + } + HardwareVersionStringValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(HardwareVersionStringValueBuffer, value.data(), value.size()); + HardwareVersionStringValue = chip::CharSpan(HardwareVersionStringValueBuffer, value.size()); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("hardwareVersionString", value, HardwareVersionStringValue)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967294UL)); + SoftwareVersionValue = value; + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("softwareVersion", value, SoftwareVersionValue)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value, 1)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 64)); + if (SoftwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SoftwareVersionStringValueBuffer); + } + SoftwareVersionStringValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(SoftwareVersionStringValueBuffer, value.data(), value.size()); + SoftwareVersionStringValue = chip::CharSpan(SoftwareVersionStringValueBuffer, value.size()); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("softwareVersionString", value, SoftwareVersionStringValue)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMinLength("value", value, 8)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 16)); + if (ManufacturingDateValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ManufacturingDateValueBuffer); + } + ManufacturingDateValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ManufacturingDateValueBuffer, value.data(), value.size()); + ManufacturingDateValue = chip::CharSpan(ManufacturingDateValueBuffer, value.size()); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("manufacturingDate", value, ManufacturingDateValue)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (PartNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(PartNumberValueBuffer); + } + PartNumberValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(PartNumberValueBuffer, value.data(), value.size()); + PartNumberValue = chip::CharSpan(PartNumberValueBuffer, value.size()); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("partNumber", value, PartNumberValue)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "long_char_string", "long_char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 256)); + if (ProductURLValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductURLValueBuffer); + } + ProductURLValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductURLValueBuffer, value.data(), value.size()); + ProductURLValue = chip::CharSpan(ProductURLValueBuffer, value.size()); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productURL", value, ProductURLValue)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 64)); + if (ProductLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductLabelValueBuffer); + } + ProductLabelValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductLabelValueBuffer, value.data(), value.size()); + ProductLabelValue = chip::CharSpan(ProductLabelValueBuffer, value.size()); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productLabel", value, ProductLabelValue)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (SerialNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SerialNumberValueBuffer); + } + SerialNumberValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(SerialNumberValueBuffer, value.data(), value.size()); + SerialNumberValue = chip::CharSpan(SerialNumberValueBuffer, value.size()); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("serialNumber", value, SerialNumberValue)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("reachable", value, true)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("reachable", value, true)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (UniqueIDValueBuffer != nullptr) + { + chip::Platform::MemoryFree(UniqueIDValueBuffer); + } + UniqueIDValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(UniqueIDValueBuffer, value.data(), value.size()); + UniqueIDValue = chip::CharSpan(UniqueIDValueBuffer, value.size()); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("uniqueID", value, UniqueIDValue)); + } + 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 VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorName::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH writes VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("samplegarbage: not in length on purpose", 6); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorName::Id, value, chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorName::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorID::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Verify that VendorID matches the value assigned to this manufacturer"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BRBINFO.S.A0002"), 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 6: { + LogStep(6, "TH writes VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::VendorId value; + value = static_cast(17); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorID::Id, value, chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorID::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads ProductName from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductName::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH writes ProductName from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newproductgarbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductName::Id, value, chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads ProductName from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductName::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads NodeLabel from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::NodeLabel::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "TH writes NodeLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0005 && 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' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "TH reads NodeLabel from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0005 && 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' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "TH reads HardwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersion::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH writes HardwareVersion from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 17713U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersion::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 16: { + LogStep(16, "TH reads HardwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersion::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "TH reads HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersionString::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "TH writes HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newhardwareversiongarbage: not in length on purpose", 18); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersionString::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 19: { + LogStep(19, "TH reads HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersionString::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "TH reads SoftwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersion::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "TH writes SoftwareVersion from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint32_t value; + value = 33299UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersion::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 22: { + LogStep(22, "TH reads SoftwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersion::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "TH reads SoftwareVersionString from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersionString::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "TH writes SoftwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("1.0garbage: not in length on purpose", 3); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersionString::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 25: { + LogStep(25, "TH reads SoftwareVersionString from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersionString::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "TH reads ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ManufacturingDate::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Verify if the first 8 characters specify date according to ISO 8601, i.e, YYYYMMDD."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BRBINFO.S.A000b"), 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 28: { + LogStep(28, "TH writes ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("20210814789452INgarbage: not in length on purpose", 16); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ManufacturingDate::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 29: { + LogStep(29, "TH reads ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ManufacturingDate::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "TH reads PartNumber from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::PartNumber::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, "TH writes PartNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newpartgarbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::PartNumber::Id, value, chip::NullOptional, chip::NullOptional); + } + case 32: { + LogStep(32, "TH reads PartNumber from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::PartNumber::Id, true, chip::NullOptional); + } + case 33: { + LogStep(33, "TH reads ProductURL from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductURL::Id, true, chip::NullOptional); + } + case 34: { + LogStep(34, + "Verify that it specifies a link to a specific web page, Verify that it follows the syntax rules specified in " + "RFC 3986."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BRBINFO.S.A000d"), 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 35: { + LogStep(35, "TH writes ProductURL from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("https://www.example.comgarbage: not in length on purpose", 23); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductURL::Id, value, chip::NullOptional, chip::NullOptional); + } + case 36: { + LogStep(36, "TH reads ProductURL from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductURL::Id, true, chip::NullOptional); + } + case 37: { + LogStep(37, "TH reads ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductLabel::Id, true, chip::NullOptional); + } + case 38: { + LogStep(38, "Verify that it does not include the name of the vendor as defined within the VendorName attribute"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BRBINFO.S.A000e"), 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 39: { + LogStep(39, "TH writes ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newproductlabelgarbage: not in length on purpose", 15); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductLabel::Id, value, chip::NullOptional, chip::NullOptional); + } + case 40: { + LogStep(40, "TH reads ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductLabel::Id, true, chip::NullOptional); + } + case 41: { + LogStep(41, "TH reads SerialNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SerialNumber::Id, true, chip::NullOptional); + } + case 42: { + LogStep(42, "TH writes SerialNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newserialnumbergarbage: not in length on purpose", 15); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SerialNumber::Id, value, chip::NullOptional, chip::NullOptional); + } + case 43: { + LogStep(43, "TH reads SerialNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SerialNumber::Id, true, chip::NullOptional); + } + case 44: { + LogStep(44, "TH reads Reachable from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::Reachable::Id, true, chip::NullOptional); + } + case 45: { + LogStep(45, "TH sends Write request message to DUT to change value of Reachable to false"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::Reachable::Id, value, chip::NullOptional, chip::NullOptional); + } + case 46: { + LogStep(46, "TH reads Reachable from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::Reachable::Id, true, chip::NullOptional); + } + case 47: { + LogStep(47, "TH reads UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::UniqueID::Id, true, chip::NullOptional); + } + case 48: { + LogStep(48, "TH writes UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newidgarbage: not in length on purpose", 5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::UniqueID::Id, value, chip::NullOptional, chip::NullOptional); + } + case 49: { + LogStep(49, "TH reads UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::UniqueID::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_ACT_1_1Suite : public TestCommand { public: @@ -13446,7 +15331,7 @@ class Test_TC_BINFO_2_1Suite : public TestCommand class Test_TC_CNET_1_3Suite : public TestCommand { public: - Test_TC_CNET_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_1_3", 0, credsIssuerConfig) + Test_TC_CNET_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_1_3", 16, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13479,6 +15364,159 @@ class Test_TC_CNET_1_3Suite : 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)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 4UL)); + } + 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, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + 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, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + 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, 2UL)); + } + 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, 3UL)); + } + 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, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + 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, 2UL)); + } + 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, 3UL)); + } + 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("acceptedCommandList", iter_0, 0)); + } + } + 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, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + 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))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -13494,6 +15532,103 @@ class Test_TC_CNET_1_3Suite : 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 global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !CNET.S.F00 && !CNET.S.F01 && !CNET.S.F02 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read the global attribute: FeatureMap when CNET.S.F00 is set"); + VerifyOrDo(!ShouldSkip("CNET.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Read the global attribute: FeatureMap when CNET.S.F01 is set"); + VerifyOrDo(!ShouldSkip("CNET.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: FeatureMap when CNET.S.F02 is set"); + VerifyOrDo(!ShouldSkip("CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read mandatory attributes in AttributeList if CNET.S.F00(WI)/CNET.S.F01(TH)/CNET.S.F02(ET) is true"); + VerifyOrDo(!ShouldSkip("CNET.S.F00 || CNET.S.F01 || CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the optional attribute(ScanMaxTimeSeconds): AttributeList"); + VerifyOrDo(!ShouldSkip("CNET.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Reading optional attribute(ConnectMaxTimeSeconds) in AttributeList"); + VerifyOrDo(!ShouldSkip("CNET.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read AcceptedCommandList If DUT supports Wi-Fi/Thread related features CNET.S.F00(WI),CNET.S.F01(TH)"); + VerifyOrDo(!ShouldSkip("CNET.S.F00 || CNET.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Read AcceptedCommandList If DUT supports Wi-Fi related features (CNET.S.F00(WI) is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Read AcceptedCommandList If DUT supports Thread related features(CNET.S.F01(TH) is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Read AcceptedCommandList If DUT supports Ethernet related features(CNET.S.F02(TH) is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Read the GeneratedCommandList If DUT supports Wi-Fi/Thread related features(CNET.S.F00(WI) or CNET.S.F01(TH) " + "is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F00 || CNET.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the GeneratedCommandList If DUT supports Ethernet related features(CNET.S.F02(ET) must be true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } } return CHIP_NO_ERROR; } @@ -23484,29 +25619,193 @@ class Test_TC_ALOGIN_1_12Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::ClusterRevision::Id, - true, chip::NullOptional); + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, + AccountLogin::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, + AccountLogin::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ALOGIN_12_1Suite : public TestCommand +{ +public: + Test_TC_ALOGIN_12_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ALOGIN_12_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("TempAccountIdentifier", &mTempAccountIdentifier); + AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId); + AddArgument("applicationId", &mApplicationId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ALOGIN_12_1Suite() + { + if (setupPINBuffer != nullptr) + { + chip::Platform::MemoryFree(setupPINBuffer); + setupPINBuffer = nullptr; + } + } + + 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 mTempAccountIdentifier; + chip::Optional mCatalogVendorId; + chip::Optional mApplicationId; + chip::Optional mTimeout; + + char * setupPINBuffer = nullptr; + chip::CharSpan setupPIN; + + 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::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (setupPINBuffer != nullptr) + { + chip::Platform::MemoryFree(setupPINBuffer); + } + setupPINBuffer = static_cast(chip::Platform::MemoryAlloc(value.setupPIN.size())); + memcpy(setupPINBuffer, value.setupPIN.data(), value.setupPIN.size()); + setupPIN = chip::CharSpan(setupPINBuffer, value.setupPIN.size()); + } + 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; + 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, "Launch an app with the provided a application ID"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type value; + + value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.applicationId = + mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); + + value.data.Emplace(); + value.data.Value() = chip::ByteSpan(chip::Uint8::from_const_char("Hello Worldgarbage: not in length on purpose"), 11); + return SendCommand(kIdentityAlpha, GetEndpoint(3), ApplicationLauncher::Id, + ApplicationLauncher::Commands::LaunchApp::Id, value, chip::NullOptional + + ); } case 2: { - LogStep(2, "Read the global attribute: FeatureMap"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::FeatureMap::Id, true, - chip::NullOptional); + LogStep(2, "TH sends a GetSetupPIN command to the DUT with test values provided by the product maker."); + VerifyOrDo(!ShouldSkip("ALOGIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type value; + value.tempAccountIdentifier = + mTempAccountIdentifier.HasValue() ? mTempAccountIdentifier.Value() : chip::Span("1111", 4); + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::GetSetupPIN::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } case 3: { - LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::AttributeList::Id, - true, chip::NullOptional); + LogStep(3, "TH sends a Login command to the DUT with test values provided by the product maker."); + VerifyOrDo(!ShouldSkip("ALOGIN.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::Login::Type value; + value.tempAccountIdentifier = + mTempAccountIdentifier.HasValue() ? mTempAccountIdentifier.Value() : chip::Span("1111", 4); + value.setupPIN = setupPIN; + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::Login::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } case 4: { - LogStep(4, "Read the global attribute: AcceptedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, - AccountLogin::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); - } - case 5: { - LogStep(5, "Read the global attribute: GeneratedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, - AccountLogin::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + LogStep(4, "TH sends a Logout command to the DUT with test values provided by the product maker."); + VerifyOrDo(!ShouldSkip("ALOGIN.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::Logout::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::Logout::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } } return CHIP_NO_ERROR; @@ -24308,50 +26607,240 @@ class Test_TC_APPLAUNCHER_3_8Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Stop an app with the provided application ID"); - VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type value; - - value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; - value.application.applicationId = - mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); - - return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::StopApp::Id, - value, chip::NullOptional - - ); - } - case 2: { - LogStep(2, "Reads the Status attribute"); - VerifyOrDo(!ShouldSkip("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' after successgarbage: not in length on purpose", 30); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(1, "Stop an app with the provided application ID"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type value; + + value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.applicationId = + mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::StopApp::Id, + value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Reads the Status attribute"); + VerifyOrDo(!ShouldSkip("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' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APPLAUNCHER_3_9Suite : public TestCommand +{ +public: + Test_TC_APPLAUNCHER_3_9Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_APPLAUNCHER_3_9", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId); + AddArgument("applicationId", &mApplicationId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APPLAUNCHER_3_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 mCatalogVendorId; + chip::Optional mApplicationId; + 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::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + 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 sends HideApp command to DUT"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type value; + + value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.applicationId = + mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::HideApp::Id, + value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Reads the Status attribute"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_10Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_3_10Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_10", 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_MEDIAINPUT_3_10Suite() {} + + 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))); + } + 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 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)"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, + chip::NullOptional); } } return CHIP_NO_ERROR; } }; -class Test_TC_APPLAUNCHER_3_9Suite : public TestCommand +class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand { public: - Test_TC_APPLAUNCHER_3_9Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_APPLAUNCHER_3_9", 3, credsIssuerConfig) + Test_TC_MEDIAINPUT_3_11Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_11", 4, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId); - AddArgument("applicationId", &mApplicationId); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_APPLAUNCHER_3_9Suite() {} + ~Test_TC_MEDIAINPUT_3_11Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -24362,8 +26851,6 @@ class Test_TC_APPLAUNCHER_3_9Suite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mCatalogVendorId; - chip::Optional mApplicationId; chip::Optional mTimeout; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -24385,112 +26872,19 @@ class Test_TC_APPLAUNCHER_3_9Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; 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 sends HideApp command to DUT"); - VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type value; - - value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; - value.application.applicationId = - mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); - - return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::HideApp::Id, - value, chip::NullOptional - - ); - } - case 2: { - LogStep(2, "Reads the Status attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_MEDIAINPUT_3_10Suite : public TestCommand -{ -public: - Test_TC_MEDIAINPUT_3_10Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MEDIAINPUT_3_10", 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_MEDIAINPUT_3_10Suite() {} - - 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: + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentInput", value, 1U)); } break; default: @@ -24524,16 +26918,33 @@ class Test_TC_MEDIAINPUT_3_10Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, chip::NullOptional); } + case 2: { + LogStep(2, "Select Input Command"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::SelectInput::Type value; + value.index = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::SelectInput::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Read current input list"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0001 && MEDIAINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::CurrentInput::Id, true, + chip::NullOptional); + } } return CHIP_NO_ERROR; } }; -class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand +class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand { public: - Test_TC_MEDIAINPUT_3_11Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MEDIAINPUT_3_11", 4, credsIssuerConfig) + Test_TC_MEDIAINPUT_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_12", 4, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -24541,7 +26952,7 @@ class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MEDIAINPUT_3_11Suite() {} + ~Test_TC_MEDIAINPUT_3_12Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -24582,11 +26993,6 @@ class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint8_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("currentInput", value, 1U)); - } break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); @@ -24620,32 +27026,35 @@ class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand chip::NullOptional); } case 2: { - LogStep(2, "Select Input Command"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(2, "Show Input Status Command"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::MediaInput::Commands::SelectInput::Type value; - value.index = 1U; - return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::SelectInput::Id, value, + chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::ShowInputStatus::Id, value, chip::NullOptional ); } case 3: { - LogStep(3, "Read current input list"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0001 && MEDIAINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::CurrentInput::Id, true, - chip::NullOptional); + LogStep(3, "Hide Input Status Command"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::HideInputStatus::Id, value, + chip::NullOptional + + ); } } return CHIP_NO_ERROR; } }; -class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand +class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand { public: - Test_TC_MEDIAINPUT_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MEDIAINPUT_3_12", 4, credsIssuerConfig) + Test_TC_MEDIAINPUT_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_13", 4, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -24653,7 +27062,7 @@ class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MEDIAINPUT_3_12Suite() {} + ~Test_TC_MEDIAINPUT_3_13Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -24694,6 +27103,7 @@ class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); @@ -24718,44 +27128,44 @@ class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(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)"); + LogStep(1, "TH reads the InputList attribute from the DUT to show list of Inputs available"); VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Show Input Status Command"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(2, "Rename Input Command"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::ShowInputStatus::Id, value, + chip::app::Clusters::MediaInput::Commands::RenameInput::Type value; + value.index = 1U; + value.name = chip::Span("A1garbage: not in length on purpose", 2); + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::RenameInput::Id, value, chip::NullOptional ); } case 3: { - LogStep(3, "Hide Input Status Command"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(3, "TH reads the InputList attribute from the DUT to show list of Inputs available"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAINPUT.S.A0000 && MEDIAINPUT.S.C03.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::HideInputStatus::Id, value, - chip::NullOptional - - ); + 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); } } return CHIP_NO_ERROR; } }; -class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand +class Test_TC_WAKEONLAN_4_1Suite : public TestCommand { public: - Test_TC_MEDIAINPUT_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MEDIAINPUT_3_13", 4, credsIssuerConfig) + Test_TC_WAKEONLAN_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WAKEONLAN_4_1", 4, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -24763,7 +27173,7 @@ class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MEDIAINPUT_3_13Suite() {} + ~Test_TC_WAKEONLAN_4_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -24795,8 +27205,9 @@ class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value, 12)); } break; case 2: @@ -24829,30 +27240,27 @@ class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "TH reads the InputList attribute from the DUT to show list of Inputs available"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, + LogStep(1, "TH reads the MACAddress attribute from the DUT"); + VerifyOrDo(!ShouldSkip("WAKEONLAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::MACAddress::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Rename Input Command"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(2, "TH sends a Sleep command to DUT"); + VerifyOrDo(!ShouldSkip("LOWPOWER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::MediaInput::Commands::RenameInput::Type value; - value.index = 1U; - value.name = chip::Span("A1garbage: not in length on purpose", 2); - return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::RenameInput::Id, value, + chip::app::Clusters::LowPower::Commands::Sleep::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Commands::Sleep::Id, value, chip::NullOptional ); } case 3: { - LogStep(3, "TH reads the InputList attribute from the DUT to show list of Inputs available"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAINPUT.S.A0000 && MEDIAINPUT.S.C03.Rsp"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(3, "TH sends a Wake-On LAN magic packet containing the MAC address from step 1"); + VerifyOrDo(!ShouldSkip("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.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt(kIdentityAlpha, value); @@ -38799,19 +41207,19 @@ class Test_TC_DGTHREAD_1_1Suite : public TestCommand } case 51: { LogStep(51, "Read the optional attribute (ActiveTimestamp) in AttributeList"); - VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0039"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0038"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); } case 52: { LogStep(52, "Read the optional attribute (PendingTimestamp) in AttributeList"); - VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003A"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0039"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); } case 53: { LogStep(53, "Read the optional attribute (Delay) in AttributeList"); - VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003B"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); } @@ -39366,13 +41774,13 @@ class Test_TC_DGTHREAD_2_1Suite : public TestCommand } case 29: { LogStep(29, "TH reads Delay attribute value from DUT"); - VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003A"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, ThreadNetworkDiagnostics::Attributes::Delay::Id, true, chip::NullOptional); } case 30: { LogStep(30, "Read SecurityPolicy struct attribute from DUT and Verify the each field"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A003B"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A003b"), 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); @@ -73467,6 +75875,246 @@ class Test_TC_DRLK_2_5Suite : public TestCommand } }; +class Test_TC_DRLK_2_6Suite : public TestCommand +{ +public: + Test_TC_DRLK_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_6", 10, 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_2_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; + + uint8_t NumberOfHolidaySchedulesSupported; + + 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)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + NumberOfHolidaySchedulesSupported = value; + } + 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::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 20UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 30UL)); + if (value.localEndTime.HasValue()) + { + VerifyOrReturn(CheckConstraintMinValue("value.localEndTime.Value()", value.localEndTime.Value(), 21UL)); + } + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 15U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 10U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + 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 commissionee"); + 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 NumberOfHoliday SchedulesSupported and saves for future use."); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfHolidaySchedulesSupported::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Create Holiday schedule with 1 index"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C11.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 1U; + value.localStartTime = 20UL; + value.localEndTime = 30UL; + value.operatingMode = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Get Holiday Schedule with HolidayIndex as 1"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Create Holiday schedule with invalid operating mode"); + VerifyOrDo(!ShouldSkip("DRLK.S.C11.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 1U; + value.localStartTime = 20UL; + value.localEndTime = 30UL; + value.operatingMode = static_cast(5); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Get Holiday Schedule with Invalid HolidayIndex 15."); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 15U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Get Holiday Schedule with the Non-scheduled HolidayIndex"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 10U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Clear Holiday schedule with 1 index"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C13.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Make sure that holiday schedule was deleted"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Cleanup the created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_DRLK_2_7Suite : public TestCommand { public: @@ -84192,63 +86840,6 @@ class Test_TC_MEDIAINPUT_3_17Suite : public TestCommand } }; -class Test_TC_WAKEONLAN_4_1Suite : public TestCommand -{ -public: - Test_TC_WAKEONLAN_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_WAKEONLAN_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_WAKEONLAN_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_CHANNEL_5_4Suite : public TestCommand { public: @@ -84819,68 +87410,11 @@ class Test_TC_CONTENTLAUNCHER_10_4Suite : public TestCommand } }; -class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand -{ -public: - Test_TC_CONTENTLAUNCHER_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_CONTENTLAUNCHER_10_5", 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_CONTENTLAUNCHER_10_5Suite() {} - - 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_CONTENTLAUNCHER_10_7Suite : public TestCommand +class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand { public: - Test_TC_CONTENTLAUNCHER_10_7Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_CONTENTLAUNCHER_10_7", 0, credsIssuerConfig) + Test_TC_CONTENTLAUNCHER_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -84888,7 +87422,7 @@ class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CONTENTLAUNCHER_10_7Suite() {} + ~Test_TC_CONTENTLAUNCHER_10_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -84933,10 +87467,11 @@ class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand } }; -class Test_TC_MC_11_1Suite : public TestCommand +class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand { public: - Test_TC_MC_11_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_1", 0, credsIssuerConfig) + Test_TC_CONTENTLAUNCHER_10_7Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -84944,7 +87479,7 @@ class Test_TC_MC_11_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_11_1Suite() {} + ~Test_TC_CONTENTLAUNCHER_10_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -84989,10 +87524,10 @@ class Test_TC_MC_11_1Suite : public TestCommand } }; -class Test_TC_MC_11_2Suite : public TestCommand +class Test_TC_MC_11_1Suite : public TestCommand { public: - Test_TC_MC_11_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_2", 0, credsIssuerConfig) + Test_TC_MC_11_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85000,7 +87535,7 @@ class Test_TC_MC_11_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_11_2Suite() {} + ~Test_TC_MC_11_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -85045,11 +87580,10 @@ class Test_TC_MC_11_2Suite : public TestCommand } }; -class Test_TC_ALOGIN_12_1Suite : public TestCommand +class Test_TC_MC_11_2Suite : public TestCommand { public: - Test_TC_ALOGIN_12_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ALOGIN_12_1", 0, credsIssuerConfig) + Test_TC_MC_11_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85057,7 +87591,7 @@ class Test_TC_ALOGIN_12_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ALOGIN_12_1Suite() {} + ~Test_TC_MC_11_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -98997,62 +101531,6 @@ class Test_TC_DRLK_2_1Suite : public TestCommand } }; -class Test_TC_DRLK_2_6Suite : public TestCommand -{ -public: - Test_TC_DRLK_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_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_DRLK_2_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_DRLK_2_8Suite : public TestCommand { public: @@ -103877,62 +106355,6 @@ class Test_TC_PCC_3_1Suite : public TestCommand } }; -class Test_TC_ACL_2_3Suite : public TestCommand -{ -public: - Test_TC_ACL_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_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_ACL_2_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_ACL_2_4Suite : public TestCommand { public: @@ -104381,120 +106803,6 @@ class Test_TC_ULABEL_3_1Suite : public TestCommand } }; -class Test_TC_BRBINFO_1_1Suite : public TestCommand -{ -public: - Test_TC_BRBINFO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BRBINFO_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_BRBINFO_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_BRBINFO_2_1Suite : public TestCommand -{ -public: - Test_TC_BRBINFO_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BRBINFO_2_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_BRBINFO_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) - { - 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_BRBINFO_2_2Suite : public TestCommand { public: @@ -104735,8 +107043,11 @@ 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), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -104804,6 +107115,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), @@ -104816,6 +107128,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), @@ -104940,6 +107253,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), @@ -105075,7 +107389,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), @@ -105090,7 +107403,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), @@ -105202,7 +107514,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), @@ -105252,7 +107563,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), @@ -105261,8 +107571,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), 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 8bc08e43b3ea3c..560a723adefbd1 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -39,8 +39,10 @@ class TestList : public Command { 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_BOOL_1_1\n"); printf("Test_TC_BOOL_2_1\n"); + printf("Test_TC_BRBINFO_1_1\n"); printf("Test_TC_ACT_1_1\n"); printf("Test_TC_BIND_1_1\n"); printf("Test_TC_CC_1_1\n"); @@ -102,6 +104,7 @@ class TestList : public Command { printf("Test_TC_APBSC_1_10\n"); printf("Test_TC_CONTENTLAUNCHER_1_11\n"); printf("Test_TC_ALOGIN_1_12\n"); + printf("Test_TC_ALOGIN_12_1\n"); printf("Test_TC_LOWPOWER_2_1\n"); printf("Test_TC_KEYPADINPUT_3_2\n"); printf("Test_TC_KEYPADINPUT_3_3\n"); @@ -111,6 +114,7 @@ class TestList : public Command { printf("Test_TC_MEDIAINPUT_3_11\n"); printf("Test_TC_MEDIAINPUT_3_12\n"); printf("Test_TC_MEDIAINPUT_3_13\n"); + printf("Test_TC_WAKEONLAN_4_1\n"); printf("Test_TC_CHANNEL_5_1\n"); printf("Test_TC_CHANNEL_5_2\n"); printf("Test_TC_CHANNEL_5_3\n"); @@ -225,6 +229,7 @@ class TestList : public Command { printf("Test_TC_DRLK_2_3\n"); printf("Test_TC_DRLK_2_4\n"); printf("Test_TC_DRLK_2_5\n"); + printf("Test_TC_DRLK_2_6\n"); printf("Test_TC_DRLK_2_7\n"); printf("Test_TC_DRLK_2_9\n"); printf("TestGroupsCluster\n"); @@ -2752,11 +2757,1464 @@ class Test_TC_ACL_2_2 : public TestCommandBridge { } }; +class Test_TC_ACL_2_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ACL_2_3() + : TestCommandBridge("Test_TC_ACL_2_3") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("D_OK_EMPTY", &mDOkEmpty); + AddArgument("D_OK_SINGLE", &mDOkSingle); + AddArgument("D_OK_FULL", &mDOkFull); + AddArgument("D_BAD_LENGTH", &mDBadLength); + AddArgument("D_BAD_STRUCT", &mDBadStruct); + AddArgument("D_BAD_LIST", &mDBadList); + AddArgument("D_BAD_ELEM", &mDBadElem); + AddArgument("D_BAD_OVERFLOW", &mDBadOverflow); + AddArgument("D_BAD_UNDERFLOW", &mDBadUnderflow); + AddArgument("D_BAD_NONE", &mDBadNone); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ACL_2_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ACL_2_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ACL_2_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute\n"); + err = TestTh1ReadsDutEndpoint0OperationalCredentialsClusterCurrentFabricIndexAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct: Data field: D_OK_EMPTY : 1718\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDOkEmpty1718_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_SINGLE " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061732" + "0612063686172737472696E670018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDOkSingle17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_FULL " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061732" + "0612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656" + "E7420616761696E2E2E2E2E2E0018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDOkFull17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700d00000f1ff02003148656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e7420616761696e2e2e2e2e2e0018_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_LENGTH " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061732" + "0612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656" + "E7420616761696E2E2E2E2E2E2E0018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadLength17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700d00000f1ff02003248656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e7420616761696e2e2e2e2e2e2e0018_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_STRUCT : 1518\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadStruct1518_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_LIST " + ":3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617" + "320612063686172737472696E670018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadList3701d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_ELEM " + ":17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061732061206368617" + "2737472696E670018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadElem17103d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_OVERFLOW : " + "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320" + "612063686172737472696E670018FF\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadOverflow17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018ff_13(); + break; + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_UNDERFLOW " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061732" + "0612063686172737472696E6700\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadUnderflow17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_BAD_NONE\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadNone_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 2 elements . value is list of AccessControlExtensionStruct containing 2 " + "elements . first element contains Data field: D_OK_EMPTY 1718 . second element contains Data field: D_OK_SINGLE " + "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320" + "612063686172737472696E670018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining2ElementsValueIsListOfAccessControlExtensionStructContaining2ElementsFirstElementContainsDataFieldDOkEmpty1718SecondElementContainsDataFieldDOkSingle17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is an empty " + "list\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsAnEmptyList_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_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)); + 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), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + 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. + 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 = 20; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDOkEmpty; + chip::Optional mDOkSingle; + chip::Optional mDOkFull; + chip::Optional mDBadLength; + chip::Optional mDBadStruct; + chip::Optional mDBadList; + chip::Optional mDBadElem; + chip::Optional mDBadOverflow; + chip::Optional mDBadUnderflow; + chip::Optional mDBadNone; + 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); + } + NSNumber * _Nonnull CurrentFabricIndex; + + CHIP_ERROR TestTh1ReadsDutEndpoint0OperationalCredentialsClusterCurrentFabricIndexAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentFabricIndexWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + CurrentFabricIndex = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(0))); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDOkEmpty1718_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDOkEmpty.HasValue() + ? [NSData dataWithBytes:mDOkEmpty.Value().data() length:mDOkEmpty.Value().size()] + : [[NSData alloc] initWithBytes:"\x17\x18" length:2]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is " + @"list of AccessControlExtensionStruct containing 1 element 1. struct: Data " + @"field: D_OK_EMPTY : 1718 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString( + "Data", ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).data, + mDOkEmpty.HasValue() ? [NSData dataWithBytes:mDOkEmpty.Value().data() + length:mDOkEmpty.Value().size()] + : [[NSData alloc] initWithBytes:"\x17\x18" length:2] + + )); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).fabricIndex, + CurrentFabricIndex)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDOkSingle17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDOkSingle.HasValue() + ? [NSData dataWithBytes:mDOkSingle.Value().data() length:mDOkSingle.Value().size()] + : [[NSData alloc] + initWithBytes:"\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" + "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" + length:71]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + @"AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_SINGLE " + @":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D" + @"656E74206C6976696E6720617320612063686172737472696E670018 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString( + "Data", ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).data, + mDOkSingle.HasValue() + ? [NSData dataWithBytes:mDOkSingle.Value().data() + length:mDOkSingle.Value().size()] + : [[NSData alloc] + initWithBytes: + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72" + "\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67" + "\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20" + "\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" + length:71] + + )); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).fabricIndex, + CurrentFabricIndex)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDOkFull17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700d00000f1ff02003148656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e7420616761696e2e2e2e2e2e0018_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDOkFull.HasValue() + ? [NSData dataWithBytes:mDOkFull.Value().data() length:mDOkFull.Value().size()] + : [[NSData alloc] + initWithBytes: + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73" + "\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E" + "\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x31" + "\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E" + "\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x00\x18" + length:128]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_FULL " + @":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C65" + @"6D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F205" + @"76F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E00" + @"18 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString( + "Data", ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).data, + mDOkFull.HasValue() + ? [NSData dataWithBytes:mDOkFull.Value().data() length:mDOkFull.Value().size()] + : [[NSData alloc] + initWithBytes: + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72" + "\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67" + "\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20" + "\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\xD0\x00" + "\x00\xF1\xFF\x02\x00\x31\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E" + "\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20" + "\x65\x6C\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E" + "\x00\x18" + length:128] + + )); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).fabricIndex, + CurrentFabricIndex)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadLength17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700d00000f1ff02003248656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e7420616761696e2e2e2e2e2e2e0018_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadLength.HasValue() + ? [NSData dataWithBytes:mDBadLength.Value().data() length:mDBadLength.Value().size()] + : [[NSData alloc] + initWithBytes: + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73" + "\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E" + "\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x32" + "\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E" + "\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x2E\x00\x18" + length:129]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + @"AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_LENGTH " + @":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D" + @"656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F7" + @"26C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018 " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadStruct1518_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadStruct.HasValue() + ? [NSData dataWithBytes:mDBadStruct.Value().data() length:mDBadStruct.Value().size()] + : [[NSData alloc] initWithBytes:"\x15\x18" length:2]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 1 element 1. struct Data field: " + @"D_BAD_STRUCT : 1518 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadList3701d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadList.HasValue() + ? [NSData dataWithBytes:mDBadList.Value().data() length:mDBadList.Value().size()] + : [[NSData alloc] + initWithBytes:"\x37\x01\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54" + "\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20" + "\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" + length:72]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + @"AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_LIST " + @":3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C65" + @"6D656E74206C6976696E6720617320612063686172737472696E670018 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadElem17103d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadElem.HasValue() + ? [NSData dataWithBytes:mDBadElem.Value().data() length:mDBadElem.Value().size()] + : [[NSData alloc] + initWithBytes:"\x17\x10\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20" + "\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20" + "\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" + length:65]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + @"AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_ELEM " + @":17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C69" + @"76696E6720617320612063686172737472696E670018 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadOverflow17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018ff_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadOverflow.HasValue() + ? [NSData dataWithBytes:mDBadOverflow.Value().data() length:mDBadOverflow.Value().size()] + : [[NSData alloc] + initWithBytes:"\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" + "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18\xFF" + length:72]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 1 element 1 .struct Data field: " + @"D_BAD_OVERFLOW : " + @"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656" + @"D656E74206C6976696E6720617320612063686172737472696E670018FF Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadUnderflow17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadUnderflow.HasValue() + ? [NSData dataWithBytes:mDBadUnderflow.Value().data() length:mDBadUnderflow.Value().size()] + : [[NSData alloc] + initWithBytes:"\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" + "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00" + length:70]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 1 element 1. struct Data field: " + @"D_BAD_UNDERFLOW " + @":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C65" + @"6D656E74206C6976696E6720617320612063686172737472696E6700 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadNone_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadNone.HasValue() + ? [NSData dataWithBytes:mDBadNone.Value().data() length:mDBadNone.Value().size()] + : [[NSData alloc] initWithBytes:"" length:0]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 1 element 1.struct Data field: D_BAD_NONE " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining2ElementsValueIsListOfAccessControlExtensionStructContaining2ElementsFirstElementContainsDataFieldDOkEmpty1718SecondElementContainsDataFieldDOkSingle17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDOkEmpty.HasValue() + ? [NSData dataWithBytes:mDOkEmpty.Value().data() length:mDOkEmpty.Value().size()] + : [[NSData alloc] initWithBytes:"\x17\x18" length:2]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + temp_0[1] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[1]).data = mDOkSingle.HasValue() + ? [NSData dataWithBytes:mDOkSingle.Value().data() length:mDOkSingle.Value().size()] + : [[NSData alloc] + initWithBytes:"\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" + "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" + length:71]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[1]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 2 elements . value is list of " + @"AccessControlExtensionStruct containing 2 elements . first element contains Data " + @"field: D_OK_EMPTY 1718 . second element contains Data field: D_OK_SINGLE " + @"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656" + @"D656E74206C6976696E6720617320612063686172737472696E670018 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString( + "Data", ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).data, + mDOkEmpty.HasValue() ? [NSData dataWithBytes:mDOkEmpty.Value().data() + length:mDOkEmpty.Value().size()] + : [[NSData alloc] initWithBytes:"\x17\x18" length:2] + + )); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).fabricIndex, + CurrentFabricIndex)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsAnEmptyList_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + extensionArgument = temp_0; + } + [cluster writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is " + @"an empty list Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(0))); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_BOOL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_BOOL_1_1() - : TestCommandBridge("Test_TC_BOOL_1_1") + Test_TC_BOOL_1_1() + : TestCommandBridge("Test_TC_BOOL_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_BOOL_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BOOL_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BOOL_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"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(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"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(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"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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 TestReadTheGlobalAttributeAcceptedCommandList_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(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"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(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_BOOL_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_BOOL_2_1() + : TestCommandBridge("Test_TC_BOOL_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_BOOL_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BOOL_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BOOL_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 : Read mandatory non-global attribute: StateValue\n"); + if (ShouldSkip("BOOL.S.A0000")) { + NextTest(); + return; + } + err = TestReadMandatoryNonGlobalAttributeStateValue_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 TestReadMandatoryNonGlobalAttributeStateValue_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStateValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read mandatory non-global attribute: StateValue Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("stateValue", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BRBINFO_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_BRBINFO_1_1() + : TestCommandBridge("Test_TC_BRBINFO_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -2766,7 +4224,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_BOOL_1_1() {} + ~Test_TC_BRBINFO_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -2774,11 +4232,11 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BOOL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BRBINFO_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BOOL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BRBINFO_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -2795,24 +4253,137 @@ class Test_TC_BOOL_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 ClusterRevision from DUT\n"); + err = TestThReadsTheClusterRevisionFromDut_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 the FeatureMap from DUT\n"); + err = TestThReadsTheFeatureMapFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AttributeList from DUT\n"); + err = TestThReadsAttributeListFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads optional attribute(VendorName) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeVendorNameInAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads optional attribute(VendorID) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeVendorIDInAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads optional attribute(ProductName) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeProductNameInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads optional attribute(NodeLabel) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeNodeLabelInAttributeList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads optional attribute(HardwareVersion) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0007")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeHardwareVersionInAttributeList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads optional attribute(HardwareVersionString) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeHardwareVersionStringInAttributeList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads optional attribute(SoftwareVersion) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeSoftwareVersionInAttributeList_10(); + break; + case 11: + ChipLogProgress( + chipTool, " ***** Test Step 11 : TH reads optional attribute(SoftwareVersionString) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeSoftwareVersionStringInAttributeList_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads optional attribute(ManufacturingDate) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000b")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeManufacturingDateInAttributeList_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads optional attribute(PartNumber) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000c")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributePartNumberInAttributeList_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads optional attribute(ProductURL) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000d")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeProductURLInAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads optional attribute(ProductLabel) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000e")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeProductLabelInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads optional attribute(SerialNumber) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000f")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeSerialNumberInAttributeList_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads optional attribute(UniqueID) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0012")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeUniqueIDInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH1 reads AcceptedCommandList from DUT\n"); + err = TestTh1ReadsAcceptedCommandListFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH1 reads GeneratedCommandList from DUT\n"); + err = TestTh1ReadsGeneratedCommandListFromDut_19(); break; } @@ -2843,6 +4414,48 @@ class Test_TC_BOOL_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; + 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. @@ -2856,7 +4469,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 20; chip::Optional mNodeId; chip::Optional mCluster; @@ -2871,15 +4484,17 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -2895,15 +4510,17 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -2919,20 +4536,22 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestThReadsAttributeListFromDut_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", 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, 17UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); @@ -2945,163 +4564,374 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestThReadsOptionalAttributeVendorNameInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(VendorName) 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, 1UL)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestThReadsOptionalAttributeVendorIDInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(VendorID) 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, 2UL)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_BOOL_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_BOOL_2_1() - : TestCommandBridge("Test_TC_BOOL_2_1") - , mTestIndex(0) + CHIP_ERROR TestThReadsOptionalAttributeProductNameInAttributeList_6() { - 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"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ProductName) 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; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_BOOL_2_1() {} + CHIP_ERROR TestThReadsOptionalAttributeNodeLabelInAttributeList_7() + { - /////////// TestCommand Interface ///////// - void NextTest() override + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(NodeLabel) 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 TestThReadsOptionalAttributeHardwareVersionInAttributeList_8() { - CHIP_ERROR err = CHIP_NO_ERROR; - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BOOL_2_1\n"); - } + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BOOL_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(HardwareVersion) in AttributeList 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 : Read mandatory non-global attribute: StateValue\n"); - if (ShouldSkip("BOOL.S.A0000")) { - NextTest(); - return; - } - err = TestReadMandatoryNonGlobalAttributeStateValue_1(); - break; - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + NextTest(); + }]; + + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestThReadsOptionalAttributeHardwareVersionStringInAttributeList_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; - } - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(HardwareVersionString) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestThReadsOptionalAttributeSoftwareVersionInAttributeList_10() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SoftwareVersion) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + CHIP_ERROR TestThReadsOptionalAttributeSoftwareVersionStringInAttributeList_11() + { - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SoftwareVersionString) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeManufacturingDateInAttributeList_12() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 11UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadMandatoryNonGlobalAttributeStateValue_1() + CHIP_ERROR TestThReadsOptionalAttributePartNumberInAttributeList_13() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStateValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read mandatory non-global attribute: StateValue Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(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(CheckConstraintType("stateValue", "boolean", "boolean")); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 12UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeProductURLInAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 13UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeProductLabelInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ProductLabel) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 14UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeSerialNumberInAttributeList_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SerialNumber) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeUniqueIDInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsAcceptedCommandListFromDut_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(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("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsGeneratedCommandListFromDut_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 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(); }]; @@ -17549,7 +19379,562 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 14; + const uint16_t mTestCount = 14; + + 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"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(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"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(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"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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, 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(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeManufacturingDateInAttributeList_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 11UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributePartNumberInAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 12UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeProductURLInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 13UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeProductLabelInAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ProductLabel) in attributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 14UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeSerialNumberInAttributeList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SerialNumber) in attributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeLocalConfigDisabledInAttributeList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeReachableInAttributeList_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeUniqueIDInAttributeList_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(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(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsAcceptedCommandListFromDut_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(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("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsGeneratedCommandListFromDut_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 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_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++) { + 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(" !CNET.S.F00 && !CNET.S.F01 && !CNET.S.F02 ")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: FeatureMap when CNET.S.F00 is set\n"); + if (ShouldSkip("CNET.S.F00")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMapWhenCnetsf00IsSet_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: FeatureMap when CNET.S.F01 is set\n"); + if (ShouldSkip("CNET.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMapWhenCnetsf01IsSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: FeatureMap when CNET.S.F02 is set\n"); + if (ShouldSkip("CNET.S.F02")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMapWhenCnetsf02IsSet_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read mandatory attributes in AttributeList if CNET.S.F00(WI)/CNET.S.F01(TH)/CNET.S.F02(ET) " + "is true\n"); + if (ShouldSkip("CNET.S.F00 || CNET.S.F01 || CNET.S.F02")) { + NextTest(); + return; + } + err = TestReadMandatoryAttributesInAttributeListIfCnetsf00wiCnetsf01thCnetsf02etIsTrue_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the optional attribute(ScanMaxTimeSeconds): AttributeList\n"); + if (ShouldSkip("CNET.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeScanMaxTimeSecondsAttributeList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Reading optional attribute(ConnectMaxTimeSeconds) in AttributeList\n"); + if (ShouldSkip("CNET.S.A0003")) { + NextTest(); + return; + } + err = TestReadingOptionalAttributeConnectMaxTimeSecondsInAttributeList_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Read AcceptedCommandList If DUT supports Wi-Fi/Thread related features " + "CNET.S.F00(WI),CNET.S.F01(TH)\n"); + if (ShouldSkip("CNET.S.F00 || CNET.S.F01")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListIfDutSupportsWiFiThreadRelatedFeaturesCnetsf00wicnetsf01th_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Read AcceptedCommandList If DUT supports Wi-Fi related features (CNET.S.F00(WI) is true)\n"); + if (ShouldSkip("CNET.S.F00")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListIfDutSupportsWiFiRelatedFeaturesCnetsf00wiIsTrue_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Read AcceptedCommandList If DUT supports Thread related features(CNET.S.F01(TH) is true)\n"); + if (ShouldSkip("CNET.S.F01")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListIfDutSupportsThreadRelatedFeaturesCNETSF01THIsTrue_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Read AcceptedCommandList If DUT supports Ethernet related features(CNET.S.F02(TH) is " + "true)\n"); + if (ShouldSkip("CNET.S.F02")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListIfDutSupportsEthernetRelatedFeaturesCNETSF02THIsTrue_13(); + break; + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : Read the GeneratedCommandList If DUT supports Wi-Fi/Thread related features(CNET.S.F00(WI) " + "or CNET.S.F01(TH) is true)\n"); + if (ShouldSkip("CNET.S.F00 || CNET.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGeneratedCommandListIfDutSupportsWiFiThreadRelatedFeaturesCNETSF00WIOrCnetsf01thIsTrue_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : Read the GeneratedCommandList If DUT supports Ethernet related features(CNET.S.F02(ET) must " + "be true)\n"); + if (ShouldSkip("CNET.S.F02")) { + NextTest(); + return; + } + err = TestReadTheGeneratedCommandListIfDutSupportsEthernetRelatedFeaturesCNETSF02ETMustBeTrue_15(); + 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; + } + + // 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 = 16; chip::Optional mNodeId; chip::Optional mCluster; @@ -17564,15 +19949,17 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -17588,15 +19975,17 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -17605,43 +19994,30 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsAttributeListFromDut_3() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMapWhenCnetsf00IsSet_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads AttributeList from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap when CNET.S.F00 is set 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, 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)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); + } NextTest(); }]; @@ -17649,20 +20025,24 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeManufacturingDateInAttributeList_4() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMapWhenCnetsf01IsSet_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(ManufacturingDate) in attributeList Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap when CNET.S.F01 is set Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 11UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 2UL)); + } NextTest(); }]; @@ -17670,20 +20050,24 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributePartNumberInAttributeList_5() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMapWhenCnetsf02IsSet_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(PartNumber) in attributeList Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap when CNET.S.F02 is set Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 12UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 4UL)); + } NextTest(); }]; @@ -17691,20 +20075,26 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeProductURLInAttributeList_6() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(ProductURL) in attributeList Error: %@", 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, 13UL)); + 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(); }]; @@ -17712,20 +20102,28 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeProductLabelInAttributeList_7() + CHIP_ERROR TestReadMandatoryAttributesInAttributeListIfCnetsf00wiCnetsf01thCnetsf02etIsTrue_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(ProductLabel) in attributeList Error: %@", err); + NSLog(@"Read mandatory attributes in AttributeList if CNET.S.F00(WI)/CNET.S.F01(TH)/CNET.S.F02(ET) is true Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 14UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); NextTest(); }]; @@ -17733,20 +20131,22 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeSerialNumberInAttributeList_8() + CHIP_ERROR TestReadTheOptionalAttributeScanMaxTimeSecondsAttributeList_8() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(SerialNumber) in attributeList Error: %@", err); + NSLog(@"Read the optional attribute(ScanMaxTimeSeconds): AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); NextTest(); }]; @@ -17754,20 +20154,22 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeLocalConfigDisabledInAttributeList_9() + CHIP_ERROR TestReadingOptionalAttributeConnectMaxTimeSecondsInAttributeList_9() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(LocalConfigDisabled) in attributeList Error: %@", err); + NSLog(@"Reading optional attribute(ConnectMaxTimeSeconds) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); NextTest(); }]; @@ -17775,20 +20177,26 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeReachableInAttributeList_10() + CHIP_ERROR TestReadAcceptedCommandListIfDutSupportsWiFiThreadRelatedFeaturesCnetsf00wicnetsf01th_10() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(Reachable) in attributeList Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read AcceptedCommandList If DUT supports Wi-Fi/Thread related features CNET.S.F00(WI),CNET.S.F01(TH) Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 8UL)); NextTest(); }]; @@ -17796,20 +20204,22 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeUniqueIDInAttributeList_11() + CHIP_ERROR TestReadAcceptedCommandListIfDutSupportsWiFiRelatedFeaturesCnetsf00wiIsTrue_11() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(UniqueID) in attributeList Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read AcceptedCommandList If DUT supports Wi-Fi related features (CNET.S.F00(WI) is true) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); NextTest(); }]; @@ -17817,123 +20227,106 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsAcceptedCommandListFromDut_12() + CHIP_ERROR TestReadAcceptedCommandListIfDutSupportsThreadRelatedFeaturesCNETSF01THIsTrue_12() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads AcceptedCommandList from DUT Error: %@", err); + NSLog(@"Read AcceptedCommandList If DUT supports Thread related features(CNET.S.F01(TH) is true) 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, 3UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsGeneratedCommandListFromDut_13() + CHIP_ERROR TestReadAcceptedCommandListIfDutSupportsEthernetRelatedFeaturesCNETSF02THIsTrue_13() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads GeneratedCommandList from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read AcceptedCommandList If DUT supports Ethernet related features(CNET.S.F02(TH) is true) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -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) + CHIP_ERROR TestReadTheGeneratedCommandListIfDutSupportsWiFiThreadRelatedFeaturesCNETSF00WIOrCnetsf01thIsTrue_14() { - 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; + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CNET_1_3\n"); - } + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the GeneratedCommandList If DUT supports Wi-Fi/Thread related features(CNET.S.F00(WI) or CNET.S.F01(TH) " + @"is true) Error: %@", + err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CNET_1_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - Wait(); + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 7UL)); - // 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++) { - } + 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 TestReadTheGeneratedCommandListIfDutSupportsEthernetRelatedFeaturesCNETSF02ETMustBeTrue_15() { - switch (mTestIndex - 1) { - } - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the GeneratedCommandList If DUT supports Ethernet related features(CNET.S.F02(ET) must be true) Error: %@", + err); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_DESC_1_1 : public TestCommandBridge { @@ -36408,6 +38801,261 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { } }; +class Test_TC_ALOGIN_12_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ALOGIN_12_1() + : TestCommandBridge("Test_TC_ALOGIN_12_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("TempAccountIdentifier", &mTempAccountIdentifier); + AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId); + AddArgument("applicationId", &mApplicationId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ALOGIN_12_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ALOGIN_12_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ALOGIN_12_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 : Launch an app with the provided a application ID\n"); + if (ShouldSkip("APPLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestLaunchAnAppWithTheProvidedAApplicationId_1(); + break; + case 2: + ChipLogProgress(chipTool, + " ***** Test Step 2 : TH sends a GetSetupPIN command to the DUT with test values provided by the product maker.\n"); + if (ShouldSkip("ALOGIN.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAGetSetupPINCommandToTheDutWithTestValuesProvidedByTheProductMaker_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH sends a Login command to the DUT with test values provided by the product maker.\n"); + if (ShouldSkip("ALOGIN.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALoginCommandToTheDutWithTestValuesProvidedByTheProductMaker_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : TH sends a Logout command to the DUT with test values provided by the product maker.\n"); + if (ShouldSkip("ALOGIN.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALogoutCommandToTheDutWithTestValuesProvidedByTheProductMaker_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); + } + + 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 = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTempAccountIdentifier; + chip::Optional mCatalogVendorId; + chip::Optional mApplicationId; + 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 TestLaunchAnAppWithTheProvidedAApplicationId_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRApplicationLauncherClusterLaunchAppParams alloc] init]; + params.application = [[MTRApplicationLauncherClusterApplication alloc] init]; + ((MTRApplicationLauncherClusterApplication *) params.application).catalogVendorId = mCatalogVendorId.HasValue() + ? [NSNumber numberWithUnsignedShort:mCatalogVendorId.Value()] + : [NSNumber numberWithUnsignedShort:123U]; + ((MTRApplicationLauncherClusterApplication *) params.application).applicationId = mApplicationId.HasValue() + ? [[NSString alloc] initWithBytes:mApplicationId.Value().data() + length:mApplicationId.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleid"; + + params.data = [[NSData alloc] initWithBytes:"Hello World" length:11]; + [cluster + launchAppWithParams:params + completion:^(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Launch an app with the provided a application ID Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSString * _Nonnull setupPIN; + + CHIP_ERROR TestThSendsAGetSetupPINCommandToTheDutWithTestValuesProvidedByTheProductMaker_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device endpointID:@(3) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRAccountLoginClusterGetSetupPINParams alloc] init]; + params.tempAccountIdentifier = mTempAccountIdentifier.HasValue() + ? [[NSString alloc] initWithBytes:mTempAccountIdentifier.Value().data() + length:mTempAccountIdentifier.Value().size() + encoding:NSUTF8StringEncoding] + : @"1111"; + [cluster + getSetupPINWithParams:params + completion:^(MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a GetSetupPIN command to the DUT with test values provided by the product maker. " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + setupPIN = values.setupPIN; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsALoginCommandToTheDutWithTestValuesProvidedByTheProductMaker_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device endpointID:@(3) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRAccountLoginClusterLoginParams alloc] init]; + params.tempAccountIdentifier = mTempAccountIdentifier.HasValue() + ? [[NSString alloc] initWithBytes:mTempAccountIdentifier.Value().data() + length:mTempAccountIdentifier.Value().size() + encoding:NSUTF8StringEncoding] + : @"1111"; + params.setupPIN = [setupPIN copy]; + [cluster + loginWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"TH sends a Login command to the DUT with test values provided by the product maker. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsALogoutCommandToTheDutWithTestValuesProvidedByTheProductMaker_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device endpointID:@(3) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster logoutWithCompletion:^(NSError * _Nullable err) { + NSLog(@"TH sends a Logout command to the DUT with test values provided by the product maker. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_LOWPOWER_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -37585,8 +40233,372 @@ class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR - TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() + CHIP_ERROR + TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInputListWithCompletion:^(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"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRMediaInputClusterSelectInputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1U]; + [cluster selectInputWithParams:params + completion:^(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"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentInputWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current input list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentInput", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MEDIAINPUT_3_12() + : TestCommandBridge("Test_TC_MEDIAINPUT_3_12") + , 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_MEDIAINPUT_3_12() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_12\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_12\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 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 : Show Input Status Command\n"); + if (ShouldSkip("MEDIAINPUT.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestShowInputStatusCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Hide Input Status Command\n"); + if (ShouldSkip("MEDIAINPUT.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestHideInputStatusCommand_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"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInputListWithCompletion:^(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 TestShowInputStatusCommand_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster showInputStatusWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Show Input Status Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestHideInputStatusCommand_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster hideInputStatusWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Hide Input Status Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MEDIAINPUT_3_13() + : TestCommandBridge("Test_TC_MEDIAINPUT_3_13") + , 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_MEDIAINPUT_3_13() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_13\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_13\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 InputList attribute from the DUT to show list of Inputs available\n"); + if (ShouldSkip("MEDIAINPUT.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_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; + } + + 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 TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_1() { MTRBaseDevice * device = GetDevice("alpha"); @@ -37594,10 +40606,7 @@ class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeInputListWithCompletion:^(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); + NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -37607,18 +40616,19 @@ class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSelectInputCommand_2() + CHIP_ERROR TestRenameInputCommand_2() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRMediaInputClusterSelectInputParams alloc] init]; + __auto_type * params = [[MTRMediaInputClusterRenameInputParams alloc] init]; params.index = [NSNumber numberWithUnsignedChar:1U]; - [cluster selectInputWithParams:params + params.name = @"A1"; + [cluster renameInputWithParams:params completion:^(NSError * _Nullable err) { - NSLog(@"Select Input Command Error: %@", err); + NSLog(@"Rename Input Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -37628,35 +40638,22 @@ class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadCurrentInputList_3() + CHIP_ERROR TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_3() { - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentInputWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read current input list Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentInput", actualValue, 1U)); - } - - 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_MEDIAINPUT_3_12 : public TestCommandBridge { +class Test_TC_WAKEONLAN_4_1 : 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_WAKEONLAN_4_1() + : TestCommandBridge("Test_TC_WAKEONLAN_4_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -37666,7 +40663,7 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAINPUT_3_12() {} + ~Test_TC_WAKEONLAN_4_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -37674,11 +40671,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_WAKEONLAN_4_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_12\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WAKEONLAN_4_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -37695,31 +40692,29 @@ class Test_TC_MEDIAINPUT_3_12 : 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 : TH reads the MACAddress attribute from the DUT\n"); + if (ShouldSkip("WAKEONLAN.S.A0000")) { NextTest(); return; } - err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); + err = TestThReadsTheMACAddressAttributeFromTheDut_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 : TH sends a Sleep command to DUT\n"); + if (ShouldSkip("LOWPOWER.S.C00.Rsp")) { NextTest(); return; } - err = TestShowInputStatusCommand_2(); + err = TestThSendsASleepCommandToDut_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 : TH sends a Wake-On LAN magic packet containing the MAC address from step 1\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestHideInputStatusCommand_3(); + err = TestThSendsAWakeOnLanMagicPacketContainingTheMacAddressFromStep1_3(); break; } @@ -37772,193 +40767,34 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR - TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() + CHIP_ERROR TestThReadsTheMACAddressAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeInputListWithCompletion:^(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 TestShowInputStatusCommand_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster showInputStatusWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Show Input Status Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestHideInputStatusCommand_3() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWakeOnLAN alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster hideInputStatusWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Hide Input Status Command Error: %@", err); + [cluster readAttributeMACAddressWithCompletion:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the MACAddress attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintMinLength("MACAddress", value, 12)); NextTest(); }]; return CHIP_NO_ERROR; } -}; - -class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAINPUT_3_13() - : TestCommandBridge("Test_TC_MEDIAINPUT_3_13") - , 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_MEDIAINPUT_3_13() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_13\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_13\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 InputList attribute from the DUT to show list of Inputs available\n"); - if (ShouldSkip("MEDIAINPUT.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_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; - } - - 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 TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_1() + CHIP_ERROR TestThSendsASleepCommandToDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInputListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available Error: %@", err); + [cluster sleepWithCompletion:^(NSError * _Nullable err) { + NSLog(@"TH sends a Sleep command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -37968,33 +40804,11 @@ class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRenameInputCommand_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(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 - completion:^(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_ERROR TestThSendsAWakeOnLanMagicPacketContainingTheMacAddressFromStep1_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.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); @@ -56030,7 +58844,7 @@ class Test_TC_DGTHREAD_1_1 : public TestCommandBridge { break; case 51: ChipLogProgress(chipTool, " ***** Test Step 51 : Read the optional attribute (ActiveTimestamp) in AttributeList\n"); - if (ShouldSkip("DGTHREAD.S.A0039")) { + if (ShouldSkip("DGTHREAD.S.A0038")) { NextTest(); return; } @@ -56038,7 +58852,7 @@ class Test_TC_DGTHREAD_1_1 : public TestCommandBridge { break; case 52: ChipLogProgress(chipTool, " ***** Test Step 52 : Read the optional attribute (PendingTimestamp) in AttributeList\n"); - if (ShouldSkip("DGTHREAD.S.A003A")) { + if (ShouldSkip("DGTHREAD.S.A0039")) { NextTest(); return; } @@ -56046,7 +58860,7 @@ class Test_TC_DGTHREAD_1_1 : public TestCommandBridge { break; case 53: ChipLogProgress(chipTool, " ***** Test Step 53 : Read the optional attribute (Delay) in AttributeList\n"); - if (ShouldSkip("DGTHREAD.S.A003B")) { + if (ShouldSkip("DGTHREAD.S.A003a")) { NextTest(); return; } @@ -121276,6 +124090,455 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { } }; +class Test_TC_DRLK_2_6 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DRLK_2_6() + : TestCommandBridge("Test_TC_DRLK_2_6") + , 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_DRLK_2_6() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DRLK_2_6\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DRLK_2_6\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 commissionee\n"); + err = TestWaitForCommissionee_0(); + break; + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : TH reads NumberOfHoliday SchedulesSupported and saves for future use.\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.A0016")) { + NextTest(); + return; + } + err = TestThReadsNumberOfHolidaySchedulesSupportedAndSavesForFutureUse_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Create Holiday schedule with 1 index\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C11.Rsp")) { + NextTest(); + return; + } + err = TestCreateHolidayScheduleWith1Index_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Get Holiday Schedule with HolidayIndex as 1\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx")) { + NextTest(); + return; + } + err = TestGetHolidayScheduleWithHolidayIndexAs1_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Create Holiday schedule with invalid operating mode\n"); + if (ShouldSkip("DRLK.S.C11.Rsp")) { + NextTest(); + return; + } + err = TestCreateHolidayScheduleWithInvalidOperatingMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Get Holiday Schedule with Invalid HolidayIndex 15.\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx")) { + NextTest(); + return; + } + err = TestGetHolidayScheduleWithInvalidHolidayIndex15_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Get Holiday Schedule with the Non-scheduled HolidayIndex\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx")) { + NextTest(); + return; + } + err = TestGetHolidayScheduleWithTheNonScheduledHolidayIndex_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Clear Holiday schedule with 1 index\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C13.Rsp")) { + NextTest(); + return; + } + err = TestClearHolidayScheduleWith1Index_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Make sure that holiday schedule was deleted\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx")) { + NextTest(); + return; + } + err = TestMakeSureThatHolidayScheduleWasDeleted_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Cleanup the created user\n"); + err = TestCleanupTheCreatedUser_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)); + 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), EMBER_ZCL_STATUS_INVALID_COMMAND)); + 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. + 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 TestWaitForCommissionee_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nonnull NumberOfHolidaySchedulesSupported; + + CHIP_ERROR TestThReadsNumberOfHolidaySchedulesSupportedAndSavesForFutureUse_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNumberOfHolidaySchedulesSupportedWithCompletion:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads NumberOfHoliday SchedulesSupported and saves for future use. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("numberOfHolidaySchedulesSupported", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("numberOfHolidaySchedulesSupported", [value unsignedCharValue], 255U)); + { + NumberOfHolidaySchedulesSupported = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateHolidayScheduleWith1Index_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(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:20UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:30UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; + [cluster setHolidayScheduleWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Create Holiday schedule with 1 index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetHolidayScheduleWithHolidayIndexAs1_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Get Holiday Schedule with HolidayIndex as 1 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, 20UL)); + } + + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 30UL)); + } + + if (values.localEndTime != nil) { + + VerifyOrReturn(CheckConstraintMinValue( + "localEndTime", [values.localEndTime unsignedIntValue], 21UL)); + } + + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateHolidayScheduleWithInvalidOperatingMode_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(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:20UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:30UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:5U]; + [cluster setHolidayScheduleWithParams:params + completion:^(NSError * _Nullable 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) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetHolidayScheduleWithInvalidHolidayIndex15_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:15U]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Get Holiday Schedule with Invalid HolidayIndex 15. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 15U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetHolidayScheduleWithTheNonScheduledHolidayIndex_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:10U]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Get Holiday Schedule with the Non-scheduled HolidayIndex Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 10U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestClearHolidayScheduleWith1Index_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster clearHolidayScheduleWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Clear Holiday schedule with 1 index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureThatHolidayScheduleWasDeleted_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Make sure that holiday schedule was 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, 139U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCleanupTheCreatedUser_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearUserWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Cleanup the created user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_DRLK_2_7 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -125503,8 +128766,10 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -125566,6 +128831,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -125575,6 +128841,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -125689,6 +128956,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),