From eb2f8f6ca95c181577415bc4b3e7cc240d5b2edd Mon Sep 17 00:00:00 2001 From: C Freeman Date: Sat, 4 Nov 2023 22:37:14 -0400 Subject: [PATCH] python conformance test: Add flags for provisional and in-progress (#30189) * Add flags for provisional and in-progress Also remove extra print * Add the CI weirdness as well * Remove extra print --- .../TC_DeviceBasicComposition.py | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index 21fdcf914a2906..2288c7c5a4b596 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -1013,13 +1013,26 @@ def conformance_str(conformance: Callable, feature_map: uint, feature_dict: dict return f'Conformance: {str(conformance)}, implemented features: {",".join(codes)}' + ignore_in_progress = self.user_params.get("ignore_in_progress", False) + is_ci = self.check_pics('PICS_SDK_CI_ONLY') + + ignore_attributes: dict[int, list[int]] = {} + if ignore_in_progress: + # This is a manually curated list of attributes that are in-progress in the SDK, but have landed in the spec + in_progress_attributes = {Clusters.BasicInformation.id: [0x15, 0x016]} + ignore_attributes.update(in_progress_attributes) + + if is_ci: + # The network commissioning clusters on the CI select the features on the fly and end up non-conformant + # on these attributes. Production devices should not. + ci_ignore_attributes = {Clusters.NetworkCommissioning.id: [ + Clusters.NetworkCommissioning.Attributes.ScanMaxTimeSeconds.attribute_id, Clusters.NetworkCommissioning.Attributes.ConnectMaxTimeSeconds.attribute_id]} + ignore_attributes.update(ci_ignore_attributes) + success = True - # TODO: provisional needs to be an input parameter - allow_provisional = True + allow_provisional = self.user_params.get("allow_provisional", False) clusters, problems = build_xml_clusters() self.problems = self.problems + problems - for id in sorted(list(clusters.keys())): - print(f'{id} 0x{id:02x}: {clusters[id].name}') for endpoint_id, endpoint in self.endpoints_tlv.items(): for cluster_id, cluster in endpoint.items(): if cluster_id not in clusters.keys(): @@ -1059,6 +1072,8 @@ def conformance_str(conformance: Callable, feature_map: uint, feature_dict: dict # Attribute conformance checking for attribute_id, attribute in cluster.items(): + if cluster_id in ignore_attributes and attribute_id in ignore_attributes[cluster_id]: + continue location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=attribute_id) if attribute_id not in clusters[cluster_id].attributes.keys(): # TODO: Consolidate the range checks with IDM-10.1 once that lands @@ -1076,6 +1091,8 @@ def conformance_str(conformance: Callable, feature_map: uint, feature_dict: dict problem=f'Attribute 0x{attribute_id:02x} is included, but is disallowed by conformance. {conformance_str(xml_attribute.conformance, feature_map, clusters[cluster_id].features)}') success = False for attribute_id, xml_attribute in clusters[cluster_id].attributes.items(): + if cluster_id in ignore_attributes and attribute_id in ignore_attributes[cluster_id]: + continue conformance_decision = xml_attribute.conformance(feature_map, attribute_list, all_command_list) if conformance_decision == ConformanceDecision.MANDATORY and attribute_id not in cluster.keys(): location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=attribute_id)