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: 6 additions & 4 deletions src/python_testing/TC_DeviceBasicComposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
from chip.clusters.ClusterObjects import ClusterAttributeDescriptor, ClusterObjectFieldDescriptor
from chip.interaction_model import InteractionModelError, Status
from chip.tlv import uint
from global_attribute_ids import GlobalAttributeIds
from global_attribute_ids import (GlobalAttributeIds, AttributeIdType, ClusterIdType, attribute_id_type, cluster_id_type)


from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep,
async_test_body, default_matter_test_main)
from mobly import asserts
Expand Down Expand Up @@ -472,12 +474,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 0x{bad:04x} in cluster 0x{cluster_id:08x}' + (' (Test Vendor)' if attribute_id_type(bad) == AttributeIdType.kTest else ''), spec_location='Manufacturer Extensible Identifier (MEI)')
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 0x{bad:04x} in cluster 0x{cluster_id:08x}', spec_location='Manufacturer Extensible Identifier(MEI)')
arkq 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 +525,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 0x{bad:04x}' + (' (Test Vendor)' if cluster_id_type(bad) == ClusterIdType.kTest else ''), spec_location='Manufacturer Extensible Identifier (MEI)')
success = False

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