diff --git a/src/python_testing/modebase_cluster_check.py b/src/python_testing/modebase_cluster_check.py index 9db6e308a57155..f652395a6ef969 100644 --- a/src/python_testing/modebase_cluster_check.py +++ b/src/python_testing/modebase_cluster_check.py @@ -95,6 +95,7 @@ def check_tags_in_lists(self, supported_modes, required_tags=None): This function evaluates the ModeTags of each ModeOptionStruct: - Should have at least one tag. + - There are no duplicates in ModeTag list. - Should be maximum 16bits in size. - Should be a Mfg tag or one of the supported ones (either common or specific). - Should have at least one common or specific tag. @@ -110,7 +111,12 @@ def check_tags_in_lists(self, supported_modes, required_tags=None): if len(mode_option_struct.modeTags) == 0: asserts.fail("The ModeTags field should have at least one entry.") - # Check each ModelTag + # There are no duplicates + tag_values = [tag.value for tag in mode_option_struct.modeTags] + if len(tag_values) != len(set(tag_values)): + asserts.fail(f"ModeTags contain duplicates in mode {mode_option_struct.mode}: {tag_values}.") + + # Check each ModeTag at_least_one_common_or_derived = False for tag in mode_option_struct.modeTags: # Value should not larger than 16bits