From c9bbcb7ecfd42139f5bafc9c2195ea94ba23e481 Mon Sep 17 00:00:00 2001 From: Cecille Freeman Date: Wed, 2 Aug 2023 17:13:34 -0400 Subject: [PATCH] TC-PS-3.1: Add cluster revision check This allows the test suite to be dual-purposed against existing devices in the field as well as being used for cert. Correct cluster revision for cert testing purposes is tested in the TC-PS-1.1 test. Test: Down-rev'd one PS cluster on all clusters and removed EndpointList - saw note, test passes. --- src/python_testing/TC_DeviceBasicComposition.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index 1d3f3fc944514e..677142264e877c 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -465,8 +465,15 @@ def test_TC_PS_3_1(self): for endpoint_id, endpoint in self.endpoints.items(): if Clusters.PowerSource not in endpoint: continue + location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=attribute_id) + if Clusters.PowerSource.Attributes.ClusterRevision not in endpoint[Clusters.PowerSource]: + self.record_error(self.get_test_name( + ), location=location, problem=f'Did not find Cluster revision on {location.as_cluster_string(self.cluster_mapper)}', spec_location='Global attributes') + if endpoint[Clusters.PowerSource][Clusters.PowerSource.Attributes.ClusterRevision] < 2: + self.record_note(self.get_test_name(), location=location, + problem=f'Power source ClusterRevision is < 2, skipping remainder of test for this endpoint') + continue if Clusters.PowerSource.Attributes.EndpointList not in endpoint[Clusters.PowerSource]: - location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=attribute_id) self.record_error(self.get_test_name(), location=location, problem=f'Did not find {attribute_string} on {location.as_cluster_string(self.cluster_mapper)}', spec_location="EndpointList Attribute") success = False