From 1a25bbd828c63fb2431c536eda5405ad374882ee Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Tue, 9 Aug 2022 15:22:22 -0700 Subject: [PATCH] Fix TC_CADMIN_1_9 and TC_CADMIN_1_10 tests to not be broken. (#21690) (#21728) There were several issues: * The values of the "payload" variable were mixed up between the two tests. as a result, "payload" actually had an incorrect setup code in both tests, and the tests testing that commissioning fails actually tested nothing at all, because it was guaranteed to fail. * Some of the setup payloads involved claimed a zero discovery capability bitmask, instead of the expected "bit 2 is set to indicate on-network commissioning". This led to a lot of BLE traffic when these tests run. The specific fixes here are: 1) In TC_CADMIN_1_9, regenerate the "payload" value by running: chip-tool payload generate-qrcode --vendor-id 65521 --product-id 32769 --discriminator 3840 --rendezvous 4 --setup-pin-code 47514138 and regenerate "payload2" by running: chip-tool payload generate-qrcode --vendor-id 65521 --product-id 32769 --discriminator 3840 --rendezvous 4 --setup-pin-code 20202023 This ensures that the only difference between "payload" and "payload2" is the setup code, and sets the setup code for "payload" to match the verifier we are using. 2) In TC_CADMIN_1_10, regenerate the "payload" value by running: chip-tool payload generate-qrcode --vendor-id 65521 --product-id 32769 --discriminator 3840 --rendezvous 4 --setup-pin-code 20202021 and regenerate "payload2" by running: chip-tool payload generate-qrcode --vendor-id 65521 --product-id 32769 --discriminator 3840 --rendezvous 4 --setup-pin-code 20202023 3) In both tests, add verification that the "payload" value can in fact commission the device properly when a commissioning window is opened the way the test opens it, so the rest of the test is meaningful. 4) Rename "payload" and "payload2" to more meaningful names. Co-authored-by: Boris Zbarsky --- .../certification/Test_TC_CADMIN_1_10.yaml | 108 ++++- .../certification/Test_TC_CADMIN_1_9.yaml | 118 ++++- .../chip-tool/zap-generated/test/Commands.h | 450 +++++++++++++----- 3 files changed, 503 insertions(+), 173 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_10.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_10.yaml index 5e4a400f939c37..18f09155a899d8 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_10.yaml @@ -35,12 +35,12 @@ config: discriminator: type: int16u defaultValue: 3840 - payload: + correctPayload: type: char_string - defaultValue: "MT:0000000000I31506010" - payload2: + defaultValue: "MT:-24J0AFN00KA0648G00" + incorrectSetupCodePayload: type: char_string - defaultValue: "MT:0000000000I.0648G00" + defaultValue: "MT:-24J0AFN00I.0648G00" tests: - label: "TH_CR1 starts a commissioning process with DUT_CE" @@ -52,6 +52,63 @@ tests: - name: "nodeId" value: nodeId + - label: + "Open commissioning window exactly like we plan to later to verify + that `correctPayload` can in fact commision the device." + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + PICS: CADMIN.S.C01.Rsp + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 900 + + - label: + "Temporarily commission device with `correctPayload` just like we will + try to later" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + # Only run this if we ran the previous step. + PICS: CADMIN.S && CADMIN.S.C01.Rsp + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: correctPayload + + - label: "Wait for a CASE session" + identity: "beta" + cluster: "DelayCommands" + command: "WaitForCommissionee" + PICS: CADMIN.S + arguments: + values: + - name: "nodeId" + value: nodeId2 + + - label: "Read FabricIndex of beta so we can delete the temp fabric" + identity: "beta" + cluster: "Operational Credentials" + command: "readAttribute" + attribute: "CurrentFabricIndex" + # Only run this if we commissioned the device. + PICS: CADMIN.S.C01.Rsp + response: + saveAs: tempFabricIndex + + - label: "Remove the temp fabric" + cluster: "Operational Credentials" + command: "RemoveFabric" + # Only run this if we commissioned the device. + PICS: CADMIN.S.C01.Rsp + arguments: + values: + - name: "FabricIndex" + value: tempFabricIndex + - label: "TH_CR1 opens a commissioning window on DUT_CE" cluster: "AdministratorCommissioning" command: "OpenBasicCommissioningWindow" @@ -74,7 +131,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -90,7 +147,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -106,7 +163,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -122,7 +179,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -138,7 +195,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -154,7 +211,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -170,7 +227,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -186,7 +243,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -202,7 +259,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -217,7 +274,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -233,7 +290,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -249,7 +306,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -265,7 +322,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -281,7 +338,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -297,7 +354,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -313,7 +370,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -329,7 +386,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -345,7 +402,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -361,7 +418,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -377,10 +434,11 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE + # This step must match the verification step above where we checked `correctPayload` - label: "TH_CR2 attempts to do PASE to DUT_CE using the correct onboarding payload" @@ -393,6 +451,6 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload + value: correctPayload response: error: FAILURE diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml index c1406bdcfe2bd5..922f65a58e1665 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml @@ -35,12 +35,12 @@ config: discriminator: type: int16u defaultValue: 3840 - payload: + correctPayload: type: char_string - defaultValue: "MT:-24J0AFN00KA0648G00" - payload2: + defaultValue: "MT:-24J0AFN00I31506010" + incorrectSetupCodePayload: type: char_string - defaultValue: "MT:0000000000I.0648G00" + defaultValue: "MT:-24J0AFN00I.0648G00" tests: - label: "TH_CR1 starts a commissioning process with DUT_CE" @@ -52,6 +52,71 @@ tests: - name: "nodeId" value: nodeId + - label: + "Open commissioning window exactly like we plan to later to verify + that `correctPayload` can in fact commision the device." + cluster: "AdministratorCommissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + PICS: CADMIN.S.C00.Rsp + arguments: + values: + - name: "CommissioningTimeout" + value: 900 + - 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: + "Temporarily commission device with `correctPayload` just like we will + try to later" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + # Only run this if we ran the previous step. + PICS: CADMIN.S && CADMIN.S.C00.Rsp + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: correctPayload + + - label: "Wait for a CASE session" + identity: "beta" + cluster: "DelayCommands" + command: "WaitForCommissionee" + PICS: CADMIN.S + arguments: + values: + - name: "nodeId" + value: nodeId2 + + - label: "Read FabricIndex of beta so we can delete the temp fabric" + identity: "beta" + cluster: "Operational Credentials" + command: "readAttribute" + attribute: "CurrentFabricIndex" + # Only run this if we commissioned the device. + PICS: CADMIN.S.C00.Rsp + response: + saveAs: tempFabricIndex + + - label: "Remove the temp fabric" + cluster: "Operational Credentials" + command: "RemoveFabric" + # Only run this if we commissioned the device. + PICS: CADMIN.S.C00.Rsp + arguments: + values: + - name: "FabricIndex" + value: tempFabricIndex + - label: "TH_CR1 opens a new commissioning window on DUT_CE" cluster: "AdministratorCommissioning" command: "OpenCommissioningWindow" @@ -82,7 +147,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -98,7 +163,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -114,7 +179,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -130,7 +195,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -146,7 +211,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -162,7 +227,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -178,7 +243,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -194,7 +259,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -210,7 +275,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -226,7 +291,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -242,7 +307,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -258,7 +323,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -274,7 +339,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -290,7 +355,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -306,7 +371,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -322,7 +387,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -338,7 +403,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -354,7 +419,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -370,7 +435,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE @@ -386,10 +451,11 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload2 + value: incorrectSetupCodePayload response: error: FAILURE + # This step must match the verification step above where we checked `payload` - label: "TH_CR2 starts a commissioning process with DUT_CE using valid setup code" @@ -402,7 +468,7 @@ tests: - name: "nodeId" value: nodeId2 - name: "payload" - value: payload + value: correctPayload response: error: FAILURE @@ -416,6 +482,6 @@ tests: - name: "nodeId" value: nodeId3 - name: "payload" - value: payload + value: correctPayload response: error: FAILURE diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index e55760898c9be7..0094816c310e4d 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -79537,7 +79537,7 @@ class Test_TC_CADMIN_1_6Suite : public TestCommand class Test_TC_CADMIN_1_9Suite : public TestCommand { public: - Test_TC_CADMIN_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_9", 24, credsIssuerConfig) + Test_TC_CADMIN_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_9", 29, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); @@ -79546,8 +79546,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); - AddArgument("payload", &mPayload); - AddArgument("payload2", &mPayload2); + AddArgument("correctPayload", &mCorrectPayload); + AddArgument("incorrectSetupCodePayload", &mIncorrectSetupCodePayload); } ~Test_TC_CADMIN_1_9Suite() {} @@ -79562,8 +79562,10 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand chip::Optional mNodeId3; chip::Optional mEndpoint; chip::Optional mDiscriminator; - chip::Optional mPayload; - chip::Optional mPayload2; + chip::Optional mCorrectPayload; + chip::Optional mIncorrectSetupCodePayload; + + uint8_t tempFabricIndex; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -79585,24 +79587,30 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - shouldContinue = true; + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + tempFabricIndex = value; + } break; case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - shouldContinue = true; + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - shouldContinue = true; + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); @@ -79672,6 +79680,26 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -79696,7 +79724,9 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "TH_CR1 opens a new commissioning window on DUT_CE"); + LogStep(1, + "Open commissioning window exactly like we plan to later to verify that `correctPayload` can in fact commision " + "the device."); VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; @@ -79717,49 +79747,60 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand ); } case 2: { - LogStep(2, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); - VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(2, "Temporarily commission device with `correctPayload` just like we will try to later"); + VerifyOrDo(!ShouldSkip("CADMIN.S && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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); + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = + mCorrectPayload.HasValue() ? mCorrectPayload.Value() : chip::Span("MT:-24J0AFN00I31506010", 22); return PairWithCode(kIdentityBeta, value); } case 3: { - LogStep(3, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + LogStep(3, "Wait for a CASE session"); VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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); + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); } case 4: { - LogStep(4, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); - VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - 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); + LogStep(4, "Read FabricIndex of beta so we can delete the temp fabric"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); - VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(5, "Remove the temp fabric"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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); + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = tempFabricIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); } case 6: { - LogStep(6, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); - VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(6, "TH_CR1 opens a new commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 900U; + 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 = 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, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } case 7: { LogStep(7, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); @@ -79767,7 +79808,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 8: { @@ -79776,7 +79818,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 9: { @@ -79785,7 +79828,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 10: { @@ -79794,7 +79838,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 11: { @@ -79803,7 +79848,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 12: { @@ -79812,7 +79858,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 13: { @@ -79821,7 +79868,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 14: { @@ -79830,7 +79878,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 15: { @@ -79839,7 +79888,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 16: { @@ -79848,7 +79898,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 17: { @@ -79857,7 +79908,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 18: { @@ -79866,7 +79918,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 19: { @@ -79875,7 +79928,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 20: { @@ -79884,7 +79938,8 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 21: { @@ -79893,25 +79948,78 @@ class Test_TC_CADMIN_1_9Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 22: { - LogStep(22, "TH_CR2 starts a commissioning process with DUT_CE using valid setup code"); + LogStep(22, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); VerifyOrDo(!ShouldSkip("CADMIN.S"), 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 23: { - LogStep(23, "TH_CR3 starts a commissioning process with DUT_CE"); + LogStep(23, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 24: { + LogStep(24, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 25: { + LogStep(25, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 26: { + LogStep(26, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 27: { + LogStep(27, "TH_CR2 starts a commissioning process with DUT_CE using valid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = + mCorrectPayload.HasValue() ? mCorrectPayload.Value() : chip::Span("MT:-24J0AFN00I31506010", 22); + return PairWithCode(kIdentityBeta, value); + } + case 28: { + LogStep(28, "TH_CR3 starts a commissioning process with DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId3.HasValue() ? mNodeId3.Value() : 12586990ULL; + value.payload = + mCorrectPayload.HasValue() ? mCorrectPayload.Value() : chip::Span("MT:-24J0AFN00I31506010", 22); return PairWithCode(kIdentityGamma, value); } } @@ -79923,7 +80031,7 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand { public: Test_TC_CADMIN_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_CADMIN_1_10", 23, credsIssuerConfig) + TestCommand("Test_TC_CADMIN_1_10", 28, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); @@ -79932,8 +80040,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand AddArgument("nodeId3", 0, UINT64_MAX, &mNodeId3); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); - AddArgument("payload", &mPayload); - AddArgument("payload2", &mPayload2); + AddArgument("correctPayload", &mCorrectPayload); + AddArgument("incorrectSetupCodePayload", &mIncorrectSetupCodePayload); } ~Test_TC_CADMIN_1_10Suite() {} @@ -79948,8 +80056,10 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand chip::Optional mNodeId3; chip::Optional mEndpoint; chip::Optional mDiscriminator; - chip::Optional mPayload; - chip::Optional mPayload2; + chip::Optional mCorrectPayload; + chip::Optional mIncorrectSetupCodePayload; + + uint8_t tempFabricIndex; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -79971,24 +80081,30 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - shouldContinue = true; + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + tempFabricIndex = value; + } break; case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - shouldContinue = true; + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - shouldContinue = true; + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); @@ -80054,6 +80170,26 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -80078,7 +80214,9 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "TH_CR1 opens a commissioning window on DUT_CE"); + LogStep(1, + "Open commissioning window exactly like we plan to later to verify that `correctPayload` can in fact commision " + "the device."); VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; @@ -80090,49 +80228,51 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand ); } case 2: { - LogStep(2, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); - VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(2, "Temporarily commission device with `correctPayload` just like we will try to later"); + VerifyOrDo(!ShouldSkip("CADMIN.S && CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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); + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = + mCorrectPayload.HasValue() ? mCorrectPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 3: { - LogStep(3, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + LogStep(3, "Wait for a CASE session"); VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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); + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); } case 4: { - LogStep(4, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); - VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - 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); + LogStep(4, "Read FabricIndex of beta so we can delete the temp fabric"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); - VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(5, "Remove the temp fabric"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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); + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = tempFabricIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); } case 6: { - LogStep(6, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); - VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(6, "TH_CR1 opens a commissioning window on DUT_CE"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 900U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } case 7: { LogStep(7, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); @@ -80140,7 +80280,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 8: { @@ -80149,7 +80290,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 9: { @@ -80158,7 +80300,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 10: { @@ -80167,15 +80310,18 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 11: { LogStep(11, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 12: { @@ -80184,7 +80330,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 13: { @@ -80193,7 +80340,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 14: { @@ -80202,7 +80350,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 15: { @@ -80211,16 +80360,17 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 16: { LogStep(16, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); - VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 17: { @@ -80229,7 +80379,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 18: { @@ -80238,7 +80389,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 19: { @@ -80247,7 +80399,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 20: { @@ -80256,7 +80409,8 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 21: { @@ -80265,16 +80419,68 @@ class Test_TC_CADMIN_1_10Suite : public TestCommand 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); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); return PairWithCode(kIdentityBeta, value); } case 22: { - LogStep(22, "TH_CR2 attempts to do PASE to DUT_CE using the correct onboarding payload"); + LogStep(22, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); VerifyOrDo(!ShouldSkip("CADMIN.S"), 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:0000000000I31506010", 22); + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 23: { + LogStep(23, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 24: { + LogStep(24, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 25: { + LogStep(25, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 26: { + LogStep(26, "TH_CR2 starts a commissioning process with DUT_CE using Invalid setup code"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mIncorrectSetupCodePayload.HasValue() ? mIncorrectSetupCodePayload.Value() + : chip::Span("MT:-24J0AFN00I.0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 27: { + LogStep(27, "TH_CR2 attempts to do PASE to DUT_CE using the correct onboarding payload"); + VerifyOrDo(!ShouldSkip("CADMIN.S"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = + mCorrectPayload.HasValue() ? mCorrectPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); return PairWithCode(kIdentityBeta, value); } }