From f28980b310ab33b07d138fc6b22c4e368224ef22 Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Tue, 14 Jun 2022 19:53:27 +0530 Subject: [PATCH] Modified MF tests May 17 (#19381) * Added MF tests TC-MF-1.9 TC-MF-1.10 modified tests TC-MF-1.5 TC-MF-1.6 TC-MF-1.15 * Added auto generated files * Modified scripts * Added auto generated files * Added auto generated files * Removed MF-1,10 from Darwin test * Auto generated files * Increased timeout for tests.yaml file * Modified darwin workflow timeout * Modified scripts TC-MF-1.19 and TC-MF-1.10 * Auto generated files * Removed MF test MF-1.10 and MF-1.9 from Darwinjs * Auto generated files * Increased Timeout for Darwin (no-ble-asan-clang) * Auto generated files --- .github/workflows/darwin-tests.yaml | 4 +- .github/workflows/tests.yaml | 8 +- .../suites/certification/Test_TC_MF_1_10.yaml | 426 ++++- .../suites/certification/Test_TC_MF_1_15.yaml | 52 +- .../suites/certification/Test_TC_MF_1_5.yaml | 26 +- .../suites/certification/Test_TC_MF_1_6.yaml | 26 +- .../suites/certification/Test_TC_MF_1_9.yaml | 397 ++++- src/app/tests/suites/tests.js | 4 +- .../chip-tool/zap-generated/test/Commands.h | 1189 +++++++++---- .../zap-generated/test/Commands.h | 1538 +++++++++++++---- 10 files changed, 2765 insertions(+), 905 deletions(-) diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml index c6603eaac00f4e..0f0f57b57104a5 100644 --- a/.github/workflows/darwin-tests.yaml +++ b/.github/workflows/darwin-tests.yaml @@ -29,7 +29,7 @@ concurrency: jobs: test_suites_chip_tool_darwin: name: Test Suites - Darwin - timeout-minutes: 120 + timeout-minutes: 135 strategy: matrix: @@ -96,7 +96,7 @@ jobs: --copy-artifacts-to objdir-clone \ " - name: Run Tests - timeout-minutes: 45 + timeout-minutes: 60 run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d0e5c774c023cd..ebb81d9ed58df4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -28,7 +28,7 @@ concurrency: jobs: test_suites_linux: name: Test Suites - Linux - timeout-minutes: 120 + timeout-minutes: 140 strategy: matrix: @@ -90,7 +90,7 @@ jobs: --copy-artifacts-to objdir-clone \ " - name: Run Tests - timeout-minutes: 40 + timeout-minutes: 60 run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ @@ -121,7 +121,7 @@ jobs: retention-days: 5 test_suites_darwin: name: Test Suites - Darwin - timeout-minutes: 120 + timeout-minutes: 140 strategy: matrix: @@ -190,7 +190,7 @@ jobs: --copy-artifacts-to objdir-clone \ " - name: Run Tests - timeout-minutes: 50 + timeout-minutes: 70 run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ diff --git a/src/app/tests/suites/certification/Test_TC_MF_1_10.yaml b/src/app/tests/suites/certification/Test_TC_MF_1_10.yaml index af86c1cb5ed809..a951ea5f4e3d42 100644 --- a/src/app/tests/suites/certification/Test_TC_MF_1_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_MF_1_10.yaml @@ -18,63 +18,377 @@ name: config: nodeId: 0x12344321 - cluster: "Basic" + timeout: 700 + 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:0000000000I31506010" + payload2: + type: CHAR_STRING + defaultValue: "MT:0000000000I.0648G00" tests: + - label: "Reboot target device" + cluster: "SystemCommands" + command: "Reboot" + arguments: + values: + - name: "discriminator" + value: discriminator + - 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 500 1 0 - - - [1635871562.958905][4336:4341] CHIP:DMG: InvokeCommand = - [1635871562.958976][4336:4341] CHIP:DMG: { - [1635871562.959031][4336:4341] CHIP:DMG: CommandList = - [1635871562.959095][4336:4341] CHIP:DMG: [ - [1635871562.959161][4336:4341] CHIP:DMG: CommandDataIB = - [1635871562.959225][4336:4341] CHIP:DMG: { - [1635871562.959290][4336:4341] CHIP:DMG: CommandPathIB = - [1635871562.959368][4336:4341] CHIP:DMG: { - [1635871562.959434][4336:4341] CHIP:DMG: EndpointId = 0x0, - [1635871562.959530][4336:4341] CHIP:DMG: ClusterId = 0x3c, - [1635871562.959625][4336:4341] CHIP:DMG: CommandId = 0x1, - [1635871562.959698][4336:4341] CHIP:DMG: }, - [1635871562.959776][4336:4341] CHIP:DMG: - [1635871562.959841][4336:4341] CHIP:DMG: StatusIB = - [1635871562.959911][4336:4341] CHIP:DMG: { - [1635871562.959980][4336:4341] CHIP:DMG: status = 0x0, - [1635871562.960064][4336:4341] CHIP:DMG: }, - [1635871562.960313][4336:4341] CHIP:DMG: - [1635871562.960459][4336:4341] CHIP:DMG: }, - [1635871562.960544][4336:4341] CHIP:DMG: - [1635871562.960604][4336:4341] CHIP:DMG: ], - [1635871562.960668][4336:4341] CHIP:DMG: - [1635871562.960723][4336:4341] CHIP:DMG: } - [1635871562.960824][4336:4341] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0 - [1635871562.960894][4336:4341] CHIP:TOO: Default Success Response - disabled: true - - - label: - "Set up a TH_CR2 to start attempting to do PASE to DUT_CE and failing - 20 times. This can be done using an invalid passcode" - verification: | - On 2nd controller, using chip-tool connect using wrong passcode. Repeat the step for 20 times. - - ./chip-tool pairing onnetwork 1 20202019 (With wrong passcode) - disabled: true - - - label: "TH_CR2 starts a 21st commissioning process" - verification: | - On 2nd controller, using chip tool connect using correct passcode. - - ./chip-tool pairing onnetwork 1 20202021 (correct passcode) - disabled: true + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH_CR1 opens a commissioning window on DUT_CE" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: "TH_CR3 starts a commissioning process with DUT_CE" + identity: "gamma" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId3 + - name: "payload" + value: payload + response: + error: FAILURE diff --git a/src/app/tests/suites/certification/Test_TC_MF_1_15.yaml b/src/app/tests/suites/certification/Test_TC_MF_1_15.yaml index 966145dea3b4ab..d0f4bf1728d29c 100644 --- a/src/app/tests/suites/certification/Test_TC_MF_1_15.yaml +++ b/src/app/tests/suites/certification/Test_TC_MF_1_15.yaml @@ -167,31 +167,7 @@ tests: arguments: values: - name: "ms" - value: 54000 - - - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 54000 - - - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 54000 - - - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 18000 + value: 180000 - label: "TH_CR1 re-opens new commissioning window on DUT_CE" identity: "alpha" @@ -253,31 +229,7 @@ tests: arguments: values: - name: "ms" - value: 54000 - - - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 54000 - - - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 54000 - - - label: "Wait for the expiration of PIXIT_COMM_WIN seconds" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 18000 + value: 180000 - label: "TH_CR1 opens a new commissioning window on DUT_CE" identity: "alpha" diff --git a/src/app/tests/suites/certification/Test_TC_MF_1_5.yaml b/src/app/tests/suites/certification/Test_TC_MF_1_5.yaml index e3eee90b82d022..e04f931bcce9bf 100644 --- a/src/app/tests/suites/certification/Test_TC_MF_1_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_MF_1_5.yaml @@ -76,31 +76,7 @@ tests: arguments: values: - name: "ms" - value: 54000 - - - label: "Wait for PIXIT_COMM_WIN(180) + 10 seconds" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 54000 - - - label: "Wait for PIXIT_COMM_WIN(180) + 10 seconds" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 54000 - - - label: "Wait for PIXIT_COMM_WIN(180) + 10 seconds" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 28000 + value: 190000 - label: "TH_CR2 starts a commissioning process with DUT_CE" identity: "beta" 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 c749c95dc5c958..2fb15ce3b7dbed 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 @@ -75,31 +75,7 @@ tests: arguments: values: - name: "ms" - value: 54000 - - - label: "Wait for PIXIT_COMM_WIN(180) + 10" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 54000 - - - label: "Wait for PIXIT_COMM_WIN(180) + 10" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 54000 - - - label: "Wait for PIXIT_COMM_WIN(180) + 10" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 28000 + value: 190000 - label: "Commission from beta" identity: "beta" diff --git a/src/app/tests/suites/certification/Test_TC_MF_1_9.yaml b/src/app/tests/suites/certification/Test_TC_MF_1_9.yaml index 4022bf84d2996e..ad3116782d7c7a 100644 --- a/src/app/tests/suites/certification/Test_TC_MF_1_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_MF_1_9.yaml @@ -18,46 +18,385 @@ name: config: nodeId: 0x12344321 - cluster: "Basic" + timeout: 700 + 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" + payload2: + type: CHAR_STRING + defaultValue: "MT:0000000000I.0648G00" tests: + - label: "Reboot target device" + cluster: "SystemCommands" + command: "Reboot" + arguments: + values: + - name: "discriminator" + value: discriminator + - 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 + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH_CR1 opens a new commissioning window on DUT_CE" + cluster: "AdministratorCommissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + - name: "PAKEVerifier" + value: "\x06\xc7\x56\xdf\xfc\xd7\x22\x65\x34\x52\xa1\x2d\xcd\x94\x5d\x8c\x54\xda\x2b\x0f\x3c\xbd\x1b\x4d\xc3\xf1\xad\xb2\x23\xae\xb2\x6b\x04\x7c\xd2\x4c\x96\x86\x6f\x97\x9b\x1d\x83\xec\x50\xe2\xb4\xae\x30\xcd\xf2\xfd\xb3\x2b\xd8\xa2\x11\xb8\x37\xdc\x94\xed\xcd\x56\xf4\xd1\x43\x77\x19\x10\x76\xbf\xc5\x9d\x99\xb7\xdd\x30\x53\xef\xd6\xf0\x2c\x44\x34\xf2\xbd\xd2\x7a\xa4\xf9\xce\xa7\x0d\x73\x8e\x4c" + - name: "discriminator" + value: discriminator + - name: "iterations" + value: 1000 + - name: "salt" + value: "SPAKE2P Key Salt" + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE - label: - "TH_CR1 opens a commissioning window on DUT_CE using a commissioning - timeout of PIXIT_COMM_WIN seconds using ECM" - verification: | - On 1st controller, using chip-tool, send the open-commissioning-window CMD for ECM. -t stands for timeout value, -o for OriginalSetupCode/TokenWithRandomPIN/TokenWithProvidedPIN , -d for descriminator -i for iteration count. Ref to cmd help. + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE - ./chip-tool pairing open-commissioning-window 1 1 200 1000 3840 + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE - [1635864513.699433][3850:3855] CHIP:DMG: ICR moving to [CommandSen] - [1635864513.699489][3850:3855] CHIP:CTL: Manual pairing code: [36177160937] - [1635864513.699566][3850:3855] CHIP:CTL: SetupQRCode: [MT:00000CQM00YZN476420] - [1635864513.699636][3850:3855] CHIP:EM: Sending Standalone Ack for MessageCounter:2599714227 on exchange 60688i - [1635864513.699685][3850:3855] CHIP:IN: Prepared plaintext message 0xffff8a7cd960 to 0x0000000000000000 of type 0x10 and protocolId (0, 0) on exchange 60688i with MessageCounter:3019982536. - [1635864513.699737][3850:3855] CHIP:IN: Sending plaintext msg 0xffff8a7cd960 with MessageCounter:3019982536 to 0x0000000000000000 at monotonic time: 6085358 msec - [1635864513.699834][3850:3855] CHIP:EM: Flushed pending ack for MessageCounter:2599714227 on exchange 60688i + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE - The setup pin code is extracted from the manual pairing code in the log and that will be used when pairing the 2nd admin controller. - disabled: true + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE - label: - "Set up a TH_CR2 to start attempting to do PASE to DUT_CE and failing - 20 times. This can be done using an invalid passcode" - verification: | - 1. On 2nd controller using chip-tool connect using wrong manual code. Repeat the step for 20 times. + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE - ./chip-tool pairing code 1 36177160938 (With wrong manual code) - disabled: true + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE - - label: "TH_CR2 starts a 21st commissioning process" - verification: | - 1. On 2nd controller using chip tool connect using correct passcode. + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE + + - label: + "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup + code" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload2 + response: + error: FAILURE - ./chip-tool pairing code 1 36177160937 (correct passcode) - disabled: true + - label: "TH_CR3 starts a commissioning process with DUT_CE" + identity: "gamma" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId3 + - name: "payload" + value: payload + response: + error: FAILURE diff --git a/src/app/tests/suites/tests.js b/src/app/tests/suites/tests.js index ac0ff6cd9bf22d..0601716cc8e728 100644 --- a/src/app/tests/suites/tests.js +++ b/src/app/tests/suites/tests.js @@ -228,8 +228,6 @@ function getManualTests() { 'Test_TC_MF_1_2', 'Test_TC_MF_1_7', 'Test_TC_MF_1_8', - 'Test_TC_MF_1_9', - 'Test_TC_MF_1_10', 'Test_TC_MF_1_11', 'Test_TC_MF_1_12', 'Test_TC_MF_1_13', @@ -642,6 +640,8 @@ function getTests() { 'Test_TC_MF_1_4', 'Test_TC_MF_1_5', 'Test_TC_MF_1_6', + 'Test_TC_MF_1_9', + 'Test_TC_MF_1_10', 'Test_TC_MF_1_15', ]; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 6b404f77b111ba..3a63f8d86d752e 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -122,6 +122,8 @@ class TestList : public Command printf("Test_TC_MF_1_4\n"); printf("Test_TC_MF_1_5\n"); printf("Test_TC_MF_1_6\n"); + printf("Test_TC_MF_1_9\n"); + printf("Test_TC_MF_1_10\n"); printf("Test_TC_MF_1_15\n"); printf("OTA_SuccessfulTransfer\n"); printf("Test_TC_OCC_1_1\n"); @@ -388,8 +390,6 @@ class ManualTestList : public Command printf("Test_TC_MF_1_2\n"); printf("Test_TC_MF_1_7\n"); printf("Test_TC_MF_1_8\n"); - printf("Test_TC_MF_1_9\n"); - printf("Test_TC_MF_1_10\n"); printf("Test_TC_MF_1_11\n"); printf("Test_TC_MF_1_12\n"); printf("Test_TC_MF_1_13\n"); @@ -21693,7 +21693,7 @@ class Test_TC_MF_1_4Suite : public TestCommand class Test_TC_MF_1_5Suite : public TestCommand { public: - Test_TC_MF_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_5", 17, credsIssuerConfig) + Test_TC_MF_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_5", 14, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); @@ -21747,38 +21747,26 @@ class Test_TC_MF_1_5Suite : public TestCommand shouldContinue = true; break; case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - shouldContinue = true; - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; @@ -21786,14 +21774,14 @@ class Test_TC_MF_1_5Suite : public TestCommand VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); } break; - case 14: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 15: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 16: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; @@ -21849,29 +21837,46 @@ class Test_TC_MF_1_5Suite : public TestCommand LogStep(3, "Wait for PIXIT_COMM_WIN(180) + 10 seconds"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; + value.ms = 190000UL; return WaitForMs(kIdentityAlpha, value); } case 4: { - LogStep(4, "Wait for PIXIT_COMM_WIN(180) + 10 seconds"); + LogStep(4, "TH_CR2 starts a commissioning process with DUT_CE"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs(kIdentityAlpha, value); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 5: { - LogStep(5, "Wait for PIXIT_COMM_WIN(180) + 10 seconds"); + LogStep(5, "TH_CR1 opens a new commissioning window on DUT_CE"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs(kIdentityAlpha, value); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEVerifier = chip::ByteSpan( + chip::Uint8::from_const_char("\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" + "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), + 97); + value.discriminator = 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } case 6: { - LogStep(6, "Wait for PIXIT_COMM_WIN(180) + 10 seconds"); + LogStep(6, "TH_CR1 revokes the commissioning window on DUT_CE"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 28000UL; - return WaitForMs(kIdentityAlpha, value); + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } case 7: { LogStep(7, "TH_CR2 starts a commissioning process with DUT_CE"); @@ -21882,7 +21887,30 @@ class Test_TC_MF_1_5Suite : public TestCommand return PairWithCode(kIdentityBeta, value); } case 8: { - LogStep(8, "TH_CR1 opens a new commissioning window on DUT_CE"); + LogStep(8, "TH_CR1 revokes the commissioning window on DUT_CE"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 9: { + LogStep(9, "TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("chiptestgarbage: not in length on purpose", 8); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, "TH_CR1 read the mandatory attribute NodeLabel of DUT_CE"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "TH_CR1 opens a new commissioning window on DUT_CE"); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; value.commissioningTimeout = 180U; @@ -21901,8 +21929,206 @@ class Test_TC_MF_1_5Suite : public TestCommand ); } - case 9: { - LogStep(9, "TH_CR1 revokes the commissioning window on DUT_CE"); + case 12: { + LogStep(12, "TH_CR2 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 13: { + LogStep(13, "TH_CR3 starts a commissioning process with DUT_CE"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityGamma, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_6Suite : public TestCommand +{ +public: + Test_TC_MF_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_6", 16, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + 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); + } + + ~Test_TC_MF_1_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(300)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + 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); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Stop target device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Start target device with the provided discriminator for basic commissioning advertisement"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.discriminator.Emplace(); + value.discriminator.Value() = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + return Start(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "TH_CR1 starts a commissioning process with DUT_CE"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "TH_CR1 opens a commissioning window on DUT_CE"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait for PIXIT_COMM_WIN(180) + 10"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 190000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Commission from beta"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 6: { + LogStep(6, "TH_CR1 opens a commissioning window on DUT_CE"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 7: { + LogStep(7, "TH_CR1 revokes the commissioning window on DUT_CE"); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, @@ -21911,16 +22137,16 @@ class Test_TC_MF_1_5Suite : public TestCommand ); } - case 10: { - LogStep(10, "TH_CR2 starts a commissioning process with DUT_CE"); + case 8: { + LogStep(8, "Commission from beta"); ListFreer listFreer; chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); return PairWithCode(kIdentityBeta, value); } - case 11: { - LogStep(11, "TH_CR1 revokes the commissioning window on DUT_CE"); + case 9: { + LogStep(9, "TH_CR1 revokes the commissioning window on DUT_CE"); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, @@ -21929,21 +22155,230 @@ class Test_TC_MF_1_5Suite : public TestCommand ); } - case 12: { - LogStep(12, "TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE"); + case 10: { + LogStep(10, "TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE"); ListFreer listFreer; chip::CharSpan value; value = chip::Span("chiptestgarbage: not in length on purpose", 8); return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value, chip::NullOptional, chip::NullOptional); } - case 13: { - LogStep(13, "TH_CR1 read the mandatory attribute NodeLabel of DUT_CE"); + case 11: { + LogStep(11, "TH_CR1 read the mandatory attribute NodeLabel of DUT_CE"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, chip::NullOptional); } + case 12: { + LogStep(12, "TH_CR1 opens a commissioning window on DUT_CE"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 13: { + LogStep(13, "Commission from beta"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } case 14: { - LogStep(14, "TH_CR1 opens a new commissioning window on DUT_CE"); + LogStep(14, "TH_CR2 starts a commissioning process on DUT_CE"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 15: { + LogStep(15, "TH_CR3 starts a commissioning process with DUT_CE"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityGamma, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MF_1_9Suite : public TestCommand +{ +public: + Test_TC_MF_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_9", 25, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + 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("payload2", &mPayload2); + } + + ~Test_TC_MF_1_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(700)); } + +private: + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mPayload2; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 24: + 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); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Reboot target device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH_CR1 starts a commissioning process with DUT_CE"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 2: { + LogStep(2, "TH_CR1 opens a new commissioning window on DUT_CE"); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; value.commissioningTimeout = 180U; @@ -21953,7 +22388,7 @@ class Test_TC_MF_1_5Suite : public TestCommand "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357" "\326\360,D4\362\275\322z\244\371\316\247\015s\216Lgarbage: not in length on purpose"), 97); - value.discriminator = 3840U; + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; value.iterations = 1000UL; value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, @@ -21962,17 +22397,176 @@ class Test_TC_MF_1_5Suite : public TestCommand ); } + case 3: { + LogStep(3, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 4: { + LogStep(4, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 5: { + LogStep(5, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 6: { + LogStep(6, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 7: { + LogStep(7, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 8: { + LogStep(8, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 9: { + LogStep(9, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 10: { + LogStep(10, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 11: { + LogStep(11, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 12: { + LogStep(12, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 13: { + LogStep(13, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 14: { + LogStep(14, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } case 15: { - LogStep(15, "TH_CR2 starts a commissioning process with DUT_CE"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(15, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; - value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 16: { - LogStep(16, "TH_CR3 starts a commissioning process with DUT_CE"); + LogStep(16, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 17: { + LogStep(17, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 18: { + LogStep(18, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 19: { + LogStep(19, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 20: { + LogStep(20, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 21: { + LogStep(21, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 22: { + LogStep(22, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 23: { + LogStep(23, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 24: { + LogStep(24, "TH_CR3 starts a commissioning process with DUT_CE"); ListFreer listFreer; chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; @@ -21984,10 +22578,10 @@ class Test_TC_MF_1_5Suite : public TestCommand } }; -class Test_TC_MF_1_6Suite : public TestCommand +class Test_TC_MF_1_10Suite : public TestCommand { public: - Test_TC_MF_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_6", 19, credsIssuerConfig) + Test_TC_MF_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_10", 25, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); @@ -21997,11 +22591,12 @@ class Test_TC_MF_1_6Suite : public TestCommand AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); AddArgument("payload", &mPayload); + AddArgument("payload2", &mPayload2); } - ~Test_TC_MF_1_6Suite() {} + ~Test_TC_MF_1_10Suite() {} - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(300)); } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(700)); } private: chip::Optional mNodeId; @@ -22012,6 +22607,7 @@ class Test_TC_MF_1_6Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mDiscriminator; chip::Optional mPayload; + chip::Optional mPayload2; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -22035,25 +22631,25 @@ class Test_TC_MF_1_6Suite : public TestCommand break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; break; case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; case 8: @@ -22061,10 +22657,12 @@ class Test_TC_MF_1_6Suite : public TestCommand shouldContinue = true; break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; break; case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); @@ -22072,33 +22670,56 @@ class Test_TC_MF_1_6Suite : public TestCommand break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; break; case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; break; case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("chiptest", 8))); - } + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; break; case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; break; case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); shouldContinue = true; break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -22115,28 +22736,20 @@ class Test_TC_MF_1_6Suite : public TestCommand switch (testIndex) { case 0: { - LogStep(0, "Stop target device"); + LogStep(0, "Reboot target device"); ListFreer listFreer; - chip::app::Clusters::SystemCommands::Commands::Stop::Type value; - return Stop(kIdentityAlpha, value); + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); } case 1: { - LogStep(1, "Start target device with the provided discriminator for basic commissioning advertisement"); - ListFreer listFreer; - chip::app::Clusters::SystemCommands::Commands::Start::Type value; - value.discriminator.Emplace(); - value.discriminator.Value() = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; - return Start(kIdentityAlpha, value); - } - case 2: { - LogStep(2, "TH_CR1 starts a commissioning process with DUT_CE"); + LogStep(1, "TH_CR1 starts a commissioning process with DUT_CE"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee(kIdentityAlpha, value); } - case 3: { - LogStep(3, "TH_CR1 opens a commissioning window on DUT_CE"); + case 2: { + LogStep(2, "TH_CR1 opens a commissioning window on DUT_CE"); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; value.commissioningTimeout = 180U; @@ -22146,126 +22759,180 @@ class Test_TC_MF_1_6Suite : public TestCommand ); } + case 3: { + LogStep(3, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } case 4: { - LogStep(4, "Wait for PIXIT_COMM_WIN(180) + 10"); + LogStep(4, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs(kIdentityAlpha, value); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 5: { - LogStep(5, "Wait for PIXIT_COMM_WIN(180) + 10"); + LogStep(5, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs(kIdentityAlpha, value); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 6: { - LogStep(6, "Wait for PIXIT_COMM_WIN(180) + 10"); + LogStep(6, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs(kIdentityAlpha, value); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 7: { - LogStep(7, "Wait for PIXIT_COMM_WIN(180) + 10"); + LogStep(7, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 28000UL; - return WaitForMs(kIdentityAlpha, value); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 8: { - LogStep(8, "Commission from beta"); + LogStep(8, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; - value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 9: { - LogStep(9, "TH_CR1 opens a commissioning window on DUT_CE"); + LogStep(9, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; - chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; - value.commissioningTimeout = 180U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, - AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, - chip::Optional(10000), chip::NullOptional - - ); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 10: { - LogStep(10, "TH_CR1 revokes the commissioning window on DUT_CE"); + LogStep(10, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; - chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, - AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, - chip::Optional(10000), chip::NullOptional - - ); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 11: { - LogStep(11, "Commission from beta"); + LogStep(11, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; - value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 12: { - LogStep(12, "TH_CR1 revokes the commissioning window on DUT_CE"); + LogStep(12, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; - chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, - AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, - chip::Optional(10000), chip::NullOptional - - ); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 13: { - LogStep(13, "TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE"); + LogStep(13, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; - chip::CharSpan value; - value = chip::Span("chiptestgarbage: not in length on purpose", 8); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value, - chip::NullOptional, chip::NullOptional); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 14: { - LogStep(14, "TH_CR1 read the mandatory attribute NodeLabel of DUT_CE"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, - chip::NullOptional); + LogStep(14, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 15: { - LogStep(15, "TH_CR1 opens a commissioning window on DUT_CE"); + LogStep(15, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; - chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; - value.commissioningTimeout = 180U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, - AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, - chip::Optional(10000), chip::NullOptional - - ); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 16: { - LogStep(16, "Commission from beta"); + LogStep(16, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; - value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 17: { - LogStep(17, "TH_CR2 starts a commissioning process on DUT_CE"); + LogStep(17, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; - return WaitForCommissionee(kIdentityBeta, value); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 18: { - LogStep(18, "TH_CR3 starts a commissioning process with DUT_CE"); + LogStep(18, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 19: { + LogStep(19, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 20: { + LogStep(20, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 21: { + LogStep(21, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 22: { + LogStep(22, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 23: { + LogStep(23, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 24: { + LogStep(24, "TH_CR3 starts a commissioning process with DUT_CE"); ListFreer listFreer; chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; - value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:0000000000I31506010", 22); return PairWithCode(kIdentityGamma, value); } } @@ -22276,7 +22943,7 @@ class Test_TC_MF_1_6Suite : public TestCommand class Test_TC_MF_1_15Suite : public TestCommand { public: - Test_TC_MF_1_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_15", 24, credsIssuerConfig) + Test_TC_MF_1_15Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_15", 18, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); @@ -22376,23 +23043,11 @@ class Test_TC_MF_1_15Suite : public TestCommand break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; - case 17: + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList< @@ -22412,26 +23067,14 @@ class Test_TC_MF_1_15Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 21: + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 22: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 23: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; default: @@ -22554,32 +23197,11 @@ class Test_TC_MF_1_15Suite : public TestCommand LogStep(11, "Wait for the expiration of PIXIT_COMM_WIN seconds"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; + value.ms = 180000UL; return WaitForMs(kIdentityAlpha, value); } case 12: { - LogStep(12, "Wait for the expiration of PIXIT_COMM_WIN seconds"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs(kIdentityAlpha, value); - } - case 13: { - LogStep(13, "Wait for the expiration of PIXIT_COMM_WIN seconds"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs(kIdentityAlpha, value); - } - case 14: { - LogStep(14, "Wait for the expiration of PIXIT_COMM_WIN seconds"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 18000UL; - return WaitForMs(kIdentityAlpha, value); - } - case 15: { - LogStep(15, "TH_CR1 re-opens new commissioning window on DUT_CE"); + LogStep(12, "TH_CR1 re-opens new commissioning window on DUT_CE"); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; value.commissioningTimeout = 180U; @@ -22598,8 +23220,8 @@ class Test_TC_MF_1_15Suite : public TestCommand ); } - case 16: { - LogStep(16, "TH_CR3 opens a new commissioning window on DUT_CE"); + case 13: { + LogStep(13, "TH_CR3 opens a new commissioning window on DUT_CE"); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; value.commissioningTimeout = 180U; @@ -22618,41 +23240,20 @@ class Test_TC_MF_1_15Suite : public TestCommand ); } - case 17: { - LogStep(17, "TH_CR1 reads the list of Fabrics on DUT_CE"); + case 14: { + LogStep(14, "TH_CR1 reads the list of Fabrics on DUT_CE"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, OperationalCredentials::Attributes::Fabrics::Id, false, chip::NullOptional); } - case 18: { - LogStep(18, "Wait for the expiration of PIXIT_COMM_WIN seconds"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs(kIdentityAlpha, value); - } - case 19: { - LogStep(19, "Wait for the expiration of PIXIT_COMM_WIN seconds"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs(kIdentityAlpha, value); - } - case 20: { - LogStep(20, "Wait for the expiration of PIXIT_COMM_WIN seconds"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs(kIdentityAlpha, value); - } - case 21: { - LogStep(21, "Wait for the expiration of PIXIT_COMM_WIN seconds"); + case 15: { + LogStep(15, "Wait for the expiration of PIXIT_COMM_WIN seconds"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 18000UL; + value.ms = 180000UL; return WaitForMs(kIdentityAlpha, value); } - case 22: { - LogStep(22, "TH_CR1 opens a new commissioning window on DUT_CE"); + case 16: { + LogStep(16, "TH_CR1 opens a new commissioning window on DUT_CE"); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; value.commissioningTimeout = 180U; @@ -22671,8 +23272,8 @@ class Test_TC_MF_1_15Suite : public TestCommand ); } - case 23: { - LogStep(23, "TH_CR2 opens a new commissioning window on DUT_CE"); + case 17: { + LogStep(17, "TH_CR2 opens a new commissioning window on DUT_CE"); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; value.commissioningTimeout = 180U; @@ -75538,118 +76139,6 @@ class Test_TC_MF_1_8Suite : public TestCommand } }; -class Test_TC_MF_1_9Suite : public TestCommand -{ -public: - Test_TC_MF_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_9", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_MF_1_9Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_MF_1_10Suite : public TestCommand -{ -public: - Test_TC_MF_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MF_1_10", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_MF_1_10Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - class Test_TC_MF_1_11Suite : public TestCommand { public: @@ -83216,6 +83705,8 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -83471,8 +83962,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 3c80c562841d5b..c2dc5476781413 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -121,6 +121,8 @@ class TestList : public Command { printf("Test_TC_MF_1_4\n"); printf("Test_TC_MF_1_5\n"); printf("Test_TC_MF_1_6\n"); + printf("Test_TC_MF_1_9\n"); + printf("Test_TC_MF_1_10\n"); printf("Test_TC_MF_1_15\n"); printf("OTA_SuccessfulTransfer\n"); printf("Test_TC_OCC_1_1\n"); @@ -35728,60 +35730,48 @@ class Test_TC_MF_1_5 : public TestCommandBridge { err = TestWaitForPixitCommWin18010Seconds_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Wait for PIXIT_COMM_WIN(180) + 10 seconds\n"); - err = TestWaitForPixitCommWin18010Seconds_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH_CR2 starts a commissioning process with DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessWithDutCe_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for PIXIT_COMM_WIN(180) + 10 seconds\n"); - err = TestWaitForPixitCommWin18010Seconds_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : TH_CR1 opens a new commissioning window on DUT_CE\n"); + err = TestThCr1OpensANewCommissioningWindowOnDutCe_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait for PIXIT_COMM_WIN(180) + 10 seconds\n"); - err = TestWaitForPixitCommWin18010Seconds_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 with DUT_CE\n"); err = TestThCr2StartsACommissioningProcessWithDutCe_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH_CR1 opens a new commissioning window on DUT_CE\n"); - err = TestThCr1OpensANewCommissioningWindowOnDutCe_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : TH_CR1 revokes the commissioning window on DUT_CE\n"); + err = TestThCr1RevokesTheCommissioningWindowOnDutCe_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH_CR1 revokes the commissioning window on DUT_CE\n"); - err = TestThCr1RevokesTheCommissioningWindowOnDutCe_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE\n"); + err = TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH_CR2 starts a commissioning process with DUT_CE\n"); - err = TestThCr2StartsACommissioningProcessWithDutCe_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : TH_CR1 read the mandatory attribute NodeLabel of DUT_CE\n"); + err = TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH_CR1 revokes the commissioning window on DUT_CE\n"); - err = TestThCr1RevokesTheCommissioningWindowOnDutCe_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : TH_CR1 opens a new commissioning window on DUT_CE\n"); + err = TestThCr1OpensANewCommissioningWindowOnDutCe_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE\n"); - err = TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH_CR1 read the mandatory attribute NodeLabel of DUT_CE\n"); - err = TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH_CR1 opens a new commissioning window on DUT_CE\n"); - err = TestThCr1OpensANewCommissioningWindowOnDutCe_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH_CR2 starts a commissioning process with DUT_CE\n"); + ChipLogProgress(chipTool, " ***** Test Step 12 : TH_CR2 starts a commissioning process with DUT_CE\n"); if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestThCr2StartsACommissioningProcessWithDutCe_15(); + err = TestThCr2StartsACommissioningProcessWithDutCe_12(); break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH_CR3 starts a commissioning process with DUT_CE\n"); - err = TestThCr3StartsACommissioningProcessWithDutCe_16(); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH_CR3 starts a commissioning process with DUT_CE\n"); + err = TestThCr3StartsACommissioningProcessWithDutCe_13(); break; } @@ -35807,7 +35797,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -35819,30 +35809,21 @@ class Test_TC_MF_1_5 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; } @@ -35855,7 +35836,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 14; chip::Optional mNodeId; chip::Optional mTimeout; @@ -35913,32 +35894,11 @@ class Test_TC_MF_1_5 : public TestCommandBridge { CHIP_ERROR TestWaitForPixitCommWin18010Seconds_3() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestWaitForPixitCommWin18010Seconds_4() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestWaitForPixitCommWin18010Seconds_5() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestWaitForPixitCommWin18010Seconds_6() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 28000UL; + value.ms = 190000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_7() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_4() { chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; @@ -35946,7 +35906,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { return PairWithCode("beta", value); } - CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_8() + CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_5() { CHIPDevice * device = GetDevice("alpha"); CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device @@ -35977,7 +35937,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_9() + CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_6() { CHIPDevice * device = GetDevice("alpha"); CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device @@ -35996,7 +35956,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_10() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_7() { chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; @@ -36004,7 +35964,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { return PairWithCode("beta", value); } - CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_11() + CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_8() { CHIPDevice * device = GetDevice("alpha"); CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device @@ -36022,7 +35982,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_12() + CHIP_ERROR TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_9() { CHIPDevice * device = GetDevice("alpha"); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; @@ -36042,7 +36002,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_13() + CHIP_ERROR TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_10() { CHIPDevice * device = GetDevice("alpha"); CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; @@ -36064,7 +36024,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_14() + CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_11() { CHIPDevice * device = GetDevice("alpha"); CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device @@ -36095,7 +36055,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_15() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCe_12() { chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; @@ -36103,7 +36063,7 @@ class Test_TC_MF_1_5 : public TestCommandBridge { return PairWithCode("beta", value); } - CHIP_ERROR TestThCr3StartsACommissioningProcessWithDutCe_16() + CHIP_ERROR TestThCr3StartsACommissioningProcessWithDutCe_13() { chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; @@ -36176,60 +36136,999 @@ class Test_TC_MF_1_6 : public TestCommandBridge { err = TestWaitForPixitCommWin18010_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for PIXIT_COMM_WIN(180) + 10\n"); - err = TestWaitForPixitCommWin18010_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Commission from beta\n"); + err = TestCommissionFromBeta_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait for PIXIT_COMM_WIN(180) + 10\n"); - err = TestWaitForPixitCommWin18010_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Wait for PIXIT_COMM_WIN(180) + 10\n"); - err = TestWaitForPixitCommWin18010_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : TH_CR1 revokes the commissioning window on DUT_CE\n"); + err = TestThCr1RevokesTheCommissioningWindowOnDutCe_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Commission from beta\n"); err = TestCommissionFromBeta_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH_CR1 opens a commissioning window on DUT_CE\n"); - err = TestThCr1OpensACommissioningWindowOnDutCe_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : TH_CR1 revokes the commissioning window on DUT_CE\n"); + err = TestThCr1RevokesTheCommissioningWindowOnDutCe_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE\n"); + err = TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH_CR1 read the mandatory attribute NodeLabel of DUT_CE\n"); + err = TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH_CR1 opens a commissioning window on DUT_CE\n"); + err = TestThCr1OpensACommissioningWindowOnDutCe_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Commission from beta\n"); + err = TestCommissionFromBeta_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH_CR2 starts a commissioning process on DUT_CE\n"); + err = TestThCr2StartsACommissioningProcessOnDutCe_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH_CR3 starts a commissioning process with DUT_CE\n"); + err = TestThCr3StartsACommissioningProcessWithDutCe_15(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(300)); } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 16; + + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + + CHIP_ERROR TestStopTargetDevice_0() + { + chip::app::Clusters::SystemCommands::Commands::Stop::Type value; + return Stop("alpha", value); + } + + CHIP_ERROR TestStartTargetDeviceWithTheProvidedDiscriminatorForBasicCommissioningAdvertisement_1() + { + chip::app::Clusters::SystemCommands::Commands::Start::Type value; + value.discriminator.Emplace(); + value.discriminator.Value() = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + return Start("alpha", value); + } + + CHIP_ERROR TestThCr1StartsACommissioningProcessWithDutCe_2() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_3() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForPixitCommWin18010_4() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 190000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestCommissionFromBeta_5() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_6() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_7() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 revokes the commissioning window on DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCommissionFromBeta_8() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_9() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 revokes the commissioning window on DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_10() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nodeLabelArgument; + nodeLabelArgument = @"chiptest"; + [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_11() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH_CR1 read the mandatory attribute NodeLabel of DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"chiptest")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_12() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCommissionFromBeta_13() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessOnDutCe_14() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee("beta", value); + } + + CHIP_ERROR TestThCr3StartsACommissioningProcessWithDutCe_15() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode("gamma", value); + } +}; + +class Test_TC_MF_1_9 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MF_1_9() + : TestCommandBridge("Test_TC_MF_1_9") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + 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("payload2", &mPayload2); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MF_1_9() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MF_1_9\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MF_1_9\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 new commissioning window on DUT_CE\n"); + err = TestThCr1OpensANewCommissioningWindowOnDutCe_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_7(); + break; + case 8: + ChipLogProgress( + chipTool, " ***** Test Step 8 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH_CR1 revokes the commissioning window on DUT_CE\n"); - err = TestThCr1RevokesTheCommissioningWindowOnDutCe_10(); + ChipLogProgress( + chipTool, " ***** Test Step 10 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Commission from beta\n"); - err = TestCommissionFromBeta_11(); + ChipLogProgress( + chipTool, " ***** Test Step 11 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH_CR1 revokes the commissioning window on DUT_CE\n"); - err = TestThCr1RevokesTheCommissioningWindowOnDutCe_12(); + ChipLogProgress( + chipTool, " ***** Test Step 12 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE\n"); - err = TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_13(); + ChipLogProgress( + chipTool, " ***** Test Step 13 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH_CR1 read the mandatory attribute NodeLabel of DUT_CE\n"); - err = TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_14(); + ChipLogProgress( + chipTool, " ***** Test Step 14 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH_CR1 opens a commissioning window on DUT_CE\n"); - err = TestThCr1OpensACommissioningWindowOnDutCe_15(); + ChipLogProgress( + chipTool, " ***** Test Step 15 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Commission from beta\n"); - err = TestCommissionFromBeta_16(); + ChipLogProgress( + chipTool, " ***** Test Step 16 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : TH_CR2 starts a commissioning process on DUT_CE\n"); - err = TestThCr2StartsACommissioningProcessOnDutCe_17(); + ChipLogProgress( + chipTool, " ***** Test Step 17 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : TH_CR3 starts a commissioning process with DUT_CE\n"); - err = TestThCr3StartsACommissioningProcessWithDutCe_18(); + ChipLogProgress( + chipTool, " ***** Test Step 18 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_18(); + break; + case 19: + ChipLogProgress( + chipTool, " ***** Test Step 19 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_21(); + break; + case 22: + ChipLogProgress( + chipTool, " ***** Test Step 22 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : TH_CR3 starts a commissioning process with DUT_CE\n"); + err = TestThCr3StartsACommissioningProcessWithDutCe_24(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(700)); } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 25; + + chip::Optional mNodeId; + chip::Optional mTimeout; + chip::Optional mNodeIdForDuplicateCommissioning; + chip::Optional mNodeId2; + chip::Optional mNodeId3; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mPayload2; + + CHIP_ERROR TestRebootTargetDevice_0() + { + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } + + CHIP_ERROR TestThCr1StartsACommissioningProcessWithDutCe_1() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_2() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + params.pakeVerifier = + [[NSData alloc] initWithBytes:"\006\307V\337\374\327\042e4R\241-\315\224]\214T\332+\017<\275\033M\303\361\255\262#" + "\256\262k\004|\322L\226\206o\227\233\035\203\354P\342\264\2560\315\362\375\263+" + "\330\242\021\2707\334\224\355\315V\364\321Cw\031\020v\277\305\235\231\267\3350S\357\326" + "\360,D4\362\275\322z\244\371\316\247\015s\216L" + length:97]; + params.discriminator = mDiscriminator.HasValue() ? [NSNumber numberWithUnsignedShort:mDiscriminator.Value()] + : [NSNumber numberWithUnsignedShort:3840U]; + params.iterations = [NSNumber numberWithUnsignedInt:1000UL]; + params.salt = [[NSData alloc] initWithBytes:"SPAKE2P Key Salt" length:16]; + [cluster openCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH_CR1 opens a new commissioning window on DUT_CE Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_3() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_4() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_5() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_6() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_7() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_8() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_9() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_10() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_11() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_12() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_13() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_14() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_15() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_16() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_17() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_18() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_19() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_20() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_21() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_22() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_23() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestThCr3StartsACommissioningProcessWithDutCe_24() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode("gamma", value); + } +}; + +class Test_TC_MF_1_10 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MF_1_10() + : TestCommandBridge("Test_TC_MF_1_10") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + 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("payload2", &mPayload2); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MF_1_10() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MF_1_10\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MF_1_10\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 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_7(); + break; + case 8: + ChipLogProgress( + chipTool, " ***** Test Step 8 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_10(); + break; + case 11: + ChipLogProgress( + chipTool, " ***** Test Step 11 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_12(); + break; + case 13: + ChipLogProgress( + chipTool, " ***** Test Step 13 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_13(); + break; + case 14: + ChipLogProgress( + chipTool, " ***** Test Step 14 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_14(); + break; + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_15(); + break; + case 16: + ChipLogProgress( + chipTool, " ***** Test Step 16 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_16(); + break; + case 17: + ChipLogProgress( + chipTool, " ***** Test Step 17 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_17(); + break; + case 18: + ChipLogProgress( + chipTool, " ***** Test Step 18 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_18(); + break; + case 19: + ChipLogProgress( + chipTool, " ***** Test Step 19 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_20(); + break; + case 21: + ChipLogProgress( + chipTool, " ***** Test Step 21 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_21(); + break; + case 22: + ChipLogProgress( + chipTool, " ***** Test Step 22 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code\n"); + err = TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : TH_CR3 starts a commissioning process with DUT_CE\n"); + err = TestThCr3StartsACommissioningProcessWithDutCe_24(); break; } @@ -36252,28 +37151,28 @@ class Test_TC_MF_1_6 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); @@ -36282,34 +37181,52 @@ class Test_TC_MF_1_6 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; } // Go on to the next test. ContinueOnChipMainThread(CHIP_NO_ERROR); } - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(300)); } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(700)); } private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 19; + const uint16_t mTestCount = 25; chip::Optional mNodeId; chip::Optional mTimeout; @@ -36319,29 +37236,22 @@ class Test_TC_MF_1_6 : public TestCommandBridge { chip::Optional mEndpoint; chip::Optional mDiscriminator; chip::Optional mPayload; + chip::Optional mPayload2; - CHIP_ERROR TestStopTargetDevice_0() - { - chip::app::Clusters::SystemCommands::Commands::Stop::Type value; - return Stop("alpha", value); - } - - CHIP_ERROR TestStartTargetDeviceWithTheProvidedDiscriminatorForBasicCommissioningAdvertisement_1() + CHIP_ERROR TestRebootTargetDevice_0() { - chip::app::Clusters::SystemCommands::Commands::Start::Type value; - value.discriminator.Emplace(); - value.discriminator.Value() = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; - return Start("alpha", value); + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); } - CHIP_ERROR TestThCr1StartsACommissioningProcessWithDutCe_2() + CHIP_ERROR TestThCr1StartsACommissioningProcessWithDutCe_1() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_3() + CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_2() { CHIPDevice * device = GetDevice("alpha"); CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device @@ -36363,193 +37273,179 @@ class Test_TC_MF_1_6 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWaitForPixitCommWin18010_4() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_3() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestWaitForPixitCommWin18010_5() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_4() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestWaitForPixitCommWin18010_6() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_5() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestWaitForPixitCommWin18010_7() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_6() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 28000UL; - return WaitForMs("alpha", value); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestCommissionFromBeta_8() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_7() { chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; - value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); return PairWithCode("beta", value); } - CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_9() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_8() { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; - params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; - [cluster openBasicCommissioningWindowWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_10() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_9() { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH_CR1 revokes the commissioning window on DUT_CE Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestCommissionFromBeta_11() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_10() { chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; - value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); return PairWithCode("beta", value); } - CHIP_ERROR TestThCr1RevokesTheCommissioningWindowOnDutCe_12() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_11() { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH_CR1 revokes the commissioning window on DUT_CE Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestThCr1WritesTheMandatoryAttributeNodeLabelOfDutCe_13() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_12() { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id nodeLabelArgument; - nodeLabelArgument = @"chiptest"; - [cluster writeAttributeNodeLabelWithValue:nodeLabelArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH_CR1 writes the mandatory attribute NodeLabel of DUT_CE Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestThCr1ReadTheMandatoryAttributeNodeLabelOfDutCe_14() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_13() { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH_CR1 read the mandatory attribute NodeLabel of DUT_CE Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } - { - id actualValue = value; - VerifyOrReturn(CheckValueAsString("NodeLabel", actualValue, @"chiptest")); - } + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_14() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } - NextTest(); - }]; + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_15() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } - return CHIP_NO_ERROR; + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_16() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestThCr1OpensACommissioningWindowOnDutCe_15() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_17() { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } - __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; - params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; - [cluster openBasicCommissioningWindowWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH_CR1 opens a commissioning window on DUT_CE Error: %@", err); + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_18() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_19() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } - NextTest(); - }]; + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_20() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); + } - return CHIP_NO_ERROR; + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_21() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestCommissionFromBeta_16() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_22() { chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; - value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); return PairWithCode("beta", value); } - CHIP_ERROR TestThCr2StartsACommissioningProcessOnDutCe_17() + CHIP_ERROR TestThCr2StartsACommissioningProcessWithDutCeUsingInvalidSetupCode_23() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; - return WaitForCommissionee("beta", value); + value.payload = mPayload2.HasValue() ? mPayload2.Value() : chip::Span("MT:0000000000I.0648G00", 22); + return PairWithCode("beta", value); } - CHIP_ERROR TestThCr3StartsACommissioningProcessWithDutCe_18() + CHIP_ERROR TestThCr3StartsACommissioningProcessWithDutCe_24() { chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; - value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:0000000000I31506010", 22); return PairWithCode("gamma", value); } }; @@ -36645,52 +37541,28 @@ class Test_TC_MF_1_15 : public TestCommandBridge { err = TestWaitForTheExpirationOfPixitCommWinSeconds_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); - err = TestWaitForTheExpirationOfPixitCommWinSeconds_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : TH_CR1 re-opens new commissioning window on DUT_CE\n"); + err = TestThCr1ReOpensNewCommissioningWindowOnDutCe_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); - err = TestWaitForTheExpirationOfPixitCommWinSeconds_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : TH_CR3 opens a new commissioning window on DUT_CE\n"); + err = TestThCr3OpensANewCommissioningWindowOnDutCe_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); - err = TestWaitForTheExpirationOfPixitCommWinSeconds_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : TH_CR1 reads the list of Fabrics on DUT_CE\n"); + err = TestThCr1ReadsTheListOfFabricsOnDutCe_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH_CR1 re-opens new commissioning window on DUT_CE\n"); - err = TestThCr1ReOpensNewCommissioningWindowOnDutCe_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); + err = TestWaitForTheExpirationOfPixitCommWinSeconds_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH_CR3 opens a new commissioning window on DUT_CE\n"); - err = TestThCr3OpensANewCommissioningWindowOnDutCe_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : TH_CR1 opens a new commissioning window on DUT_CE\n"); + err = TestThCr1OpensANewCommissioningWindowOnDutCe_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : TH_CR1 reads the list of Fabrics on DUT_CE\n"); - err = TestThCr1ReadsTheListOfFabricsOnDutCe_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); - err = TestWaitForTheExpirationOfPixitCommWinSeconds_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); - err = TestWaitForTheExpirationOfPixitCommWinSeconds_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); - err = TestWaitForTheExpirationOfPixitCommWinSeconds_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Wait for the expiration of PIXIT_COMM_WIN seconds\n"); - err = TestWaitForTheExpirationOfPixitCommWinSeconds_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : TH_CR1 opens a new commissioning window on DUT_CE\n"); - err = TestThCr1OpensANewCommissioningWindowOnDutCe_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : TH_CR2 opens a new commissioning window on DUT_CE\n"); - err = TestThCr2OpensANewCommissioningWindowOnDutCe_23(); + ChipLogProgress(chipTool, " ***** Test Step 17 : TH_CR2 opens a new commissioning window on DUT_CE\n"); + err = TestThCr2OpensANewCommissioningWindowOnDutCe_17(); break; } @@ -36743,7 +37615,7 @@ class Test_TC_MF_1_15 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -36752,27 +37624,9 @@ class Test_TC_MF_1_15 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 23: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; } @@ -36785,7 +37639,7 @@ class Test_TC_MF_1_15 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 24; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mTimeout; @@ -36972,32 +37826,11 @@ class Test_TC_MF_1_15 : public TestCommandBridge { CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_11() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_12() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_13() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_14() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 18000UL; + value.ms = 180000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThCr1ReOpensNewCommissioningWindowOnDutCe_15() + CHIP_ERROR TestThCr1ReOpensNewCommissioningWindowOnDutCe_12() { CHIPDevice * device = GetDevice("alpha"); CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device @@ -37028,7 +37861,7 @@ class Test_TC_MF_1_15 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThCr3OpensANewCommissioningWindowOnDutCe_16() + CHIP_ERROR TestThCr3OpensANewCommissioningWindowOnDutCe_13() { CHIPDevice * device = GetDevice("gamma"); CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device @@ -37058,7 +37891,7 @@ class Test_TC_MF_1_15 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThCr1ReadsTheListOfFabricsOnDutCe_17() + CHIP_ERROR TestThCr1ReadsTheListOfFabricsOnDutCe_14() { CHIPDevice * device = GetDevice("alpha"); CHIPTestOperationalCredentials * cluster = [[CHIPTestOperationalCredentials alloc] initWithDevice:device @@ -37092,35 +37925,14 @@ class Test_TC_MF_1_15 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_18() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_19() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_20() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 54000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_21() + CHIP_ERROR TestWaitForTheExpirationOfPixitCommWinSeconds_15() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 18000UL; + value.ms = 180000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_22() + CHIP_ERROR TestThCr1OpensANewCommissioningWindowOnDutCe_16() { CHIPDevice * device = GetDevice("alpha"); CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device @@ -37151,7 +37963,7 @@ class Test_TC_MF_1_15 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThCr2OpensANewCommissioningWindowOnDutCe_23() + CHIP_ERROR TestThCr2OpensANewCommissioningWindowOnDutCe_17() { CHIPDevice * device = GetDevice("beta"); CHIPTestAdministratorCommissioning * cluster = [[CHIPTestAdministratorCommissioning alloc] initWithDevice:device @@ -108739,6 +109551,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),