diff --git a/examples/chip-tool/templates/tests/tests.js b/examples/chip-tool/templates/tests/tests.js index 0a45f1b68e16b3..911d50623efe9b 100644 --- a/examples/chip-tool/templates/tests/tests.js +++ b/examples/chip-tool/templates/tests/tests.js @@ -145,7 +145,6 @@ function getManualTests() 'Test_TC_MF_1_2', 'Test_TC_MF_1_3', 'Test_TC_MF_1_5', - 'Test_TC_MF_1_6', 'Test_TC_MF_1_7', 'Test_TC_MF_1_8', 'Test_TC_MF_1_9', @@ -423,6 +422,7 @@ function getTests() const MultipleFabrics = [ 'Test_TC_MF_1_4', + 'Test_TC_MF_1_6', ]; const OnOff = [ diff --git a/src/app/tests/suites/certification/Test_TC_BI_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BI_1_1.yaml index c17214634842e9..6c6fc3f8520a9f 100644 --- a/src/app/tests/suites/certification/Test_TC_BI_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BI_1_1.yaml @@ -74,7 +74,6 @@ tests: type: list - label: "Read the global attribute: AcceptedCommandList" - disabled: true command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -82,7 +81,6 @@ tests: type: list - label: "Read the global attribute: GeneratedCommandList" - disabled: true command: "readAttribute" attribute: "GeneratedCommandList" response: diff --git a/src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml index 020d0cc8d3eaf7..b3669266f0f28b 100644 --- a/src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ETHDIAG_1_1.yaml @@ -17,7 +17,7 @@ name: 48.1.1. [TC-ETHDIAG-1.1] Attributes with server as DUT config: nodeId: 0x12344321 cluster: "Ethernet Network Diagnostics" - endpoint: 1 + endpoint: 0 tests: - label: "Wait for the commissioned device to be retrieved" @@ -28,7 +28,7 @@ tests: - name: "nodeId" value: nodeId - #Disabled due to issue #11670 and #13648 + #Disabled due to issue #16552 and #13648 - label: "Read PHYRate attribute" disabled: true command: "readAttribute" @@ -37,7 +37,6 @@ tests: value: null - label: "Read PHYRate attribute constraints" - disabled: true command: "readAttribute" attribute: "PHYRate" response: @@ -54,7 +53,6 @@ tests: value: null - label: "Read FullDuplex attribute constraints" - disabled: true command: "readAttribute" attribute: "FullDuplex" response: @@ -69,7 +67,6 @@ tests: value: 0 - label: "Read PacketRxCount attribute constraints" - disabled: true command: "readAttribute" attribute: "PacketRxCount" response: @@ -84,7 +81,6 @@ tests: value: 0 - label: "Read PacketTxCount attribute constraints" - disabled: true command: "readAttribute" attribute: "PacketTxCount" response: @@ -99,7 +95,6 @@ tests: value: 0 - label: "Read TxErrCount attribute constraints" - disabled: true command: "readAttribute" attribute: "TxErrCount" response: @@ -114,7 +109,6 @@ tests: value: 0 - label: "Read CollisionCount attribute constraints" - disabled: true command: "readAttribute" attribute: "CollisionCount" response: @@ -129,7 +123,6 @@ tests: value: 0 - label: "Read OverrunCount attribute constraints" - disabled: true command: "readAttribute" attribute: "OverrunCount" response: @@ -144,7 +137,6 @@ tests: value: null - label: "Read CarrierDetect attribute constraints" - disabled: true command: "readAttribute" attribute: "CarrierDetect" response: @@ -159,7 +151,6 @@ tests: value: 0 - label: "Read TimeSinceReset attribute constraints" - disabled: true command: "readAttribute" attribute: "TimeSinceReset" response: diff --git a/src/app/tests/suites/certification/Test_TC_MF_1_6.yaml b/src/app/tests/suites/certification/Test_TC_MF_1_6.yaml index bfdf80cd95f5c8..257c9058c84dba 100644 --- a/src/app/tests/suites/certification/Test_TC_MF_1_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_MF_1_6.yaml @@ -18,257 +18,146 @@ name: config: nodeId: 0x12344321 - cluster: "Basic" + nodeIdForDuplicateCommissioning: + type: NODE_ID + defaultValue: 0x11 + nodeId2: + type: NODE_ID + defaultValue: 0xCAFE + nodeId3: + type: NODE_ID + defaultValue: 0xC00FEE endpoint: 0 + discriminator: + type: INT16U + defaultValue: 3840 + payload: + type: CHAR_STRING + defaultValue: "MT:-24J0AFN00KA0648G00" # This value needs to be generated automatically tests: - - label: "TH_CR1 starts a commissioning process with DUT_CE" - verification: | - 1. Provision the device using 1st python controller on the raspi (use above instructions) - disabled: true - - - label: - "TH_CR1 opens a commissioning window on DUT_CE using a commissioning - timeout of PIXIT_COMM_WIN seconds using BCM" - verification: | - On 1st controller, using chip tool open commissioning window using BCM - - - ./chip-tool administratorcommissioning open-basic-commissioning-window 100 1 0 - - [1635870657.145515][4221:4226] CHIP:DMG: InvokeCommand = - [1635870657.145582][4221:4226] CHIP:DMG: { - [1635870657.145629][4221:4226] CHIP:DMG: CommandList = - [1635870657.145686][4221:4226] CHIP:DMG: [ - [1635870657.145740][4221:4226] CHIP:DMG: CommandDataIB = - [1635870657.145808][4221:4226] CHIP:DMG: { - [1635870657.145872][4221:4226] CHIP:DMG: CommandPathIB = - [1635870657.145944][4221:4226] CHIP:DMG: { - [1635870657.146010][4221:4226] CHIP:DMG: EndpointId = 0x0, - [1635870657.146086][4221:4226] CHIP:DMG: ClusterId = 0x3c, - [1635870657.146161][4221:4226] CHIP:DMG: CommandId = 0x1, - [1635870657.146232][4221:4226] CHIP:DMG: }, - [1635870657.146310][4221:4226] CHIP:DMG: - [1635870657.146367][4221:4226] CHIP:DMG: StatusIB = - [1635870657.146436][4221:4226] CHIP:DMG: { - [1635870657.146503][4221:4226] CHIP:DMG: status = 0x0, - [1635870657.146566][4221:4226] CHIP:DMG: }, - [1635870657.146637][4221:4226] CHIP:DMG: - [1635870657.146700][4221:4226] CHIP:DMG: }, - [1635870657.146769][4221:4226] CHIP:DMG: - [1635870657.146828][4221:4226] CHIP:DMG: ], - [1635870657.146898][4221:4226] CHIP:DMG: - [1635870657.146952][4221:4226] CHIP:DMG: } - [1635870657.147042][4221:4226] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0 - [1635870657.147102][4221:4226] CHIP:TOO: Default Success Response - disabled: true - - - label: - "TH_CR2 starts a commissioning process with DUT_CE after - PIXIT_COMM_WIN + 10 seconds" - verification: | - On the 2nd controller using chip-tool , connect to the accessory - - ./chip-tool pairing onnetwork 1 20202021 - disabled: true - - - label: - "TH_CR1 opens a new commissioning window on DUT_CE using a - commissioning timeout of PIXIT_COMM_WIN seconds using BCM" - verification: | - On 1st controller, using chip tool open commissioning window using BCM - - ./chip-tool administratorcommissioning open-basic-commissioning-window 100 1 0 - disabled: true - - - label: - "TH_CR1 revokes the commissioning window on DUT_CE using - RevokeCommissioning command" - verification: | - On 1st controller, using chip tool send revoke commissioning - - - ./chip-tool administratorcommissioning revoke-commissioning 1 0 - - [1635870803.030626][4234:4239] CHIP:DMG: InvokeCommand = - [1635870803.030664][4234:4239] CHIP:DMG: { - [1635870803.030696][4234:4239] CHIP:DMG: CommandList = - [1635870803.030735][4234:4239] CHIP:DMG: [ - [1635870803.030768][4234:4239] CHIP:DMG: CommandDataIB = - [1635870803.030821][4234:4239] CHIP:DMG: { - [1635870803.030868][4234:4239] CHIP:DMG: CommandPathIB = - [1635870803.030922][4234:4239] CHIP:DMG: { - [1635870803.030965][4234:4239] CHIP:DMG: EndpointId = 0x0, - [1635870803.031020][4234:4239] CHIP:DMG: ClusterId = 0x3c, - [1635870803.031062][4234:4239] CHIP:DMG: CommandId = 0x2, - [1635870803.031113][4234:4239] CHIP:DMG: }, - [1635870803.031158][4234:4239] CHIP:DMG: - [1635870803.031204][4234:4239] CHIP:DMG: StatusIB = - [1635870803.031245][4234:4239] CHIP:DMG: { - [1635870803.031304][4234:4239] CHIP:DMG: status = 0x0, - [1635870803.031345][4234:4239] CHIP:DMG: }, - [1635870803.031533][4234:4239] CHIP:DMG: - [1635870803.031592][4234:4239] CHIP:DMG: }, - [1635870803.031644][4234:4239] CHIP:DMG: - [1635870803.031695][4234:4239] CHIP:DMG: ], - [1635870803.031739][4234:4239] CHIP:DMG: - [1635870803.031785][4234:4239] CHIP:DMG: } - [1635870803.031848][4234:4239] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0002 Status=0x0 - [1635870803.031903][4234:4239] CHIP:TOO: Default Success Response - disabled: true - - - label: "TH_CR2 starts a commissioning process with DUT_CE" - verification: | - On the 2nd controller using chip-tool , connect to the accessory + - label: "Reboot target device" + cluster: "SystemCommands" + command: "Reboot" + arguments: + values: + - name: "discriminator" + value: discriminator - ./chip-tool pairing onnetwork 1 20202021 - disabled: true - - - label: - "TH_CR1 revokes the commissioning window on DUT_CE using - RevokeCommissioning command" - verification: | - On 1st controller, using chip tool send revoke commissioning - - ./chip-tool administratorcommissioning revoke-commissioning 1 0 - [1635870856.382876][4241:4246] CHIP:DMG: InvokeCommand = - [1635870856.382942][4241:4246] CHIP:DMG: { - [1635870856.382975][4241:4246] CHIP:DMG: CommandList = - [1635870856.383010][4241:4246] CHIP:DMG: [ - [1635870856.383062][4241:4246] CHIP:DMG: CommandDataIB = - [1635870856.383102][4241:4246] CHIP:DMG: { - [1635870856.383136][4241:4246] CHIP:DMG: CommandPathIB = - [1635870856.383215][4241:4246] CHIP:DMG: { - [1635870856.383259][4241:4246] CHIP:DMG: EndpointId = 0x0, - [1635870856.383329][4241:4246] CHIP:DMG: ClusterId = 0x3c, - [1635870856.383390][4241:4246] CHIP:DMG: CommandId = 0x2, - [1635870856.383445][4241:4246] CHIP:DMG: }, - [1635870856.383490][4241:4246] CHIP:DMG: - [1635870856.383540][4241:4246] CHIP:DMG: StatusIB = - [1635870856.383644][4241:4246] CHIP:DMG: { - [1635870856.383697][4241:4246] CHIP:DMG: status = 0x0, - [1635870856.383756][4241:4246] CHIP:DMG: }, - [1635870856.383813][4241:4246] CHIP:DMG: - [1635870856.383847][4241:4246] CHIP:DMG: }, - [1635870856.383892][4241:4246] CHIP:DMG: - [1635870856.383923][4241:4246] CHIP:DMG: ], - [1635870856.383978][4241:4246] CHIP:DMG: - [1635870856.384011][4241:4246] CHIP:DMG: } - [1635870856.384106][4241:4246] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0002 Status=0x0 - [1635870856.384182][4241:4246] CHIP:TOO: Default Success Response - disabled: true - - - label: - "TH_CR1 writes and reads the Basic Information Clusters NodeLabel - mandatory attribute of DUT_CE" - verification: | - On 1st controller, using chip tool, write and read Basic Information Clusters NodeLabel mandatory attribute of DUT_CE - - - ./chip-tool basic write user-label te5new 1 0 - [1635870913.073437][4249:4254] CHIP:DMG: WriteResponse = - [1635870913.073477][4249:4254] CHIP:DMG: { - [1635870913.073510][4249:4254] CHIP:DMG: AttributeStatusList = - [1635870913.073548][4249:4254] CHIP:DMG: [ - [1635870913.073583][4249:4254] CHIP:DMG: AttributeStatusIB = - [1635870913.073630][4249:4254] CHIP:DMG: { - [1635870913.073669][4249:4254] CHIP:DMG: AttributePath = - [1635870913.073715][4249:4254] CHIP:DMG: { - [1635870913.073763][4249:4254] CHIP:DMG: FieldTag = 0x0000_0005, - [1635870913.073816][4249:4254] CHIP:DMG: NodeId = 0x0, - [1635870913.073867][4249:4254] CHIP:DMG: ClusterId = 0x28, - [1635870913.073915][4249:4254] CHIP:DMG: EndpointId = 0x0, - [1635870913.073961][4249:4254] CHIP:DMG: } - [1635870913.074011][4249:4254] CHIP:DMG: - [1635870913.074055][4249:4254] CHIP:DMG: StatusIB = - [1635870913.074101][4249:4254] CHIP:DMG: { - [1635870913.074147][4249:4254] CHIP:DMG: status = 0x0, - [1635870913.074192][4249:4254] CHIP:DMG: }, - [1635870913.074238][4249:4254] CHIP:DMG: - [1635870913.074279][4249:4254] CHIP:DMG: }, - [1635870913.074326][4249:4254] CHIP:DMG: - [1635870913.074361][4249:4254] CHIP:DMG: ], - [1635870913.074403][4249:4254] CHIP:DMG: - [1635870913.074436][4249:4254] CHIP:DMG: } - [1635870913.074511][4249:4254] CHIP:ZCL: WriteResponse: - [1635870913.074545][4249:4254] CHIP:ZCL: status: Success (0x0000) - [1635870913.074582][4249:4254] CHIP:TOO: Default Success Response - - - ./chip-tool basic read user-label 1 0 - - [1635870953.693980][4257:4262] CHIP:DMG: ReportData = - [1635870953.694013][4257:4262] CHIP:DMG: { - [1635870953.694042][4257:4262] CHIP:DMG: AttributeDataList = - [1635870953.694080][4257:4262] CHIP:DMG: [ - [1635870953.694113][4257:4262] CHIP:DMG: AttributeDataElement = - [1635870953.694159][4257:4262] CHIP:DMG: { - [1635870953.694194][4257:4262] CHIP:DMG: AttributePath = - [1635870953.694240][4257:4262] CHIP:DMG: { - [1635870953.694279][4257:4262] CHIP:DMG: NodeId = 0x1, - [1635870953.694336][4257:4262] CHIP:DMG: EndpointId = 0x0, - [1635870953.694387][4257:4262] CHIP:DMG: ClusterId = 0x28, - [1635870953.694437][4257:4262] CHIP:DMG: FieldTag = 0x0000_0005, - [1635870953.694489][4257:4262] CHIP:DMG: } - [1635870953.694541][4257:4262] CHIP:DMG: - [1635870953.694713][4257:4262] CHIP:DMG: Data = "te5new", - [1635870953.694759][4257:4262] CHIP:DMG: DataElementVersion = 0x0, - [1635870953.694803][4257:4262] CHIP:DMG: }, - [1635870953.694849][4257:4262] CHIP:DMG: - [1635870953.694885][4257:4262] CHIP:DMG: ], - [1635870953.694924][4257:4262] CHIP:DMG: - [1635870953.694957][4257:4262] CHIP:DMG: } - [1635870953.695061][4257:4262] CHIP:ZCL: ReadAttributesResponse: - [1635870953.695094][4257:4262] CHIP:ZCL: ClusterId: 0x0000_0028 - [1635870953.695129][4257:4262] CHIP:ZCL: attributeId: 0x0000_0005 - [1635870953.695161][4257:4262] CHIP:ZCL: status: Success (0x0000) - [1635870953.695191][4257:4262] CHIP:ZCL: attribute TLV Type: 0x0c - [1635870953.695221][4257:4262] CHIP:TOO: CharString attribute Response: te5new - disabled: true - - - label: - "TH_CR1 opens a new commissioning window on DUT_CE using a - commissioning timeout of PIXIT_COMM_WIN seconds using BCM" - verification: | - On first controller using chip-tool open commissioning widow using BCM. - ./chip-tool administratorcommissioning open-basic-commissioning-window 100 1 0 - [1635871001.349078][4265:4270] CHIP:DMG: InvokeCommand = - [1635871001.349113][4265:4270] CHIP:DMG: { - [1635871001.349172][4265:4270] CHIP:DMG: CommandList = - [1635871001.349208][4265:4270] CHIP:DMG: [ - [1635871001.349244][4265:4270] CHIP:DMG: CommandDataIB = - [1635871001.349306][4265:4270] CHIP:DMG: { - [1635871001.349346][4265:4270] CHIP:DMG: CommandPathIB = - [1635871001.349386][4265:4270] CHIP:DMG: { - [1635871001.349490][4265:4270] CHIP:DMG: EndpointId = 0x0, - [1635871001.349585][4265:4270] CHIP:DMG: ClusterId = 0x3c, - [1635871001.349627][4265:4270] CHIP:DMG: CommandId = 0x1, - [1635871001.349692][4265:4270] CHIP:DMG: }, - [1635871001.349782][4265:4270] CHIP:DMG: - [1635871001.349841][4265:4270] CHIP:DMG: StatusIB = - [1635871001.349886][4265:4270] CHIP:DMG: { - [1635871001.349928][4265:4270] CHIP:DMG: status = 0x0, - [1635871001.349977][4265:4270] CHIP:DMG: }, - [1635871001.350022][4265:4270] CHIP:DMG: - [1635871001.350058][4265:4270] CHIP:DMG: }, - [1635871001.350098][4265:4270] CHIP:DMG: - [1635871001.350133][4265:4270] CHIP:DMG: ], - [1635871001.350173][4265:4270] CHIP:DMG: - [1635871001.350205][4265:4270] CHIP:DMG: } - [1635871001.350267][4265:4270] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0 - [1635871001.350308][4265:4270] CHIP:TOO: Default Success Response - disabled: true - - - label: "TH_CR2 starts a commissioning process with DUT_CE" - verification: | - On the 2nd controller using chip-tool , connect to the accessory - - ./chip-tool pairing onnetwork 1 20202021 - disabled: true + - label: "TH_CR1 starts a commissioning process with DUT_CE" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH_CR1 opens a commissioning window on DUT_CE" + identity: "alpha" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "Commission from beta" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload + + - label: "TH_CR2 starts a commissioning process on DUT_CE" + identity: "beta" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId2 + + - label: "Open Commissioning Window from alpha" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "TH_CR1 revokes the commissioning window on DUT_CE" + cluster: "AdministratorCommissioning" + command: "RevokeCommissioning" + timedInteractionTimeoutMs: 10000 + + - label: "TH_CR2 starts a commissioning process on DUT_CE" + identity: "beta" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId2 + + - label: "TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE" + identity: "alpha" + cluster: "Basic" + command: "writeAttribute" + attribute: "NodeLabel" + arguments: + value: "chiptest" + + - label: "TH_CR1 read the mandatory attribute NodeLabel of DUT_CE" + identity: "alpha" + cluster: "Basic" + command: "readAttribute" + attribute: "NodeLabel" + response: + value: "chiptest" + + - label: "TH_CR1 opens a commissioning window on DUT_CE" + identity: "alpha" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "TH_CR2 starts a commissioning process on DUT_CE" + identity: "beta" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId2 - label: "TH_CR3 starts a commissioning process with DUT_CE" - verification: | - On the 3rd controller using chip-tool , connect to the accessory - - ./chip-tool pairing onnetwork 1 20202021 - disabled: true + identity: "gamma" + cluster: "CommissionerCommands" + command: "PairWithQRCode" + arguments: + values: + - name: "nodeId" + value: nodeId3 + - name: "payload" + value: payload + + - label: "Wait for the commissioned device to be retrieved for gamma" + identity: "gamma" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId3 + response: + error: FAILURE diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml index 324135f2ca337a..2df9346e21fc88 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml @@ -36,6 +36,7 @@ tests: type: bool - label: "read LT attribute: GlobalSceneControl" + optional: true command: "readAttribute" attribute: "GlobalSceneControl" response: @@ -43,6 +44,7 @@ tests: type: bool - label: "read LT attribute: OnTime" + optional: true command: "readAttribute" attribute: "OnTime" response: @@ -50,6 +52,7 @@ tests: type: uint16 - label: "read LT attribute: OffWaitTime" + optional: true command: "readAttribute" attribute: "OffWaitTime" response: @@ -57,6 +60,7 @@ tests: type: uint16 - label: "read LT attribute: StartUpOnOff" + optional: true command: "readAttribute" attribute: "StartUpOnOff" response: diff --git a/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml index 05250e107b249a..5e7095b3aa34ab 100644 --- a/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml @@ -208,7 +208,7 @@ tests: constraints: type: int16 - #issue #11670 Null check is not implemented in YAML framework. + #issue #16650 - label: "read the optional attribute: MinConstPressure" disabled: true command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_PCC_2_2.yaml b/src/app/tests/suites/certification/Test_TC_PCC_2_2.yaml index 53d8b1a6e0fbc7..df45148e855468 100644 --- a/src/app/tests/suites/certification/Test_TC_PCC_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_PCC_2_2.yaml @@ -36,7 +36,6 @@ tests: value: 1 - label: "Reads the attribute: EffectiveOperationMode" - disabled: true command: "readAttribute" attribute: "EffectiveOperationMode" PICS: A_EFFECTIVEOPERATIONMODE @@ -51,7 +50,6 @@ tests: value: 2 - label: "Reads the attribute: EffectiveOperationMode" - disabled: true command: "readAttribute" attribute: "EffectiveOperationMode" PICS: A_EFFECTIVEOPERATIONMODE @@ -66,7 +64,6 @@ tests: value: 3 - label: "Reads the attribute: EffectiveOperationMode" - disabled: true command: "readAttribute" attribute: "EffectiveOperationMode" PICS: A_EFFECTIVEOPERATIONMODE diff --git a/src/app/tests/suites/certification/Test_TC_PCC_2_3.yaml b/src/app/tests/suites/certification/Test_TC_PCC_2_3.yaml index 55319761407622..28999176999bf8 100644 --- a/src/app/tests/suites/certification/Test_TC_PCC_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_PCC_2_3.yaml @@ -64,7 +64,6 @@ tests: value: 1 - label: "Reads the attribute: EffectiveControlMode" - disabled: true command: "readAttribute" attribute: "EffectiveControlMode" PICS: A_EFFECTIVECONTROLMODE @@ -79,7 +78,6 @@ tests: value: 2 - label: "Reads the attribute: EffectiveControlMode" - disabled: true command: "readAttribute" attribute: "EffectiveControlMode" PICS: A_EFFECTIVECONTROLMODE @@ -94,7 +92,6 @@ tests: value: 3 - label: "Reads the attribute: EffectiveControlMode" - disabled: true command: "readAttribute" attribute: "EffectiveControlMode" PICS: A_EFFECTIVECONTROLMODE @@ -109,7 +106,6 @@ tests: value: 5 - label: "Reads the attribute: EffectiveControlMode" - disabled: true command: "readAttribute" attribute: "EffectiveControlMode" PICS: A_EFFECTIVECONTROLMODE @@ -124,7 +120,6 @@ tests: value: 7 - label: "Reads the attribute: EffectiveControlMode" - disabled: true command: "readAttribute" attribute: "EffectiveControlMode" PICS: A_EFFECTIVECONTROLMODE diff --git a/src/app/tests/suites/certification/Test_TC_PCC_2_4.yaml b/src/app/tests/suites/certification/Test_TC_PCC_2_4.yaml index c2b2c26b8256a7..5535b6fa407af8 100644 --- a/src/app/tests/suites/certification/Test_TC_PCC_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_PCC_2_4.yaml @@ -71,7 +71,6 @@ tests: value: 1 - label: "Reads the attribute: LifetimeEnergyConsumed" - disabled: true command: "readAttribute" attribute: "LifetimeEnergyConsumed" response: diff --git a/src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml index 70dd41a50da8e8..6d90c74fdb2b50 100644 --- a/src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WIFIDIAG_1_1.yaml @@ -41,7 +41,6 @@ tests: # https://github.com/project-chip/connectedhomeip/pull/14755 is # fixed and the SDK has the right types. - label: "Reads SecurityType attribute from DUT" - disabled: true command: "readAttribute" attribute: "SecurityType" response: @@ -54,19 +53,14 @@ tests: constraints: type: enum - - label: "Reads WiFiVersion attribute from DUT" - disabled: true - command: "readAttribute" - attribute: "WiFiVersion" - response: - value: null - - label: "Reads WiFiVersion attribute constraints" command: "readAttribute" attribute: "WiFiVersion" response: constraints: type: enum + minValue: 0 + maxValue: 5 - label: "Reads ChannelNumber attribute from DUT" disabled: true diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 5f4a72b593a906..b249713640b17e 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -1569,6 +1569,44 @@ - (void)testSendClusterTest_TC_BI_1_1_000005_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_BI_1_1_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AcceptedCommandList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_BI_1_1_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: GeneratedCommandList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_BI_2_1_000000_WaitForCommissionee { @@ -12720,6 +12758,208 @@ - (void)testSendClusterTest_TC_ETHDIAG_1_1_000000_WaitForCommissionee WaitForCommissionee(expectation, queue, 305414945); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read PHYRate attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PHYRate attribute constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read FullDuplex attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read FullDuplex attribute constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read PacketRxCount attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PacketRxCount attribute constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read PacketTxCount attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PacketTxCount attribute constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read TxErrCount attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read TxErrCount attribute constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CollisionCount attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CollisionCount attribute constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read OverrunCount attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OverrunCount attribute constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000008_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read CarrierDetect attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CarrierDetect attribute constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_ETHDIAG_1_1_000009_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read TimeSinceReset attribute constraints"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read TimeSinceReset attribute constraints Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_ETHDIAG_2_1_000000_WaitForCommissionee { @@ -18407,6 +18647,11 @@ - (void)testSendClusterTest_TC_OO_2_1_000002_ReadAttribute [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"read LT attribute: GlobalSceneControl Error: %@", err); + if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); [expectation fulfill]; @@ -18426,6 +18671,11 @@ - (void)testSendClusterTest_TC_OO_2_1_000003_ReadAttribute [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"read LT attribute: OnTime Error: %@", err); + if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); [expectation fulfill]; @@ -18445,6 +18695,11 @@ - (void)testSendClusterTest_TC_OO_2_1_000004_ReadAttribute [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"read LT attribute: OffWaitTime Error: %@", err); + if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); [expectation fulfill]; @@ -18464,6 +18719,11 @@ - (void)testSendClusterTest_TC_OO_2_1_000005_ReadAttribute [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"read LT attribute: StartUpOnOff Error: %@", err); + if (err.domain == MatterInteractionErrorDomain && err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + [expectation fulfill]; + return; + } + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); [expectation fulfill]; @@ -22028,7 +22288,33 @@ - (void)testSendClusterTest_TC_PCC_2_2_000001_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_2_000002_WriteAttribute +- (void)testSendClusterTest_TC_PCC_2_2_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveOperationMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 1); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_2_000003_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write 2 to the OperationMode attribute to DUT: OperationMode"]; @@ -22053,7 +22339,33 @@ - (void)testSendClusterTest_TC_PCC_2_2_000002_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_2_000003_WriteAttribute +- (void)testSendClusterTest_TC_PCC_2_2_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveOperationMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 2); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_2_000005_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write 3 to the OperationMode attribute to DUT: OperationMode"]; @@ -22078,6 +22390,32 @@ - (void)testSendClusterTest_TC_PCC_2_2_000003_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_PCC_2_2_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveOperationMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 3); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_PCC_2_3_000000_WaitForCommissionee { @@ -22211,7 +22549,33 @@ - (void)testSendClusterTest_TC_PCC_2_3_000005_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_3_000006_WriteAttribute +- (void)testSendClusterTest_TC_PCC_2_3_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 1); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_3_000007_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write 2 to the ControlMode attribute to DUT"]; @@ -22235,7 +22599,33 @@ - (void)testSendClusterTest_TC_PCC_2_3_000006_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_3_000007_WriteAttribute +- (void)testSendClusterTest_TC_PCC_2_3_000008_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 2); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_3_000009_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write 3 to the ControlMode attribute to DUT"]; @@ -22259,7 +22649,33 @@ - (void)testSendClusterTest_TC_PCC_2_3_000007_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_3_000008_WriteAttribute +- (void)testSendClusterTest_TC_PCC_2_3_000010_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 3); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_3_000011_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write 5 to the ControlMode attribute to DUT"]; @@ -22283,7 +22699,33 @@ - (void)testSendClusterTest_TC_PCC_2_3_000008_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_3_000009_WriteAttribute +- (void)testSendClusterTest_TC_PCC_2_3_000012_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 5); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_3_000013_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write 7 to the ControlMode attribute to DUT"]; @@ -22307,6 +22749,32 @@ - (void)testSendClusterTest_TC_PCC_2_3_000009_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_PCC_2_3_000014_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveControlMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 7); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_PCC_2_4_000000_WaitForCommissionee { @@ -22493,7 +22961,34 @@ - (void)testSendClusterTest_TC_PCC_2_4_000007_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_4_000008_WriteAttribute +- (void)testSendClusterTest_TC_PCC_2_4_000008_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeEnergyConsumed"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedIntValue], 1UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000009_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write 2 to the LifetimeEnergyConsumed attribute to DUT"]; @@ -22517,7 +23012,7 @@ - (void)testSendClusterTest_TC_PCC_2_4_000008_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_4_000009_ReadAttribute +- (void)testSendClusterTest_TC_PCC_2_4_000010_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeEnergyConsumed"]; @@ -22544,7 +23039,7 @@ - (void)testSendClusterTest_TC_PCC_2_4_000009_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_4_000010_WriteAttribute +- (void)testSendClusterTest_TC_PCC_2_4_000011_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write 3 to the LifetimeEnergyConsumed attribute to DUT"]; @@ -22568,7 +23063,7 @@ - (void)testSendClusterTest_TC_PCC_2_4_000010_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_PCC_2_4_000011_ReadAttribute +- (void)testSendClusterTest_TC_PCC_2_4_000012_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeEnergyConsumed"]; @@ -28981,6 +29476,32 @@ - (void)testSendClusterTest_TC_WIFIDIAG_1_1_000001_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTest_TC_WIFIDIAG_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads SecurityType attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeSecurityTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads SecurityType attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000003_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads SecurityType attribute constraints"]; @@ -29001,7 +29522,7 @@ - (void)testSendClusterTest_TC_WIFIDIAG_1_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000003_ReadAttribute +- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000004_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads WiFiVersion attribute constraints"]; @@ -29017,12 +29538,25 @@ - (void)testSendClusterTest_TC_WIFIDIAG_1_1_000003_ReadAttribute XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5); + } + } + [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000005_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads ChannelNumber attribute constraints"]; @@ -29043,7 +29577,7 @@ - (void)testSendClusterTest_TC_WIFIDIAG_1_1_000004_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000005_ReadAttribute +- (void)testSendClusterTest_TC_WIFIDIAG_1_1_000006_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Reads RSSI attribute constraints"]; 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 80bafa0d0c7289..3f7418b1add5f0 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -1564,6 +1564,14 @@ class Test_TC_BI_1_1 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); err = TestReadTheGlobalAttributeAttributeList_5(); break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -1579,7 +1587,7 @@ class Test_TC_BI_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -1702,6 +1710,46 @@ class Test_TC_BI_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestBinaryInputBasic * cluster = [[CHIPTestBinaryInputBasic alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_BI_2_1 : public TestCommandBridge { @@ -16055,6 +16103,42 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read PHYRate attribute constraints\n"); + err = TestReadPHYRateAttributeConstraints_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read FullDuplex attribute constraints\n"); + err = TestReadFullDuplexAttributeConstraints_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read PacketRxCount attribute constraints\n"); + err = TestReadPacketRxCountAttributeConstraints_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read PacketTxCount attribute constraints\n"); + err = TestReadPacketTxCountAttributeConstraints_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read TxErrCount attribute constraints\n"); + err = TestReadTxErrCountAttributeConstraints_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read CollisionCount attribute constraints\n"); + err = TestReadCollisionCountAttributeConstraints_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read OverrunCount attribute constraints\n"); + err = TestReadOverrunCountAttributeConstraints_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read CarrierDetect attribute constraints\n"); + err = TestReadCarrierDetectAttributeConstraints_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read TimeSinceReset attribute constraints\n"); + err = TestReadTimeSinceResetAttributeConstraints_9(); + break; } if (CHIP_NO_ERROR != err) { @@ -16070,7 +16154,7 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -16082,6 +16166,193 @@ class Test_TC_ETHDIAG_1_1 : public TestCommandBridge { WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadPHYRateAttributeConstraints_1() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PHYRate attribute constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("PHYRate", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFullDuplexAttributeConstraints_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read FullDuplex attribute constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("fullDuplex", "", "bool")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadPacketRxCountAttributeConstraints_3() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PacketRxCount attribute constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("packetRxCount", "", "uint64")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadPacketTxCountAttributeConstraints_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PacketTxCount attribute constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("packetTxCount", "", "uint64")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTxErrCountAttributeConstraints_5() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read TxErrCount attribute constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("txErrCount", "", "uint64")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCollisionCountAttributeConstraints_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CollisionCount attribute constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("collisionCount", "", "uint64")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadOverrunCountAttributeConstraints_7() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OverrunCount attribute constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("overrunCount", "", "uint64")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCarrierDetectAttributeConstraints_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CarrierDetect attribute constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("carrierDetect", "", "bool")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTimeSinceResetAttributeConstraints_9() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestEthernetNetworkDiagnostics * cluster = [[CHIPTestEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read TimeSinceReset attribute constraints Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("timeSinceReset", "", "uint64")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_ETHDIAG_2_1 : public TestCommandBridge { @@ -25921,6 +26192,11 @@ class Test_TC_OO_2_1 : public TestCommandBridge { [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"read LT attribute: GlobalSceneControl Error: %@", err); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("globalSceneControl", "", "bool")); @@ -25939,6 +26215,11 @@ class Test_TC_OO_2_1 : public TestCommandBridge { [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"read LT attribute: OnTime Error: %@", err); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("onTime", "", "uint16")); @@ -25957,6 +26238,11 @@ class Test_TC_OO_2_1 : public TestCommandBridge { [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"read LT attribute: OffWaitTime Error: %@", err); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("offWaitTime", "", "uint16")); @@ -25975,6 +26261,11 @@ class Test_TC_OO_2_1 : public TestCommandBridge { [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"read LT attribute: StartUpOnOff Error: %@", err); + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("startUpOnOff", "", "enum8")); @@ -30540,20 +30831,44 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { err = TestWrite1ToTheOperationModeAttributeToDutOperationMode_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); - if (ShouldSkip("A_OPERATIONMODE")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { NextTest(); return; } - err = TestWrite2ToTheOperationModeAttributeToDutOperationMode_2(); + err = TestReadsTheAttributeEffectiveOperationMode_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); if (ShouldSkip("A_OPERATIONMODE")) { NextTest(); return; } - err = TestWrite3ToTheOperationModeAttributeToDutOperationMode_3(); + err = TestWrite2ToTheOperationModeAttributeToDutOperationMode_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveOperationMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); + if (ShouldSkip("A_OPERATIONMODE")) { + NextTest(); + return; + } + err = TestWrite3ToTheOperationModeAttributeToDutOperationMode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveOperationMode_6(); break; } @@ -30570,7 +30885,7 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -30605,7 +30920,31 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_2() + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -30627,7 +30966,31 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_3() + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_4() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 2)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -30648,6 +31011,30 @@ class Test_TC_PCC_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveOperationMode", actualValue, 3)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_PCC_2_3 : public TestCommandBridge { @@ -30731,36 +31118,76 @@ class Test_TC_PCC_2_3 : public TestCommandBridge { err = TestWrite1ToTheControlModeAttributeToDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Write 2 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { NextTest(); return; } - err = TestWrite2ToTheControlModeAttributeToDut_6(); + err = TestReadsTheAttributeEffectiveControlMode_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write 3 to the ControlMode attribute to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 7 : Write 2 to the ControlMode attribute to DUT\n"); if (ShouldSkip("A_CONTROLMODE")) { NextTest(); return; } - err = TestWrite3ToTheControlModeAttributeToDut_7(); + err = TestWrite2ToTheControlModeAttributeToDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write 5 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { NextTest(); return; } - err = TestWrite5ToTheControlModeAttributeToDut_8(); + err = TestReadsTheAttributeEffectiveControlMode_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write 7 to the ControlMode attribute to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 9 : Write 3 to the ControlMode attribute to DUT\n"); if (ShouldSkip("A_CONTROLMODE")) { NextTest(); return; } - err = TestWrite7ToTheControlModeAttributeToDut_9(); + err = TestWrite3ToTheControlModeAttributeToDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Write 5 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) { + NextTest(); + return; + } + err = TestWrite5ToTheControlModeAttributeToDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Write 7 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) { + NextTest(); + return; + } + err = TestWrite7ToTheControlModeAttributeToDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_14(); break; } @@ -30777,7 +31204,7 @@ class Test_TC_PCC_2_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 15; chip::Optional mNodeId; chip::Optional mCluster; @@ -30904,7 +31331,31 @@ class Test_TC_PCC_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite2ToTheControlModeAttributeToDut_6() + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_6() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWrite2ToTheControlModeAttributeToDut_7() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -30926,7 +31377,31 @@ class Test_TC_PCC_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite3ToTheControlModeAttributeToDut_7() + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 2)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWrite3ToTheControlModeAttributeToDut_9() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -30948,7 +31423,31 @@ class Test_TC_PCC_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite5ToTheControlModeAttributeToDut_8() + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_10() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 3)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWrite5ToTheControlModeAttributeToDut_11() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -30970,7 +31469,31 @@ class Test_TC_PCC_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite7ToTheControlModeAttributeToDut_9() + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_12() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 5)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWrite7ToTheControlModeAttributeToDut_13() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -30991,6 +31514,30 @@ class Test_TC_PCC_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_14() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: EffectiveControlMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EffectiveControlMode", actualValue, 7)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_PCC_2_4 : public TestCommandBridge { @@ -31062,20 +31609,24 @@ class Test_TC_PCC_2_4 : public TestCommandBridge { err = TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write 2 to the LifetimeEnergyConsumed attribute to DUT\n"); - err = TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the attribute: LifetimeEnergyConsumed\n"); - err = TestReadsTheAttributeLifetimeEnergyConsumed_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Write 2 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Write 3 to the LifetimeEnergyConsumed attribute to DUT\n"); - err = TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the attribute: LifetimeEnergyConsumed\n"); - err = TestReadsTheAttributeLifetimeEnergyConsumed_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Write 3 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_12(); break; } @@ -31092,7 +31643,7 @@ class Test_TC_PCC_2_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 13; chip::Optional mNodeId; chip::Optional mCluster; @@ -31268,7 +31819,32 @@ class Test_TC_PCC_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_8() + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LifetimeEnergyConsumed", actualValue)); + VerifyOrReturn(CheckValue("LifetimeEnergyConsumed", actualValue, 1UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_9() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -31290,7 +31866,7 @@ class Test_TC_PCC_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_9() + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_10() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -31315,7 +31891,7 @@ class Test_TC_PCC_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_10() + CHIP_ERROR TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_11() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -31337,7 +31913,7 @@ class Test_TC_PCC_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_11() + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_12() { CHIPDevice * device = GetConnectedDevice(); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -39515,20 +40091,24 @@ class Test_TC_WIFIDIAG_1_1 : public TestCommandBridge { err = TestReadsNetworkInterfaceStructureAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads SecurityType attribute constraints\n"); - err = TestReadsSecurityTypeAttributeConstraints_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads SecurityType attribute from DUT\n"); + err = TestReadsSecurityTypeAttributeFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads WiFiVersion attribute constraints\n"); - err = TestReadsWiFiVersionAttributeConstraints_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads SecurityType attribute constraints\n"); + err = TestReadsSecurityTypeAttributeConstraints_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads ChannelNumber attribute constraints\n"); - err = TestReadsChannelNumberAttributeConstraints_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads WiFiVersion attribute constraints\n"); + err = TestReadsWiFiVersionAttributeConstraints_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads RSSI attribute constraints\n"); - err = TestReadsRssiAttributeConstraints_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads ChannelNumber attribute constraints\n"); + err = TestReadsChannelNumberAttributeConstraints_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads RSSI attribute constraints\n"); + err = TestReadsRssiAttributeConstraints_6(); break; } @@ -39545,7 +40125,7 @@ class Test_TC_WIFIDIAG_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -39578,7 +40158,31 @@ class Test_TC_WIFIDIAG_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsSecurityTypeAttributeConstraints_2() + CHIP_ERROR TestReadsSecurityTypeAttributeFromDut_2() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSecurityTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads SecurityType attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("SecurityType", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsSecurityTypeAttributeConstraints_3() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device @@ -39598,7 +40202,7 @@ class Test_TC_WIFIDIAG_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsWiFiVersionAttributeConstraints_3() + CHIP_ERROR TestReadsWiFiVersionAttributeConstraints_4() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device @@ -39612,13 +40216,20 @@ class Test_TC_WIFIDIAG_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err, 0)); VerifyOrReturn(CheckConstraintType("wiFiVersion", "", "enum")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("wiFiVersion", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("wiFiVersion", [value unsignedCharValue], 5)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsChannelNumberAttributeConstraints_4() + CHIP_ERROR TestReadsChannelNumberAttributeConstraints_5() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device @@ -39638,7 +40249,7 @@ class Test_TC_WIFIDIAG_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsRssiAttributeConstraints_5() + CHIP_ERROR TestReadsRssiAttributeConstraints_6() { CHIPDevice * device = GetConnectedDevice(); CHIPTestWiFiNetworkDiagnostics * cluster = [[CHIPTestWiFiNetworkDiagnostics alloc] initWithDevice:device diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 826796d3bc3b82..473002dcce8513 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -125,6 +125,7 @@ class TestList : public Command printf("Test_TC_MC_10_1\n"); printf("Test_TC_MOD_1_1\n"); printf("Test_TC_MF_1_4\n"); + printf("Test_TC_MF_1_6\n"); printf("Test_TC_OCC_1_1\n"); printf("Test_TC_OCC_2_1\n"); printf("Test_TC_OCC_2_2\n"); @@ -311,7 +312,6 @@ class ManualTestList : public Command printf("Test_TC_MF_1_2\n"); printf("Test_TC_MF_1_3\n"); printf("Test_TC_MF_1_5\n"); - printf("Test_TC_MF_1_6\n"); printf("Test_TC_MF_1_7\n"); printf("Test_TC_MF_1_8\n"); printf("Test_TC_MF_1_9\n"); @@ -2005,6 +2005,14 @@ class Test_TC_BI_1_1Suite : public TestCommand ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); err = TestReadTheGlobalAttributeAttributeList_5(); break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_7(); + break; } if (CHIP_NO_ERROR != err) @@ -2021,7 +2029,7 @@ class Test_TC_BI_1_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -2095,6 +2103,28 @@ class Test_TC_BI_1_1Suite : public TestCommand (static_cast(context))->OnSuccessResponse_5(attributeList); } + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context, + const chip::app::DataModel::DecodableList & acceptedCommandList) + { + (static_cast(context))->OnSuccessResponse_6(acceptedCommandList); + } + + static void OnFailureCallback_7(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_7(error); + } + + static void OnSuccessCallback_7(void * context, + const chip::app::DataModel::DecodableList & generatedCommandList) + { + (static_cast(context))->OnSuccessResponse_7(generatedCommandList); + } + // // Tests methods // @@ -2221,6 +2251,54 @@ class Test_TC_BI_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BinaryInputBasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_6(const chip::app::DataModel::DecodableList & acceptedCommandList) + { + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::BinaryInputBasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_7(const chip::app::DataModel::DecodableList & generatedCommandList) + { + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + } }; class Test_TC_BI_2_1Suite : public TestCommand @@ -21510,212 +21588,41 @@ class Test_TC_ETHDIAG_1_1Suite : public TestCommand ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - 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 = 1; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - 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; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read PHYRate attribute constraints\n"); + err = TestReadPHYRateAttributeConstraints_1(); break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - } -}; - -class Test_TC_ETHDIAG_2_1Suite : public TestCommand -{ -public: - Test_TC_ETHDIAG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ETHDIAG_2_1", credsIssuerConfig), mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_ETHDIAG_2_1Suite() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ETHDIAG_2_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ETHDIAG_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read FullDuplex attribute constraints\n"); + err = TestReadFullDuplexAttributeConstraints_2(); break; - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - 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 = 1; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - 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; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read PacketRxCount attribute constraints\n"); + err = TestReadPacketRxCountAttributeConstraints_3(); break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - } -}; - -class Test_TC_FLW_1_1Suite : public TestCommand -{ -public: - Test_TC_FLW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_FLW_1_1", credsIssuerConfig), mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_FLW_1_1Suite() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read PacketTxCount attribute constraints\n"); + err = TestReadPacketTxCountAttributeConstraints_4(); break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read TxErrCount attribute constraints\n"); + err = TestReadTxErrCountAttributeConstraints_5(); break; - case 2: - ChipLogProgress(chipTool, - " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read CollisionCount attribute constraints\n"); + err = TestReadCollisionCountAttributeConstraints_6(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read OverrunCount attribute constraints\n"); + err = TestReadOverrunCountAttributeConstraints_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read CarrierDetect attribute constraints\n"); + err = TestReadCarrierDetectAttributeConstraints_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read TimeSinceReset attribute constraints\n"); + err = TestReadTimeSinceResetAttributeConstraints_9(); break; } @@ -21733,7 +21640,524 @@ class Test_TC_FLW_1_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + 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; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1( + void * context, + const chip::app::DataModel::Nullable & PHYRate) + { + (static_cast(context))->OnSuccessResponse_1(PHYRate); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, const chip::app::DataModel::Nullable & fullDuplex) + { + (static_cast(context))->OnSuccessResponse_2(fullDuplex); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, uint64_t packetRxCount) + { + (static_cast(context))->OnSuccessResponse_3(packetRxCount); + } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4(void * context, uint64_t packetTxCount) + { + (static_cast(context))->OnSuccessResponse_4(packetTxCount); + } + + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); + } + + static void OnSuccessCallback_5(void * context, uint64_t txErrCount) + { + (static_cast(context))->OnSuccessResponse_5(txErrCount); + } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context, uint64_t collisionCount) + { + (static_cast(context))->OnSuccessResponse_6(collisionCount); + } + + static void OnFailureCallback_7(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_7(error); + } + + static void OnSuccessCallback_7(void * context, uint64_t overrunCount) + { + (static_cast(context))->OnSuccessResponse_7(overrunCount); + } + + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); + } + + static void OnSuccessCallback_8(void * context, const chip::app::DataModel::Nullable & carrierDetect) + { + (static_cast(context))->OnSuccessResponse_8(carrierDetect); + } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context, uint64_t timeSinceReset) + { + (static_cast(context))->OnSuccessResponse_9(timeSinceReset); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadPHYRateAttributeConstraints_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::EthernetNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_1( + const chip::app::DataModel::Nullable & PHYRate) + { + VerifyOrReturn(CheckConstraintType("PHYRate", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", PHYRate, 0)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", PHYRate, 9)); + NextTest(); + } + + CHIP_ERROR TestReadFullDuplexAttributeConstraints_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::EthernetNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_2(const chip::app::DataModel::Nullable & fullDuplex) + { + VerifyOrReturn(CheckConstraintType("fullDuplex", "", "bool")); + NextTest(); + } + + CHIP_ERROR TestReadPacketRxCountAttributeConstraints_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::EthernetNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_3(uint64_t packetRxCount) + { + VerifyOrReturn(CheckConstraintType("packetRxCount", "", "uint64")); + NextTest(); + } + + CHIP_ERROR TestReadPacketTxCountAttributeConstraints_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::EthernetNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_4(uint64_t packetTxCount) + { + VerifyOrReturn(CheckConstraintType("packetTxCount", "", "uint64")); + NextTest(); + } + + CHIP_ERROR TestReadTxErrCountAttributeConstraints_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::EthernetNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_5, OnFailureCallback_5, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_5(uint64_t txErrCount) + { + VerifyOrReturn(CheckConstraintType("txErrCount", "", "uint64")); + NextTest(); + } + + CHIP_ERROR TestReadCollisionCountAttributeConstraints_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::EthernetNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_6(uint64_t collisionCount) + { + VerifyOrReturn(CheckConstraintType("collisionCount", "", "uint64")); + NextTest(); + } + + CHIP_ERROR TestReadOverrunCountAttributeConstraints_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::EthernetNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_7(uint64_t overrunCount) + { + VerifyOrReturn(CheckConstraintType("overrunCount", "", "uint64")); + NextTest(); + } + + CHIP_ERROR TestReadCarrierDetectAttributeConstraints_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::EthernetNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_8, OnFailureCallback_8, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_8(const chip::app::DataModel::Nullable & carrierDetect) + { + VerifyOrReturn(CheckConstraintType("carrierDetect", "", "bool")); + NextTest(); + } + + CHIP_ERROR TestReadTimeSinceResetAttributeConstraints_9() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::EthernetNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_9, OnFailureCallback_9, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_9(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_9(uint64_t timeSinceReset) + { + VerifyOrReturn(CheckConstraintType("timeSinceReset", "", "uint64")); + NextTest(); + } +}; + +class Test_TC_ETHDIAG_2_1Suite : public TestCommand +{ +public: + Test_TC_ETHDIAG_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ETHDIAG_2_1", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ETHDIAG_2_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ETHDIAG_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ETHDIAG_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + 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 = 1; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + 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; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } +}; + +class Test_TC_FLW_1_1Suite : public TestCommand +{ +public: + Test_TC_FLW_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_FLW_1_1", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLW_1_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, + " ***** Test Step 2 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -34552,11 +34976,459 @@ class Test_TC_MF_1_4Suite : public TestCommand request.commissioningTimeout = 180U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); + (static_cast(context))->OnSuccessResponse_2(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_2(error); + }; + + ReturnErrorOnFailure( + chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan nodeLabelArgument; + nodeLabelArgument = chip::Span("chiptestgarbage: not in length on purpose", 8); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nodeLabelArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_4(chip::CharSpan nodeLabel) + { + VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", nodeLabel.size(), 32)); + NextTest(); + } + + CHIP_ERROR TestCommissionFromBeta_5() + { + SetIdentity(kIdentityBeta); + return PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_6() + { + SetIdentity(kIdentityBeta); + return WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); + } + + CHIP_ERROR TestQueryFabricsList_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::OperationalCredentialsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_7, OnFailureCallback_7, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_7(const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) + { + { + auto iter_0 = fabrics.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + } + + CHIP_ERROR TestQueryFabricsList_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::OperationalCredentialsClusterTest cluster; + cluster.Associate(mDevices[kIdentityBeta], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_8, OnFailureCallback_8, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_8(const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) + { + { + auto iter_0 = fabrics.begin(); + VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); + VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); + VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); + } + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + NextTest(); + } + + CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_9() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan nodeLabelArgument; + nodeLabelArgument = chip::Span("chiptestgarbage: not in length on purpose", 8); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nodeLabelArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_9(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_9() { NextTest(); } + + CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_10() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_10, OnFailureCallback_10, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_10(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_10(chip::CharSpan nodeLabel) + { + VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", nodeLabel.size(), 32)); + NextTest(); + } + + CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_11() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityBeta], endpoint); + + chip::CharSpan nodeLabelArgument; + nodeLabelArgument = chip::Span("chiptestgarbage: not in length on purpose", 8); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nodeLabelArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_11(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_11() { NextTest(); } + + CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_12() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::BasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityBeta], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_12, OnFailureCallback_12, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_12(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_12(chip::CharSpan nodeLabel) + { + VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", nodeLabel.size(), 32)); + NextTest(); + } +}; + +class Test_TC_MF_1_6Suite : public TestCommand +{ +public: + Test_TC_MF_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MF_1_6", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("nodeIdForDuplicateCommissioning", 0, UINT64_MAX, &mNodeIdForDuplicateCommissioning); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MF_1_6Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MF_1_6\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MF_1_6\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Reboot target device\n"); + err = TestRebootTargetDevice_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH_CR1 starts a commissioning process with DUT_CE\n"); + err = TestThCr1StartsACommissioningProcessWithDutCe_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Commission from beta\n"); + err = TestCommissionFromBeta_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH_CR2 starts a commissioning process on DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessOnDutCe_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Open Commissioning Window from alpha\n"); + err = TestOpenCommissioningWindowFromAlpha_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH_CR1 revokes the commissioning window on DUT_CE\n"); + err = TestThCr1RevokesTheCommissioningWindowOnDutCe_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH_CR2 starts a commissioning process on DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessOnDutCe_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE\n"); + err = TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH_CR1 read the mandatory attribute NodeLabel of DUT_CE\n"); + err = TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH_CR2 starts a commissioning process on DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessOnDutCe_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH_CR3 starts a commissioning process with DUT_CE\n"); + err = TestThCr3StartsACommissioningProcessWithDutCe_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Wait for the commissioned device to be retrieved for gamma\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForGamma_13(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + 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 = 14; + + chip::Optional mNodeId; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + + 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)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); + } + + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context, chip::CharSpan nodeLabel) + { + (static_cast(context))->OnSuccessResponse_9(nodeLabel); + } + + // + // Tests methods + // + + CHIP_ERROR TestRebootTargetDevice_0() + { + SetIdentity(kIdentityAlpha); + return Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U); + } + + CHIP_ERROR TestThCr1StartsACommissioningProcessWithDutCe_1() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type; + + RequestType request; + request.commissioningTimeout = 180U; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_2(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); }; ReturnErrorOnFailure( @@ -34572,126 +35444,83 @@ class Test_TC_MF_1_4Suite : public TestCommand void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_3() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::CharSpan nodeLabelArgument; - nodeLabelArgument = chip::Span("chiptestgarbage: not in length on purpose", 8); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nodeLabelArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(error); - } - - void OnSuccessResponse_3() { NextTest(); } - - CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_4() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_4(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(error); - } - - void OnSuccessResponse_4(chip::CharSpan nodeLabel) - { - VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", nodeLabel.size(), 32)); - NextTest(); - } - - CHIP_ERROR TestCommissionFromBeta_5() + CHIP_ERROR TestCommissionFromBeta_3() { SetIdentity(kIdentityBeta); return PairWithQRCode(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL, mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); } - CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_6() + CHIP_ERROR TestThCr2StartsACommissioningProcessOnDutCe_4() { SetIdentity(kIdentityBeta); return WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); } - CHIP_ERROR TestQueryFabricsList_7() + CHIP_ERROR TestOpenCommissioningWindowFromAlpha_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + using RequestType = chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type; - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7, true)); + RequestType request; + request.commissioningTimeout = 180U; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_5(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_5(error); + }; + + ReturnErrorOnFailure( + chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_7(const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) - { - { - auto iter_0 = fabrics.begin(); - VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); - VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); - VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); - } - VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); - NextTest(); - } + void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestQueryFabricsList_8() + CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; - chip::Controller::OperationalCredentialsClusterTest cluster; - cluster.Associate(mDevices[kIdentityBeta], endpoint); + using RequestType = chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type; - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8, true)); + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_6(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_6(error); + }; + + ReturnErrorOnFailure( + chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_6(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_8(const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & fabrics) + void OnSuccessResponse_6() { NextTest(); } + + CHIP_ERROR TestThCr2StartsACommissioningProcessOnDutCe_7() { - { - auto iter_0 = fabrics.begin(); - VerifyOrReturn(CheckNextListItemDecodes("fabrics", iter_0, 0)); - VerifyOrReturn(CheckValueAsString("fabrics[0].label", iter_0.GetValue().label, chip::CharSpan("", 0))); - VerifyOrReturn(CheckNoMoreListItems("fabrics", iter_0, 1)); - } - VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); - NextTest(); + SetIdentity(kIdentityBeta); + return WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); } - CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_9() + CHIP_ERROR TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::BasicClusterTest cluster; @@ -34701,86 +35530,88 @@ class Test_TC_MF_1_4Suite : public TestCommand nodeLabelArgument = chip::Span("chiptestgarbage: not in length on purpose", 8); ReturnErrorOnFailure(cluster.WriteAttribute( - nodeLabelArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); + nodeLabelArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); return CHIP_NO_ERROR; } - void OnFailureResponse_9(CHIP_ERROR error) + void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_9() { NextTest(); } + void OnSuccessResponse_8() { NextTest(); } - CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_10() + CHIP_ERROR TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::BasicClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10, true)); + this, OnSuccessCallback_9, OnFailureCallback_9, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_10(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_10(chip::CharSpan nodeLabel) + void OnSuccessResponse_9(chip::CharSpan nodeLabel) { - VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", nodeLabel.size(), 32)); + VerifyOrReturn(CheckValueAsString("nodeLabel", nodeLabel, chip::CharSpan("chiptest", 8))); + NextTest(); } - CHIP_ERROR TestThCr1WritesTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_11() + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityBeta], endpoint); + using RequestType = chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type; - chip::CharSpan nodeLabelArgument; - nodeLabelArgument = chip::Span("chiptestgarbage: not in length on purpose", 8); + RequestType request; + request.commissioningTimeout = 180U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nodeLabelArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_10(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_10(error); + }; + + ReturnErrorOnFailure( + chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); return CHIP_NO_ERROR; } - void OnFailureResponse_11(CHIP_ERROR error) + void OnFailureResponse_10(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_11() { NextTest(); } + void OnSuccessResponse_10() { NextTest(); } - CHIP_ERROR TestThCr1ReadsTheBasicInformationClustersNodeLabelMandatoryAttributeOfDutCe_12() + CHIP_ERROR TestThCr2StartsACommissioningProcessOnDutCe_11() { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityBeta], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_12, OnFailureCallback_12, true)); - return CHIP_NO_ERROR; + SetIdentity(kIdentityBeta); + return WaitForCommissionee(mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL); } - void OnFailureResponse_12(CHIP_ERROR error) + CHIP_ERROR TestThCr3StartsACommissioningProcessWithDutCe_12() { - chip::app::StatusIB status(error); - ThrowFailureResponse(error); + SetIdentity(kIdentityGamma); + return PairWithQRCode(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL, + mPayload.HasValue() ? mPayload.Value() : chip::CharSpan::fromCharString("MT:-24J0AFN00KA0648G00")); } - void OnSuccessResponse_12(chip::CharSpan nodeLabel) + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForGamma_13() { - VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", nodeLabel.size(), 32)); - NextTest(); + SetIdentity(kIdentityGamma); + return WaitForCommissionee(mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL); } }; @@ -36245,7 +37076,8 @@ class Test_TC_OO_2_1Suite : public TestCommand void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() + : ThrowFailureResponse(error); } void OnSuccessResponse_2(bool globalSceneControl) @@ -36268,7 +37100,8 @@ class Test_TC_OO_2_1Suite : public TestCommand void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() + : ThrowFailureResponse(error); } void OnSuccessResponse_3(uint16_t onTime) @@ -36291,7 +37124,8 @@ class Test_TC_OO_2_1Suite : public TestCommand void OnFailureResponse_4(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() + : ThrowFailureResponse(error); } void OnSuccessResponse_4(uint16_t offWaitTime) @@ -36314,7 +37148,8 @@ class Test_TC_OO_2_1Suite : public TestCommand void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); - ThrowFailureResponse(error); + (status.mStatus == chip::Protocols::InteractionModel::Status::UnsupportedAttribute) ? NextTest() + : ThrowFailureResponse(error); } void OnSuccessResponse_5(const chip::app::DataModel::Nullable & startUpOnOff) @@ -43502,22 +44337,49 @@ class Test_TC_PCC_2_2Suite : public TestCommand err = TestWrite1ToTheOperationModeAttributeToDutOperationMode_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); - if (ShouldSkip("A_OPERATIONMODE")) + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) { NextTest(); return; } - err = TestWrite2ToTheOperationModeAttributeToDutOperationMode_2(); + err = TestReadsTheAttributeEffectiveOperationMode_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); + if (ShouldSkip("A_OPERATIONMODE")) + { + NextTest(); + return; + } + err = TestWrite2ToTheOperationModeAttributeToDutOperationMode_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveOperationMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); if (ShouldSkip("A_OPERATIONMODE")) { NextTest(); return; } - err = TestWrite3ToTheOperationModeAttributeToDutOperationMode_3(); + err = TestWrite3ToTheOperationModeAttributeToDutOperationMode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveOperationMode_6(); break; } @@ -43535,7 +44397,7 @@ class Test_TC_PCC_2_2Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -43574,7 +44436,10 @@ class Test_TC_PCC_2_2Suite : public TestCommand (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + static void OnSuccessCallback_2(void * context, uint8_t effectiveOperationMode) + { + (static_cast(context))->OnSuccessResponse_2(effectiveOperationMode); + } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { @@ -43583,6 +44448,33 @@ class Test_TC_PCC_2_2Suite : public TestCommand static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4(void * context, uint8_t effectiveOperationMode) + { + (static_cast(context))->OnSuccessResponse_4(effectiveOperationMode); + } + + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); + } + + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context, uint8_t effectiveOperationMode) + { + (static_cast(context))->OnSuccessResponse_6(effectiveOperationMode); + } + // // Tests methods // @@ -43616,7 +44508,32 @@ class Test_TC_PCC_2_2Suite : public TestCommand void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_2() + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_2(uint8_t effectiveOperationMode) + { + VerifyOrReturn(CheckValue("effectiveOperationMode", effectiveOperationMode, 1)); + + NextTest(); + } + + CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -43627,19 +44544,44 @@ class Test_TC_PCC_2_2Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + operationModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_3() + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_4(uint8_t effectiveOperationMode) + { + VerifyOrReturn(CheckValue("effectiveOperationMode", effectiveOperationMode, 2)); + + NextTest(); + } + + CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -43650,17 +44592,42 @@ class Test_TC_PCC_2_2Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + operationModeArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_6(uint8_t effectiveOperationMode) + { + VerifyOrReturn(CheckValue("effectiveOperationMode", effectiveOperationMode, 3)); + + NextTest(); + } }; class Test_TC_PCC_2_3Suite : public TestCommand @@ -43752,40 +44719,85 @@ class Test_TC_PCC_2_3Suite : public TestCommand err = TestWrite1ToTheControlModeAttributeToDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Write 2 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { NextTest(); return; } - err = TestWrite2ToTheControlModeAttributeToDut_6(); + err = TestReadsTheAttributeEffectiveControlMode_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write 3 to the ControlMode attribute to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 7 : Write 2 to the ControlMode attribute to DUT\n"); if (ShouldSkip("A_CONTROLMODE")) { NextTest(); return; } - err = TestWrite3ToTheControlModeAttributeToDut_7(); + err = TestWrite2ToTheControlModeAttributeToDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write 5 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) { NextTest(); return; } - err = TestWrite5ToTheControlModeAttributeToDut_8(); + err = TestReadsTheAttributeEffectiveControlMode_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write 7 to the ControlMode attribute to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 9 : Write 3 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite3ToTheControlModeAttributeToDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Write 5 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite5ToTheControlModeAttributeToDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Write 7 to the ControlMode attribute to DUT\n"); if (ShouldSkip("A_CONTROLMODE")) { NextTest(); return; } - err = TestWrite7ToTheControlModeAttributeToDut_9(); + err = TestWrite7ToTheControlModeAttributeToDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_14(); break; } @@ -43803,7 +44815,7 @@ class Test_TC_PCC_2_3Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 15; chip::Optional mNodeId; chip::Optional mCluster; @@ -43876,7 +44888,10 @@ class Test_TC_PCC_2_3Suite : public TestCommand (static_cast(context))->OnFailureResponse_6(error); } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + static void OnSuccessCallback_6(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_6(effectiveControlMode); + } static void OnFailureCallback_7(void * context, CHIP_ERROR error) { @@ -43890,7 +44905,10 @@ class Test_TC_PCC_2_3Suite : public TestCommand (static_cast(context))->OnFailureResponse_8(error); } - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + static void OnSuccessCallback_8(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_8(effectiveControlMode); + } static void OnFailureCallback_9(void * context, CHIP_ERROR error) { @@ -43899,6 +44917,50 @@ class Test_TC_PCC_2_3Suite : public TestCommand static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } + static void OnFailureCallback_10(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_10(error); + } + + static void OnSuccessCallback_10(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_10(effectiveControlMode); + } + + static void OnFailureCallback_11(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_11(error); + } + + static void OnSuccessCallback_11(void * context) { (static_cast(context))->OnSuccessResponse_11(); } + + static void OnFailureCallback_12(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_12(error); + } + + static void OnSuccessCallback_12(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_12(effectiveControlMode); + } + + static void OnFailureCallback_13(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_13(error); + } + + static void OnSuccessCallback_13(void * context) { (static_cast(context))->OnSuccessResponse_13(); } + + static void OnFailureCallback_14(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_14(error); + } + + static void OnSuccessCallback_14(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_14(effectiveControlMode); + } + // // Tests methods // @@ -44028,7 +45090,32 @@ class Test_TC_PCC_2_3Suite : public TestCommand void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestWrite2ToTheControlModeAttributeToDut_6() + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_6(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckValue("effectiveControlMode", effectiveControlMode, 1)); + + NextTest(); + } + + CHIP_ERROR TestWrite2ToTheControlModeAttributeToDut_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -44039,19 +45126,44 @@ class Test_TC_PCC_2_3Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_6, OnFailureCallback_6)); + controlModeArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_7() { NextTest(); } + + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_8, OnFailureCallback_8, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_8(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckValue("effectiveControlMode", effectiveControlMode, 2)); - CHIP_ERROR TestWrite3ToTheControlModeAttributeToDut_7() + NextTest(); + } + + CHIP_ERROR TestWrite3ToTheControlModeAttributeToDut_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -44062,19 +45174,44 @@ class Test_TC_PCC_2_3Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); + controlModeArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_7() { NextTest(); } + void OnSuccessResponse_9() { NextTest(); } + + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_10() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - CHIP_ERROR TestWrite5ToTheControlModeAttributeToDut_8() + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_10, OnFailureCallback_10, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_10(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_10(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckValue("effectiveControlMode", effectiveControlMode, 3)); + + NextTest(); + } + + CHIP_ERROR TestWrite5ToTheControlModeAttributeToDut_11() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -44085,19 +45222,44 @@ class Test_TC_PCC_2_3Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + controlModeArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_11(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_8() { NextTest(); } + void OnSuccessResponse_11() { NextTest(); } + + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_12() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_12, OnFailureCallback_12, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_12(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_12(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckValue("effectiveControlMode", effectiveControlMode, 5)); - CHIP_ERROR TestWrite7ToTheControlModeAttributeToDut_9() + NextTest(); + } + + CHIP_ERROR TestWrite7ToTheControlModeAttributeToDut_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -44108,17 +45270,42 @@ class Test_TC_PCC_2_3Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); + controlModeArgument, this, OnSuccessCallback_13, OnFailureCallback_13)); return CHIP_NO_ERROR; } - void OnFailureResponse_9(CHIP_ERROR error) + void OnFailureResponse_13(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_9() { NextTest(); } + void OnSuccessResponse_13() { NextTest(); } + + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_14() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_14, OnFailureCallback_14, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_14(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckValue("effectiveControlMode", effectiveControlMode, 7)); + + NextTest(); + } }; class Test_TC_PCC_2_4Suite : public TestCommand @@ -44193,20 +45380,24 @@ class Test_TC_PCC_2_4Suite : public TestCommand err = TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write 2 to the LifetimeEnergyConsumed attribute to DUT\n"); - err = TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the attribute: LifetimeEnergyConsumed\n"); - err = TestReadsTheAttributeLifetimeEnergyConsumed_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Write 2 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Write 3 to the LifetimeEnergyConsumed attribute to DUT\n"); - err = TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the attribute: LifetimeEnergyConsumed\n"); - err = TestReadsTheAttributeLifetimeEnergyConsumed_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Write 3 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_12(); break; } @@ -44224,7 +45415,7 @@ class Test_TC_PCC_2_4Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 13; chip::Optional mNodeId; chip::Optional mCluster; @@ -44314,33 +45505,43 @@ class Test_TC_PCC_2_4Suite : public TestCommand (static_cast(context))->OnFailureResponse_8(error); } - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + static void OnSuccessCallback_8(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + (static_cast(context))->OnSuccessResponse_8(lifetimeEnergyConsumed); + } static void OnFailureCallback_9(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_9(error); } - static void OnSuccessCallback_9(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) - { - (static_cast(context))->OnSuccessResponse_9(lifetimeEnergyConsumed); - } + static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } static void OnFailureCallback_10(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_10(error); } - static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + static void OnSuccessCallback_10(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + (static_cast(context))->OnSuccessResponse_10(lifetimeEnergyConsumed); + } static void OnFailureCallback_11(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_11(error); } - static void OnSuccessCallback_11(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + static void OnSuccessCallback_11(void * context) { (static_cast(context))->OnSuccessResponse_11(); } + + static void OnFailureCallback_12(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_12(error); + } + + static void OnSuccessCallback_12(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) { - (static_cast(context))->OnSuccessResponse_11(lifetimeEnergyConsumed); + (static_cast(context))->OnSuccessResponse_12(lifetimeEnergyConsumed); } // @@ -44527,7 +45728,33 @@ class Test_TC_PCC_2_4Suite : public TestCommand void OnSuccessResponse_7() { NextTest(); } - CHIP_ERROR TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_8() + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_8, OnFailureCallback_8, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_8(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); + VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 1UL)); + + NextTest(); + } + + CHIP_ERROR TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -44539,19 +45766,19 @@ class Test_TC_PCC_2_4Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - lifetimeEnergyConsumedArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + lifetimeEnergyConsumedArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_8() { NextTest(); } + void OnSuccessResponse_9() { NextTest(); } - CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_9() + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -44559,17 +45786,17 @@ class Test_TC_PCC_2_4Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9, true)); + this, OnSuccessCallback_10, OnFailureCallback_10, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_9(CHIP_ERROR error) + void OnFailureResponse_10(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_9(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + void OnSuccessResponse_10(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) { VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 2UL)); @@ -44577,7 +45804,7 @@ class Test_TC_PCC_2_4Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_10() + CHIP_ERROR TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_11() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -44589,19 +45816,19 @@ class Test_TC_PCC_2_4Suite : public TestCommand ReturnErrorOnFailure( cluster.WriteAttribute( - lifetimeEnergyConsumedArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); + lifetimeEnergyConsumedArgument, this, OnSuccessCallback_11, OnFailureCallback_11)); return CHIP_NO_ERROR; } - void OnFailureResponse_10(CHIP_ERROR error) + void OnFailureResponse_11(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_10() { NextTest(); } + void OnSuccessResponse_11() { NextTest(); } - CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_11() + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_12() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; @@ -44609,17 +45836,17 @@ class Test_TC_PCC_2_4Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11, true)); + this, OnSuccessCallback_12, OnFailureCallback_12, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_11(CHIP_ERROR error) + void OnFailureResponse_12(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_11(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + void OnSuccessResponse_12(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) { VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 3UL)); @@ -56483,20 +57710,24 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand err = TestReadsNetworkInterfaceStructureAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads SecurityType attribute constraints\n"); - err = TestReadsSecurityTypeAttributeConstraints_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads SecurityType attribute from DUT\n"); + err = TestReadsSecurityTypeAttributeFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads WiFiVersion attribute constraints\n"); - err = TestReadsWiFiVersionAttributeConstraints_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads SecurityType attribute constraints\n"); + err = TestReadsSecurityTypeAttributeConstraints_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads ChannelNumber attribute constraints\n"); - err = TestReadsChannelNumberAttributeConstraints_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads WiFiVersion attribute constraints\n"); + err = TestReadsWiFiVersionAttributeConstraints_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads RSSI attribute constraints\n"); - err = TestReadsRssiAttributeConstraints_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads ChannelNumber attribute constraints\n"); + err = TestReadsChannelNumberAttributeConstraints_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads RSSI attribute constraints\n"); + err = TestReadsRssiAttributeConstraints_6(); break; } @@ -56514,7 +57745,7 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -56573,9 +57804,9 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand static void OnSuccessCallback_3( void * context, - const chip::app::DataModel::Nullable & wiFiVersion) + const chip::app::DataModel::Nullable & securityType) { - (static_cast(context))->OnSuccessResponse_3(wiFiVersion); + (static_cast(context))->OnSuccessResponse_3(securityType); } static void OnFailureCallback_4(void * context, CHIP_ERROR error) @@ -56583,9 +57814,11 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_4(void * context, const chip::app::DataModel::Nullable & channelNumber) + static void OnSuccessCallback_4( + void * context, + const chip::app::DataModel::Nullable & wiFiVersion) { - (static_cast(context))->OnSuccessResponse_4(channelNumber); + (static_cast(context))->OnSuccessResponse_4(wiFiVersion); } static void OnFailureCallback_5(void * context, CHIP_ERROR error) @@ -56593,9 +57826,19 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_5(error); } - static void OnSuccessCallback_5(void * context, const chip::app::DataModel::Nullable & rssi) + static void OnSuccessCallback_5(void * context, const chip::app::DataModel::Nullable & channelNumber) + { + (static_cast(context))->OnSuccessResponse_5(channelNumber); + } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context, const chip::app::DataModel::Nullable & rssi) { - (static_cast(context))->OnSuccessResponse_5(rssi); + (static_cast(context))->OnSuccessResponse_6(rssi); } // @@ -56634,7 +57877,7 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestReadsSecurityTypeAttributeConstraints_2() + CHIP_ERROR TestReadsSecurityTypeAttributeFromDut_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::WiFiNetworkDiagnosticsClusterTest cluster; @@ -56654,17 +57897,18 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand void OnSuccessResponse_2( const chip::app::DataModel::Nullable & securityType) { - VerifyOrReturn(CheckConstraintType("securityType", "", "enum")); + VerifyOrReturn(CheckValueNull("securityType", securityType)); + NextTest(); } - CHIP_ERROR TestReadsWiFiVersionAttributeConstraints_3() + CHIP_ERROR TestReadsSecurityTypeAttributeConstraints_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::WiFiNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } @@ -56676,13 +57920,39 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand } void OnSuccessResponse_3( + const chip::app::DataModel::Nullable & securityType) + { + VerifyOrReturn(CheckConstraintType("securityType", "", "enum")); + NextTest(); + } + + CHIP_ERROR TestReadsWiFiVersionAttributeConstraints_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::WiFiNetworkDiagnosticsClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(error); + } + + void OnSuccessResponse_4( const chip::app::DataModel::Nullable & wiFiVersion) { VerifyOrReturn(CheckConstraintType("wiFiVersion", "", "enum")); + VerifyOrReturn(CheckConstraintMinValue("wiFiVersion", wiFiVersion, 0)); + VerifyOrReturn(CheckConstraintMaxValue("wiFiVersion", wiFiVersion, 5)); NextTest(); } - CHIP_ERROR TestReadsChannelNumberAttributeConstraints_4() + CHIP_ERROR TestReadsChannelNumberAttributeConstraints_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::WiFiNetworkDiagnosticsClusterTest cluster; @@ -56690,40 +57960,40 @@ class Test_TC_WIFIDIAG_1_1Suite : public TestCommand ReturnErrorOnFailure( cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); + this, OnSuccessCallback_5, OnFailureCallback_5, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_4(const chip::app::DataModel::Nullable & channelNumber) + void OnSuccessResponse_5(const chip::app::DataModel::Nullable & channelNumber) { VerifyOrReturn(CheckConstraintType("channelNumber", "", "uint16")); NextTest(); } - CHIP_ERROR TestReadsRssiAttributeConstraints_5() + CHIP_ERROR TestReadsRssiAttributeConstraints_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::WiFiNetworkDiagnosticsClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5, true)); + this, OnSuccessCallback_6, OnFailureCallback_6, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_5(CHIP_ERROR error) + void OnFailureResponse_6(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(error); } - void OnSuccessResponse_5(const chip::app::DataModel::Nullable & rssi) + void OnSuccessResponse_6(const chip::app::DataModel::Nullable & rssi) { VerifyOrReturn(CheckConstraintType("rssi", "", "int8")); VerifyOrReturn(CheckConstraintMinValue("rssi", rssi, -120)); @@ -119816,89 +121086,6 @@ class Test_TC_MF_1_5Suite : public TestCommand // }; -class Test_TC_MF_1_6Suite : public TestCommand -{ -public: - Test_TC_MF_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MF_1_6", credsIssuerConfig), mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_MF_1_6Suite() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MF_1_6\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MF_1_6\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) - { - } - - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - 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); - } - } - - // - // Tests methods - // -}; - class Test_TC_MF_1_7Suite : public TestCommand { public: @@ -125062,6 +126249,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -125237,7 +126425,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),