From 1216568ae862612d475f798cf97364fa6cd6c7c3 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 6 Mar 2023 19:34:06 -0500 Subject: [PATCH] Fix non-fabric-filtered reads of Group Key Management attributes. (#25319) We were only returning the entries for the accessing fabric, not for all fabrics. Fixes https://github.com/project-chip/connectedhomeip/issues/23322 --- .../group-key-mgmt-server.cpp | 56 +- .../suites/TestGroupKeyManagementCluster.yaml | 233 +++- .../chip-tool/zap-generated/test/Commands.h | 650 +++++++++-- .../zap-generated/test/Commands.h | 1040 ++++++++++++++--- 4 files changed, 1713 insertions(+), 266 deletions(-) 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 95b87985469e6a..9878058eada76e 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 @@ -155,25 +155,28 @@ class GroupKeyManagementAttributeAccess : public AttributeAccessInterface } CHIP_ERROR ReadGroupKeyMap(EndpointId endpoint, AttributeValueEncoder & aEncoder) { - auto fabric_index = aEncoder.AccessingFabricIndex(); - auto provider = GetGroupDataProvider(); + auto provider = GetGroupDataProvider(); VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); - CHIP_ERROR err = aEncoder.EncodeList([provider, fabric_index](const auto & encoder) -> CHIP_ERROR { - auto iter = provider->IterateGroupKeys(fabric_index); - VerifyOrReturnError(nullptr != iter, CHIP_ERROR_NO_MEMORY); - - GroupDataProvider::GroupKey mapping; - while (iter->Next(mapping)) + CHIP_ERROR err = aEncoder.EncodeList([provider](const auto & encoder) -> CHIP_ERROR { + for (auto & fabric : Server::GetInstance().GetFabricTable()) { - GroupKeyManagement::Structs::GroupKeyMapStruct::Type key = { - .groupId = mapping.group_id, - .groupKeySetID = mapping.keyset_id, - .fabricIndex = fabric_index, - }; - encoder.Encode(key); + auto fabric_index = fabric.GetFabricIndex(); + auto iter = provider->IterateGroupKeys(fabric_index); + VerifyOrReturnError(nullptr != iter, CHIP_ERROR_NO_MEMORY); + + GroupDataProvider::GroupKey mapping; + while (iter->Next(mapping)) + { + GroupKeyManagement::Structs::GroupKeyMapStruct::Type key = { + .groupId = mapping.group_id, + .groupKeySetID = mapping.keyset_id, + .fabricIndex = fabric_index, + }; + encoder.Encode(key); + } + iter->Release(); } - iter->Release(); return CHIP_NO_ERROR; }); return err; @@ -240,20 +243,23 @@ class GroupKeyManagementAttributeAccess : public AttributeAccessInterface CHIP_ERROR ReadGroupTable(EndpointId endpoint, AttributeValueEncoder & aEncoder) { - auto fabric_index = aEncoder.AccessingFabricIndex(); - auto provider = GetGroupDataProvider(); + auto provider = GetGroupDataProvider(); VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); - CHIP_ERROR err = aEncoder.EncodeList([provider, fabric_index](const auto & encoder) -> CHIP_ERROR { - auto iter = provider->IterateGroupInfo(fabric_index); - VerifyOrReturnError(nullptr != iter, CHIP_ERROR_NO_MEMORY); - - GroupDataProvider::GroupInfo info; - while (iter->Next(info)) + CHIP_ERROR err = aEncoder.EncodeList([provider](const auto & encoder) -> CHIP_ERROR { + for (auto & fabric : Server::GetInstance().GetFabricTable()) { - encoder.Encode(GroupTableCodec(provider, fabric_index, info)); + auto fabric_index = fabric.GetFabricIndex(); + auto iter = provider->IterateGroupInfo(fabric_index); + VerifyOrReturnError(nullptr != iter, CHIP_ERROR_NO_MEMORY); + + GroupDataProvider::GroupInfo info; + while (iter->Next(info)) + { + encoder.Encode(GroupTableCodec(provider, fabric_index, info)); + } + iter->Release(); } - iter->Release(); return CHIP_NO_ERROR; }); return err; diff --git a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml index eb89d57ae0dd40..571a912bb77262 100644 --- a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml +++ b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml @@ -18,9 +18,41 @@ config: nodeId: 0x12344321 cluster: "Group Key Management" endpoint: 0 + payload: + type: char_string + defaultValue: "MT:-24J0AFN00KA0648G00" # This value needs to be generated automatically tests: - - label: "Wait for the commissioned device to be retrieved" + - label: "Wait for the commissioned device to be retrieved for alpha" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Open Commissioning Window from alpha" + cluster: "Administrator Commissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "Commission from beta" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId + - name: "payload" + value: payload + + - label: "Wait for the commissioned device to be retrieved for beta" + identity: "beta" cluster: "DelayCommands" command: "WaitForCommissionee" arguments: @@ -76,6 +108,26 @@ tests: EpochStartTime2: 2110002, } + - label: "KeySet Write 3" + identity: "beta" + command: "KeySetWrite" + arguments: + values: + - name: "GroupKeySet" + value: + { + GroupKeySetID: 0x01a3, + GroupKeySecurityPolicy: 1, + EpochKey0: + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + EpochStartTime0: 2110000, + EpochKey1: "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + EpochStartTime1: 2110001, + EpochKey2: + "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f", + EpochStartTime2: 2110002, + } + - label: "KeySet Read" command: "KeySetRead" arguments: @@ -129,10 +181,35 @@ tests: response: error: FAILURE - - label: "Write Group Keys" + - label: "Write Group Keys on alpha" + command: "writeAttribute" + attribute: "GroupKeyMap" + arguments: + value: + [ + { FabricIndex: 1, GroupId: 0x0101, GroupKeySetID: 0x01a1 }, + { FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0x01a2 }, + { FabricIndex: 1, GroupId: 0x0103, GroupKeySetID: 0x01a1 }, + { FabricIndex: 1, GroupId: 0x0104, GroupKeySetID: 0x01a2 }, + ] + + - label: "Write Group Keys on beta" + identity: "beta" command: "writeAttribute" attribute: "GroupKeyMap" arguments: + value: [ + # Note: the FabricIndex here does not matter; it's not sent on the wire. + { FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0x01a3 }, + { FabricIndex: 1, GroupId: 0x0103, GroupKeySetID: 0x01a3 }, + { FabricIndex: 1, GroupId: 0x0104, GroupKeySetID: 0x01a3 }, + { FabricIndex: 1, GroupId: 0x0105, GroupKeySetID: 0x01a3 }, + ] + + - label: "Read Group Keys on alpha" + command: "readAttribute" + attribute: "GroupKeyMap" + response: value: [ { FabricIndex: 1, GroupId: 0x0101, GroupKeySetID: 0x01a1 }, @@ -141,9 +218,41 @@ tests: { FabricIndex: 1, GroupId: 0x0104, GroupKeySetID: 0x01a2 }, ] - - label: "Read Group Keys" + - label: "Read Group Keys on alpha without fabric filtering" + command: "readAttribute" + attribute: "GroupKeyMap" + fabricFiltered: false + response: + value: + [ + { FabricIndex: 1, GroupId: 0x0101, GroupKeySetID: 0x01a1 }, + { FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0x01a2 }, + { FabricIndex: 1, GroupId: 0x0103, GroupKeySetID: 0x01a1 }, + { FabricIndex: 1, GroupId: 0x0104, GroupKeySetID: 0x01a2 }, + { FabricIndex: 2, GroupId: 0x0102, GroupKeySetID: 0x01a3 }, + { FabricIndex: 2, GroupId: 0x0103, GroupKeySetID: 0x01a3 }, + { FabricIndex: 2, GroupId: 0x0104, GroupKeySetID: 0x01a3 }, + { FabricIndex: 2, GroupId: 0x0105, GroupKeySetID: 0x01a3 }, + ] + + - label: "Read Group Keys on beta" + identity: "beta" + command: "readAttribute" + attribute: "GroupKeyMap" + response: + value: + [ + { FabricIndex: 2, GroupId: 0x0102, GroupKeySetID: 0x01a3 }, + { FabricIndex: 2, GroupId: 0x0103, GroupKeySetID: 0x01a3 }, + { FabricIndex: 2, GroupId: 0x0104, GroupKeySetID: 0x01a3 }, + { FabricIndex: 2, GroupId: 0x0105, GroupKeySetID: 0x01a3 }, + ] + + - label: "Read Group Keys on beta without fabric filtering" + identity: "beta" command: "readAttribute" attribute: "GroupKeyMap" + fabricFiltered: false response: value: [ @@ -151,6 +260,10 @@ tests: { FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0x01a2 }, { FabricIndex: 1, GroupId: 0x0103, GroupKeySetID: 0x01a1 }, { FabricIndex: 1, GroupId: 0x0104, GroupKeySetID: 0x01a2 }, + { FabricIndex: 2, GroupId: 0x0102, GroupKeySetID: 0x01a3 }, + { FabricIndex: 2, GroupId: 0x0103, GroupKeySetID: 0x01a3 }, + { FabricIndex: 2, GroupId: 0x0104, GroupKeySetID: 0x01a3 }, + { FabricIndex: 2, GroupId: 0x0105, GroupKeySetID: 0x01a3 }, ] - label: "Add Group 1" @@ -221,9 +334,115 @@ tests: - name: "GroupID" value: 0x0104 - - label: "Read GroupTable" + - label: "Add Group 5" + identity: "beta" + cluster: "Groups" + endpoint: 1 + command: "AddGroup" + arguments: + values: + - name: "GroupID" + value: 0x0105 + - name: "GroupName" + value: "Group #5" + response: + values: + - name: "Status" + value: 0 + - name: "GroupID" + value: 0x0105 + + - label: "Read GroupTable from alpha" + command: "readAttribute" + attribute: "GroupTable" + response: + value: + [ + { + FabricIndex: 1, + GroupId: 0x0101, + Endpoints: [1], + GroupName: "Group #1", + }, + { + FabricIndex: 1, + GroupId: 0x0102, + Endpoints: [1], + GroupName: "Group #2", + }, + { + FabricIndex: 1, + GroupId: 0x0103, + Endpoints: [1], + GroupName: "Group #3", + }, + { + FabricIndex: 1, + GroupId: 0x0104, + Endpoints: [1], + GroupName: "Group #4", + }, + ] + + - label: "Read GroupTable from alpha without fabric filtering" + command: "readAttribute" + attribute: "GroupTable" + fabricFiltered: false + response: + value: + [ + { + FabricIndex: 1, + GroupId: 0x0101, + Endpoints: [1], + GroupName: "Group #1", + }, + { + FabricIndex: 1, + GroupId: 0x0102, + Endpoints: [1], + GroupName: "Group #2", + }, + { + FabricIndex: 1, + GroupId: 0x0103, + Endpoints: [1], + GroupName: "Group #3", + }, + { + FabricIndex: 1, + GroupId: 0x0104, + Endpoints: [1], + GroupName: "Group #4", + }, + { + FabricIndex: 2, + GroupId: 0x0105, + Endpoints: [1], + GroupName: "Group #5", + }, + ] + + - label: "Read GroupTable from beta" + identity: "beta" command: "readAttribute" attribute: "GroupTable" + response: + value: + [ + { + FabricIndex: 2, + GroupId: 0x0105, + Endpoints: [1], + GroupName: "Group #5", + }, + ] + + - label: "Read GroupTable from beta without fabric filtering" + identity: "beta" + command: "readAttribute" + attribute: "GroupTable" + fabricFiltered: false response: value: [ @@ -251,6 +470,12 @@ tests: Endpoints: [1], GroupName: "Group #4", }, + { + FabricIndex: 2, + GroupId: 0x0105, + Endpoints: [1], + GroupName: "Group #5", + }, ] - label: "KeySet Remove 1" diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index a4af2886981692..dd43f9aaafa5fe 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -87231,11 +87231,12 @@ class TestGroupKeyManagementClusterSuite : public TestCommand { public: TestGroupKeyManagementClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("TestGroupKeyManagementCluster", 31, credsIssuerConfig) + TestCommand("TestGroupKeyManagementCluster", 43, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("payload", &mPayload); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } @@ -87250,6 +87251,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mPayload; chip::Optional mTimeout; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -87269,6 +87271,17 @@ class TestGroupKeyManagementClusterSuite : public TestCommand shouldContinue = true; break; case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -87276,7 +87289,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); } break; - case 2: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -87284,13 +87297,16 @@ class TestGroupKeyManagementClusterSuite : public TestCommand VerifyOrReturn(CheckConstraintMinValue("value", value, 3U)); } break; - case 3: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 4: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 5: + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType value; @@ -87311,16 +87327,19 @@ class TestGroupKeyManagementClusterSuite : public TestCommand CheckValue("groupKeySet.epochStartTime2.Value()", value.groupKeySet.epochStartTime2.Value(), 1110002ULL)); } break; - case 6: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 7: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; - case 8: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 9: + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList< @@ -87349,7 +87368,126 @@ class TestGroupKeyManagementClusterSuite : public TestCommand } } break; - case 10: + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 0)); + VerifyOrReturn(CheckValue("groupKeyMap[0].groupId", iter_0.GetValue().groupId, 257U)); + VerifyOrReturn(CheckValue("groupKeyMap[0].groupKeySetID", iter_0.GetValue().groupKeySetID, 417U)); + VerifyOrReturn(CheckValue("groupKeyMap[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 1)); + VerifyOrReturn(CheckValue("groupKeyMap[1].groupId", iter_0.GetValue().groupId, 258U)); + VerifyOrReturn(CheckValue("groupKeyMap[1].groupKeySetID", iter_0.GetValue().groupKeySetID, 418U)); + VerifyOrReturn(CheckValue("groupKeyMap[1].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 2)); + VerifyOrReturn(CheckValue("groupKeyMap[2].groupId", iter_0.GetValue().groupId, 259U)); + VerifyOrReturn(CheckValue("groupKeyMap[2].groupKeySetID", iter_0.GetValue().groupKeySetID, 417U)); + VerifyOrReturn(CheckValue("groupKeyMap[2].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 3)); + VerifyOrReturn(CheckValue("groupKeyMap[3].groupId", iter_0.GetValue().groupId, 260U)); + VerifyOrReturn(CheckValue("groupKeyMap[3].groupKeySetID", iter_0.GetValue().groupKeySetID, 418U)); + VerifyOrReturn(CheckValue("groupKeyMap[3].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 4)); + VerifyOrReturn(CheckValue("groupKeyMap[4].groupId", iter_0.GetValue().groupId, 258U)); + VerifyOrReturn(CheckValue("groupKeyMap[4].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[4].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 5)); + VerifyOrReturn(CheckValue("groupKeyMap[5].groupId", iter_0.GetValue().groupId, 259U)); + VerifyOrReturn(CheckValue("groupKeyMap[5].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[5].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 6)); + VerifyOrReturn(CheckValue("groupKeyMap[6].groupId", iter_0.GetValue().groupId, 260U)); + VerifyOrReturn(CheckValue("groupKeyMap[6].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[6].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 7)); + VerifyOrReturn(CheckValue("groupKeyMap[7].groupId", iter_0.GetValue().groupId, 261U)); + VerifyOrReturn(CheckValue("groupKeyMap[7].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[7].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNoMoreListItems("groupKeyMap", iter_0, 8)); + } + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 0)); + VerifyOrReturn(CheckValue("groupKeyMap[0].groupId", iter_0.GetValue().groupId, 258U)); + VerifyOrReturn(CheckValue("groupKeyMap[0].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[0].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 1)); + VerifyOrReturn(CheckValue("groupKeyMap[1].groupId", iter_0.GetValue().groupId, 259U)); + VerifyOrReturn(CheckValue("groupKeyMap[1].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[1].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 2)); + VerifyOrReturn(CheckValue("groupKeyMap[2].groupId", iter_0.GetValue().groupId, 260U)); + VerifyOrReturn(CheckValue("groupKeyMap[2].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[2].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 3)); + VerifyOrReturn(CheckValue("groupKeyMap[3].groupId", iter_0.GetValue().groupId, 261U)); + VerifyOrReturn(CheckValue("groupKeyMap[3].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[3].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNoMoreListItems("groupKeyMap", iter_0, 4)); + } + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 0)); + VerifyOrReturn(CheckValue("groupKeyMap[0].groupId", iter_0.GetValue().groupId, 257U)); + VerifyOrReturn(CheckValue("groupKeyMap[0].groupKeySetID", iter_0.GetValue().groupKeySetID, 417U)); + VerifyOrReturn(CheckValue("groupKeyMap[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 1)); + VerifyOrReturn(CheckValue("groupKeyMap[1].groupId", iter_0.GetValue().groupId, 258U)); + VerifyOrReturn(CheckValue("groupKeyMap[1].groupKeySetID", iter_0.GetValue().groupKeySetID, 418U)); + VerifyOrReturn(CheckValue("groupKeyMap[1].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 2)); + VerifyOrReturn(CheckValue("groupKeyMap[2].groupId", iter_0.GetValue().groupId, 259U)); + VerifyOrReturn(CheckValue("groupKeyMap[2].groupKeySetID", iter_0.GetValue().groupKeySetID, 417U)); + VerifyOrReturn(CheckValue("groupKeyMap[2].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 3)); + VerifyOrReturn(CheckValue("groupKeyMap[3].groupId", iter_0.GetValue().groupId, 260U)); + VerifyOrReturn(CheckValue("groupKeyMap[3].groupKeySetID", iter_0.GetValue().groupKeySetID, 418U)); + VerifyOrReturn(CheckValue("groupKeyMap[3].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 4)); + VerifyOrReturn(CheckValue("groupKeyMap[4].groupId", iter_0.GetValue().groupId, 258U)); + VerifyOrReturn(CheckValue("groupKeyMap[4].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[4].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 5)); + VerifyOrReturn(CheckValue("groupKeyMap[5].groupId", iter_0.GetValue().groupId, 259U)); + VerifyOrReturn(CheckValue("groupKeyMap[5].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[5].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 6)); + VerifyOrReturn(CheckValue("groupKeyMap[6].groupId", iter_0.GetValue().groupId, 260U)); + VerifyOrReturn(CheckValue("groupKeyMap[6].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[6].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 7)); + VerifyOrReturn(CheckValue("groupKeyMap[7].groupId", iter_0.GetValue().groupId, 261U)); + VerifyOrReturn(CheckValue("groupKeyMap[7].groupKeySetID", iter_0.GetValue().groupKeySetID, 419U)); + VerifyOrReturn(CheckValue("groupKeyMap[7].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNoMoreListItems("groupKeyMap", iter_0, 8)); + } + } + break; + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; @@ -87358,7 +87496,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); } break; - case 11: + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; @@ -87367,7 +87505,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand VerifyOrReturn(CheckValue("groupID", value.groupID, 258U)); } break; - case 12: + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; @@ -87376,7 +87514,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand VerifyOrReturn(CheckValue("groupID", value.groupID, 259U)); } break; - case 13: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; @@ -87385,7 +87523,16 @@ class TestGroupKeyManagementClusterSuite : public TestCommand VerifyOrReturn(CheckValue("groupID", value.groupID, 260U)); } break; - case 14: + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("groupID", value.groupID, 261U)); + } + break; + case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList< @@ -87454,13 +87601,206 @@ class TestGroupKeyManagementClusterSuite : public TestCommand } } break; - case 15: + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 0)); + VerifyOrReturn(CheckValue("groupTable[0].groupId", iter_0.GetValue().groupId, 257U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[0].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[0].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[0].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[0].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[0].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #1", 8))); + VerifyOrReturn(CheckValue("groupTable[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 1)); + VerifyOrReturn(CheckValue("groupTable[1].groupId", iter_0.GetValue().groupId, 258U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[1].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[1].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[1].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[1].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[1].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #2", 8))); + VerifyOrReturn(CheckValue("groupTable[1].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 2)); + VerifyOrReturn(CheckValue("groupTable[2].groupId", iter_0.GetValue().groupId, 259U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[2].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[2].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[2].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[2].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[2].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #3", 8))); + VerifyOrReturn(CheckValue("groupTable[2].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 3)); + VerifyOrReturn(CheckValue("groupTable[3].groupId", iter_0.GetValue().groupId, 260U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[3].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[3].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[3].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[3].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[3].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #4", 8))); + VerifyOrReturn(CheckValue("groupTable[3].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 4)); + VerifyOrReturn(CheckValue("groupTable[4].groupId", iter_0.GetValue().groupId, 261U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[4].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[4].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[4].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[4].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[4].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #5", 8))); + VerifyOrReturn(CheckValue("groupTable[4].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNoMoreListItems("groupTable", iter_0, 5)); + } + } + break; + case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 0)); + VerifyOrReturn(CheckValue("groupTable[0].groupId", iter_0.GetValue().groupId, 261U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[0].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[0].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[0].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[0].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[0].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #5", 8))); + VerifyOrReturn(CheckValue("groupTable[0].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNoMoreListItems("groupTable", iter_0, 1)); + } + } break; - case 16: + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 0)); + VerifyOrReturn(CheckValue("groupTable[0].groupId", iter_0.GetValue().groupId, 257U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[0].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[0].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[0].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[0].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[0].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #1", 8))); + VerifyOrReturn(CheckValue("groupTable[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 1)); + VerifyOrReturn(CheckValue("groupTable[1].groupId", iter_0.GetValue().groupId, 258U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[1].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[1].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[1].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[1].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[1].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #2", 8))); + VerifyOrReturn(CheckValue("groupTable[1].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 2)); + VerifyOrReturn(CheckValue("groupTable[2].groupId", iter_0.GetValue().groupId, 259U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[2].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[2].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[2].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[2].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[2].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #3", 8))); + VerifyOrReturn(CheckValue("groupTable[2].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 3)); + VerifyOrReturn(CheckValue("groupTable[3].groupId", iter_0.GetValue().groupId, 260U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[3].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[3].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[3].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[3].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[3].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #4", 8))); + VerifyOrReturn(CheckValue("groupTable[3].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 4)); + VerifyOrReturn(CheckValue("groupTable[4].groupId", iter_0.GetValue().groupId, 261U)); + { + auto iter_2 = iter_0.GetValue().endpoints.begin(); + VerifyOrReturn( + CheckNextListItemDecodes("groupTable[4].endpoints", iter_2, 0)); + VerifyOrReturn(CheckValue("groupTable[4].endpoints[0]", iter_2.GetValue(), 1U)); + VerifyOrReturn( + CheckNoMoreListItems("groupTable[4].endpoints", iter_2, 1)); + } + VerifyOrReturn(CheckValuePresent("groupTable[4].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[4].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #5", 8))); + VerifyOrReturn(CheckValue("groupTable[4].fabricIndex", iter_0.GetValue().fabricIndex, 2U)); + VerifyOrReturn(CheckNoMoreListItems("groupTable", iter_0, 5)); + } + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); break; - case 17: + case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType value; @@ -87481,7 +87821,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand CheckValue("groupKeySet.epochStartTime2.Value()", value.groupKeySet.epochStartTime2.Value(), 2110002ULL)); } break; - case 18: + case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType value; @@ -87490,7 +87830,7 @@ class TestGroupKeyManagementClusterSuite : public TestCommand VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); } break; - case 19: + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList< @@ -87545,10 +87885,10 @@ class TestGroupKeyManagementClusterSuite : public TestCommand } } break; - case 20: + case 32: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 21: + case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList< @@ -87561,25 +87901,25 @@ class TestGroupKeyManagementClusterSuite : public TestCommand } } break; - case 22: + case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 23: + case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); break; - case 24: + case 36: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 25: + case 37: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 26: + case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 27: + case 39: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 28: + case 40: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList< @@ -87596,10 +87936,10 @@ class TestGroupKeyManagementClusterSuite : public TestCommand } } break; - case 29: + case 41: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 30: + case 42: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList< @@ -87628,24 +87968,50 @@ class TestGroupKeyManagementClusterSuite : public TestCommand switch (testIndex) { case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); + LogStep(0, "Wait for the commissioned device to be retrieved for alpha"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Read maxGroupsPerFabric"); + LogStep(1, "Open Commissioning Window from alpha"); + 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 2: { + LogStep(2, "Commission from beta"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 3: { + LogStep(3, "Wait for the commissioned device to be retrieved for beta"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 4: { + LogStep(4, "Read maxGroupsPerFabric"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::MaxGroupsPerFabric::Id, true, chip::NullOptional); } - case 2: { - LogStep(2, "Read maxGroupKeysPerFabric"); + case 5: { + LogStep(5, "Read maxGroupKeysPerFabric"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::Id, true, chip::NullOptional); } - case 3: { - LogStep(3, "KeySet Write 1"); + case 6: { + LogStep(6, "KeySet Write 1"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; @@ -87679,8 +88045,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 4: { - LogStep(4, "KeySet Write 2"); + case 7: { + LogStep(7, "KeySet Write 2"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; @@ -87714,8 +88080,41 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 5: { - LogStep(5, "KeySet Read"); + case 8: { + LogStep(8, "KeySet Write 3"); + ListFreer listFreer; + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; + + value.groupKeySet.groupKeySetID = 419U; + value.groupKeySet.groupKeySecurityPolicy = + static_cast(1); + value.groupKeySet.epochKey0.SetNonNull(); + value.groupKeySet.epochKey0.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime0.SetNonNull(); + value.groupKeySet.epochStartTime0.Value() = 2110000ULL; + value.groupKeySet.epochKey1.SetNonNull(); + value.groupKeySet.epochKey1.Value() = chip::ByteSpan( + chip::Uint8::from_const_char( + "\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037garbage: not in length on purpose"), + 16); + value.groupKeySet.epochStartTime1.SetNonNull(); + value.groupKeySet.epochStartTime1.Value() = 2110001ULL; + value.groupKeySet.epochKey2.SetNonNull(); + value.groupKeySet.epochKey2.Value() = + chip::ByteSpan(chip::Uint8::from_const_char(" !\042#$%&'()*+,-./garbage: not in length on purpose"), 16); + value.groupKeySet.epochStartTime2.SetNonNull(); + value.groupKeySet.epochStartTime2.Value() = 2110002ULL; + + return SendCommand(kIdentityBeta, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Commands::KeySetWrite::Id, + value, chip::NullOptional + + ); + } + case 9: { + LogStep(9, "KeySet Read"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; value.groupKeySetID = 417U; @@ -87724,8 +88123,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 6: { - LogStep(6, "Write Group Keys (invalid)"); + case 10: { + LogStep(10, "Write Group Keys (invalid)"); ListFreer listFreer; chip::app::DataModel::List value; @@ -87743,8 +88142,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); } - case 7: { - LogStep(7, "Write Group Keys (too many)"); + case 11: { + LogStep(11, "Write Group Keys (too many)"); ListFreer listFreer; chip::app::DataModel::List value; @@ -87782,8 +88181,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); } - case 8: { - LogStep(8, "Write Group Keys"); + case 12: { + LogStep(12, "Write Group Keys on alpha"); ListFreer listFreer; chip::app::DataModel::List value; @@ -87813,13 +88212,59 @@ class TestGroupKeyManagementClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); } - case 9: { - LogStep(9, "Read Group Keys"); + case 13: { + LogStep(13, "Write Group Keys on beta"); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(4); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].groupId = 258U; + listHolder_0->mList[0].groupKeySetID = 419U; + listHolder_0->mList[0].fabricIndex = 1U; + + listHolder_0->mList[1].groupId = 259U; + listHolder_0->mList[1].groupKeySetID = 419U; + listHolder_0->mList[1].fabricIndex = 1U; + + listHolder_0->mList[2].groupId = 260U; + listHolder_0->mList[2].groupKeySetID = 419U; + listHolder_0->mList[2].fabricIndex = 1U; + + listHolder_0->mList[3].groupId = 261U; + listHolder_0->mList[3].groupKeySetID = 419U; + listHolder_0->mList[3].fabricIndex = 1U; + + value = chip::app::DataModel::List( + listHolder_0->mList, 4); + } + return WriteAttribute(kIdentityBeta, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, "Read Group Keys on alpha"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupKeyMap::Id, true, chip::NullOptional); } - case 10: { - LogStep(10, "Add Group 1"); + case 15: { + LogStep(15, "Read Group Keys on alpha without fabric filtering"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupKeyMap::Id, false, chip::NullOptional); + } + case 16: { + LogStep(16, "Read Group Keys on beta"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupKeyMap::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Read Group Keys on beta without fabric filtering"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupKeyMap::Id, false, chip::NullOptional); + } + case 18: { + LogStep(18, "Add Group 1"); ListFreer listFreer; chip::app::Clusters::Groups::Commands::AddGroup::Type value; value.groupID = 257U; @@ -87828,8 +88273,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 11: { - LogStep(11, "Add Group 2"); + case 19: { + LogStep(19, "Add Group 2"); ListFreer listFreer; chip::app::Clusters::Groups::Commands::AddGroup::Type value; value.groupID = 258U; @@ -87838,8 +88283,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 12: { - LogStep(12, "Add Group 3"); + case 20: { + LogStep(20, "Add Group 3"); ListFreer listFreer; chip::app::Clusters::Groups::Commands::AddGroup::Type value; value.groupID = 259U; @@ -87848,8 +88293,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 13: { - LogStep(13, "Add Group 4"); + case 21: { + LogStep(21, "Add Group 4"); ListFreer listFreer; chip::app::Clusters::Groups::Commands::AddGroup::Type value; value.groupID = 260U; @@ -87858,13 +88303,38 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 14: { - LogStep(14, "Read GroupTable"); + case 22: { + LogStep(22, "Add Group 5"); + ListFreer listFreer; + chip::app::Clusters::Groups::Commands::AddGroup::Type value; + value.groupID = 261U; + value.groupName = chip::Span("Group #5garbage: not in length on purpose", 8); + return SendCommand(kIdentityBeta, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Read GroupTable from alpha"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional); } - case 15: { - LogStep(15, "KeySet Remove 1"); + case 24: { + LogStep(24, "Read GroupTable from alpha without fabric filtering"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupTable::Id, false, chip::NullOptional); + } + case 25: { + LogStep(25, "Read GroupTable from beta"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read GroupTable from beta without fabric filtering"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupTable::Id, false, chip::NullOptional); + } + case 27: { + LogStep(27, "KeySet Remove 1"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; value.groupKeySetID = 417U; @@ -87873,8 +88343,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 16: { - LogStep(16, "KeySet Read (removed)"); + case 28: { + LogStep(28, "KeySet Read (removed)"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; value.groupKeySetID = 417U; @@ -87883,8 +88353,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 17: { - LogStep(17, "KeySet Read (not removed)"); + case 29: { + LogStep(29, "KeySet Read (not removed)"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; value.groupKeySetID = 418U; @@ -87893,8 +88363,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 18: { - LogStep(18, "Remove Group 1"); + case 30: { + LogStep(30, "Remove Group 1"); ListFreer listFreer; chip::app::Clusters::Groups::Commands::RemoveGroup::Type value; value.groupID = 257U; @@ -87903,13 +88373,13 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 19: { - LogStep(19, "Read GroupTable 2"); + case 31: { + LogStep(31, "Read GroupTable 2"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional); } - case 20: { - LogStep(20, "Remove All"); + case 32: { + LogStep(32, "Remove All"); ListFreer listFreer; chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveAllGroups::Id, value, @@ -87917,13 +88387,13 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 21: { - LogStep(21, "Read GroupTable 3"); + case 33: { + LogStep(33, "Read GroupTable 3"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional); } - case 22: { - LogStep(22, "KeySet Remove 2"); + case 34: { + LogStep(34, "KeySet Remove 2"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; value.groupKeySetID = 418U; @@ -87932,8 +88402,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 23: { - LogStep(23, "KeySet Read (also removed)"); + case 35: { + LogStep(35, "KeySet Read (also removed)"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; value.groupKeySetID = 418U; @@ -87942,8 +88412,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 24: { - LogStep(24, "KeySet Write 1"); + case 36: { + LogStep(36, "KeySet Write 1"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; @@ -87977,8 +88447,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 25: { - LogStep(25, "KeySet Write 2"); + case 37: { + LogStep(37, "KeySet Write 2"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; @@ -88012,8 +88482,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 26: { - LogStep(26, "Map Group 1 and Group 2 to KeySet 1 and group 2 to KeySet 2"); + case 38: { + LogStep(38, "Map Group 1 and Group 2 to KeySet 1 and group 2 to KeySet 2"); ListFreer listFreer; chip::app::DataModel::List value; @@ -88039,8 +88509,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); } - case 27: { - LogStep(27, "Remove keyset 1"); + case 39: { + LogStep(39, "Remove keyset 1"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; value.groupKeySetID = 417U; @@ -88049,13 +88519,13 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 28: { - LogStep(28, "TH verifies GroupKeyMap entries for KeySet 1 have been removed"); + case 40: { + LogStep(40, "TH verifies GroupKeyMap entries for KeySet 1 have been removed"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupKeyMap::Id, true, chip::NullOptional); } - case 29: { - LogStep(29, "Remove keyset 2"); + case 41: { + LogStep(41, "Remove keyset 2"); ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; value.groupKeySetID = 418U; @@ -88064,8 +88534,8 @@ class TestGroupKeyManagementClusterSuite : public TestCommand ); } - case 30: { - LogStep(30, "TH verifies GroupKeyMap entries for KeySet 2 have been removed"); + case 42: { + LogStep(42, "TH verifies GroupKeyMap entries for KeySet 2 have been removed"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupKeyMap::Id, true, chip::NullOptional); } 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 5e152698339007..211cf0f0c7a45b 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -131867,6 +131867,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("payload", &mPayload); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) @@ -131896,128 +131897,176 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved for alpha\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForAlpha_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read maxGroupsPerFabric\n"); - err = TestReadMaxGroupsPerFabric_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Open Commissioning Window from alpha\n"); + err = TestOpenCommissioningWindowFromAlpha_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read maxGroupKeysPerFabric\n"); - err = TestReadMaxGroupKeysPerFabric_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Commission from beta\n"); + err = TestCommissionFromBeta_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : KeySet Write 1\n"); - err = TestKeySetWrite1_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Wait for the commissioned device to be retrieved for beta\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : KeySet Write 2\n"); - err = TestKeySetWrite2_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read maxGroupsPerFabric\n"); + err = TestReadMaxGroupsPerFabric_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : KeySet Read\n"); - err = TestKeySetRead_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read maxGroupKeysPerFabric\n"); + err = TestReadMaxGroupKeysPerFabric_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Write Group Keys (invalid)\n"); - err = TestWriteGroupKeysInvalid_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : KeySet Write 1\n"); + err = TestKeySetWrite1_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write Group Keys (too many)\n"); - err = TestWriteGroupKeysTooMany_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : KeySet Write 2\n"); + err = TestKeySetWrite2_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write Group Keys\n"); - err = TestWriteGroupKeys_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : KeySet Write 3\n"); + err = TestKeySetWrite3_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read Group Keys\n"); - err = TestReadGroupKeys_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : KeySet Read\n"); + err = TestKeySetRead_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Add Group 1\n"); - err = TestAddGroup1_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Write Group Keys (invalid)\n"); + err = TestWriteGroupKeysInvalid_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Add Group 2\n"); - err = TestAddGroup2_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Write Group Keys (too many)\n"); + err = TestWriteGroupKeysTooMany_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Add Group 3\n"); - err = TestAddGroup3_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Write Group Keys on alpha\n"); + err = TestWriteGroupKeysOnAlpha_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Add Group 4\n"); - err = TestAddGroup4_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Write Group Keys on beta\n"); + err = TestWriteGroupKeysOnBeta_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Read GroupTable\n"); - err = TestReadGroupTable_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Read Group Keys on alpha\n"); + err = TestReadGroupKeysOnAlpha_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : KeySet Remove 1\n"); - err = TestKeySetRemove1_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Read Group Keys on alpha without fabric filtering\n"); + err = TestReadGroupKeysOnAlphaWithoutFabricFiltering_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : KeySet Read (removed)\n"); - err = TestKeySetReadRemoved_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : Read Group Keys on beta\n"); + err = TestReadGroupKeysOnBeta_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : KeySet Read (not removed)\n"); - err = TestKeySetReadNotRemoved_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Read Group Keys on beta without fabric filtering\n"); + err = TestReadGroupKeysOnBetaWithoutFabricFiltering_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Remove Group 1\n"); - err = TestRemoveGroup1_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Add Group 1\n"); + err = TestAddGroup1_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read GroupTable 2\n"); - err = TestReadGroupTable2_19(); + ChipLogProgress(chipTool, " ***** Test Step 19 : Add Group 2\n"); + err = TestAddGroup2_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Remove All\n"); - err = TestRemoveAll_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : Add Group 3\n"); + err = TestAddGroup3_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read GroupTable 3\n"); - err = TestReadGroupTable3_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : Add Group 4\n"); + err = TestAddGroup4_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : KeySet Remove 2\n"); - err = TestKeySetRemove2_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Add Group 5\n"); + err = TestAddGroup5_22(); break; case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : KeySet Read (also removed)\n"); - err = TestKeySetReadAlsoRemoved_23(); + ChipLogProgress(chipTool, " ***** Test Step 23 : Read GroupTable from alpha\n"); + err = TestReadGroupTableFromAlpha_23(); break; case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : KeySet Write 1\n"); - err = TestKeySetWrite1_24(); + ChipLogProgress(chipTool, " ***** Test Step 24 : Read GroupTable from alpha without fabric filtering\n"); + err = TestReadGroupTableFromAlphaWithoutFabricFiltering_24(); break; case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : KeySet Write 2\n"); - err = TestKeySetWrite2_25(); + ChipLogProgress(chipTool, " ***** Test Step 25 : Read GroupTable from beta\n"); + err = TestReadGroupTableFromBeta_25(); break; case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Map Group 1 and Group 2 to KeySet 1 and group 2 to KeySet 2\n"); - err = TestMapGroup1AndGroup2ToKeySet1AndGroup2ToKeySet2_26(); + ChipLogProgress(chipTool, " ***** Test Step 26 : Read GroupTable from beta without fabric filtering\n"); + err = TestReadGroupTableFromBetaWithoutFabricFiltering_26(); break; case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Remove keyset 1\n"); - err = TestRemoveKeyset1_27(); + ChipLogProgress(chipTool, " ***** Test Step 27 : KeySet Remove 1\n"); + err = TestKeySetRemove1_27(); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : TH verifies GroupKeyMap entries for KeySet 1 have been removed\n"); - err = TestThVerifiesGroupKeyMapEntriesForKeySet1HaveBeenRemoved_28(); + ChipLogProgress(chipTool, " ***** Test Step 28 : KeySet Read (removed)\n"); + err = TestKeySetReadRemoved_28(); break; case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Remove keyset 2\n"); - err = TestRemoveKeyset2_29(); + ChipLogProgress(chipTool, " ***** Test Step 29 : KeySet Read (not removed)\n"); + err = TestKeySetReadNotRemoved_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : TH verifies GroupKeyMap entries for KeySet 2 have been removed\n"); - err = TestThVerifiesGroupKeyMapEntriesForKeySet2HaveBeenRemoved_30(); + ChipLogProgress(chipTool, " ***** Test Step 30 : Remove Group 1\n"); + err = TestRemoveGroup1_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Read GroupTable 2\n"); + err = TestReadGroupTable2_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Remove All\n"); + err = TestRemoveAll_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Read GroupTable 3\n"); + err = TestReadGroupTable3_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : KeySet Remove 2\n"); + err = TestKeySetRemove2_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : KeySet Read (also removed)\n"); + err = TestKeySetReadAlsoRemoved_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : KeySet Write 1\n"); + err = TestKeySetWrite1_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : KeySet Write 2\n"); + err = TestKeySetWrite2_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Map Group 1 and Group 2 to KeySet 1 and group 2 to KeySet 2\n"); + err = TestMapGroup1AndGroup2ToKeySet1AndGroup2ToKeySet2_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Remove keyset 1\n"); + err = TestRemoveKeyset1_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : TH verifies GroupKeyMap entries for KeySet 1 have been removed\n"); + err = TestThVerifiesGroupKeyMapEntriesForKeySet1HaveBeenRemoved_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Remove keyset 2\n"); + err = TestRemoveKeyset2_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : TH verifies GroupKeyMap entries for KeySet 2 have been removed\n"); + err = TestThVerifiesGroupKeyMapEntriesForKeySet2HaveBeenRemoved_42(); break; } @@ -132049,10 +132098,10 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -132061,10 +132110,10 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -132079,7 +132128,7 @@ class TestGroupKeyManagementCluster : 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_NOT_FOUND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -132100,7 +132149,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -132115,7 +132164,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); break; case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -132123,6 +132172,42 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -132136,14 +132221,15 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 31; + const uint16_t mTestCount = 43; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mPayload; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForAlpha_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -132151,7 +132237,47 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadMaxGroupsPerFabric_1() + CHIP_ERROR TestOpenCommissioningWindowFromAlpha_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Open Commissioning Window from alpha Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCommissionFromBeta_2() + { + + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_3() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("beta", value); + } + + CHIP_ERROR TestReadMaxGroupsPerFabric_4() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132173,7 +132299,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadMaxGroupKeysPerFabric_2() + CHIP_ERROR TestReadMaxGroupKeysPerFabric_5() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132195,7 +132321,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetWrite1_3() + CHIP_ERROR TestKeySetWrite1_6() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132235,7 +132361,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetWrite2_4() + CHIP_ERROR TestKeySetWrite2_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132275,7 +132401,47 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetRead_5() + CHIP_ERROR TestKeySetWrite3_8() + { + + MTRBaseDevice * device = GetDevice("beta"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = + [NSNumber numberWithUnsignedShort:419U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:1U]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:2110000ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:2110001ULL]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:" !\042#$%&'()*+,-./" length:16]; + ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:2110002ULL]; + + [cluster keySetWriteWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"KeySet Write 3 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestKeySetRead_9() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132326,7 +132492,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteGroupKeysInvalid_6() + CHIP_ERROR TestWriteGroupKeysInvalid_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132361,7 +132527,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteGroupKeysTooMany_7() + CHIP_ERROR TestWriteGroupKeysTooMany_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132421,7 +132587,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteGroupKeys_8() + CHIP_ERROR TestWriteGroupKeysOnAlpha_12() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132457,7 +132623,53 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { } [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument completion:^(NSError * _Nullable err) { - NSLog(@"Write Group Keys Error: %@", err); + NSLog(@"Write Group Keys on alpha Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteGroupKeysOnBeta_13() + { + + MTRBaseDevice * device = GetDevice("beta"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id groupKeyMapArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:258U]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:419U]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1U]; + + temp_0[1] = [[MTRGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupId = [NSNumber numberWithUnsignedShort:259U]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupKeySetID = [NSNumber numberWithUnsignedShort:419U]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1U]; + + temp_0[2] = [[MTRGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[2]).groupId = [NSNumber numberWithUnsignedShort:260U]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[2]).groupKeySetID = [NSNumber numberWithUnsignedShort:419U]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:1U]; + + temp_0[3] = [[MTRGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[3]).groupId = [NSNumber numberWithUnsignedShort:261U]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[3]).groupKeySetID = [NSNumber numberWithUnsignedShort:419U]; + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[3]).fabricIndex = [NSNumber numberWithUnsignedChar:1U]; + + groupKeyMapArgument = temp_0; + } + [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Write Group Keys on beta Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -132467,7 +132679,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadGroupKeys_9() + CHIP_ERROR TestReadGroupKeysOnAlpha_14() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132481,7 +132693,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { [cluster readAttributeGroupKeyMapWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read Group Keys Error: %@", err); + NSLog(@"Read Group Keys on alpha Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -132529,58 +132741,308 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestAddGroup1_10() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRGroupsClusterAddGroupParams alloc] init]; - params.groupID = [NSNumber numberWithUnsignedShort:257U]; - params.groupName = @"Group #1"; - [cluster addGroupWithParams:params - completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 1 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, 257U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestAddGroup2_11() + CHIP_ERROR TestReadGroupKeysOnAlphaWithoutFabricFiltering_15() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRGroupsClusterAddGroupParams alloc] init]; - params.groupID = [NSNumber numberWithUnsignedShort:258U]; - params.groupName = @"Group #2"; - [cluster addGroupWithParams:params - completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 2 Error: %@", err); + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = false; + [cluster + readAttributeGroupKeyMapWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Group Keys on alpha without fabric filtering Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } + { + id actualValue = value; + VerifyOrReturn( + CheckValue("GroupKeyMap", [actualValue count], static_cast(8))); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupId, 257U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupKeySetID, + 417U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupId, 258U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupKeySetID, + 418U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[2]).groupId, 259U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[2]).groupKeySetID, + 417U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[2]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[3]).groupId, 260U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[3]).groupKeySetID, + 418U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[3]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[4]).groupId, 258U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[4]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[4]).fabricIndex, + 2U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[5]).groupId, 259U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[5]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[5]).fabricIndex, + 2U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[6]).groupId, 260U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[6]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[6]).fabricIndex, + 2U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[7]).groupId, 261U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[7]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[7]).fabricIndex, + 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadGroupKeysOnBeta_16() + { + + MTRBaseDevice * device = GetDevice("beta"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeGroupKeyMapWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Group Keys on beta Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn( + CheckValue("GroupKeyMap", [actualValue count], static_cast(4))); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupId, 258U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).fabricIndex, + 2U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupId, 259U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).fabricIndex, + 2U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[2]).groupId, 260U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[2]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[2]).fabricIndex, + 2U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[3]).groupId, 261U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[3]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[3]).fabricIndex, + 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadGroupKeysOnBetaWithoutFabricFiltering_17() + { + + MTRBaseDevice * device = GetDevice("beta"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = false; + [cluster + readAttributeGroupKeyMapWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Group Keys on beta without fabric filtering Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn( + CheckValue("GroupKeyMap", [actualValue count], static_cast(8))); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupId, 257U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupKeySetID, + 417U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupId, 258U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupKeySetID, + 418U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[2]).groupId, 259U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[2]).groupKeySetID, + 417U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[2]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[3]).groupId, 260U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[3]).groupKeySetID, + 418U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[3]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[4]).groupId, 258U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[4]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[4]).fabricIndex, + 2U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[5]).groupId, 259U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[5]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[5]).fabricIndex, + 2U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[6]).groupId, 260U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[6]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[6]).fabricIndex, + 2U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[7]).groupId, 261U)); + VerifyOrReturn(CheckValue("GroupKeySetID", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[7]).groupKeySetID, + 419U)); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[7]).fabricIndex, + 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestAddGroup1_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRGroupsClusterAddGroupParams alloc] init]; + params.groupID = [NSNumber numberWithUnsignedShort:257U]; + params.groupName = @"Group #1"; + [cluster addGroupWithParams:params + completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 1 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + { + id actualValue = values.groupID; + VerifyOrReturn(CheckValue("GroupID", actualValue, 257U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestAddGroup2_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRGroupsClusterAddGroupParams alloc] init]; + params.groupID = [NSNumber numberWithUnsignedShort:258U]; + params.groupName = @"Group #2"; + [cluster addGroupWithParams:params + completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 2 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } { id actualValue = values.groupID; @@ -132593,7 +133055,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestAddGroup3_12() + CHIP_ERROR TestAddGroup3_20() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132625,7 +133087,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestAddGroup4_13() + CHIP_ERROR TestAddGroup4_21() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132657,7 +133119,39 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadGroupTable_14() + CHIP_ERROR TestAddGroup5_22() + { + + MTRBaseDevice * device = GetDevice("beta"); + __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRGroupsClusterAddGroupParams alloc] init]; + params.groupID = [NSNumber numberWithUnsignedShort:261U]; + params.groupName = @"Group #5"; + [cluster addGroupWithParams:params + completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 5 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + { + id actualValue = values.groupID; + VerifyOrReturn(CheckValue("GroupID", actualValue, 261U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadGroupTableFromAlpha_23() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132671,7 +133165,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { [cluster readAttributeGroupTableWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read GroupTable Error: %@", err); + NSLog(@"Read GroupTable from alpha Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -132746,7 +133240,259 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetRemove1_15() + CHIP_ERROR TestReadGroupTableFromAlphaWithoutFabricFiltering_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = false; + [cluster + readAttributeGroupTableWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read GroupTable from alpha without fabric filtering Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GroupTable", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupId, 257U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[0]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName, + @"Group #1")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupId, 258U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[1]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupName, + @"Group #2")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[2]).groupId, 259U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[2]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[2]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[2]).groupName, + @"Group #3")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[2]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[3]).groupId, 260U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[3]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[3]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[3]).groupName, + @"Group #4")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[3]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[4]).groupId, 261U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[4]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[4]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[4]).groupName, + @"Group #5")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[4]).fabricIndex, + 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadGroupTableFromBeta_25() + { + + MTRBaseDevice * device = GetDevice("beta"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeGroupTableWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read GroupTable from beta Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GroupTable", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupId, 261U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[0]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName, + @"Group #5")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).fabricIndex, + 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadGroupTableFromBetaWithoutFabricFiltering_26() + { + + MTRBaseDevice * device = GetDevice("beta"); + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = false; + [cluster + readAttributeGroupTableWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read GroupTable from beta without fabric filtering Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GroupTable", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupId, 257U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[0]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName, + @"Group #1")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupId, 258U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[1]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupName, + @"Group #2")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[2]).groupId, 259U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[2]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[2]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[2]).groupName, + @"Group #3")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[2]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[3]).groupId, 260U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[3]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[3]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[3]).groupName, + @"Group #4")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[3]).fabricIndex, + 1U)); + VerifyOrReturn(CheckValue("GroupId", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[4]).groupId, 261U)); + VerifyOrReturn(CheckValue("Endpoints", + [((MTRGroupKeyManagementClusterGroupInfoMapStruct *) + actualValue[4]).endpoints count], + static_cast(1))); + VerifyOrReturn(CheckValue("", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[4]).endpoints[0], + 1U)); + VerifyOrReturn(CheckValueAsString("GroupName", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[4]).groupName, + @"Group #5")); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[4]).fabricIndex, + 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestKeySetRemove1_27() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132769,7 +133515,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetReadRemoved_16() + CHIP_ERROR TestKeySetReadRemoved_28() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132796,7 +133542,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetReadNotRemoved_17() + CHIP_ERROR TestKeySetReadNotRemoved_29() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132847,7 +133593,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveGroup1_18() + CHIP_ERROR TestRemoveGroup1_30() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132878,7 +133624,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadGroupTable2_19() + CHIP_ERROR TestReadGroupTable2_31() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132952,7 +133698,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveAll_20() + CHIP_ERROR TestRemoveAll_32() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132970,7 +133716,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadGroupTable3_21() + CHIP_ERROR TestReadGroupTable3_33() { MTRBaseDevice * device = GetDevice("alpha"); @@ -132999,7 +133745,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetRemove2_22() + CHIP_ERROR TestKeySetRemove2_34() { MTRBaseDevice * device = GetDevice("alpha"); @@ -133022,7 +133768,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetReadAlsoRemoved_23() + CHIP_ERROR TestKeySetReadAlsoRemoved_35() { MTRBaseDevice * device = GetDevice("alpha"); @@ -133049,7 +133795,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetWrite1_24() + CHIP_ERROR TestKeySetWrite1_36() { MTRBaseDevice * device = GetDevice("alpha"); @@ -133089,7 +133835,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestKeySetWrite2_25() + CHIP_ERROR TestKeySetWrite2_37() { MTRBaseDevice * device = GetDevice("alpha"); @@ -133129,7 +133875,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMapGroup1AndGroup2ToKeySet1AndGroup2ToKeySet2_26() + CHIP_ERROR TestMapGroup1AndGroup2ToKeySet1AndGroup2ToKeySet2_38() { MTRBaseDevice * device = GetDevice("alpha"); @@ -133170,7 +133916,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveKeyset1_27() + CHIP_ERROR TestRemoveKeyset1_39() { MTRBaseDevice * device = GetDevice("alpha"); @@ -133193,7 +133939,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThVerifiesGroupKeyMapEntriesForKeySet1HaveBeenRemoved_28() + CHIP_ERROR TestThVerifiesGroupKeyMapEntriesForKeySet1HaveBeenRemoved_40() { MTRBaseDevice * device = GetDevice("alpha"); @@ -133231,7 +133977,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRemoveKeyset2_29() + CHIP_ERROR TestRemoveKeyset2_41() { MTRBaseDevice * device = GetDevice("alpha"); @@ -133254,7 +134000,7 @@ class TestGroupKeyManagementCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThVerifiesGroupKeyMapEntriesForKeySet2HaveBeenRemoved_30() + CHIP_ERROR TestThVerifiesGroupKeyMapEntriesForKeySet2HaveBeenRemoved_42() { MTRBaseDevice * device = GetDevice("alpha");