diff --git a/examples/chip-tool/templates/tests/commands.zapt b/examples/chip-tool/templates/tests/commands.zapt index 34e80ddfb44843..acafcaa626f3dc 100644 --- a/examples/chip-tool/templates/tests/commands.zapt +++ b/examples/chip-tool/templates/tests/commands.zapt @@ -36,6 +36,18 @@ public: } }; +class PythonRunnerOnlyTestList : public Command +{ +public: + PythonRunnerOnlyTestList() : Command("list-python-runner-only") {}; + CHIP_ERROR Run() override + { + {{#chip_tests "../../../../src/app/tests/suites/pythonRunnerOnlyTests.json" includeAllClusters=true}}printf("{{filename}}\n");{{/chip_tests}} + + return CHIP_NO_ERROR; + } +}; + {{>test_cluster tests="../../../../src/app/tests/suites/ciTests.json" credsIssuerConfigArg=true needsWaitDuration=true}} {{>test_cluster tests="../../../../src/app/tests/suites/manualTests.json" credsIssuerConfigArg=true needsWaitDuration=true}} @@ -49,6 +61,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds #if CONFIG_ENABLE_YAML_TESTS make_unique(), make_unique(), + make_unique(), {{#chip_tests "../../../../src/app/tests/suites/ciTests.json" includeAllClusters=true}} make_unique<{{filename}}Suite>(credsIssuerConfig), {{/chip_tests}} diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 4e5390495bdac5..94c17c1706f15e 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -185,19 +185,23 @@ def target_for_name(name: str): return TestTarget.ALL_CLUSTERS -def tests_with_command(chip_tool: str, is_manual: bool): +def tests_with_command(chip_tool: str, is_manual: bool, is_chip_tool_python_only: bool = False): """Executes `chip_tool` binary to see what tests are available, using cmd to get the list. """ cmd = "list" if is_manual: cmd += "-manual" + elif is_chip_tool_python_only: + cmd += "-python-runner-only" result = subprocess.run([chip_tool, "tests", cmd], capture_output=True) test_tags = set() if is_manual: test_tags.add(TestTag.MANUAL) + if is_chip_tool_python_only: + test_tags.add(TestTag.CHIP_TOOL_PYTHON_ONLY) in_development_tests = [s.replace(".yaml", "") for s in _GetInDevelopmentTests()] @@ -260,6 +264,9 @@ def AllChipToolTests(chip_tool: str): for test in tests_with_command(chip_tool, is_manual=True): yield test + for test in tests_with_command(chip_tool, is_manual=False, is_chip_tool_python_only=True): + yield test + __all__ = [ "TestTarget", diff --git a/scripts/tests/chiptest/test_definition.py b/scripts/tests/chiptest/test_definition.py index 5009ad90109dae..08f97c98a2ea4e 100644 --- a/scripts/tests/chiptest/test_definition.py +++ b/scripts/tests/chiptest/test_definition.py @@ -217,6 +217,7 @@ class TestTag(Enum): SLOW = auto() # test uses Sleep and is generally slow (>=10s is a typical threshold) FLAKY = auto() # test is considered flaky (usually a bug/time dependent issue) IN_DEVELOPMENT = auto() # test may not pass or undergoes changes + CHIP_TOOL_PYTHON_ONLY = auto() # test uses YAML features only supported by the CHIP_TOOL_PYTHON runner. def to_s(self): for (k, v) in TestTag.__members__.items(): diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index 53ce7da5d07a01..7493539e2c2e4c 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -174,6 +174,9 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob, TestTag.FLAKY, } + if runtime != TestRunTime.CHIP_TOOL_PYTHON: + exclude_tags.add(TestTag.CHIP_TOOL_PYTHON_ONLY) + if 'all' not in target: tests = [] for name in target: diff --git a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml index cc69380fa16796..11d190c78738d6 100644 --- a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml +++ b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml @@ -74,30 +74,29 @@ tests: constraints: minValue: 3 - # TODO(#28396): Re-enabled when CI wouldn't break on this syntax - # - # command: "readAttribute" - # attribute: "ClusterRevision" - # response: - # saveAs: ClusterRevisionValue - # constraints: - # minValue: 1 - # maxValue: 2 - # type: int16u - - # - label: "Creates a new variable to hold if the cluster revision is == 2" - # cluster: EqualityCommands - # command: UnsignedNumberEquals - # arguments: - # values: - # - name: Value1 - # value: ClusterRevisionValue - # - name: Value2 - # value: 2 - # response: - # - values: - # - name: Equals - # saveAs: ClusterIsRevision2 + - label: "Read the ClusterRevision attribute" + command: "readAttribute" + attribute: "ClusterRevision" + response: + saveAs: ClusterRevisionValue + constraints: + minValue: 1 + maxValue: 2 + type: int16u + + - label: "Creates a new variable to hold if the cluster revision is == 2" + cluster: EqualityCommands + command: UnsignedNumberEquals + arguments: + values: + - name: Value1 + value: ClusterRevisionValue + - name: Value2 + value: 2 + response: + - values: + - name: Equals + saveAs: ClusterIsRevision2 ########### KeySetWrite Epoch0 field validations - label: "KeySetWrite with EpochKey0 null fails INVALID_COMMAND" @@ -161,7 +160,7 @@ tests: - label: "KeySetWrite with EpochKey0 with length 1 != 16 fails with CONSTRAINT_ERROR" - # runIf: ClusterIsRevision2 + runIf: ClusterIsRevision2 command: "KeySetWrite" arguments: values: @@ -183,7 +182,7 @@ tests: - label: "KeySetWrite with EpochKey0 with length 0 != 16 fails with CONSTRAINT_ERROR" - # runIf: ClusterIsRevision2 + runIf: ClusterIsRevision2 command: "KeySetWrite" arguments: values: @@ -204,7 +203,7 @@ tests: ########### KeySetWrite Epoch1 field validations - label: "KeySetWrite with EpochStartTime1 null fails INVALID_COMMAND" - # runIf: ClusterIsRevision2 + runIf: ClusterIsRevision2 command: "KeySetWrite" arguments: values: @@ -245,7 +244,7 @@ tests: - label: "KeySetWrite with EpochKey1 with length 1 != 16 fails with CONSTRAINT_ERROR" - # runIf: ClusterIsRevision2 + runIf: ClusterIsRevision2 command: "KeySetWrite" arguments: values: @@ -267,7 +266,7 @@ tests: - label: "KeySetWrite with EpochKey1 with length 0 != 16 fails with CONSTRAINT_ERROR" - # runIf: ClusterIsRevision2 + runIf: ClusterIsRevision2 command: "KeySetWrite" arguments: values: @@ -310,7 +309,7 @@ tests: ########### KeySetWrite Epoch2 field validations - label: "KeySetWrite with EpochStartTime2 null fails INVALID_COMMAND" command: "KeySetWrite" - # runIf: ClusterIsRevision2 + runIf: ClusterIsRevision2 arguments: values: - name: "GroupKeySet" @@ -350,7 +349,7 @@ tests: - label: "KeySetWrite with EpochKey2 with length 1 != 16 fails with CONSTRAINT_ERROR" - # runIf: ClusterIsRevision2 + runIf: ClusterIsRevision2 command: "KeySetWrite" arguments: values: @@ -372,7 +371,7 @@ tests: - label: "KeySetWrite with EpochKey2 with length 0 != 16 fails with CONSTRAINT_ERROR" - # runIf: ClusterIsRevision2 + runIf: ClusterIsRevision2 command: "KeySetWrite" arguments: values: diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 7db3d988af0d3b..30f793e64c6f46 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -297,7 +297,6 @@ "Groups": [ "TestGroupMessaging", "TestGroupsCluster", - "TestGroupKeyManagementCluster", "Test_TC_G_1_1", "Test_TC_G_2_1" ], diff --git a/src/app/tests/suites/pythonRunnerOnlyTests.json b/src/app/tests/suites/pythonRunnerOnlyTests.json new file mode 100644 index 00000000000000..d37726c21bfd22 --- /dev/null +++ b/src/app/tests/suites/pythonRunnerOnlyTests.json @@ -0,0 +1,4 @@ +{ + "Groups": ["TestGroupKeyManagementCluster"], + "collection": ["Groups"] +} diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index d157cf5183082c..986020bfc6074d 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -319,7 +319,6 @@ class TestList : public Command printf("Test_TC_DRLK_2_12\n"); printf("TestGroupMessaging\n"); printf("TestGroupsCluster\n"); - printf("TestGroupKeyManagementCluster\n"); printf("Test_TC_G_1_1\n"); printf("Test_TC_G_2_1\n"); printf("TestActivatedCarbonFilterMonitoring\n"); @@ -657,6 +656,18 @@ class ManualTestList : public Command } }; +class PythonRunnerOnlyTestList : public Command +{ +public: + PythonRunnerOnlyTestList() : Command("list-python-runner-only"){}; + CHIP_ERROR Run() override + { + printf("TestGroupKeyManagementCluster\n"); + + return CHIP_NO_ERROR; + } +}; + class TestAccessControlClusterSuite : public TestCommand { public: @@ -113400,2031 +113411,6 @@ class TestGroupsClusterSuite : public TestCommand } }; -class TestGroupKeyManagementClusterSuite : public TestCommand -{ -public: - TestGroupKeyManagementClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("TestGroupKeyManagementCluster", 64, 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); - } - - ~TestGroupKeyManagementClusterSuite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mPayload; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - 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; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 4U)); - } - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 3U)); - } - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 25: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 26: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("groupKeySet.groupKeySetID", value.groupKeySet.groupKeySetID, 417U)); - VerifyOrReturn(CheckValue("groupKeySet.groupKeySecurityPolicy", value.groupKeySet.groupKeySecurityPolicy, 0U)); - VerifyOrReturn(CheckValueNull("groupKeySet.epochKey0", value.groupKeySet.epochKey0)); - VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime0", value.groupKeySet.epochStartTime0)); - VerifyOrReturn( - CheckValue("groupKeySet.epochStartTime0.Value()", value.groupKeySet.epochStartTime0.Value(), 1110000ULL)); - VerifyOrReturn(CheckValueNull("groupKeySet.epochKey1", value.groupKeySet.epochKey1)); - VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime1", value.groupKeySet.epochStartTime1)); - VerifyOrReturn( - CheckValue("groupKeySet.epochStartTime1.Value()", value.groupKeySet.epochStartTime1.Value(), 1110001ULL)); - VerifyOrReturn(CheckValueNull("groupKeySet.epochKey2", value.groupKeySet.epochKey2)); - VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime2", value.groupKeySet.epochStartTime2)); - VerifyOrReturn( - CheckValue("groupKeySet.epochStartTime2.Value()", value.groupKeySet.epochStartTime2.Value(), 1110002ULL)); - } - break; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintContains("value", value.groupKeySetIDs, 417U)); - VerifyOrReturn(CheckConstraintContains("value", value.groupKeySetIDs, 418U)); - VerifyOrReturn(CheckConstraintContains("value", value.groupKeySetIDs, 0U)); - } - break; - case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED)); - break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - 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)); - { - 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(CheckNoMoreListItems("groupKeyMap", iter_0, 4)); - } - } - break; - case 34: - 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 35: - 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 36: - 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 37: - 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, 257U)); - } - break; - case 38: - 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, 258U)); - } - break; - case 39: - 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, 259U)); - } - break; - case 40: - 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, 260U)); - } - break; - case 41: - 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 42: - 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(CheckNoMoreListItems("groupTable", iter_0, 4)); - } - } - break; - case 43: - 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 44: - 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 45: - 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 46: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 47: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); - break; - case 48: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("groupKeySet.groupKeySetID", value.groupKeySet.groupKeySetID, 418U)); - VerifyOrReturn(CheckValue("groupKeySet.groupKeySecurityPolicy", value.groupKeySet.groupKeySecurityPolicy, 1U)); - VerifyOrReturn(CheckValueNull("groupKeySet.epochKey0", value.groupKeySet.epochKey0)); - VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime0", value.groupKeySet.epochStartTime0)); - VerifyOrReturn( - CheckValue("groupKeySet.epochStartTime0.Value()", value.groupKeySet.epochStartTime0.Value(), 2110000ULL)); - VerifyOrReturn(CheckValueNull("groupKeySet.epochKey1", value.groupKeySet.epochKey1)); - VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime1", value.groupKeySet.epochStartTime1)); - VerifyOrReturn( - CheckValue("groupKeySet.epochStartTime1.Value()", value.groupKeySet.epochStartTime1.Value(), 2110001ULL)); - VerifyOrReturn(CheckValueNull("groupKeySet.epochKey2", value.groupKeySet.epochKey2)); - VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime2", value.groupKeySet.epochStartTime2)); - VerifyOrReturn( - CheckValue("groupKeySet.epochStartTime2.Value()", value.groupKeySet.epochStartTime2.Value(), 2110002ULL)); - } - break; - case 49: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("groupKeySet.groupKeySetID", value.groupKeySet.groupKeySetID, 418U)); - VerifyOrReturn(CheckValue("groupKeySet.groupKeySecurityPolicy", value.groupKeySet.groupKeySecurityPolicy, 0U)); - VerifyOrReturn(CheckValueNull("groupKeySet.epochKey0", value.groupKeySet.epochKey0)); - VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime0", value.groupKeySet.epochStartTime0)); - VerifyOrReturn( - CheckValue("groupKeySet.epochStartTime0.Value()", value.groupKeySet.epochStartTime0.Value(), 2110000ULL)); - VerifyOrReturn(CheckValueNull("groupKeySet.epochKey1", value.groupKeySet.epochKey1)); - VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime1", value.groupKeySet.epochStartTime1)); - VerifyOrReturn( - CheckValue("groupKeySet.epochStartTime1.Value()", value.groupKeySet.epochStartTime1.Value(), 2110001ULL)); - VerifyOrReturn(CheckValueNull("groupKeySet.epochKey2", value.groupKeySet.epochKey2)); - VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime2", value.groupKeySet.epochStartTime2)); - VerifyOrReturn( - CheckValue("groupKeySet.epochStartTime2.Value()", value.groupKeySet.epochStartTime2.Value(), 2110002ULL)); - } - break; - case 50: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("status", value.status, 0U)); - VerifyOrReturn(CheckValue("groupID", value.groupID, 257U)); - } - break; - case 51: - 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, 258U)); - { - 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 #2", 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, 259U)); - { - 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 #3", 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, 260U)); - { - 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 #4", 8))); - VerifyOrReturn(CheckValue("groupTable[2].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); - VerifyOrReturn(CheckNoMoreListItems("groupTable", iter_0, 3)); - } - } - break; - case 52: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 53: - 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(CheckNoMoreListItems("groupTable", iter_0, 0)); - } - } - break; - case 54: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 55: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); - break; - case 56: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 57: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 58: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 59: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 60: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 61: - 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, 418U)); - VerifyOrReturn(CheckValue("groupKeyMap[0].fabricIndex", iter_0.GetValue().fabricIndex, 1U)); - VerifyOrReturn(CheckNoMoreListItems("groupKeyMap", iter_0, 1)); - } - } - break; - case 62: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 63: - 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(CheckNoMoreListItems("groupKeyMap", iter_0, 0)); - } - } - break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "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, "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 5: { - LogStep(5, "Read maxGroupKeysPerFabric"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::Id, true, chip::NullOptional); - } - case 6: { - LogStep(6, "KeySetWrite with EpochKey0 null fails INVALID_COMMAND"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNull(); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNull(); - value.groupKeySet.epochStartTime1.SetNull(); - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 7: { - LogStep(7, "KeySetWrite with EpochStartTime0 null fails INVALID_COMMAND"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNull(); - value.groupKeySet.epochKey1.SetNull(); - value.groupKeySet.epochStartTime1.SetNull(); - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 8: { - LogStep(8, "KeySetWrite with EpochStartTime0 set to zero fails INVALID_COMMAND"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 0ULL; - value.groupKeySet.epochKey1.SetNull(); - value.groupKeySet.epochStartTime1.SetNull(); - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 9: { - LogStep(9, "KeySetWrite with EpochKey0 with length 1 != 16 fails with CONSTRAINT_ERROR"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = - chip::ByteSpan(chip::Uint8::from_const_char("\240garbage: not in length on purpose"), 1); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1ULL; - value.groupKeySet.epochKey1.SetNull(); - value.groupKeySet.epochStartTime1.SetNull(); - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 10: { - LogStep(10, "KeySetWrite with EpochKey0 with length 0 != 16 fails with CONSTRAINT_ERROR"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = - chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1ULL; - value.groupKeySet.epochKey1.SetNull(); - value.groupKeySet.epochStartTime1.SetNull(); - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 11: { - LogStep(11, "KeySetWrite with EpochStartTime1 null fails INVALID_COMMAND"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNull(); - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 12: { - LogStep(12, "KeySetWrite with EpochKey1 null fails INVALID_COMMAND"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNull(); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 13: { - LogStep(13, "KeySetWrite with EpochKey1 with length 1 != 16 fails with CONSTRAINT_ERROR"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = - chip::ByteSpan(chip::Uint8::from_const_char("\260garbage: not in length on purpose"), 1); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 14: { - LogStep(14, "KeySetWrite with EpochKey1 with length 0 != 16 fails with CONSTRAINT_ERROR"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = - chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 15: { - LogStep(15, "KeySetWrite with EpochStartTime1 not later than EpochStart0 fails with INVALID_COMMAND"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1ULL; - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 16: { - LogStep(16, "KeySetWrite with EpochStartTime2 null fails INVALID_COMMAND"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNonNull(); - value.groupKeySet.epochKey2.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime2.SetNull(); - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 17: { - LogStep(17, "KeySetWrite with EpochKey2 null fails INVALID_COMMAND"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNull(); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 1110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 18: { - LogStep(18, "KeySetWrite with EpochKey2 with length 1 != 16 fails with CONSTRAINT_ERROR"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNonNull(); - value.groupKeySet.epochKey2.Value() = - chip::ByteSpan(chip::Uint8::from_const_char("\300garbage: not in length on purpose"), 1); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 1110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 19: { - LogStep(19, "KeySetWrite with EpochKey2 with length 0 != 16 fails with CONSTRAINT_ERROR"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNonNull(); - value.groupKeySet.epochKey2.Value() = - chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 1110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 20: { - LogStep(20, "KeySetWrite with EpochStartTime2 not later than EpochStart1 fails with INVALID_COMMAND"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNonNull(); - value.groupKeySet.epochKey2.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 100ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 21: { - LogStep(21, "KeySet Write 1"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNonNull(); - value.groupKeySet.epochKey2.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 1110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 22: { - LogStep(22, "KeySet Write 2 CacheAndSync"); - VerifyOrDo(!ShouldSkip("GRPKEY.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 418U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(1); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337garbage: 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( - "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357garbage: 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( - "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 2110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 23: { - LogStep(23, "KeySet Write 2 TrustFirst"); - VerifyOrDo(!ShouldSkip("!GRPKEY.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 418U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337garbage: 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( - "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357garbage: 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( - "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 2110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 24: { - LogStep(24, "KeySet Write 3 CacheAndSync"); - VerifyOrDo(!ShouldSkip("GRPKEY.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - 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 25: { - LogStep(25, "KeySet Write 3 TrustFirst"); - VerifyOrDo(!ShouldSkip("!GRPKEY.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 419U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - 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 26: { - LogStep(26, "KeySet Read"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; - value.groupKeySetID = 417U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Commands::KeySetRead::Id, - value, chip::NullOptional - - ); - } - case 27: { - LogStep(27, "KeySet Read All Indices"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetReadAllIndices::Id, value, chip::NullOptional - - ); - } - case 28: { - LogStep(28, "Write one keyset too many when already full"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 546U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\321\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 3110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\341\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 3110001ULL; - value.groupKeySet.epochKey2.SetNonNull(); - value.groupKeySet.epochKey2.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\361\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 3110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 29: { - LogStep(29, "Write Group Keys (invalid)"); - ListFreer listFreer; - chip::app::DataModel::List value; - - { - auto * listHolder_0 = new ListHolder(1); - listFreer.add(listHolder_0); - - listHolder_0->mList[0].groupId = 258U; - listHolder_0->mList[0].groupKeySetID = 0U; - listHolder_0->mList[0].fabricIndex = 1U; - - value = chip::app::DataModel::List( - listHolder_0->mList, 1); - } - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); - } - case 30: { - LogStep(30, "Write Group Keys (too many)"); - ListFreer listFreer; - chip::app::DataModel::List value; - - { - auto * listHolder_0 = new ListHolder(14); - listFreer.add(listHolder_0); - - listHolder_0->mList[0].groupId = 257U; - listHolder_0->mList[0].groupKeySetID = 417U; - listHolder_0->mList[0].fabricIndex = 1U; - - listHolder_0->mList[1].groupId = 257U; - listHolder_0->mList[1].groupKeySetID = 418U; - listHolder_0->mList[1].fabricIndex = 1U; - - listHolder_0->mList[2].groupId = 258U; - listHolder_0->mList[2].groupKeySetID = 417U; - listHolder_0->mList[2].fabricIndex = 1U; - - listHolder_0->mList[3].groupId = 258U; - listHolder_0->mList[3].groupKeySetID = 418U; - listHolder_0->mList[3].fabricIndex = 1U; - - listHolder_0->mList[4].groupId = 259U; - listHolder_0->mList[4].groupKeySetID = 417U; - listHolder_0->mList[4].fabricIndex = 1U; - - listHolder_0->mList[5].groupId = 259U; - listHolder_0->mList[5].groupKeySetID = 418U; - listHolder_0->mList[5].fabricIndex = 1U; - - listHolder_0->mList[6].groupId = 260U; - listHolder_0->mList[6].groupKeySetID = 417U; - listHolder_0->mList[6].fabricIndex = 1U; - - listHolder_0->mList[7].groupId = 260U; - listHolder_0->mList[7].groupKeySetID = 418U; - listHolder_0->mList[7].fabricIndex = 1U; - - listHolder_0->mList[8].groupId = 261U; - listHolder_0->mList[8].groupKeySetID = 417U; - listHolder_0->mList[8].fabricIndex = 1U; - - listHolder_0->mList[9].groupId = 261U; - listHolder_0->mList[9].groupKeySetID = 418U; - listHolder_0->mList[9].fabricIndex = 1U; - - listHolder_0->mList[10].groupId = 262U; - listHolder_0->mList[10].groupKeySetID = 417U; - listHolder_0->mList[10].fabricIndex = 1U; - - listHolder_0->mList[11].groupId = 262U; - listHolder_0->mList[11].groupKeySetID = 418U; - listHolder_0->mList[11].fabricIndex = 1U; - - listHolder_0->mList[12].groupId = 263U; - listHolder_0->mList[12].groupKeySetID = 417U; - listHolder_0->mList[12].fabricIndex = 1U; - - listHolder_0->mList[13].groupId = 263U; - listHolder_0->mList[13].groupKeySetID = 418U; - listHolder_0->mList[13].fabricIndex = 1U; - - value = chip::app::DataModel::List( - listHolder_0->mList, 14); - } - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); - } - case 31: { - LogStep(31, "Write Group Keys on alpha"); - ListFreer listFreer; - chip::app::DataModel::List value; - - { - auto * listHolder_0 = new ListHolder(4); - listFreer.add(listHolder_0); - - listHolder_0->mList[0].groupId = 257U; - listHolder_0->mList[0].groupKeySetID = 417U; - listHolder_0->mList[0].fabricIndex = 1U; - - listHolder_0->mList[1].groupId = 258U; - listHolder_0->mList[1].groupKeySetID = 418U; - listHolder_0->mList[1].fabricIndex = 1U; - - listHolder_0->mList[2].groupId = 259U; - listHolder_0->mList[2].groupKeySetID = 417U; - listHolder_0->mList[2].fabricIndex = 1U; - - listHolder_0->mList[3].groupId = 260U; - listHolder_0->mList[3].groupKeySetID = 418U; - listHolder_0->mList[3].fabricIndex = 1U; - - value = chip::app::DataModel::List( - listHolder_0->mList, 4); - } - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); - } - case 32: { - LogStep(32, "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 33: { - LogStep(33, "Read Group Keys on alpha"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupKeyMap::Id, true, chip::NullOptional); - } - case 34: { - LogStep(34, "Read Group Keys on alpha without fabric filtering"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupKeyMap::Id, false, chip::NullOptional); - } - case 35: { - LogStep(35, "Read Group Keys on beta"); - return ReadAttribute(kIdentityBeta, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupKeyMap::Id, true, chip::NullOptional); - } - case 36: { - LogStep(36, "Read Group Keys on beta without fabric filtering"); - return ReadAttribute(kIdentityBeta, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupKeyMap::Id, false, chip::NullOptional); - } - case 37: { - LogStep(37, "Add Group 1"); - ListFreer listFreer; - chip::app::Clusters::Groups::Commands::AddGroup::Type value; - value.groupID = 257U; - value.groupName = chip::Span("Group #1garbage: not in length on purpose", 8); - return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional - - ); - } - case 38: { - LogStep(38, "Add Group 2"); - ListFreer listFreer; - chip::app::Clusters::Groups::Commands::AddGroup::Type value; - value.groupID = 258U; - value.groupName = chip::Span("Group #2garbage: not in length on purpose", 8); - return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional - - ); - } - case 39: { - LogStep(39, "Add Group 3"); - ListFreer listFreer; - chip::app::Clusters::Groups::Commands::AddGroup::Type value; - value.groupID = 259U; - value.groupName = chip::Span("Group #3garbage: not in length on purpose", 8); - return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional - - ); - } - case 40: { - LogStep(40, "Add Group 4"); - ListFreer listFreer; - chip::app::Clusters::Groups::Commands::AddGroup::Type value; - value.groupID = 260U; - value.groupName = chip::Span("Group #4garbage: not in length on purpose", 8); - return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional - - ); - } - case 41: { - LogStep(41, "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 42: { - LogStep(42, "Read GroupTable from alpha"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional); - } - case 43: { - LogStep(43, "Read GroupTable from alpha without fabric filtering"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupTable::Id, false, chip::NullOptional); - } - case 44: { - LogStep(44, "Read GroupTable from beta"); - return ReadAttribute(kIdentityBeta, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional); - } - case 45: { - LogStep(45, "Read GroupTable from beta without fabric filtering"); - return ReadAttribute(kIdentityBeta, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupTable::Id, false, chip::NullOptional); - } - case 46: { - LogStep(46, "KeySet Remove 1"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; - value.groupKeySetID = 417U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetRemove::Id, value, chip::NullOptional - - ); - } - case 47: { - LogStep(47, "KeySet Read (removed)"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; - value.groupKeySetID = 417U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Commands::KeySetRead::Id, - value, chip::NullOptional - - ); - } - case 48: { - LogStep(48, "KeySet Read (not removed) CacheAndSync"); - VerifyOrDo(!ShouldSkip("GRPKEY.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; - value.groupKeySetID = 418U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Commands::KeySetRead::Id, - value, chip::NullOptional - - ); - } - case 49: { - LogStep(49, "KeySet Read (not removed) TrustFirst"); - VerifyOrDo(!ShouldSkip("GRPKEY.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; - value.groupKeySetID = 418U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Commands::KeySetRead::Id, - value, chip::NullOptional - - ); - } - case 50: { - LogStep(50, "Remove Group 1"); - ListFreer listFreer; - chip::app::Clusters::Groups::Commands::RemoveGroup::Type value; - value.groupID = 257U; - return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveGroup::Id, value, - chip::NullOptional - - ); - } - case 51: { - LogStep(51, "Read GroupTable 2"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional); - } - case 52: { - LogStep(52, "Remove All"); - ListFreer listFreer; - chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveAllGroups::Id, value, - chip::NullOptional - - ); - } - case 53: { - LogStep(53, "Read GroupTable 3"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional); - } - case 54: { - LogStep(54, "KeySet Remove 2"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; - value.groupKeySetID = 418U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetRemove::Id, value, chip::NullOptional - - ); - } - case 55: { - LogStep(55, "KeySet Read (also removed)"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value; - value.groupKeySetID = 418U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Commands::KeySetRead::Id, - value, chip::NullOptional - - ); - } - case 56: { - LogStep(56, "KeySet Write 1"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 417U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime0.SetNonNull(); - value.groupKeySet.epochStartTime0.Value() = 1110000ULL; - value.groupKeySet.epochKey1.SetNonNull(); - value.groupKeySet.epochKey1.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime1.SetNonNull(); - value.groupKeySet.epochStartTime1.Value() = 1110001ULL; - value.groupKeySet.epochKey2.SetNonNull(); - value.groupKeySet.epochKey2.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 1110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 57: { - LogStep(57, "KeySet Write 2 CacheAndSync"); - VerifyOrDo(!ShouldSkip("GRPKEY.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 418U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(1); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337garbage: 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( - "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357garbage: 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( - "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 2110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 58: { - LogStep(58, "KeySet Write 2 TrustFirst"); - VerifyOrDo(!ShouldSkip("!GRPKEY.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value; - - value.groupKeySet.groupKeySetID = 418U; - value.groupKeySet.groupKeySecurityPolicy = - static_cast(0); - value.groupKeySet.epochKey0.SetNonNull(); - value.groupKeySet.epochKey0.Value() = chip::ByteSpan( - chip::Uint8::from_const_char( - "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337garbage: 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( - "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357garbage: 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( - "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377garbage: not in length on purpose"), - 16); - value.groupKeySet.epochStartTime2.SetNonNull(); - value.groupKeySet.epochStartTime2.Value() = 2110002ULL; - - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional - - ); - } - case 59: { - LogStep(59, "Map Group 1 and Group 2 to KeySet 1 and group 2 to KeySet 2"); - ListFreer listFreer; - chip::app::DataModel::List value; - - { - auto * listHolder_0 = new ListHolder(3); - listFreer.add(listHolder_0); - - listHolder_0->mList[0].groupId = 257U; - listHolder_0->mList[0].groupKeySetID = 417U; - listHolder_0->mList[0].fabricIndex = 1U; - - listHolder_0->mList[1].groupId = 258U; - listHolder_0->mList[1].groupKeySetID = 418U; - listHolder_0->mList[1].fabricIndex = 1U; - - listHolder_0->mList[2].groupId = 258U; - listHolder_0->mList[2].groupKeySetID = 417U; - listHolder_0->mList[2].fabricIndex = 1U; - - value = chip::app::DataModel::List( - listHolder_0->mList, 3); - } - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional); - } - case 60: { - LogStep(60, "Remove keyset 1"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; - value.groupKeySetID = 417U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetRemove::Id, value, chip::NullOptional - - ); - } - case 61: { - LogStep(61, "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 62: { - LogStep(62, "Remove keyset 2"); - ListFreer listFreer; - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value; - value.groupKeySetID = 418U; - return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Commands::KeySetRemove::Id, value, chip::NullOptional - - ); - } - case 63: { - LogStep(63, "TH verifies GroupKeyMap entries for KeySet 2 have been removed"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, - GroupKeyManagement::Attributes::GroupKeyMap::Id, true, chip::NullOptional); - } - } - return CHIP_NO_ERROR; - } -}; - class Test_TC_G_1_1Suite : public TestCommand { public: @@ -147164,6 +145150,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds #if CONFIG_ENABLE_YAML_TESTS make_unique(), make_unique(), + make_unique(), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -147448,7 +145435,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig),