Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python_testing: Improve TC_IDM_10_1 error msgs #35999

10 changes: 7 additions & 3 deletions src/python_testing/TC_DeviceBasicComposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ def check_no_duplicates(obj: Any) -> None:
raise ValueError(f"Value {str(obj)} contains duplicate values")


def is_test_vendor(id) -> bool:
return 0xFFF1_0000 <= id <= 0xFFF4_FFFF
soares-sergio marked this conversation as resolved.
Show resolved Hide resolved


class TC_DeviceBasicComposition(MatterBaseTest, BasicCompositionTests):
@async_test_body
async def setup_class(self):
Expand Down Expand Up @@ -472,12 +476,12 @@ class RequiredMandatoryAttribute:
for bad in bad_attrs:
location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=bad)
self.record_error(self.get_test_name(
), location=location, problem=f'Attribute with bad prefix {attribute_id} in cluster {cluster_id}', spec_location='Manufacturer Extensible Identifier (MEI)')
), location=location, problem=f'Attribute with bad prefix {hex(bad)[:6]} in cluster {cluster_id}' + (' (Test Vendor)' if is_test_vendor(bad) else ''), spec_location='Manufacturer Extensible Identifier (MEI)')
soares-sergio marked this conversation as resolved.
Show resolved Hide resolved
success = False
for bad in bad_cmds:
location = CommandPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, command_id=bad)
self.record_error(self.get_test_name(
), location=location, problem=f'Command with bad prefix {attribute_id} in cluster {cluster_id}', spec_location='Manufacturer Extensible Identifier (MEI)')
), location=location, problem=f'Command with bad prefix {hex(bad)[:6]} in cluster {cluster_id}' + (' (Test Vendor)' if is_test_vendor(bad) else ''), spec_location='Manufacturer Extensible Identifier(MEI)')
soares-sergio marked this conversation as resolved.
Show resolved Hide resolved
success = False

self.print_step(7, "Validate that none of the MEI global attribute IDs contain values outside of the allowed suffix range")
Expand Down Expand Up @@ -523,7 +527,7 @@ class RequiredMandatoryAttribute:
for bad in bad_clusters_ids:
location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=bad)
self.record_error(self.get_test_name(), location=location,
problem=f'Bad cluster id prefix {bad}', spec_location='Manufacturer Extensible Identifier (MEI)')
problem=f'Bad cluster id prefix {hex(bad)[:6]}' + (' (Test Vendor)' if is_test_vendor(bad) else ''), spec_location='Manufacturer Extensible Identifier (MEI)')
soares-sergio marked this conversation as resolved.
Show resolved Hide resolved
success = False

self.print_step(9, "Validate that all clusters in the standard range have a known cluster ID")
Expand Down
Loading