Skip to content

Commit

Permalink
Merge 6edd499 into 2338544
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille authored Nov 7, 2023
2 parents 2338544 + 6edd499 commit 1094016
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
28 changes: 28 additions & 0 deletions src/python_testing/TC_DeviceBasicComposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,34 @@ def check_spec_conformance_for_commands(command_type: CommandType) -> bool:
# self.fail_current_test("Problems with conformance")
logging.error("Problems found with conformance, this should turn into a test failure once #29812 is resolved")

def test_IDM_10_3(self):
# TODO: move to class setup
success = True
clusters, problems = build_xml_clusters()
self.problems = self.problems + problems
for endpoint_id, endpoint in self.endpoints_tlv.items():
for cluster_id, cluster in endpoint.items():
if cluster_id not in clusters.keys():
if (cluster_id & 0xFFFF_0000) != 0:
# manufacturer cluster
continue
location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id)
# TODO: update this from a warning once we have all the data
self.record_warning(self.get_test_name(), location=location,
problem='Standard cluster found on device, but is not present in spec data')
continue
if int(clusters[cluster_id].revision) != cluster[CLUSTER_REVISION_ID]:
location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id,
attribute_id=CLUSTER_REVISION_ID)
self.record_error(self.get_test_name(
), location=location, problem=f'Revision found on cluster ({cluster[CLUSTER_REVISION_ID]}) does not match revision listed in the spec ({clusters[cluster_id].revision})')
success = False
if not success:
# TODO: Right now, we have failures in all-cluster, so we can't fail this test and keep it in CI. For now, just log.
# Issue tracking: #30210
# self.fail_current_test("Problems with cluster revision on at least one cluster")
logging.error('Problems with cluster revision on at least one cluster')


if __name__ == "__main__":
default_matter_test_main()
6 changes: 5 additions & 1 deletion src/python_testing/spec_parsing_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ def parse_events(self) -> dict[uint, XmlAttribute]:
return events

def create_cluster(self) -> XmlCluster:
return XmlCluster(revision=self._cluster.attrib['revision'], derived=self._derived,
try:
revision = int(self._cluster.attrib['revision'], 0)
except ValueError:
revision = 0
return XmlCluster(revision=revision, derived=self._derived,
name=self._name, feature_map=self.params.feature_map,
attribute_map=self.params.attribute_map, command_map=self.params.command_map,
features=self.parse_features(),
Expand Down

0 comments on commit 1094016

Please sign in to comment.