diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index 35bb53403295ef..accc5c66c14398 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -203,6 +203,9 @@ class GroupKeyManagementAttributeAccess : public AttributeAccessInterface { const auto & value = iter.GetValue(); VerifyOrReturnError(fabric_index == value.fabricIndex, CHIP_ERROR_INVALID_FABRIC_ID); + // Cannot map to IPK, see `GroupKeyMapStruct` in Group Key Management cluster spec + VerifyOrReturnError(value.groupKeySetID != 0, CHIP_IM_GLOBAL_STATUS(ConstraintError)); + ReturnErrorOnFailure(provider->SetGroupKeyAt(value.fabricIndex, i++, GroupDataProvider::GroupKey(value.groupId, value.groupKeySetID))); } @@ -215,6 +218,8 @@ class GroupKeyManagementAttributeAccess : public AttributeAccessInterface VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); ReturnErrorOnFailure(aDecoder.Decode(value)); VerifyOrReturnError(fabric_index == value.fabricIndex, CHIP_ERROR_INVALID_FABRIC_ID); + // Cannot map to IPK, see `GroupKeyMapStruct` in Group Key Management cluster spec + VerifyOrReturnError(value.groupKeySetID != 0, CHIP_IM_GLOBAL_STATUS(ConstraintError)); { auto iter = provider->IterateGroupKeys(fabric_index); diff --git a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml index 2fe4ff9b624844..2c8f97e754aa6e 100644 --- a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml +++ b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml @@ -138,6 +138,14 @@ tests: - name: "GroupKeySetIDs" value: [0x01a1, 0x01a2] + - label: "Write Group Keys (invalid)" + command: "writeAttribute" + attribute: "GroupKeyMap" + arguments: + value: [{ FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0 }] + response: + error: CONSTRAINT_ERROR + - label: "Write Group Keys" command: "writeAttribute" attribute: "GroupKeyMap" diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index f169fd959ae3e9..2b37aac716bf21 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -47620,6 +47620,35 @@ - (void)testSendClusterTestGroupKeyManagementCluster_000007_KeySetRead [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTestGroupKeyManagementCluster_000008_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write Group Keys (invalid)"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + id groupKeyMapArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:258U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:0U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + + groupKeyMapArgument = temp_0; + } + [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Group Keys (invalid) Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000009_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write Group Keys"]; @@ -47654,7 +47683,7 @@ - (void)testSendClusterTestGroupKeyManagementCluster_000008_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupKeyManagementCluster_000009_ReadAttribute +- (void)testSendClusterTestGroupKeyManagementCluster_000010_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read Group Keys"]; @@ -47699,7 +47728,7 @@ - (void)testSendClusterTestGroupKeyManagementCluster_000009_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupKeyManagementCluster_000010_ReadAttribute +- (void)testSendClusterTestGroupKeyManagementCluster_000011_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read GroupTable"]; @@ -47742,7 +47771,7 @@ - (void)testSendClusterTestGroupKeyManagementCluster_000010_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupKeyManagementCluster_000011_KeySetRemove +- (void)testSendClusterTestGroupKeyManagementCluster_000012_KeySetRemove { XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Remove 1"]; @@ -47764,7 +47793,7 @@ - (void)testSendClusterTestGroupKeyManagementCluster_000011_KeySetRemove [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupKeyManagementCluster_000012_KeySetRead +- (void)testSendClusterTestGroupKeyManagementCluster_000013_KeySetRead { XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (removed)"]; @@ -47786,7 +47815,7 @@ - (void)testSendClusterTestGroupKeyManagementCluster_000012_KeySetRead [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupKeyManagementCluster_000013_KeySetRead +- (void)testSendClusterTestGroupKeyManagementCluster_000014_KeySetRead { XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (not removed)"]; @@ -47833,7 +47862,7 @@ - (void)testSendClusterTestGroupKeyManagementCluster_000013_KeySetRead [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupKeyManagementCluster_000014_RemoveAllGroups +- (void)testSendClusterTestGroupKeyManagementCluster_000015_RemoveAllGroups { XCTestExpectation * expectation = [self expectationWithDescription:@"Remove All"]; @@ -47852,7 +47881,7 @@ - (void)testSendClusterTestGroupKeyManagementCluster_000014_RemoveAllGroups [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupKeyManagementCluster_000015_KeySetRemove +- (void)testSendClusterTestGroupKeyManagementCluster_000016_KeySetRemove { XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Remove 2"]; @@ -47874,7 +47903,7 @@ - (void)testSendClusterTestGroupKeyManagementCluster_000015_KeySetRemove [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupKeyManagementCluster_000016_KeySetRead +- (void)testSendClusterTestGroupKeyManagementCluster_000017_KeySetRead { XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (also removed)"]; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index 7360214a6abd09..2f9167910b8ece 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -53982,40 +53982,44 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { err = TestKeySetRead_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write Group Keys\n"); - err = TestWriteGroupKeys_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Write Group Keys (invalid)\n"); + err = TestWriteGroupKeysInvalid_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read Group Keys\n"); - err = TestReadGroupKeys_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Write Group Keys\n"); + err = TestWriteGroupKeys_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read GroupTable\n"); - err = TestReadGroupTable_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Read Group Keys\n"); + err = TestReadGroupKeys_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : KeySet Remove 1\n"); - err = TestKeySetRemove1_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Read GroupTable\n"); + err = TestReadGroupTable_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : KeySet Read (removed)\n"); - err = TestKeySetReadRemoved_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : KeySet Remove 1\n"); + err = TestKeySetRemove1_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : KeySet Read (not removed)\n"); - err = TestKeySetReadNotRemoved_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : KeySet Read (removed)\n"); + err = TestKeySetReadRemoved_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Remove All\n"); - err = TestRemoveAll_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : KeySet Read (not removed)\n"); + err = TestKeySetReadNotRemoved_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : KeySet Remove 2\n"); - err = TestKeySetRemove2_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Remove All\n"); + err = TestRemoveAll_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : KeySet Read (also removed)\n"); - err = TestKeySetReadAlsoRemoved_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : KeySet Remove 2\n"); + err = TestKeySetRemove2_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : KeySet Read (also removed)\n"); + err = TestKeySetReadAlsoRemoved_17(); break; } @@ -54032,7 +54036,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -54282,7 +54286,36 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteGroupKeys_8() + CHIP_ERROR TestWriteGroupKeysInvalid_8() + { + CHIPDevice * device = GetConnectedDevice(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id groupKeyMapArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:258U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:0U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + + groupKeyMapArgument = temp_0; + } + [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Group Keys (invalid) Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteGroupKeys_9() { CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device @@ -54317,7 +54350,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadGroupKeys_9() + CHIP_ERROR TestReadGroupKeys_10() { CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device @@ -54357,7 +54390,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadGroupTable_10() + CHIP_ERROR TestReadGroupTable_11() { CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device @@ -54398,7 +54431,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetRemove1_11() + CHIP_ERROR TestKeySetRemove1_12() { CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device @@ -54420,7 +54453,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetReadRemoved_12() + CHIP_ERROR TestKeySetReadRemoved_13() { CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device @@ -54442,7 +54475,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetReadNotRemoved_13() + CHIP_ERROR TestKeySetReadNotRemoved_14() { CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device @@ -54492,7 +54525,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveAll_14() + CHIP_ERROR TestRemoveAll_15() { CHIPDevice * device = GetConnectedDevice(); CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -54509,7 +54542,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetRemove2_15() + CHIP_ERROR TestKeySetRemove2_16() { CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device @@ -54531,7 +54564,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetReadAlsoRemoved_16() + CHIP_ERROR TestKeySetReadAlsoRemoved_17() { CHIPDevice * device = GetConnectedDevice(); CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 88bbb0d2dc9c38..48456e70d7361d 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -103359,40 +103359,44 @@ class TestGroupKeyManagementClusterSuite : public TestCommand err = TestKeySetRead_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write Group Keys\n"); - err = TestWriteGroupKeys_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Write Group Keys (invalid)\n"); + err = TestWriteGroupKeysInvalid_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read Group Keys\n"); - err = TestReadGroupKeys_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Write Group Keys\n"); + err = TestWriteGroupKeys_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read GroupTable\n"); - err = TestReadGroupTable_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Read Group Keys\n"); + err = TestReadGroupKeys_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : KeySet Remove 1\n"); - err = TestKeySetRemove1_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Read GroupTable\n"); + err = TestReadGroupTable_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : KeySet Read (removed)\n"); - err = TestKeySetReadRemoved_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : KeySet Remove 1\n"); + err = TestKeySetRemove1_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : KeySet Read (not removed)\n"); - err = TestKeySetReadNotRemoved_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : KeySet Read (removed)\n"); + err = TestKeySetReadRemoved_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Remove All\n"); - err = TestRemoveAll_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : KeySet Read (not removed)\n"); + err = TestKeySetReadNotRemoved_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : KeySet Remove 2\n"); - err = TestKeySetRemove2_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Remove All\n"); + err = TestRemoveAll_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : KeySet Read (also removed)\n"); - err = TestKeySetReadAlsoRemoved_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : KeySet Remove 2\n"); + err = TestKeySetRemove2_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : KeySet Read (also removed)\n"); + err = TestKeySetReadAlsoRemoved_17(); break; } @@ -103410,7 +103414,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -103460,12 +103464,9 @@ class TestGroupKeyManagementClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_9(error); } - static void - OnSuccessCallback_9(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & groupKeyMap) + static void OnSuccessCallback_9(void * context) { - (static_cast(context))->OnSuccessResponse_9(groupKeyMap); + (static_cast(context))->OnSuccessResponse_9(); } static void OnFailureCallback_10(void * context, CHIP_ERROR error) @@ -103475,10 +103476,23 @@ class TestGroupKeyManagementClusterSuite : public TestCommand static void OnSuccessCallback_10(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & groupKeyMap) + { + (static_cast(context))->OnSuccessResponse_10(groupKeyMap); + } + + static void OnFailureCallback_11(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_11(error); + } + + static void + OnSuccessCallback_11(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & groupTable) { - (static_cast(context))->OnSuccessResponse_10(groupTable); + (static_cast(context))->OnSuccessResponse_11(groupTable); } // @@ -103759,7 +103773,44 @@ class TestGroupKeyManagementClusterSuite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteGroupKeys_8() + CHIP_ERROR TestWriteGroupKeysInvalid_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::GroupKeyManagementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ListFreer listFreer; + chip::app::DataModel::List + groupKeyMapArgument; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].groupId = 258U; + listHolder_0->mList[0].groupKeySetID = 0U; + listHolder_0->mList[0].fabricIndex = 1; + + groupKeyMapArgument = + chip::app::DataModel::List( + listHolder_0->mList, 1); + } + + ReturnErrorOnFailure(cluster.WriteAttribute( + groupKeyMapArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_8() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteGroupKeys_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::GroupKeyManagementClusterTest cluster; @@ -103787,37 +103838,37 @@ class TestGroupKeyManagementClusterSuite : public TestCommand } ReturnErrorOnFailure(cluster.WriteAttribute( - groupKeyMapArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + groupKeyMapArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_8() { NextTest(); } + void OnSuccessResponse_9() { NextTest(); } - CHIP_ERROR TestReadGroupKeys_9() + CHIP_ERROR TestReadGroupKeys_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::GroupKeyManagementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_9, OnFailureCallback_9, true)); + this, OnSuccessCallback_10, OnFailureCallback_10, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_9(CHIP_ERROR error) + void OnFailureResponse_10(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_9(const chip::app::DataModel::DecodableList< - chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & groupKeyMap) + void OnSuccessResponse_10(const chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & groupKeyMap) { { auto iter_0 = groupKeyMap.begin(); @@ -103835,24 +103886,24 @@ class TestGroupKeyManagementClusterSuite : public TestCommand NextTest(); } - CHIP_ERROR TestReadGroupTable_10() + CHIP_ERROR TestReadGroupTable_11() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::GroupKeyManagementClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10, true)); + this, OnSuccessCallback_11, OnFailureCallback_11, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_10(CHIP_ERROR error) + void OnFailureResponse_11(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_10(const chip::app::DataModel::DecodableList< + void OnSuccessResponse_11(const chip::app::DataModel::DecodableList< chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & groupTable) { { @@ -103875,7 +103926,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand NextTest(); } - CHIP_ERROR TestKeySetRemove1_11() + CHIP_ERROR TestKeySetRemove1_12() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type; @@ -103884,26 +103935,26 @@ class TestGroupKeyManagementClusterSuite : public TestCommand request.groupKeySetID = 417U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_11(); + (static_cast(context))->OnSuccessResponse_12(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_11(error); + (static_cast(context))->OnFailureResponse_12(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_11(CHIP_ERROR error) + void OnFailureResponse_12(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_11() { NextTest(); } + void OnSuccessResponse_12() { NextTest(); } - CHIP_ERROR TestKeySetReadRemoved_12() + CHIP_ERROR TestKeySetReadRemoved_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type; @@ -103912,18 +103963,18 @@ class TestGroupKeyManagementClusterSuite : public TestCommand request.groupKeySetID = 417U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_12(data.groupKeySet); + (static_cast(context))->OnSuccessResponse_13(data.groupKeySet); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_12(error); + (static_cast(context))->OnFailureResponse_13(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_12(CHIP_ERROR error) + void OnFailureResponse_13(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); @@ -103931,12 +103982,12 @@ class TestGroupKeyManagementClusterSuite : public TestCommand } void - OnSuccessResponse_12(const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & groupKeySet) + OnSuccessResponse_13(const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & groupKeySet) { ThrowSuccessResponse(); } - CHIP_ERROR TestKeySetReadNotRemoved_13() + CHIP_ERROR TestKeySetReadNotRemoved_14() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type; @@ -103945,25 +103996,25 @@ class TestGroupKeyManagementClusterSuite : public TestCommand request.groupKeySetID = 418U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_13(data.groupKeySet); + (static_cast(context))->OnSuccessResponse_14(data.groupKeySet); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_13(error); + (static_cast(context))->OnFailureResponse_14(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_13(CHIP_ERROR error) + void OnFailureResponse_14(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } void - OnSuccessResponse_13(const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & groupKeySet) + OnSuccessResponse_14(const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & groupKeySet) { VerifyOrReturn(CheckValue("groupKeySet.groupKeySetID", groupKeySet.groupKeySetID, 418U)); VerifyOrReturn(CheckValue("groupKeySet.groupKeySecurityPolicy", groupKeySet.groupKeySecurityPolicy, 1)); @@ -103980,7 +104031,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand NextTest(); } - CHIP_ERROR TestRemoveAll_14() + CHIP_ERROR TestRemoveAll_15() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type; @@ -103988,26 +104039,26 @@ class TestGroupKeyManagementClusterSuite : public TestCommand RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_14(); + (static_cast(context))->OnSuccessResponse_15(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_14(error); + (static_cast(context))->OnFailureResponse_15(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_15(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14() { NextTest(); } + void OnSuccessResponse_15() { NextTest(); } - CHIP_ERROR TestKeySetRemove2_15() + CHIP_ERROR TestKeySetRemove2_16() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type; @@ -104016,26 +104067,26 @@ class TestGroupKeyManagementClusterSuite : public TestCommand request.groupKeySetID = 418U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(); + (static_cast(context))->OnSuccessResponse_16(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_15(error); + (static_cast(context))->OnFailureResponse_16(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_15(CHIP_ERROR error) + void OnFailureResponse_16(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_15() { NextTest(); } + void OnSuccessResponse_16() { NextTest(); } - CHIP_ERROR TestKeySetReadAlsoRemoved_16() + CHIP_ERROR TestKeySetReadAlsoRemoved_17() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type; @@ -104044,18 +104095,18 @@ class TestGroupKeyManagementClusterSuite : public TestCommand request.groupKeySetID = 418U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_16(data.groupKeySet); + (static_cast(context))->OnSuccessResponse_17(data.groupKeySet); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_16(error); + (static_cast(context))->OnFailureResponse_17(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_16(CHIP_ERROR error) + void OnFailureResponse_17(CHIP_ERROR error) { chip::app::StatusIB status(error); VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); @@ -104063,7 +104114,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand } void - OnSuccessResponse_16(const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & groupKeySet) + OnSuccessResponse_17(const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & groupKeySet) { ThrowSuccessResponse(); }