diff --git a/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_2_2.yaml index 795bb1195745c3..0863ac1d33c6c3 100644 --- a/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_2_2.yaml @@ -11,211 +11,138 @@ # 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: 48.3. [TC-DIAG-TH_NW-2.2] Attributes-Tx [DUT Server] config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Thread Network Diagnostics" endpoint: 0 tests: - - label: "Commission DUT to TH" - verification: | - - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH reads TxTotalCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-total-count 476 0 - - [1649826011.966538][3502:3507] CHIP:DMG: SuppressResponse = true, - [1649826011.966580][3502:3507] CHIP:DMG: InteractionModelRevision = 1 - [1649826011.966618][3502:3507] CHIP:DMG: } - [1649826011.966832][3502:3507] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0016 DataVersion: 2758196590 - [1649826011.966933][3502:3507] CHIP:TOO: TxTotalCount: 432 - disabled: true + command: "readAttribute" + attribute: "TxTotalCount" + response: + constraints: + type: uint32 - label: "TH reads TxUnicastCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-unicast-count 476 0 - - - [1649826032.959906][3511:3516] CHIP:DMG: SuppressResponse = true, - [1649826032.959968][3511:3516] CHIP:DMG: InteractionModelRevision = 1 - [1649826032.960025][3511:3516] CHIP:DMG: } - [1649826032.960325][3511:3516] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0017 DataVersion: 2758196590 - [1649826032.960575][3511:3516] CHIP:TOO: TxUnicastCount: 439 - disabled: true + command: "readAttribute" + attribute: "TxUnicastCount" + response: + constraints: + type: uint32 - label: "TH reads TxBroadcastCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-broadcast-count 476 0 - - [1649826061.534516][3519:3524] CHIP:DMG: SuppressResponse = true, - [1649826061.534579][3519:3524] CHIP:DMG: InteractionModelRevision = 1 - [1649826061.534636][3519:3524] CHIP:DMG: } - [1649826061.534936][3519:3524] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0018 DataVersion: 2758196590 - [1649826061.535078][3519:3524] CHIP:TOO: TxBroadcastCount: 4 - disabled: true + command: "readAttribute" + attribute: "TxBroadcastCount" + response: + constraints: + type: uint32 - label: "TH reads TxAckRequestedCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-ack-requested-count 476 0 - - - [1649826091.335485][3525:3530] CHIP:DMG: SuppressResponse = true, - [1649826091.335549][3525:3530] CHIP:DMG: InteractionModelRevision = 1 - [1649826091.335607][3525:3530] CHIP:DMG: } - [1649826091.335905][3525:3530] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0019 DataVersion: 2758196590 - [1649826091.336042][3525:3530] CHIP:TOO: TxAckRequestedCount: 461 - disabled: true + command: "readAttribute" + attribute: "TxAckRequestedCount" + response: + constraints: + type: uint32 - label: "TH reads TxAckedCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-acked-count 476 0 - - - [1649826121.430757][3534:3539] CHIP:DMG: SuppressResponse = true, - [1649826121.430799][3534:3539] CHIP:DMG: InteractionModelRevision = 1 - [1649826121.430837][3534:3539] CHIP:DMG: } - [1649826121.431047][3534:3539] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_001A DataVersion: 2758196590 - [1649826121.431144][3534:3539] CHIP:TOO: TxAckedCount: 462 - disabled: true + command: "readAttribute" + attribute: "TxAckedCount" + response: + constraints: + type: uint32 - label: "TH reads TxNoAckRequestedCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-no-ack-requested-count 476 0 - - - [1649826152.539898][3540:3545] CHIP:DMG: SuppressResponse = true, - [1649826152.539960][3540:3545] CHIP:DMG: InteractionModelRevision = 1 - [1649826152.540017][3540:3545] CHIP:DMG: } - [1649826152.540314][3540:3545] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_001B DataVersion: 2758196590 - [1649826152.540550][3540:3545] CHIP:TOO: TxNoAckRequestedCount: 4 - disabled: true + command: "readAttribute" + attribute: "TxNoAckRequestedCount" + response: + constraints: + type: uint32 - label: "TH reads TxDataCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-data-count 476 0 - - [1649826184.869528][3547:3552] CHIP:DMG: SuppressResponse = true, - [1649826184.869589][3547:3552] CHIP:DMG: InteractionModelRevision = 1 - [1649826184.869646][3547:3552] CHIP:DMG: } - [1649826184.869951][3547:3552] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_001C DataVersion: 2758196590 - [1649826184.870089][3547:3552] CHIP:TOO: TxDataCount: 503 - disabled: true + command: "readAttribute" + attribute: "TxDataCount" + response: + constraints: + type: uint32 - label: "TH reads TxDataPollCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-data-poll-count 476 0 - - [1649826215.573121][3553:3558] CHIP:DMG: SuppressResponse = true, - [1649826215.573185][3553:3558] CHIP:DMG: InteractionModelRevision = 1 - [1649826215.573242][3553:3558] CHIP:DMG: } - [1649826215.573541][3553:3558] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_001D DataVersion: 2758196590 - [1649826215.573679][3553:3558] CHIP:TOO: TxDataPollCount: 0 - disabled: true + command: "readAttribute" + attribute: "TxDataPollCount" + response: + constraints: + type: uint32 - label: "TH reads TxBeaconCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-beacon-count 476 0 - - - [1649826252.581671][3561:3566] CHIP:DMG: SuppressResponse = true, - [1649826252.581733][3561:3566] CHIP:DMG: InteractionModelRevision = 1 - [1649826252.581789][3561:3566] CHIP:DMG: } - [1649826252.582088][3561:3566] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_001E DataVersion: 2758196590 - [1649826252.582224][3561:3566] CHIP:TOO: TxBeaconCount: 0 - disabled: true + command: "readAttribute" + attribute: "TxBeaconCount" + response: + constraints: + type: uint32 - label: "TH reads TxBeaconRequestCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-beacon-request-count 476 0 - - [1649826283.345936][3568:3573] CHIP:DMG: SuppressResponse = true, - [1649826283.345998][3568:3573] CHIP:DMG: InteractionModelRevision = 1 - [1649826283.346055][3568:3573] CHIP:DMG: } - [1649826283.346357][3568:3573] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_001F DataVersion: 2758196590 - [1649826283.346499][3568:3573] CHIP:TOO: TxBeaconRequestCount: 0 - disabled: true + command: "readAttribute" + attribute: "TxBeaconRequestCount" + response: + constraints: + type: uint32 - label: "TH reads TxOtherCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-other-count 476 0 - - [1649826328.386892][3574:3579] CHIP:DMG: SuppressResponse = true, - [1649826328.386953][3574:3579] CHIP:DMG: InteractionModelRevision = 1 - [1649826328.387010][3574:3579] CHIP:DMG: } - [1649826328.387310][3574:3579] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0020 DataVersion: 2758196590 - [1649826328.387453][3574:3579] CHIP:TOO: TxOtherCount: 0 - disabled: true + command: "readAttribute" + attribute: "TxOtherCount" + response: + constraints: + type: uint32 - label: "TH reads TxRetryCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-retry-count 476 0 - - [1649826365.526774][3584:3589] CHIP:DMG: SuppressResponse = true, - [1649826365.526838][3584:3589] CHIP:DMG: InteractionModelRevision = 1 - [1649826365.526915][3584:3589] CHIP:DMG: } - [1649826365.527258][3584:3589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0021 DataVersion: 2758196590 - [1649826365.527400][3584:3589] CHIP:TOO: TxRetryCount: 986 - disabled: true + command: "readAttribute" + attribute: "TxRetryCount" + response: + constraints: + type: uint32 - label: "TH reads TxDirectMaxRetryExpiryCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-direct-max-retry-expiry-count 476 0 - - - [1649826396.738205][3590:3595] CHIP:DMG: SuppressResponse = true, - [1649826396.738269][3590:3595] CHIP:DMG: InteractionModelRevision = 1 - [1649826396.738353][3590:3595] CHIP:DMG: } - [1649826396.738698][3590:3595] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0022 DataVersion: 2758196590 - [1649826396.738841][3590:3595] CHIP:TOO: TxDirectMaxRetryExpiryCount: 15 - disabled: true + command: "readAttribute" + attribute: "TxDirectMaxRetryExpiryCount" + response: + constraints: + type: uint32 - label: "TH reads TxIndirectMaxRetryExpiryCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-indirect-max-retry-expiry-count 476 0 - - [1649826428.732746][3598:3603] CHIP:DMG: SuppressResponse = true, - [1649826428.732810][3598:3603] CHIP:DMG: InteractionModelRevision = 1 - [1649826428.732868][3598:3603] CHIP:DMG: } - [1649826428.733168][3598:3603] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0023 DataVersion: 2758196590 - [1649826428.733307][3598:3603] CHIP:TOO: TxIndirectMaxRetryExpiryCount: 0 - disabled: true + command: "readAttribute" + attribute: "TxIndirectMaxRetryExpiryCount" + response: + constraints: + type: uint32 - label: "TH reads TxErrCcaCount attribute value from DUT" - verification: | - /chip-tool threadnetworkdiagnostics read tx-err-cca-count 476 0 - - [1649826459.644117][3606:3611] CHIP:DMG: SuppressResponse = true, - [1649826459.644179][3606:3611] CHIP:DMG: InteractionModelRevision = 1 - [1649826459.644236][3606:3611] CHIP:DMG: } - [1649826459.644572][3606:3611] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0024 DataVersion: 2758196590 - [1649826459.644713][3606:3611] CHIP:TOO: TxErrCcaCount: 8 - disabled: true + command: "readAttribute" + attribute: "TxErrCcaCount" + response: + constraints: + type: uint32 - label: "TH reads TxErrAbortCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-err-abort-count 476 0 - - - [1649826488.510290][3614:3619] CHIP:DMG: SuppressResponse = true, - [1649826488.510353][3614:3619] CHIP:DMG: InteractionModelRevision = 1 - [1649826488.510411][3614:3619] CHIP:DMG: } - [1649826488.510711][3614:3619] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0025 DataVersion: 2758196590 - [1649826488.510848][3614:3619] CHIP:TOO: TxErrAbortCount: 0 - disabled: true + command: "readAttribute" + attribute: "TxErrAbortCount" + response: + constraints: + type: uint32 - label: "TH reads TxErrBusyChannelCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read tx-err-busy-channel-count 476 0 - - [1649826519.384125][3621:3626] CHIP:DMG: SuppressResponse = true, - [1649826519.384189][3621:3626] CHIP:DMG: InteractionModelRevision = 1 - [1649826519.384269][3621:3626] CHIP:DMG: } - [1649826519.384665][3621:3626] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0026 DataVersion: 2758196590 - [1649826519.384810][3621:3626] CHIP:TOO: TxErrBusyChannelCount: 0 - disabled: true + command: "readAttribute" + attribute: "TxErrBusyChannelCount" + response: + constraints: + type: uint32 diff --git a/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_2_3.yaml b/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_2_3.yaml index 515f7f9544b18e..05f8b4479521f7 100644 --- a/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DIAG_TH_NW_2_3.yaml @@ -11,206 +11,153 @@ # 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: 48.4. [TC-DIAG-TH_NW-2.3] Attributes-Rx [DUT Server] config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Thread Network Diagnostics" endpoint: 0 tests: - - label: "Commission DUT to TH" - verification: | - - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH reads RxTotalCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-total-count 476 0 - - - [1649826557.581996][3628:3633] CHIP:DMG: SuppressResponse = true, - [1649826557.582060][3628:3633] CHIP:DMG: InteractionModelRevision = 1 - [1649826557.582140][3628:3633] CHIP:DMG: } - [1649826557.582440][3628:3633] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0027 DataVersion: 2758196590 - [1649826557.582577][3628:3633] CHIP:TOO: RxTotalCount: 1800 - disabled: true + command: "readAttribute" + attribute: "RxTotalCount" + response: + constraints: + type: uint32 - label: "TH reads RxUnicastCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-unicast-count 476 0 - - [1649826579.815407][3637:3642] CHIP:DMG: SuppressResponse = true, - [1649826579.815471][3637:3642] CHIP:DMG: InteractionModelRevision = 1 - [1649826579.815528][3637:3642] CHIP:DMG: } - [1649826579.815826][3637:3642] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0028 DataVersion: 2758196590 - [1649826579.815967][3637:3642] CHIP:TOO: RxUnicastCount: 1170 - disabled: true + command: "readAttribute" + attribute: "RxUnicastCount" + response: + constraints: + type: uint32 - label: "TH reads RxBroadcastCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-broadcast-count 476 0 - - [1649826618.938816][3643:3648] CHIP:DMG: SuppressResponse = true, - [1649826618.938878][3643:3648] CHIP:DMG: InteractionModelRevision = 1 - [1649826618.938937][3643:3648] CHIP:DMG: } - [1649826618.939235][3643:3648] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0029 DataVersion: 2758196590 - [1649826618.939376][3643:3648] CHIP:TOO: RxBroadcastCount: 91 - disabled: true + command: "readAttribute" + attribute: "RxBroadcastCount" + response: + constraints: + type: uint32 - label: "TH reads RxDataCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-data-count 476 0 - - [1649826651.375014][3653:3658] CHIP:DMG: SuppressResponse = true, - [1649826651.375076][3653:3658] CHIP:DMG: InteractionModelRevision = 1 - [1649826651.375134][3653:3658] CHIP:DMG: } - [1649826651.375439][3653:3658] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_002A DataVersion: 2758196590 - [1649826651.375576][3653:3658] CHIP:TOO: RxDataCount: 1137 - disabled: true + command: "readAttribute" + attribute: "RxDataCount" + response: + constraints: + type: uint32 - label: "TH reads RxDataPollCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-data-poll-count 476 0 - - - [1649826681.548001][3659:3664] CHIP:DMG: SuppressResponse = true, - [1649826681.548086][3659:3664] CHIP:DMG: InteractionModelRevision = 1 - [1649826681.548146][3659:3664] CHIP:DMG: } - [1649826681.548573][3659:3664] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_002B DataVersion: 2758196590 - [1649826681.548717][3659:3664] CHIP:TOO: RxDataPollCount: 0 - disabled: true + command: "readAttribute" + attribute: "RxDataPollCount" + response: + constraints: + type: uint32 - label: "TH reads RxBeaconCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-beacon-count 476 0 - - [1649826720.298790][3667:3672] CHIP:DMG: SuppressResponse = true, - [1649826720.298852][3667:3672] CHIP:DMG: InteractionModelRevision = 1 - [1649826720.298909][3667:3672] CHIP:DMG: } - [1649826720.299210][3667:3672] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_002C DataVersion: 2758196590 - [1649826720.299349][3667:3672] CHIP:TOO: RxBeaconCount: 0 - disabled: true + command: "readAttribute" + attribute: "RxBeaconCount" + response: + constraints: + type: uint32 - label: "TH reads RxBeaconRequestCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-beacon-request-count 476 0 - - [1649826748.246273][3675:3680] CHIP:DMG: SuppressResponse = true, - [1649826748.246337][3675:3680] CHIP:DMG: InteractionModelRevision = 1 - [1649826748.246394][3675:3680] CHIP:DMG: } - [1649826748.246689][3675:3680] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_002D DataVersion: 2758196590 - [1649826748.246829][3675:3680] CHIP:TOO: RxBeaconRequestCount: 0 - disabled: true + command: "readAttribute" + attribute: "RxBeaconRequestCount" + response: + constraints: + type: uint32 - label: "TH reads RxOtherCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-other-count 476 0 - - [1649826777.590499][3682:3687] CHIP:DMG: SuppressResponse = true, - [1649826777.590561][3682:3687] CHIP:DMG: InteractionModelRevision = 1 - [1649826777.590618][3682:3687] CHIP:DMG: } - [1649826777.590919][3682:3687] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_002E DataVersion: 2758196590 - [1649826777.591058][3682:3687] CHIP:TOO: RxOtherCount: 0 - disabled: true + command: "readAttribute" + attribute: "RxOtherCount" + response: + constraints: + type: uint32 - label: "TH reads RxAddressFilteredCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-address-filtered-count 476 0 - - [1649826804.387075][3688:3693] CHIP:DMG: SuppressResponse = true, - [1649826804.387139][3688:3693] CHIP:DMG: InteractionModelRevision = 1 - [1649826804.387197][3688:3693] CHIP:DMG: } - [1649826804.387498][3688:3693] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_002F DataVersion: 2758196590 - [1649826804.387640][3688:3693] CHIP:TOO: RxAddressFilteredCount: 0 - disabled: true + command: "readAttribute" + attribute: "RxAddressFilteredCount" + response: + constraints: + type: uint32 - label: "TH reads RxDestAddrFilteredCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-dest-addr-filtered-count 476 0 - - [1649826829.993945][3697:3702] CHIP:DMG: SuppressResponse = true, - [1649826829.994007][3697:3702] CHIP:DMG: InteractionModelRevision = 1 - [1649826829.994066][3697:3702] CHIP:DMG: } - [1649826829.994369][3697:3702] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0030 DataVersion: 2758196590 - [1649826829.994509][3697:3702] CHIP:TOO: RxDestAddrFilteredCount: 65 - disabled: true + command: "readAttribute" + attribute: "RxDestAddrFilteredCount" + response: + constraints: + type: uint32 - label: "TH reads RxDuplicatedCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-duplicated-count 476 0 - - [1649826865.904951][3703:3708] CHIP:DMG: SuppressResponse = true, - [1649826865.905034][3703:3708] CHIP:DMG: InteractionModelRevision = 1 - [1649826865.905094][3703:3708] CHIP:DMG: } - [1649826865.905397][3703:3708] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0031 DataVersion: 2758196590 - [1649826865.905541][3703:3708] CHIP:TOO: RxDuplicatedCount: 194 - disabled: true + command: "readAttribute" + attribute: "RxDuplicatedCount" + response: + constraints: + type: uint32 - label: "TH reads RxErrNoFrameCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-err-no-frame-count 476 0 - - [1649826895.919770][3711:3716] CHIP:DMG: SuppressResponse = true, - [1649826895.919832][3711:3716] CHIP:DMG: InteractionModelRevision = 1 - [1649826895.919890][3711:3716] CHIP:DMG: } - [1649826895.920190][3711:3716] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0032 DataVersion: 2758196590 - [1649826895.920328][3711:3716] CHIP:TOO: RxErrNoFrameCount: 7 - disabled: true + command: "readAttribute" + attribute: "RxErrNoFrameCount" + response: + constraints: + type: uint32 - label: "TH reads RxErrUnknownNeighborCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-err-unknown-neighbor-count 476 0 + command: "readAttribute" + attribute: "RxErrUnknownNeighborCount" + response: + constraints: + type: uint32 - [1649826928.095373][3718:3723] CHIP:DMG: SuppressResponse = true, - [1649826928.095435][3718:3723] CHIP:DMG: InteractionModelRevision = 1 - [1649826928.095492][3718:3723] CHIP:DMG: } - [1649826928.095796][3718:3723] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0033 DataVersion: 2758196590 - [1649826928.095936][3718:3723] CHIP:TOO: RxErrUnknownNeighborCount: 0 - disabled: true - - - label: "TH reads RxErrInvalidScrAddrCount attribute value from DUT" + #Issue #18335 + - label: + "TH reads RxErrInvalidScrAddrCount attribute value from DUT and verify + data type" verification: | ./chip-tool threadnetworkdiagnostics read rx-err-invalid-src-addr-count 476 0 - [1649826953.827775][3727:3732] CHIP:DMG: SuppressResponse = true, - [1649826953.827837][3727:3732] CHIP:DMG: InteractionModelRevision = 1 - [1649826953.827894][3727:3732] CHIP:DMG: } - [1649826953.828197][3727:3732] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0034 DataVersion: 2758196590 - [1649826953.828346][3727:3732] CHIP:TOO: RxErrInvalidSrcAddrCount: 0 - disabled: true + [1649826953.827775][3727:3732] CHIP:DMG: SuppressResponse = true, + [1649826953.827837][3727:3732] CHIP:DMG: InteractionModelRevision = 1 + [1649826953.827894][3727:3732] CHIP:DMG: } + [1649826953.828197][3727:3732] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0034 DataVersion: 2758196590 + [1649826953.828346][3727:3732] CHIP:TOO: RxErrInvalidSrcAddrCount: 0 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "TH reads RxErrSecCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-err-sec-count 476 0 - - [1649826991.014971][3733:3738] CHIP:DMG: SuppressResponse = true, - [1649826991.015035][3733:3738] CHIP:DMG: InteractionModelRevision = 1 - [1649826991.015093][3733:3738] CHIP:DMG: } - [1649826991.015394][3733:3738] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0035 DataVersion: 2758196590 - [1649826991.015534][3733:3738] CHIP:TOO: RxErrSecCount: 0 - disabled: true + command: "readAttribute" + attribute: "RxErrSecCount" + response: + constraints: + type: uint32 - label: "TH reads RxErrFcsCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-err-fcs-count 476 0 - - [1649827019.107248][3740:3745] CHIP:DMG: SuppressResponse = true, - [1649827019.107310][3740:3745] CHIP:DMG: InteractionModelRevision = 1 - [1649827019.107367][3740:3745] CHIP:DMG: } - [1649827019.107664][3740:3745] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0036 DataVersion: 2758196590 - [1649827019.107803][3740:3745] CHIP:TOO: RxErrFcsCount: 674 - disabled: true + command: "readAttribute" + attribute: "RxErrFcsCount" + response: + constraints: + type: uint32 - label: "TH reads RxErrOtherCount attribute value from DUT" - verification: | - ./chip-tool threadnetworkdiagnostics read rx-err-other-count 476 0 - - [1649827053.305098][3750:3755] CHIP:DMG: SuppressResponse = true, - [1649827053.305160][3750:3755] CHIP:DMG: InteractionModelRevision = 1 - [1649827053.305217][3750:3755] CHIP:DMG: } - [1649827053.305513][3750:3755] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0035 Attribute 0x0000_0037 DataVersion: 2758196590 - [1649827053.305651][3750:3755] CHIP:TOO: RxErrOtherCount: 5 - disabled: true + command: "readAttribute" + attribute: "RxErrOtherCount" + response: + constraints: + type: uint32 diff --git a/src/app/tests/suites/certification/Test_TC_DL_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_2.yaml index 2e13d891f92ac1..e3f23f75f8e1a0 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_2.yaml @@ -11,73 +11,166 @@ # 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: 100.2.2. [TC-DL-2.2] Verification for Door lock command[DUT-Server] +name: 108.2.2. [TC-DL-2.2] Verification for Door lock command[DUT-Server] config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Door Lock" + endpoint: 1 tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "TH writes the RequirePINforRemoteOperation attribute value as False on the DUT" - verification: | - https://github.com/project-chip/connectedhomeip/issues/15776 - disabled: true - - - label: "TH sends Lock Door Command to the DUT without any valid PINCode" - verification: | - - disabled: true + command: "writeAttribute" + attribute: "RequirePINforRemoteOperation" + arguments: + value: false + + - label: "TH sends Lock Door Command to the DUT without PINCode" + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "PINCode" + value: "" + response: + error: FAILURE - label: "TH writes the RequirePINforRemoteOperation attribute value as True on the DUT" - verification: | - - disabled: true + command: "writeAttribute" + attribute: "RequirePINforRemoteOperation" + arguments: + value: true + + - label: "Create new PIN credential and lock/unlock user" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "operationType" + value: 0 + - name: "credential" + value: { CredentialType: 1, CredentialIndex: 1 } + - name: "credentialData" + value: "123456" + - name: "userIndex" + value: null + - name: "userStatus" + value: null + - name: "userType" + value: null + response: + values: + - name: "status" + value: 0 + - name: "userIndex" + value: 1 + - name: "nextCredentialIndex" + value: 2 - label: "TH sends Lock Door Command to the DUT with valid PINCode" - verification: | - - disabled: true + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "123456" - label: "TH sends Lock Door Command to the DUT without any argument PINCode" - verification: | - - disabled: true + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "" + response: + error: FAILURE - label: "TH writes WrongCodeEntryLimit attribute value as 3 on the DUT" - verification: | - - disabled: true + command: "writeAttribute" + attribute: "WrongCodeEntryLimit" + arguments: + value: 3 - label: "TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds on the DUT" - verification: | - - disabled: true + command: "writeAttribute" + attribute: "UserCodeTemporaryDisableTime" + arguments: + value: 5 - label: "TH sends Lock Door Command to the DUT with invalid PINCode" - verification: | + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "12345" + response: + error: FAILURE - disabled: true - - - label: - "Repeat the above step 3 times TH reads UserCodeTemporaryDisableTime - attribute from DUT" - verification: | + - label: "TH sends Lock Door Command to the DUT with invalid PINCode" + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "54321" + response: + error: FAILURE - disabled: true + - label: "TH sends Lock Door Command to the DUT with invalid PINCode" + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "987623" + response: + error: FAILURE - - label: - "After UserCodeTemporaryDisableTime attribute time expires, TH sends - Lock Command to the DUT with valid PINCode" - verification: | + - label: "TH sends Lock Door Command to the DUT with invalid PINCode" + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "67890" + response: + error: FAILURE + + - label: "TH reads UserCodeTemporaryDisableTime attribute from DUT" + command: "readAttribute" + attribute: "UserCodeTemporaryDisableTime" + response: + value: 5 - disabled: true + - label: "TH sends Lock Door Command to the DUT with valid PINCode" + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "123456" + + - label: "Clean the created credential" + command: "ClearCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "credential" + value: { CredentialType: 1, CredentialIndex: 1 } diff --git a/src/app/tests/suites/certification/Test_TC_DL_1_3.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_3.yaml similarity index 96% rename from src/app/tests/suites/certification/Test_TC_DL_1_3.yaml rename to src/app/tests/suites/certification/Test_TC_DL_2_3.yaml index e4b4025ec42832..49d08213ff8195 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_3.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 106.3. [TC-DL-1.3] Verification for Unlock Door command [DUT-Server] +name: 108.2.3. [TC-DL-2.3] Verification for Unlock Door command [DUT-Server] config: nodeId: 0x12344321 @@ -90,7 +90,7 @@ tests: - name: "ms" value: 10000 - - label: "TH reads LockState attriute" + - label: "TH reads LockState attribute" command: "readAttribute" attribute: "LockState" response: diff --git a/src/app/tests/suites/certification/Test_TC_DL_2_4.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_4.yaml index 1c0940251bd30f..d208014d345629 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_4.yaml @@ -11,27 +11,91 @@ # 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: - 100.2.4. [TC-DL-2.4] Verification for Unlock with Timeout command + 108.2.4. [TC-DL-2.4] Verification for Unlock with Timeout command [DUT-Server] config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Door Lock" + endpoint: 1 tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Create new PIN credential and lock/unlock user" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "operationType" + value: 0 + - name: "credential" + value: { CredentialType: 1, CredentialIndex: 1 } + - name: "credentialData" + value: "123456" + - name: "userIndex" + value: null + - name: "userStatus" + value: null + - name: "userType" + value: null + response: + values: + - name: "status" + value: 0 + - name: "userIndex" + value: 1 + - name: "nextCredentialIndex" + value: 2 + + - label: "Precondition: Door is in locked state" + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "PINCode" + value: "123456" + - label: "TH writes AutoRelockTime attribute value as 10 seconds on the DUT" - verification: | - https://github.com/project-chip/connectedhomeip/issues/15776 - disabled: true + command: "writeAttribute" + attribute: "AutoRelockTime" + arguments: + value: 10 + + - label: "TH sends the unlock with Timeout command to the DUT " + command: "UnlockWithTimeout" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "Timeout" + value: 5 + - name: "PINCode" + value: "123456" + + - label: "TH reads AutoRelockTime attribute from DUT" + command: "readAttribute" + attribute: "AutoRelockTime" + response: + value: 10 - - label: - "TH sends the unlock with Timeout command to the DUT with argument - PINCode value as 'xxxxxxxx' and the Timeout argument value as 5 - seconds" - verification: | + - label: "Wait 5000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 5000 - disabled: true + - label: "TH reads LockState attribute" + command: "readAttribute" + attribute: "LockState" + response: + value: 1 diff --git a/src/app/tests/suites/tests.js b/src/app/tests/suites/tests.js index cd20427313a236..19f0b78c80bcc3 100644 --- a/src/app/tests/suites/tests.js +++ b/src/app/tests/suites/tests.js @@ -318,8 +318,6 @@ function getManualTests() const DoorLock = [ 'Test_TC_DL_2_1', - 'Test_TC_DL_2_2', - 'Test_TC_DL_2_4', 'Test_TC_DL_2_5', 'Test_TC_DL_2_6', 'Test_TC_DL_2_7', @@ -397,8 +395,6 @@ function getManualTests() ]; const ThreadNetworkDiagnostics = [ - 'Test_TC_DIAG_TH_NW_2_2', - 'Test_TC_DIAG_TH_NW_2_3', 'Test_TC_DIAG_TH_NW_2_6', 'Test_TC_DIAG_TH_NW_2_7', 'Test_TC_DIAG_TH_NW_2_8', @@ -675,6 +671,8 @@ function getTests() const ThreadNetworkDiagnostics = [ 'Test_TC_DIAG_TH_NW_1_1', 'Test_TC_DIAG_TH_NW_1_2', + 'Test_TC_DIAG_TH_NW_2_2', + 'Test_TC_DIAG_TH_NW_2_3', ]; const WiFiNetworkDiagnostics = [ @@ -757,7 +755,9 @@ function getTests() 'DL_UsersAndCredentials', 'DL_LockUnlock', 'DL_Schedules', - 'Test_TC_DL_1_3', + 'Test_TC_DL_2_2', + 'Test_TC_DL_2_3', + 'Test_TC_DL_2_4', ]; const Groups = [ diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index 18ff685e354082..cd2ca92a30a4cb 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -161,6 +161,8 @@ class TestList : public Command { printf("Test_TC_TSUIC_2_2\n"); printf("Test_TC_DIAG_TH_NW_1_1\n"); printf("Test_TC_DIAG_TH_NW_1_2\n"); + printf("Test_TC_DIAG_TH_NW_2_2\n"); + printf("Test_TC_DIAG_TH_NW_2_3\n"); printf("Test_TC_LC_1_2\n"); printf("Test_TC_WIFIDIAG_1_1\n"); printf("Test_TC_WIFIDIAG_3_1\n"); @@ -217,7 +219,9 @@ class TestList : public Command { printf("DL_UsersAndCredentials\n"); printf("DL_LockUnlock\n"); printf("DL_Schedules\n"); - printf("Test_TC_DL_1_3\n"); + printf("Test_TC_DL_2_2\n"); + printf("Test_TC_DL_2_3\n"); + printf("Test_TC_DL_2_4\n"); printf("TestGroupsCluster\n"); printf("TestGroupKeyManagementCluster\n"); @@ -57644,6 +57648,1092 @@ class Test_TC_DIAG_TH_NW_1_2 : public TestCommandBridge { } }; +class Test_TC_DIAG_TH_NW_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DIAG_TH_NW_2_2() + : TestCommandBridge("Test_TC_DIAG_TH_NW_2_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_DIAG_TH_NW_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_TH_NW_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_TH_NW_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads TxTotalCount attribute value from DUT\n"); + err = TestThReadsTxTotalCountAttributeValueFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads TxUnicastCount attribute value from DUT\n"); + err = TestThReadsTxUnicastCountAttributeValueFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads TxBroadcastCount attribute value from DUT\n"); + err = TestThReadsTxBroadcastCountAttributeValueFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads TxAckRequestedCount attribute value from DUT\n"); + err = TestThReadsTxAckRequestedCountAttributeValueFromDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads TxAckedCount attribute value from DUT\n"); + err = TestThReadsTxAckedCountAttributeValueFromDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads TxNoAckRequestedCount attribute value from DUT\n"); + err = TestThReadsTxNoAckRequestedCountAttributeValueFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads TxDataCount attribute value from DUT\n"); + err = TestThReadsTxDataCountAttributeValueFromDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads TxDataPollCount attribute value from DUT\n"); + err = TestThReadsTxDataPollCountAttributeValueFromDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads TxBeaconCount attribute value from DUT\n"); + err = TestThReadsTxBeaconCountAttributeValueFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads TxBeaconRequestCount attribute value from DUT\n"); + err = TestThReadsTxBeaconRequestCountAttributeValueFromDut_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads TxOtherCount attribute value from DUT\n"); + err = TestThReadsTxOtherCountAttributeValueFromDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads TxRetryCount attribute value from DUT\n"); + err = TestThReadsTxRetryCountAttributeValueFromDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads TxDirectMaxRetryExpiryCount attribute value from DUT\n"); + err = TestThReadsTxDirectMaxRetryExpiryCountAttributeValueFromDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads TxIndirectMaxRetryExpiryCount attribute value from DUT\n"); + err = TestThReadsTxIndirectMaxRetryExpiryCountAttributeValueFromDut_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads TxErrCcaCount attribute value from DUT\n"); + err = TestThReadsTxErrCcaCountAttributeValueFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads TxErrAbortCount attribute value from DUT\n"); + err = TestThReadsTxErrAbortCountAttributeValueFromDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads TxErrBusyChannelCount attribute value from DUT\n"); + err = TestThReadsTxErrBusyChannelCountAttributeValueFromDut_17(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 18; + + 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; + WaitForCommissionee("alpha", value); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxTotalCountAttributeValueFromDut_1() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxTotalCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txTotalCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxUnicastCountAttributeValueFromDut_2() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxUnicastCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txUnicastCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxBroadcastCountAttributeValueFromDut_3() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxBroadcastCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txBroadcastCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxAckRequestedCountAttributeValueFromDut_4() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxAckRequestedCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txAckRequestedCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxAckedCountAttributeValueFromDut_5() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxAckedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxAckedCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txAckedCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxNoAckRequestedCountAttributeValueFromDut_6() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxNoAckRequestedCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txNoAckRequestedCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxDataCountAttributeValueFromDut_7() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxDataCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txDataCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxDataPollCountAttributeValueFromDut_8() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxDataPollCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txDataPollCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxBeaconCountAttributeValueFromDut_9() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxBeaconCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txBeaconCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxBeaconRequestCountAttributeValueFromDut_10() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxBeaconRequestCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txBeaconRequestCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxOtherCountAttributeValueFromDut_11() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxOtherCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txOtherCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxRetryCountAttributeValueFromDut_12() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxRetryCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txRetryCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxDirectMaxRetryExpiryCountAttributeValueFromDut_13() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxDirectMaxRetryExpiryCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txDirectMaxRetryExpiryCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxIndirectMaxRetryExpiryCountAttributeValueFromDut_14() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxIndirectMaxRetryExpiryCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txIndirectMaxRetryExpiryCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxErrCcaCountAttributeValueFromDut_15() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxErrCcaCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txErrCcaCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxErrAbortCountAttributeValueFromDut_16() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxErrAbortCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txErrAbortCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTxErrBusyChannelCountAttributeValueFromDut_17() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads TxErrBusyChannelCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("txErrBusyChannelCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DIAG_TH_NW_2_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DIAG_TH_NW_2_3() + : TestCommandBridge("Test_TC_DIAG_TH_NW_2_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_DIAG_TH_NW_2_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_TH_NW_2_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_TH_NW_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 : TH reads RxTotalCount attribute value from DUT\n"); + err = TestThReadsRxTotalCountAttributeValueFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads RxUnicastCount attribute value from DUT\n"); + err = TestThReadsRxUnicastCountAttributeValueFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads RxBroadcastCount attribute value from DUT\n"); + err = TestThReadsRxBroadcastCountAttributeValueFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads RxDataCount attribute value from DUT\n"); + err = TestThReadsRxDataCountAttributeValueFromDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads RxDataPollCount attribute value from DUT\n"); + err = TestThReadsRxDataPollCountAttributeValueFromDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads RxBeaconCount attribute value from DUT\n"); + err = TestThReadsRxBeaconCountAttributeValueFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads RxBeaconRequestCount attribute value from DUT\n"); + err = TestThReadsRxBeaconRequestCountAttributeValueFromDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads RxOtherCount attribute value from DUT\n"); + err = TestThReadsRxOtherCountAttributeValueFromDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads RxAddressFilteredCount attribute value from DUT\n"); + err = TestThReadsRxAddressFilteredCountAttributeValueFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads RxDestAddrFilteredCount attribute value from DUT\n"); + err = TestThReadsRxDestAddrFilteredCountAttributeValueFromDut_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads RxDuplicatedCount attribute value from DUT\n"); + err = TestThReadsRxDuplicatedCountAttributeValueFromDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads RxErrNoFrameCount attribute value from DUT\n"); + err = TestThReadsRxErrNoFrameCountAttributeValueFromDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads RxErrUnknownNeighborCount attribute value from DUT\n"); + err = TestThReadsRxErrUnknownNeighborCountAttributeValueFromDut_13(); + break; + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : TH reads RxErrInvalidScrAddrCount attribute value from DUT and verify data type\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestThReadsRxErrInvalidScrAddrCountAttributeValueFromDutAndVerifyDataType_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads RxErrSecCount attribute value from DUT\n"); + err = TestThReadsRxErrSecCountAttributeValueFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads RxErrFcsCount attribute value from DUT\n"); + err = TestThReadsRxErrFcsCountAttributeValueFromDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads RxErrOtherCount attribute value from DUT\n"); + err = TestThReadsRxErrOtherCountAttributeValueFromDut_17(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 18; + + 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; + WaitForCommissionee("alpha", value); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxTotalCountAttributeValueFromDut_1() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxTotalCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxTotalCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxUnicastCountAttributeValueFromDut_2() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxUnicastCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxUnicastCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxBroadcastCountAttributeValueFromDut_3() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxBroadcastCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxBroadcastCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxDataCountAttributeValueFromDut_4() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxDataCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxDataCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxDataPollCountAttributeValueFromDut_5() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxDataPollCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxDataPollCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxBeaconCountAttributeValueFromDut_6() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxBeaconCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxBeaconCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxBeaconRequestCountAttributeValueFromDut_7() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxBeaconRequestCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxBeaconRequestCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxOtherCountAttributeValueFromDut_8() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxOtherCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxOtherCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxAddressFilteredCountAttributeValueFromDut_9() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxAddressFilteredCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxAddressFilteredCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxDestAddrFilteredCountAttributeValueFromDut_10() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxDestAddrFilteredCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxDestAddrFilteredCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxDuplicatedCountAttributeValueFromDut_11() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxDuplicatedCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxDuplicatedCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxErrNoFrameCountAttributeValueFromDut_12() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxErrNoFrameCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxErrNoFrameCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxErrUnknownNeighborCountAttributeValueFromDut_13() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxErrUnknownNeighborCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxErrUnknownNeighborCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxErrInvalidScrAddrCountAttributeValueFromDutAndVerifyDataType_14() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + UserPrompt("alpha", value); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxErrSecCountAttributeValueFromDut_15() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxErrSecCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxErrSecCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxErrFcsCountAttributeValueFromDut_16() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxErrFcsCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxErrFcsCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsRxErrOtherCountAttributeValueFromDut_17() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestThreadNetworkDiagnostics * cluster = [[CHIPTestThreadNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RxErrOtherCount attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("rxErrOtherCount", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_LC_1_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -102757,250 +103847,776 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateYearDayScheduleForSecondUser_77() + CHIP_ERROR TestCreateYearDayScheduleForSecondUser_77() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:55555UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:7777777UL]; + [cluster setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create Year Day schedule for second user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCreatedYearDayScheduleForFirst_78() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Verify created year day schedule for first Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 55555UL)); + } + + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 7777777UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCleanup_79() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:65534U]; + [cluster clearUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Cleanup Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedWeekDaySchedules_80() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing first user also cleared week day schedules Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedYearDaySchedules_81() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:4]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing first user also cleared year day schedules Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 4)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedWeekDaySchedules_82() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:4]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing second user also cleared week day schedules Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 4)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedYearDaySchedules_83() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing second user also cleared year day schedules Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DL_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DL_2_2() + : TestCommandBridge("Test_TC_DL_2_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_DL_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : TH writes the RequirePINforRemoteOperation attribute value as False on the DUT\n"); + err = TestThWritesTheRequirePINforRemoteOperationAttributeValueAsFalseOnTheDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends Lock Door Command to the DUT without PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithoutPINCode_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : TH writes the RequirePINforRemoteOperation attribute value as True on the DUT\n"); + err = TestThWritesTheRequirePINforRemoteOperationAttributeValueAsTrueOnTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends Lock Door Command to the DUT with valid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH sends Lock Door Command to the DUT without any argument PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithoutAnyArgumentPINCode_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH writes WrongCodeEntryLimit attribute value as 3 on the DUT\n"); + err = TestThWritesWrongCodeEntryLimitAttributeValueAs3OnTheDut_7(); + break; + case 8: + ChipLogProgress( + chipTool, " ***** Test Step 8 : TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds on the DUT\n"); + err = TestThWritesUserCodeTemporaryDisableTimeAttributeValueAs5SecondsOnTheDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads UserCodeTemporaryDisableTime attribute from DUT\n"); + err = TestThReadsUserCodeTemporaryDisableTimeAttributeFromDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH sends Lock Door Command to the DUT with valid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Clean the created credential\n"); + err = TestCleanTheCreatedCredential_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), EMBER_ZCL_STATUS_FAILURE)); + 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), EMBER_ZCL_STATUS_FAILURE)); + 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_FAILURE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + 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. + WaitForMs(0); + } + + 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; + 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; + WaitForCommissionee("alpha", value); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesTheRequirePINforRemoteOperationAttributeValueAsFalseOnTheDut_1() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id requirePINforRemoteOperationArgument; + requirePINforRemoteOperationArgument = [NSNumber numberWithBool:false]; + [cluster writeAttributeRequirePINforRemoteOperationWithValue:requirePINforRemoteOperationArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes the RequirePINforRemoteOperation attribute value as False " + @"on the DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutPINCode_2() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"" length:0]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT without PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesTheRequirePINforRemoteOperationAttributeValueAsTrueOnTheDut_3() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id requirePINforRemoteOperationArgument; + requirePINforRemoteOperationArgument = [NSNumber numberWithBool:true]; + [cluster writeAttributeRequirePINforRemoteOperationWithValue:requirePINforRemoteOperationArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes the RequirePINforRemoteOperation attribute value as True " + @"on the DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_4() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_5() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with valid PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutAnyArgumentPINCode_6() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterSetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:55555UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:7777777UL]; - [cluster setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Create Year Day schedule for second user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"" length:0]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT without any argument PINCode Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedYearDayScheduleForFirst_78() + CHIP_ERROR TestThWritesWrongCodeEntryLimitAttributeValueAs3OnTheDut_7() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify created year day schedule for first Error: %@", err); + id wrongCodeEntryLimitArgument; + wrongCodeEntryLimitArgument = [NSNumber numberWithUnsignedChar:3]; + [cluster + writeAttributeWrongCodeEntryLimitWithValue:wrongCodeEntryLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes WrongCodeEntryLimit attribute value as 3 on the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1)); - } + NextTest(); + }]; - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + CHIP_ERROR TestThWritesUserCodeTemporaryDisableTimeAttributeValueAs5SecondsOnTheDut_8() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 55555UL)); - } + id userCodeTemporaryDisableTimeArgument; + userCodeTemporaryDisableTimeArgument = [NSNumber numberWithUnsignedChar:5]; + [cluster writeAttributeUserCodeTemporaryDisableTimeWithValue:userCodeTemporaryDisableTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds " + @"on the DUT Error: %@", + err); - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 7777777UL)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanup_79() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_9() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterClearUserParams alloc] init]; - params.userIndex = [NSNumber numberWithUnsignedShort:65534U]; - [cluster clearUserWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Cleanup Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"12345" length:5]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedWeekDaySchedules_80() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_10() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getWeekDayScheduleWithParams:params - completionHandler:^( - CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing first user also cleared week day schedules Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"54321" length:5]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; - { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_11() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"987623" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedYearDaySchedules_81() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_12() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:4]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing first user also cleared year day schedules Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"67890" length:5]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 4)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + CHIP_ERROR TestThReadsUserCodeTemporaryDisableTimeAttributeFromDut_13() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + [cluster + readAttributeUserCodeTemporaryDisableTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads UserCodeTemporaryDisableTime attribute from DUT Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("UserCodeTemporaryDisableTime", actualValue, 5)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedWeekDaySchedules_82() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_14() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:4]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - [cluster getWeekDayScheduleWithParams:params - completionHandler:^( - CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing second user also cleared week day schedules Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 4)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); - } + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with valid PINCode Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedYearDaySchedules_83() + CHIP_ERROR TestCleanTheCreatedCredential_15() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing second user also cleared year day schedules Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1)); - } + __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); - } + [cluster clearCredentialWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clean the created credential Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_DL_1_3 : public TestCommandBridge { +class Test_TC_DL_2_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DL_1_3() - : TestCommandBridge("Test_TC_DL_1_3") + Test_TC_DL_2_3() + : TestCommandBridge("Test_TC_DL_2_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -103010,7 +104626,7 @@ class Test_TC_DL_1_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DL_1_3() {} + ~Test_TC_DL_2_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -103018,11 +104634,11 @@ class Test_TC_DL_1_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_1_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_1_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -103063,8 +104679,8 @@ class Test_TC_DL_1_3 : public TestCommandBridge { err = TestWait10000ms_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attriute\n"); - err = TestThReadsLockStateAttriute_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attribute\n"); + err = TestThReadsLockStateAttribute_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Clean the created credential\n"); @@ -103270,14 +104886,14 @@ class Test_TC_DL_1_3 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsLockStateAttriute_7() + CHIP_ERROR TestThReadsLockStateAttribute_7() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LockState attriute Error: %@", err); + NSLog(@"TH reads LockState attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -103317,6 +104933,300 @@ class Test_TC_DL_1_3 : public TestCommandBridge { } }; +class Test_TC_DL_2_4 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DL_2_4() + : TestCommandBridge("Test_TC_DL_2_4") + , 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_DL_2_4() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_4\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_4\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 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Door is in locked state\n"); + err = TestPreconditionDoorIsInLockedState_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); + err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends the unlock with Timeout command to the DUT \n"); + err = TestThSendsTheUnlockWithTimeoutCommandToTheDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AutoRelockTime attribute from DUT\n"); + err = TestThReadsAutoRelockTimeAttributeFromDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 5000ms\n"); + err = TestWait5000ms_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attribute\n"); + err = TestThReadsLockStateAttribute_7(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 8; + + 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; + WaitForCommissionee("alpha", value); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPreconditionDoorIsInLockedState_2() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Precondition: Door is in locked state Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id autoRelockTimeArgument; + autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; + [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsTheUnlockWithTimeoutCommandToTheDut_4() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterUnlockWithTimeoutParams alloc] init]; + params.timeout = [NSNumber numberWithUnsignedShort:5U]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster unlockWithTimeoutWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends the unlock with Timeout command to the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AutoRelockTime", actualValue, 10UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait5000ms_6() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + WaitForMs("alpha", value); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsLockStateAttribute_7() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LockState attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class TestGroupsCluster : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -104971,6 +106881,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -105027,7 +106939,9 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), #endif // CONFIG_ENABLE_YAML_TESTS diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index d4c0788239feb8..b1feff556f53a2 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -163,6 +163,8 @@ class TestList : public Command printf("Test_TC_TSUIC_2_2\n"); printf("Test_TC_DIAG_TH_NW_1_1\n"); printf("Test_TC_DIAG_TH_NW_1_2\n"); + printf("Test_TC_DIAG_TH_NW_2_2\n"); + printf("Test_TC_DIAG_TH_NW_2_3\n"); printf("Test_TC_LC_1_2\n"); printf("Test_TC_WIFIDIAG_1_1\n"); printf("Test_TC_WIFIDIAG_3_1\n"); @@ -222,7 +224,9 @@ class TestList : public Command printf("DL_UsersAndCredentials\n"); printf("DL_LockUnlock\n"); printf("DL_Schedules\n"); - printf("Test_TC_DL_1_3\n"); + printf("Test_TC_DL_2_2\n"); + printf("Test_TC_DL_2_3\n"); + printf("Test_TC_DL_2_4\n"); printf("TestGroupMessaging\n"); printf("TestGroupsCluster\n"); printf("TestGroupKeyManagementCluster\n"); @@ -434,8 +438,6 @@ class ManualTestList : public Command printf("Test_TC_CC_7_5\n"); printf("Test_TC_CC_9_4\n"); printf("Test_TC_DL_2_1\n"); - printf("Test_TC_DL_2_2\n"); - printf("Test_TC_DL_2_4\n"); printf("Test_TC_DL_2_5\n"); printf("Test_TC_DL_2_6\n"); printf("Test_TC_DL_2_7\n"); @@ -480,8 +482,6 @@ class ManualTestList : public Command printf("Test_TC_TSTAT_3_1\n"); printf("Test_TC_TSTAT_3_2\n"); printf("Test_TC_TSUIC_3_1\n"); - printf("Test_TC_DIAG_TH_NW_2_2\n"); - printf("Test_TC_DIAG_TH_NW_2_3\n"); printf("Test_TC_DIAG_TH_NW_2_6\n"); printf("Test_TC_DIAG_TH_NW_2_7\n"); printf("Test_TC_DIAG_TH_NW_2_8\n"); @@ -31655,10 +31655,11 @@ class Test_TC_DIAG_TH_NW_1_2Suite : public TestCommand } }; -class Test_TC_LC_1_2Suite : public TestCommand +class Test_TC_DIAG_TH_NW_2_2Suite : public TestCommand { public: - Test_TC_LC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_1_2", 2, credsIssuerConfig) + Test_TC_DIAG_TH_NW_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_TH_NW_2_2", 18, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -31666,7 +31667,7 @@ class Test_TC_LC_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LC_1_2Suite() {} + ~Test_TC_DIAG_TH_NW_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -31698,133 +31699,137 @@ class Test_TC_LC_1_2Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); } 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"); - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); - } - case 1: { - LogStep(1, "TH1 reads LabelList attribute from the DUT"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_WIFIDIAG_1_1Suite : public TestCommand -{ -public: - Test_TC_WIFIDIAG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_WIFIDIAG_1_1", 7, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_WIFIDIAG_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: + case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } break; - case 1: + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList< - chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> - value; + uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); } break; - case 2: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueNull("securityType", value)); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); } break; - case 3: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "enum")); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); } break; - case 4: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "enum")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 5)); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); } break; - case 5: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); } break; - case 6: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "int8")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -120)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); } break; default: @@ -31849,45 +31854,100 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Reads NetworkInterface structure attribute from DUT"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, - GeneralDiagnostics::Attributes::NetworkInterfaces::Id); + LogStep(1, "TH reads TxTotalCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id); } case 2: { - LogStep(2, "Reads SecurityType attribute from DUT"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, - WiFiNetworkDiagnostics::Attributes::SecurityType::Id); + LogStep(2, "TH reads TxUnicastCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxUnicastCount::Id); } case 3: { - LogStep(3, "Reads SecurityType attribute constraints"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, - WiFiNetworkDiagnostics::Attributes::SecurityType::Id); + LogStep(3, "TH reads TxBroadcastCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::Id); } case 4: { - LogStep(4, "Reads WiFiVersion attribute constraints"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, - WiFiNetworkDiagnostics::Attributes::WiFiVersion::Id); + LogStep(4, "TH reads TxAckRequestedCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::Id); } case 5: { - LogStep(5, "Reads ChannelNumber attribute constraints"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, - WiFiNetworkDiagnostics::Attributes::ChannelNumber::Id); + LogStep(5, "TH reads TxAckedCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxAckedCount::Id); } case 6: { - LogStep(6, "Reads RSSI attribute constraints"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, - WiFiNetworkDiagnostics::Attributes::Rssi::Id); + LogStep(6, "TH reads TxNoAckRequestedCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::Id); + } + case 7: { + LogStep(7, "TH reads TxDataCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxDataCount::Id); + } + case 8: { + LogStep(8, "TH reads TxDataPollCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxDataPollCount::Id); + } + case 9: { + LogStep(9, "TH reads TxBeaconCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxBeaconCount::Id); + } + case 10: { + LogStep(10, "TH reads TxBeaconRequestCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::Id); + } + case 11: { + LogStep(11, "TH reads TxOtherCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxOtherCount::Id); + } + case 12: { + LogStep(12, "TH reads TxRetryCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxRetryCount::Id); + } + case 13: { + LogStep(13, "TH reads TxDirectMaxRetryExpiryCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::Id); + } + case 14: { + LogStep(14, "TH reads TxIndirectMaxRetryExpiryCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::Id); + } + case 15: { + LogStep(15, "TH reads TxErrCcaCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::Id); + } + case 16: { + LogStep(16, "TH reads TxErrAbortCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::Id); + } + case 17: { + LogStep(17, "TH reads TxErrBusyChannelCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::Id); } } return CHIP_NO_ERROR; } }; -class Test_TC_WIFIDIAG_3_1Suite : public TestCommand +class Test_TC_DIAG_TH_NW_2_3Suite : public TestCommand { public: - Test_TC_WIFIDIAG_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_WIFIDIAG_3_1", 1, credsIssuerConfig) + Test_TC_DIAG_TH_NW_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_TH_NW_2_3", 18, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -31895,7 +31955,523 @@ class Test_TC_WIFIDIAG_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_WIFIDIAG_3_1Suite() {} + ~Test_TC_DIAG_TH_NW_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) + { + 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)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + 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"); + 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 RxTotalCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxTotalCount::Id); + } + case 2: { + LogStep(2, "TH reads RxUnicastCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxUnicastCount::Id); + } + case 3: { + LogStep(3, "TH reads RxBroadcastCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::Id); + } + case 4: { + LogStep(4, "TH reads RxDataCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxDataCount::Id); + } + case 5: { + LogStep(5, "TH reads RxDataPollCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxDataPollCount::Id); + } + case 6: { + LogStep(6, "TH reads RxBeaconCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxBeaconCount::Id); + } + case 7: { + LogStep(7, "TH reads RxBeaconRequestCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::Id); + } + case 8: { + LogStep(8, "TH reads RxOtherCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxOtherCount::Id); + } + case 9: { + LogStep(9, "TH reads RxAddressFilteredCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::Id); + } + case 10: { + LogStep(10, "TH reads RxDestAddrFilteredCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::Id); + } + case 11: { + LogStep(11, "TH reads RxDuplicatedCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::Id); + } + case 12: { + LogStep(12, "TH reads RxErrNoFrameCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::Id); + } + case 13: { + LogStep(13, "TH reads RxErrUnknownNeighborCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::Id); + } + case 14: { + LogStep(14, "TH reads RxErrInvalidScrAddrCount attribute value from DUT and verify data type"); + VerifyOrdo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(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(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "TH reads RxErrSecCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrSecCount::Id); + } + case 16: { + LogStep(16, "TH reads RxErrFcsCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::Id); + } + case 17: { + LogStep(17, "TH reads RxErrOtherCount attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, + ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::Id); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LC_1_2Suite : public TestCommand +{ +public: + Test_TC_LC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LC_1_2", 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_LC_1_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + 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"); + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH1 reads LabelList attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UserLabel::Id, UserLabel::Attributes::LabelList::Id); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WIFIDIAG_1_1Suite : public TestCommand +{ +public: + Test_TC_WIFIDIAG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WIFIDIAG_1_1", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WIFIDIAG_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)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("securityType", value)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "int8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, -120)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 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"); + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Reads NetworkInterface structure attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralDiagnostics::Id, + GeneralDiagnostics::Attributes::NetworkInterfaces::Id); + } + case 2: { + LogStep(2, "Reads SecurityType attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::SecurityType::Id); + } + case 3: { + LogStep(3, "Reads SecurityType attribute constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::SecurityType::Id); + } + case 4: { + LogStep(4, "Reads WiFiVersion attribute constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::WiFiVersion::Id); + } + case 5: { + LogStep(5, "Reads ChannelNumber attribute constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::ChannelNumber::Id); + } + case 6: { + LogStep(6, "Reads RSSI attribute constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), WiFiNetworkDiagnostics::Id, + WiFiNetworkDiagnostics::Attributes::Rssi::Id); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WIFIDIAG_3_1Suite : public TestCommand +{ +public: + Test_TC_WIFIDIAG_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WIFIDIAG_3_1", 1, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WIFIDIAG_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -54848,10 +55424,260 @@ class DL_SchedulesSuite : public TestCommand } }; -class Test_TC_DL_1_3Suite : public TestCommand +class Test_TC_DL_2_2Suite : public TestCommand +{ +public: + Test_TC_DL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_2", 16, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DL_2_2Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + 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::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0)); + + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + 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_FAILURE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userCodeTemporaryDisableTime", value, 5)); + } + 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; + 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"); + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH writes the RequirePINforRemoteOperation attribute value as False on the DUT"); + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::RequirePINforRemoteOperation::Id, value); + } + case 2: { + LogStep(2, "TH sends Lock Door Command to the DUT without PINCode"); + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000)); + } + case 3: { + LogStep(3, "TH writes the RequirePINforRemoteOperation attribute value as True on the DUT"); + bool value; + value = true; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::RequirePINforRemoteOperation::Id, value); + } + case 4: { + LogStep(4, "Create new PIN credential and lock/unlock user"); + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000)); + } + case 5: { + LogStep(5, "TH sends Lock Door Command to the DUT with valid PINCode"); + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000)); + } + case 6: { + LogStep(6, "TH sends Lock Door Command to the DUT without any argument PINCode"); + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000)); + } + case 7: { + LogStep(7, "TH writes WrongCodeEntryLimit attribute value as 3 on the DUT"); + uint8_t value; + value = 3; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::WrongCodeEntryLimit::Id, + value); + } + case 8: { + LogStep(8, "TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds on the DUT"); + uint8_t value; + value = 5; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::UserCodeTemporaryDisableTime::Id, value); + } + case 9: { + LogStep(9, "TH sends Lock Door Command to the DUT with invalid PINCode"); + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("12345garbage: not in length on purpose"), 5); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000)); + } + case 10: { + LogStep(10, "TH sends Lock Door Command to the DUT with invalid PINCode"); + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("54321garbage: not in length on purpose"), 5); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000)); + } + case 11: { + LogStep(11, "TH sends Lock Door Command to the DUT with invalid PINCode"); + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("987623garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000)); + } + case 12: { + LogStep(12, "TH sends Lock Door Command to the DUT with invalid PINCode"); + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("67890garbage: not in length on purpose"), 5); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000)); + } + case 13: { + LogStep(13, "TH reads UserCodeTemporaryDisableTime attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::UserCodeTemporaryDisableTime::Id); + } + case 14: { + LogStep(14, "TH sends Lock Door Command to the DUT with valid PINCode"); + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000)); + } + case 15: { + LogStep(15, "Clean the created credential"); + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; + value.credential.SetNonNull(); + + value.credential.Value().credentialType = static_cast(1); + value.credential.Value().credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::Optional(10000)); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DL_2_3Suite : public TestCommand { public: - Test_TC_DL_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_1_3", 9, credsIssuerConfig) + Test_TC_DL_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_3", 9, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -54859,7 +55685,7 @@ class Test_TC_DL_1_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_1_3Suite() {} + ~Test_TC_DL_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -55004,7 +55830,7 @@ class Test_TC_DL_1_3Suite : public TestCommand return WaitForMs(kIdentityAlpha, value); } case 7: { - LogStep(7, "TH reads LockState attriute"); + LogStep(7, "TH reads LockState attribute"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id); } case 8: { @@ -55023,6 +55849,168 @@ class Test_TC_DL_1_3Suite : public TestCommand } }; +class Test_TC_DL_2_4Suite : public TestCommand +{ +public: + Test_TC_DL_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_4", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DL_2_4Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + 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::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0)); + + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + 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)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("autoRelockTime", value, 10UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1)); + } + 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"); + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Create new PIN credential and lock/unlock user"); + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000)); + } + case 2: { + LogStep(2, "Precondition: Door is in locked state"); + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000)); + } + case 3: { + LogStep(3, "TH writes AutoRelockTime attribute value as 10 seconds on the DUT"); + uint32_t value; + value = 10UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, value); + } + case 4: { + LogStep(4, "TH sends the unlock with Timeout command to the DUT "); + chip::app::Clusters::DoorLock::Commands::UnlockWithTimeout::Type value; + value.timeout = 5U; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockWithTimeout::Id, value, + chip::Optional(10000)); + } + case 5: { + LogStep(5, "TH reads AutoRelockTime attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id); + } + case 6: { + LogStep(6, "Wait 5000ms"); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "TH reads LockState attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id); + } + } + return CHIP_NO_ERROR; + } +}; + class TestGroupMessagingSuite : public TestCommand { public: @@ -66334,123 +67322,11 @@ class Test_TC_WIFIDIAG_1_2Suite : public TestCommand } }; -class Test_TC_WIFIDIAG_2_1Suite : public TestCommand -{ -public: - Test_TC_WIFIDIAG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_WIFIDIAG_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_WIFIDIAG_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_WNCV_6_1Suite : public TestCommand -{ -public: - Test_TC_WNCV_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_6_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_WNCV_6_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_WNCV_7_1Suite : public TestCommand +class Test_TC_WIFIDIAG_2_1Suite : public TestCommand { public: - Test_TC_WNCV_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_7_1", 0, credsIssuerConfig) + Test_TC_WIFIDIAG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WIFIDIAG_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -66458,7 +67334,7 @@ class Test_TC_WNCV_7_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_WNCV_7_1Suite() {} + ~Test_TC_WIFIDIAG_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -66503,10 +67379,10 @@ class Test_TC_WNCV_7_1Suite : public TestCommand } }; -class Test_TC_FLW_3_1Suite : public TestCommand +class Test_TC_WNCV_6_1Suite : public TestCommand { public: - Test_TC_FLW_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_3_1", 0, credsIssuerConfig) + Test_TC_WNCV_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_6_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -66514,7 +67390,7 @@ class Test_TC_FLW_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_FLW_3_1Suite() {} + ~Test_TC_WNCV_6_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -66559,10 +67435,10 @@ class Test_TC_FLW_3_1Suite : public TestCommand } }; -class Test_TC_OCC_2_3Suite : public TestCommand +class Test_TC_WNCV_7_1Suite : public TestCommand { public: - Test_TC_OCC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_2_3", 0, credsIssuerConfig) + Test_TC_WNCV_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_7_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -66570,7 +67446,7 @@ class Test_TC_OCC_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_OCC_2_3Suite() {} + ~Test_TC_WNCV_7_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -66615,10 +67491,10 @@ class Test_TC_OCC_2_3Suite : public TestCommand } }; -class Test_TC_OCC_2_4Suite : public TestCommand +class Test_TC_FLW_3_1Suite : public TestCommand { public: - Test_TC_OCC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_2_4", 0, credsIssuerConfig) + Test_TC_FLW_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_FLW_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -66626,7 +67502,7 @@ class Test_TC_OCC_2_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_OCC_2_4Suite() {} + ~Test_TC_FLW_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -66671,10 +67547,10 @@ class Test_TC_OCC_2_4Suite : public TestCommand } }; -class Test_TC_OCC_3_1Suite : public TestCommand +class Test_TC_OCC_2_3Suite : public TestCommand { public: - Test_TC_OCC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_3_1", 0, credsIssuerConfig) + Test_TC_OCC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -66682,7 +67558,7 @@ class Test_TC_OCC_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_OCC_3_1Suite() {} + ~Test_TC_OCC_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -66727,10 +67603,10 @@ class Test_TC_OCC_3_1Suite : public TestCommand } }; -class Test_TC_OCC_3_2Suite : public TestCommand +class Test_TC_OCC_2_4Suite : public TestCommand { public: - Test_TC_OCC_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_3_2", 0, credsIssuerConfig) + Test_TC_OCC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_2_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -66738,7 +67614,7 @@ class Test_TC_OCC_3_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_OCC_3_2Suite() {} + ~Test_TC_OCC_2_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -66783,10 +67659,10 @@ class Test_TC_OCC_3_2Suite : public TestCommand } }; -class Test_TC_PRS_2_2Suite : public TestCommand +class Test_TC_OCC_3_1Suite : public TestCommand { public: - Test_TC_PRS_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_2_2", 0, credsIssuerConfig) + Test_TC_OCC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -66794,7 +67670,7 @@ class Test_TC_PRS_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PRS_2_2Suite() {} + ~Test_TC_OCC_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -66839,10 +67715,10 @@ class Test_TC_PRS_2_2Suite : public TestCommand } }; -class Test_TC_PRS_2_3Suite : public TestCommand +class Test_TC_OCC_3_2Suite : public TestCommand { public: - Test_TC_PRS_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_2_3", 0, credsIssuerConfig) + Test_TC_OCC_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OCC_3_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -66850,7 +67726,7 @@ class Test_TC_PRS_2_3Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PRS_2_3Suite() {} + ~Test_TC_OCC_3_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -66895,10 +67771,10 @@ class Test_TC_PRS_2_3Suite : public TestCommand } }; -class Test_TC_PRS_3_1Suite : public TestCommand +class Test_TC_PRS_2_2Suite : public TestCommand { public: - Test_TC_PRS_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_3_1", 0, credsIssuerConfig) + Test_TC_PRS_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -66906,7 +67782,7 @@ class Test_TC_PRS_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PRS_3_1Suite() {} + ~Test_TC_PRS_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -66951,10 +67827,10 @@ class Test_TC_PRS_3_1Suite : public TestCommand } }; -class Test_TC_PS_2_2Suite : public TestCommand +class Test_TC_PRS_2_3Suite : public TestCommand { public: - Test_TC_PS_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_2_2", 0, credsIssuerConfig) + Test_TC_PRS_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_2_3", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -66962,7 +67838,7 @@ class Test_TC_PS_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PS_2_2Suite() {} + ~Test_TC_PRS_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67007,10 +67883,10 @@ class Test_TC_PS_2_2Suite : public TestCommand } }; -class Test_TC_PS_3_1Suite : public TestCommand +class Test_TC_PRS_3_1Suite : public TestCommand { public: - Test_TC_PS_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_3_1", 0, credsIssuerConfig) + Test_TC_PRS_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67018,7 +67894,7 @@ class Test_TC_PS_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_PS_3_1Suite() {} + ~Test_TC_PRS_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67063,10 +67939,10 @@ class Test_TC_PS_3_1Suite : public TestCommand } }; -class Test_TC_BOOL_2_2Suite : public TestCommand +class Test_TC_PS_2_2Suite : public TestCommand { public: - Test_TC_BOOL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_2_2", 0, credsIssuerConfig) + Test_TC_PS_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67074,7 +67950,7 @@ class Test_TC_BOOL_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BOOL_2_2Suite() {} + ~Test_TC_PS_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67119,10 +67995,10 @@ class Test_TC_BOOL_2_2Suite : public TestCommand } }; -class Test_TC_BOOL_3_1Suite : public TestCommand +class Test_TC_PS_3_1Suite : public TestCommand { public: - Test_TC_BOOL_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_3_1", 0, credsIssuerConfig) + Test_TC_PS_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67130,7 +68006,7 @@ class Test_TC_BOOL_3_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BOOL_3_1Suite() {} + ~Test_TC_PS_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67175,10 +68051,10 @@ class Test_TC_BOOL_3_1Suite : public TestCommand } }; -class Test_TC_CC_2_2Suite : public TestCommand +class Test_TC_BOOL_2_2Suite : public TestCommand { public: - Test_TC_CC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_2_2", 0, credsIssuerConfig) + Test_TC_BOOL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67186,7 +68062,7 @@ class Test_TC_CC_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CC_2_2Suite() {} + ~Test_TC_BOOL_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67231,10 +68107,10 @@ class Test_TC_CC_2_2Suite : public TestCommand } }; -class Test_TC_CC_3_4Suite : public TestCommand +class Test_TC_BOOL_3_1Suite : public TestCommand { public: - Test_TC_CC_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_4", 0, credsIssuerConfig) + Test_TC_BOOL_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_3_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67242,7 +68118,7 @@ class Test_TC_CC_3_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CC_3_4Suite() {} + ~Test_TC_BOOL_3_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67287,10 +68163,10 @@ class Test_TC_CC_3_4Suite : public TestCommand } }; -class Test_TC_CC_4_5Suite : public TestCommand +class Test_TC_CC_2_2Suite : public TestCommand { public: - Test_TC_CC_4_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_5", 0, credsIssuerConfig) + Test_TC_CC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_2_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67298,7 +68174,7 @@ class Test_TC_CC_4_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CC_4_5Suite() {} + ~Test_TC_CC_2_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67343,10 +68219,10 @@ class Test_TC_CC_4_5Suite : public TestCommand } }; -class Test_TC_CC_5_4Suite : public TestCommand +class Test_TC_CC_3_4Suite : public TestCommand { public: - Test_TC_CC_5_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_4", 0, credsIssuerConfig) + Test_TC_CC_3_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67354,7 +68230,7 @@ class Test_TC_CC_5_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CC_5_4Suite() {} + ~Test_TC_CC_3_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67399,10 +68275,10 @@ class Test_TC_CC_5_4Suite : public TestCommand } }; -class Test_TC_CC_6_4Suite : public TestCommand +class Test_TC_CC_4_5Suite : public TestCommand { public: - Test_TC_CC_6_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_4", 0, credsIssuerConfig) + Test_TC_CC_4_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67410,7 +68286,7 @@ class Test_TC_CC_6_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CC_6_4Suite() {} + ~Test_TC_CC_4_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67455,10 +68331,10 @@ class Test_TC_CC_6_4Suite : public TestCommand } }; -class Test_TC_CC_7_5Suite : public TestCommand +class Test_TC_CC_5_4Suite : public TestCommand { public: - Test_TC_CC_7_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_5", 0, credsIssuerConfig) + Test_TC_CC_5_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67466,7 +68342,7 @@ class Test_TC_CC_7_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CC_7_5Suite() {} + ~Test_TC_CC_5_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67511,10 +68387,10 @@ class Test_TC_CC_7_5Suite : public TestCommand } }; -class Test_TC_CC_9_4Suite : public TestCommand +class Test_TC_CC_6_4Suite : public TestCommand { public: - Test_TC_CC_9_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_9_4", 0, credsIssuerConfig) + Test_TC_CC_6_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67522,7 +68398,7 @@ class Test_TC_CC_9_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CC_9_4Suite() {} + ~Test_TC_CC_6_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67567,10 +68443,10 @@ class Test_TC_CC_9_4Suite : public TestCommand } }; -class Test_TC_DL_2_1Suite : public TestCommand +class Test_TC_CC_7_5Suite : public TestCommand { public: - Test_TC_DL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_1", 0, credsIssuerConfig) + Test_TC_CC_7_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67578,7 +68454,7 @@ class Test_TC_DL_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_2_1Suite() {} + ~Test_TC_CC_7_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67623,10 +68499,10 @@ class Test_TC_DL_2_1Suite : public TestCommand } }; -class Test_TC_DL_2_2Suite : public TestCommand +class Test_TC_CC_9_4Suite : public TestCommand { public: - Test_TC_DL_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_2", 0, credsIssuerConfig) + Test_TC_CC_9_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_9_4", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67634,7 +68510,7 @@ class Test_TC_DL_2_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_2_2Suite() {} + ~Test_TC_CC_9_4Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -67679,10 +68555,10 @@ class Test_TC_DL_2_2Suite : public TestCommand } }; -class Test_TC_DL_2_4Suite : public TestCommand +class Test_TC_DL_2_1Suite : public TestCommand { public: - Test_TC_DL_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_4", 0, credsIssuerConfig) + Test_TC_DL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -67690,7 +68566,7 @@ class Test_TC_DL_2_4Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_DL_2_4Suite() {} + ~Test_TC_DL_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -70199,120 +71075,6 @@ class Test_TC_TSUIC_3_1Suite : public TestCommand } }; -class Test_TC_DIAG_TH_NW_2_2Suite : public TestCommand -{ -public: - Test_TC_DIAG_TH_NW_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_TH_NW_2_2", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_DIAG_TH_NW_2_2Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_DIAG_TH_NW_2_3Suite : public TestCommand -{ -public: - Test_TC_DIAG_TH_NW_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_TH_NW_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_DIAG_TH_NW_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_DIAG_TH_NW_2_6Suite : public TestCommand { public: @@ -70680,6 +71442,8 @@ 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), @@ -70739,7 +71503,9 @@ 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), @@ -70940,8 +71706,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), @@ -70986,8 +71750,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),