|
18 | 18 | import glob
|
19 | 19 | import logging
|
20 | 20 | import os
|
| 21 | +import typing |
21 | 22 | import xml.etree.ElementTree as ElementTree
|
22 | 23 | from copy import deepcopy
|
23 | 24 | from dataclasses import dataclass
|
|
28 | 29 | from chip.tlv import uint
|
29 | 30 | from conformance_support import (DEPRECATE_CONFORM, DISALLOW_CONFORM, MANDATORY_CONFORM, OPTIONAL_CONFORM, OTHERWISE_CONFORM,
|
30 | 31 | PROVISIONAL_CONFORM, ConformanceDecision, ConformanceException, ConformanceParseParameters,
|
31 |
| - feature, or_operation, parse_callable_from_xml) |
| 32 | + feature, optional, or_operation, parse_callable_from_xml) |
32 | 33 | from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, EventPathLocation,
|
33 | 34 | FeaturePathLocation, ProblemNotice, ProblemSeverity)
|
34 | 35 |
|
@@ -296,6 +297,25 @@ def build_xml_clusters() -> tuple[list[XmlCluster], list[ProblemNotice]]:
|
296 | 297 | else:
|
297 | 298 | derived_clusters[name] = new
|
298 | 299 |
|
| 300 | + # There are a few clusters where the conformance columns are listed as desc. These clusters need specific, targeted tests |
| 301 | + # to properly assess conformance. Here, we list them as Optional to allow these for the general test. Targeted tests are described below. |
| 302 | + # Descriptor - TagList feature - this feature is mandated when the duplicate condition holds for the endpoint. It is tested in DESC-2.2 |
| 303 | + # Actions cluster - all commands - these need to be listed in the ActionsList attribute to be supported. |
| 304 | + # We do not currently have a test for this. Please see https://github.com/CHIP-Specifications/chip-test-plans/issues/3646. |
| 305 | + def remove_problem(location: typing.Union[CommandPathLocation, FeaturePathLocation]): |
| 306 | + nonlocal problems |
| 307 | + problems = [p for p in problems if p.location != location] |
| 308 | + |
| 309 | + descriptor_id = Clusters.Descriptor.id |
| 310 | + code = 'TAGLIST' |
| 311 | + mask = clusters[descriptor_id].feature_map[code] |
| 312 | + clusters[descriptor_id].features[mask].conformance = optional() |
| 313 | + remove_problem(FeaturePathLocation(endpoint_id=0, cluster_id=descriptor_id, feature_code=code)) |
| 314 | + action_id = Clusters.Actions.id |
| 315 | + for c in Clusters.ClusterObjects.ALL_ACCEPTED_COMMANDS[action_id]: |
| 316 | + clusters[action_id].accepted_commands[c].conformance = optional() |
| 317 | + remove_problem(CommandPathLocation(endpoint_id=0, cluster_id=action_id, command_id=c)) |
| 318 | + |
299 | 319 | # We have the information now about which clusters are derived, so we need to fix them up. Apply first the base cluster,
|
300 | 320 | # then add the specific cluster overtop
|
301 | 321 | for id, c in clusters.items():
|
|
0 commit comments