From 9f5bb580aa108967551d1af6fdf819c7ab15aa45 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Mon, 3 Jun 2024 05:56:20 -0400 Subject: [PATCH] TC-IDM-10.2: checks for non-spec clusters (#33695) * 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 --- .../python/chip/clusters/__init__.py | 37 ++++++++++--------- src/python_testing/TC_DeviceConformance.py | 14 +++++-- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/controller/python/chip/clusters/__init__.py b/src/controller/python/chip/clusters/__init__.py index 44d9910c670098..76a37b84abbc87 100644 --- a/src/controller/python/chip/clusters/__init__.py +++ b/src/controller/python/chip/clusters/__init__.py @@ -27,23 +27,24 @@ 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) @@ -51,7 +52,7 @@ 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, diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index 1db208fa39f40b..42fddd7e31ee4b 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -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 @@ -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] + \