Skip to content

Commit

Permalink
Cherry-pick provisional cluster check PRs to 1.3-SVE test harness bra…
Browse files Browse the repository at this point in the history
…nch. (#33885)

* TC-IDM-10.2: Add test for provisional clusters (#33361)

* TC-IDM-10.2: Add test for provisional clusters

* Restyled by autopep8

* Un-hard-code IDs

* Add content control to the init file so we can use the ID

* Add some more provisional clusters

* Restyled by autopep8

* Restyled by isort

* Add in a couple more provisional from main spec

* it's nice to add ALL the changes before uploading

---------

Co-authored-by: Restyled.io <[email protected]>

* 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 <[email protected]>

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
cecille and restyled-commits committed Jun 13, 2024
1 parent fb2c0e5 commit 50bcad1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 21 deletions.
39 changes: 20 additions & 19 deletions src/controller/python/chip/clusters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,33 @@
ApplicationBasic, ApplicationLauncher, AudioOutput, BallastConfiguration, BarrierControl, BasicInformation,
BinaryInputBasic, Binding, BooleanState, BooleanStateConfiguration, BridgedDeviceBasicInformation,
CarbonDioxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurement, Channel, ColorControl,
ContentLauncher, Descriptor, DeviceEnergyManagement, DeviceEnergyManagementMode, DiagnosticLogs,
DishwasherAlarm, DishwasherMode, DoorLock, ElectricalEnergyMeasurement, ElectricalMeasurement,
ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode, 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, ContentLauncher, Descriptor, DeviceEnergyManagementMode, DeviceEnergyManagement, DiagnosticLogs, DishwasherAlarm, DishwasherMode,
DoorLock, ElectricalEnergyMeasurement, ElectricalMeasurement, ElectricalPowerMeasurement, EnergyEvse, EnergyEvseMode,
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,
HepaFilterMonitoring, IcdManagement, Identify, IlluminanceMeasurement, KeypadInput, LaundryDryerControls,
Expand Down
20 changes: 18 additions & 2 deletions src/python_testing/TC_DeviceConformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,31 @@ def record_warning(location, problem):

success = True
allow_provisional = self.user_params.get("allow_provisional", False)
# TODO: automate this once https://github.com/csa-data-model/projects/issues/454 is done.
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
continue
location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id)
# TODO: update this from a warning once we have all the data
record_warning(location=location, problem='Standard cluster found on device, but is not present in spec data')
record_warning(location=cluster_location,
problem='Standard cluster found on device, but is not present in spec data')
continue

feature_map = cluster[GlobalAttributeIds.FEATURE_MAP_ID]
Expand Down

0 comments on commit 50bcad1

Please sign in to comment.