Skip to content

Commit

Permalink
TC-IDM-10.2: checks for non-spec clusters (project-chip#33695)
Browse files Browse the repository at this point in the history
* TC-IDM-10.2: checks for non-spec clusters

There are a number of clusters that appear in the spec adoc
but are ifdef'd. These were not caught by the original
provisional cluster checks.

The following do not appear in the codegen and will therefore
be caught in the IDM-10.1 test if they appear in cert
(check that all clusters in the standard range have known IDs).
These are therefore not included in the specific check.

0x0094 Water Heater Management
0x0095 Energy Price
0x009A Energy Calendar
0x009E Water Heater Mode
0x0450 Network Identity Management

The following DOES appear in the 1.3-SVE codegen and are therefore
checked explicitly:

0x0096 Demand Response and Load Control

The following appears in the master codegen, but is not included
in the 1.3-sve branch and will therefore fail the 10.1 test:
0x0451 WiFi Network Management

There are also some completely non-spec clusters that appear in the
codegen, but not in the spec at all. They appear to be zigbee only
clusters. These are added to the new checks:

0x0007 On/off Switch Configuration
0x000F Binary Input (Basic)
0x0103 Barrier Control
0x0B04 Electrical Measurement

In all cases, inclusion of these clusters on a device at cert SHOULD
cause a failure in the PICS checker test as there is no way to specify
these clusters in the PICS, but a definite check here is also beneficial.

* Restyled by autopep8

* Restyled by isort

* missed removing wifi in the test itself

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
cecille and restyled-commits committed Jun 12, 2024
1 parent 99dda3b commit 9f5bb58
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
37 changes: 19 additions & 18 deletions src/controller/python/chip/clusters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,32 @@
ApplicationBasic, ApplicationLauncher, AudioOutput, BallastConfiguration, BarrierControl, BasicInformation,
BinaryInputBasic, Binding, BooleanState, BooleanStateConfiguration, BridgedDeviceBasicInformation,
CarbonDioxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurement, Channel, ColorControl,
ContentControl, ContentLauncher, Descriptor, DeviceEnergyManagement, DeviceEnergyManagementMode,
DiagnosticLogs, DishwasherAlarm, DishwasherMode, DoorLock, ElectricalEnergyMeasurement, ElectricalMeasurement,
ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode, EnergyPreference, EthernetNetworkDiagnostics,
FanControl, FaultInjection, FixedLabel, FlowMeasurement, FormaldehydeConcentrationMeasurement,
GeneralCommissioning, GeneralDiagnostics, GroupKeyManagement, Groups, HepaFilterMonitoring, IcdManagement,
Identify, IlluminanceMeasurement, KeypadInput, LaundryDryerControls, LaundryWasherControls, LaundryWasherMode,
LevelControl, LocalizationConfiguration, LowPower, MediaInput, MediaPlayback, MicrowaveOvenControl,
MicrowaveOvenMode, ModeSelect, NetworkCommissioning, NitrogenDioxideConcentrationMeasurement,
OccupancySensing, OnOff, OnOffSwitchConfiguration, OperationalCredentials, OperationalState,
OtaSoftwareUpdateProvider, OtaSoftwareUpdateRequestor, OvenCavityOperationalState, OvenMode,
OzoneConcentrationMeasurement, Pm1ConcentrationMeasurement, Pm10ConcentrationMeasurement,
Pm25ConcentrationMeasurement, PowerSource, PowerSourceConfiguration, PowerTopology, PressureMeasurement,
ProxyConfiguration, ProxyDiscovery, ProxyValid, PulseWidthModulation, PumpConfigurationAndControl,
RadonConcentrationMeasurement, RefrigeratorAlarm, RefrigeratorAndTemperatureControlledCabinetMode,
RelativeHumidityMeasurement, RvcCleanMode, RvcOperationalState, RvcRunMode, ScenesManagement, SmokeCoAlarm,
SoftwareDiagnostics, Switch, TargetNavigator, TemperatureControl, TemperatureMeasurement, Thermostat,
ThermostatUserInterfaceConfiguration, ThreadNetworkDiagnostics, TimeFormatLocalization, TimeSynchronization,
ContentControl, ContentLauncher, DemandResponseLoadControl, Descriptor, DeviceEnergyManagement,
DeviceEnergyManagementMode, DiagnosticLogs, DishwasherAlarm, DishwasherMode, DoorLock,
ElectricalEnergyMeasurement, ElectricalMeasurement, ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode,
EnergyPreference, EthernetNetworkDiagnostics, FanControl, FaultInjection, FixedLabel, FlowMeasurement,
FormaldehydeConcentrationMeasurement, GeneralCommissioning, GeneralDiagnostics, GroupKeyManagement, Groups,
HepaFilterMonitoring, IcdManagement, Identify, IlluminanceMeasurement, KeypadInput, LaundryDryerControls,
LaundryWasherControls, LaundryWasherMode, LevelControl, LocalizationConfiguration, LowPower, MediaInput,
MediaPlayback, MicrowaveOvenControl, MicrowaveOvenMode, ModeSelect, NetworkCommissioning,
NitrogenDioxideConcentrationMeasurement, OccupancySensing, OnOff, OnOffSwitchConfiguration,
OperationalCredentials, OperationalState, OtaSoftwareUpdateProvider, OtaSoftwareUpdateRequestor,
OvenCavityOperationalState, OvenMode, OzoneConcentrationMeasurement, Pm1ConcentrationMeasurement,
Pm10ConcentrationMeasurement, Pm25ConcentrationMeasurement, PowerSource, PowerSourceConfiguration,
PowerTopology, PressureMeasurement, ProxyConfiguration, ProxyDiscovery, ProxyValid, PulseWidthModulation,
PumpConfigurationAndControl, RadonConcentrationMeasurement, RefrigeratorAlarm,
RefrigeratorAndTemperatureControlledCabinetMode, RelativeHumidityMeasurement, RvcCleanMode,
RvcOperationalState, RvcRunMode, ScenesManagement, SmokeCoAlarm, SoftwareDiagnostics, Switch, TargetNavigator,
TemperatureControl, TemperatureMeasurement, Thermostat, ThermostatUserInterfaceConfiguration,
ThreadNetworkDiagnostics, TimeFormatLocalization, TimeSynchronization,
TotalVolatileOrganicCompoundsConcentrationMeasurement, UnitLocalization, UnitTesting, UserLabel,
ValveConfigurationAndControl, WakeOnLan, WiFiNetworkDiagnostics, WindowCovering)

__all__ = [Attribute, CHIPClusters, Command, AccessControl, AccountLogin, Actions, ActivatedCarbonFilterMonitoring, AdministratorCommissioning, AirQuality,
ApplicationBasic, ApplicationLauncher, AudioOutput, BallastConfiguration, BarrierControl, BasicInformation,
BinaryInputBasic, Binding, BooleanState, BooleanStateConfiguration, BridgedDeviceBasicInformation, CarbonDioxideConcentrationMeasurement,
CarbonMonoxideConcentrationMeasurement, Channel,
ColorControl, ContentControl, ContentLauncher, Descriptor, DeviceEnergyManagementMode, DeviceEnergyManagement, DeviceEnergyManagementMode, DiagnosticLogs, DishwasherAlarm, DishwasherMode,
ColorControl, ContentControl, ContentLauncher, DemandResponseLoadControl, Descriptor, DeviceEnergyManagementMode, DeviceEnergyManagement, DeviceEnergyManagementMode, DiagnosticLogs, DishwasherAlarm, DishwasherMode,
DoorLock, ElectricalEnergyMeasurement, ElectricalMeasurement, ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode, EnergyPreference,
EthernetNetworkDiagnostics, FanControl, FaultInjection, FixedLabel, FlowMeasurement,
FormaldehydeConcentrationMeasurement, GeneralCommissioning, GeneralDiagnostics, GroupKeyManagement, Groups,
Expand Down
14 changes: 11 additions & 3 deletions src/python_testing/TC_DeviceConformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,20 @@ def record_warning(location, problem):
provisional_cluster_ids = [Clusters.ContentControl.id, Clusters.ScenesManagement.id, Clusters.BallastConfiguration.id,
Clusters.EnergyPreference.id, Clusters.DeviceEnergyManagement.id, Clusters.DeviceEnergyManagementMode.id, Clusters.PulseWidthModulation.id,
Clusters.ProxyConfiguration.id, Clusters.ProxyDiscovery.id, Clusters.ProxyValid.id]
# TODO: Remove this once the latest 1.3 lands with the clusters removed from the DM XML and change the warning below about missing DM XMLs into a proper error
# These are clusters that weren't part of the 1.3 spec that landed in the SDK before the branch cut
provisional_cluster_ids.extend([Clusters.DemandResponseLoadControl.id])
# These clusters are zigbee only. I don't even know why they're part of the codegen, but we should get rid of them.
provisional_cluster_ids.extend([Clusters.BarrierControl.id, Clusters.OnOffSwitchConfiguration.id,
Clusters.BinaryInputBasic.id, Clusters.ElectricalMeasurement.id])
for endpoint_id, endpoint in self.endpoints_tlv.items():
for cluster_id, cluster in endpoint.items():
cluster_location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id)

if not allow_provisional and cluster_id in provisional_cluster_ids:
record_error(location=cluster_location, problem='Provisional cluster found on device')
continue

if cluster_id not in self.xml_clusters.keys():
if (cluster_id & 0xFFFF_0000) != 0:
# manufacturer cluster
Expand All @@ -92,9 +103,6 @@ def record_warning(location, problem):
problem='Standard cluster found on device, but is not present in spec data')
continue

if not allow_provisional and cluster_id in provisional_cluster_ids:
record_error(location=cluster_location, problem='Provisional cluster found on device')

feature_map = cluster[GlobalAttributeIds.FEATURE_MAP_ID]
attribute_list = cluster[GlobalAttributeIds.ATTRIBUTE_LIST_ID]
all_command_list = cluster[GlobalAttributeIds.ACCEPTED_COMMAND_LIST_ID] + \
Expand Down

0 comments on commit 9f5bb58

Please sign in to comment.