From 99dda3b73e9165827cbd63e5055f05f47672a641 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Wed, 15 May 2024 10:50:40 -0400 Subject: [PATCH] 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 --- src/controller/python/chip/clusters/__init__.py | 16 ++++++++-------- src/python_testing/TC_DeviceConformance.py | 12 ++++++++++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/controller/python/chip/clusters/__init__.py b/src/controller/python/chip/clusters/__init__.py index 85048384d8a81c..44d9910c670098 100644 --- a/src/controller/python/chip/clusters/__init__.py +++ b/src/controller/python/chip/clusters/__init__.py @@ -27,12 +27,12 @@ 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, + 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, @@ -51,8 +51,8 @@ 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, 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, diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index 18ad273a6241d6..1db208fa39f40b 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -76,17 +76,25 @@ 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] 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 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 + 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] + \