Skip to content

Commit a6e6298

Browse files
committed
Remove cluster from testing read API
1 parent dc5bba7 commit a6e6298

File tree

106 files changed

+508
-802
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+508
-802
lines changed

docs/testing/python.md

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class TC_MYTEST_1_1(MatterBaseTest):
6868
self.default_controlller</span>
6969
node_id = self.dut_node_id, <span style="color:#38761D"># defaults to
7070
self.dut_node_id</span>
71-
cluster=Clusters.BasicInformation,
7271
attribute=Clusters.BasicInformation.Attributes.VendorName,
7372
endpoint = 0, <span style="color:#38761D">#defaults to 0</span>
7473
)

src/python_testing/TC_ACE_1_3.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ async def write_acl(self, acl):
5050
async def read_descriptor_expect_success(self, th):
5151
cluster = Clusters.Objects.Descriptor
5252
attribute = Clusters.Descriptor.Attributes.DeviceTypeList
53-
await self.read_single_attribute_check_success(dev_ctrl=th, endpoint=0, cluster=cluster, attribute=attribute)
53+
await self.read_single_attribute_check_success(dev_ctrl=th, endpoint=0, attribute=attribute)
5454

5555
async def read_descriptor_expect_unsupported_access(self, th):
5656
cluster = Clusters.Objects.Descriptor
5757
attribute = Clusters.Descriptor.Attributes.DeviceTypeList
5858
await self.read_single_attribute_expect_error(
59-
dev_ctrl=th, endpoint=0, cluster=cluster, attribute=attribute, error=Status.UnsupportedAccess)
59+
dev_ctrl=th, endpoint=0, attribute=attribute, error=Status.UnsupportedAccess)
6060

6161
def desc_TC_ACE_1_3(self) -> str:
6262
return "[TC-ACE-1.3] Subjects"

src/python_testing/TC_ACE_1_4.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,21 @@ async def write_acl(self, acl):
5656
asserts.assert_equal(result[0].Status, Status.Success, "ACL write failed")
5757

5858
async def read_descriptor_expect_success(self, endpoint: int) -> None:
59-
cluster = Clusters.Objects.Descriptor
6059
attribute = Clusters.Descriptor.Attributes.DeviceTypeList
61-
await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)
60+
await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attribute)
6261

6362
async def read_descriptor_expect_unsupported_access(self, endpoint: int) -> None:
6463
cluster = Clusters.Objects.Descriptor
6564
attribute = Clusters.Descriptor.Attributes.DeviceTypeList
6665
await self.read_single_attribute_expect_error(
67-
endpoint=endpoint, cluster=cluster, attribute=attribute, error=Status.UnsupportedAccess)
66+
endpoint=endpoint, attribute=attribute, error=Status.UnsupportedAccess)
6867

6968
async def read_appcluster_expect_success(self) -> None:
70-
await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=self.cluster, attribute=self.attribute)
69+
await self.read_single_attribute_check_success(endpoint=self.endpoint, attribute=self.attribute)
7170

7271
async def read_appcluster_expect_unsupported_access(self) -> None:
7372
await self.read_single_attribute_expect_error(
74-
endpoint=self.endpoint, cluster=self.cluster, attribute=self.attribute, error=Status.UnsupportedAccess)
73+
endpoint=self.endpoint, attribute=self.attribute, error=Status.UnsupportedAccess)
7574

7675
async def read_wildcard_endpoint(self, attribute: object) -> object:
7776
return await self.default_controller.ReadAttribute(self.dut_node_id, [(attribute)])

src/python_testing/TC_ACE_1_5.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@
3939
class TC_ACE_1_5(MatterBaseTest):
4040

4141
async def read_currentfabricindex(self, th: ChipDeviceCtrl) -> int:
42-
cluster = Clusters.Objects.OperationalCredentials
4342
attribute = Clusters.OperationalCredentials.Attributes.CurrentFabricIndex
44-
current_fabric_index = await self.read_single_attribute_check_success(dev_ctrl=th, endpoint=0, cluster=cluster, attribute=attribute)
43+
current_fabric_index = await self.read_single_attribute_check_success(dev_ctrl=th, endpoint=0, attribute=attribute)
4544
return current_fabric_index
4645

4746
async def write_acl(self, acl: Clusters.AccessControl, th: ChipDeviceCtrl):
@@ -110,27 +109,23 @@ async def test_TC_ACE_1_5(self):
110109
self.print_step(7, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute")
111110
await self.read_single_attribute_check_success(
112111
dev_ctrl=self.th1, endpoint=0,
113-
cluster=Clusters.Objects.Descriptor,
114112
attribute=Clusters.Descriptor.Attributes.DeviceTypeList)
115113

116114
self.print_step(8, "TH1 reads DUT Endpoint 0 Basic Information cluster VendorID attribute")
117115
await self.read_single_attribute_expect_error(
118116
dev_ctrl=self.th1, endpoint=0,
119-
cluster=Clusters.Objects.BasicInformation,
120117
attribute=Clusters.BasicInformation.Attributes.VendorID,
121118
error=Status.UnsupportedAccess)
122119

123120
self.print_step(9, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute")
124121
await self.read_single_attribute_expect_error(
125122
dev_ctrl=self.th2, endpoint=0,
126-
cluster=Clusters.Objects.Descriptor,
127123
attribute=Clusters.Descriptor.Attributes.DeviceTypeList,
128124
error=Status.UnsupportedAccess)
129125

130126
self.print_step(10, "TH2 reads DUT Endpoint 0 Basic Information cluster VendorID attribute")
131127
await self.read_single_attribute_check_success(
132128
dev_ctrl=self.th2, endpoint=0,
133-
cluster=Clusters.Objects.BasicInformation,
134129
attribute=Clusters.BasicInformation.Attributes.VendorID)
135130

136131
self.print_step(11, "TH1 resets the ACLs to default value by writing DUT EP0")

src/python_testing/TC_AccessChecker.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def setup_class(self):
6767
await self.setup_class_helper()
6868
self.xml_clusters, self.problems = build_xml_clusters()
6969
acl_attr = Clusters.AccessControl.Attributes.Acl
70-
self.default_acl = await self.read_single_attribute_check_success(cluster=Clusters.AccessControl, attribute=acl_attr)
70+
self.default_acl = await self.read_single_attribute_check_success(attribute=acl_attr)
7171
self._record_errors()
7272
# We need to run this test from two controllers so we can test access to the ACL cluster while retaining access to the ACL cluster
7373
fabric_admin = self.certificate_authority_manager.activeCaList[0].adminList[0]
@@ -146,14 +146,13 @@ async def _run_read_access_test_for_cluster_privilege(self, endpoint_id, cluster
146146
for attribute_id in checkable_attributes(cluster_id, device_cluster_data, xml_cluster):
147147
spec_requires = xml_cluster.attributes[attribute_id].read_access
148148
attribute = Clusters.ClusterObjects.ALL_ATTRIBUTES[cluster_id][attribute_id]
149-
cluster_class = Clusters.ClusterObjects.ALL_CLUSTERS[cluster_id]
150149

151150
if operation_allowed(spec_requires, privilege):
152-
ret = await self.read_single_attribute_check_success(dev_ctrl=self.TH2, endpoint=endpoint_id, cluster=cluster_class, attribute=attribute, assert_on_error=False, test_name=f"Read access Checker - {privilege}")
151+
ret = await self.read_single_attribute_check_success(dev_ctrl=self.TH2, endpoint=endpoint_id, attribute=attribute, assert_on_error=False, test_name=f"Read access Checker - {privilege}")
153152
if ret is None:
154153
self.success = False
155154
else:
156-
ret = await self.read_single_attribute_expect_error(dev_ctrl=self.TH2, endpoint=endpoint_id, cluster=cluster_class, attribute=attribute, error=Status.UnsupportedAccess, assert_on_error=False, test_name=f"Read access Checker - {privilege}")
155+
ret = await self.read_single_attribute_expect_error(dev_ctrl=self.TH2, endpoint=endpoint_id, attribute=attribute, error=Status.UnsupportedAccess, assert_on_error=False, test_name=f"Read access Checker - {privilege}")
157156
if ret is None:
158157
self.success = False
159158

src/python_testing/TC_BOOLCFG_2_1.py

+9-13
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434

3535

3636
class TC_BOOLCFG_2_1(MatterBaseTest):
37-
async def read_boolcfg_attribute_expect_success(self, endpoint, attribute):
38-
cluster = Clusters.Objects.BooleanStateConfiguration
39-
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)
40-
4137
def desc_TC_BOOLCFG_2_1(self) -> str:
4238
return "[TC-BOOLCFG-2.1] Attributes with DUT as Server"
4339

@@ -75,65 +71,65 @@ async def test_TC_BOOLCFG_2_1(self):
7571
attributes = Clusters.BooleanStateConfiguration.Attributes
7672

7773
self.step(2)
78-
attribute_list = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AttributeList)
74+
attribute_list = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.AttributeList)
7975

8076
number_of_supported_levels = 0
8177

8278
self.step(3)
8379
if attributes.SupportedSensitivityLevels.attribute_id in attribute_list:
84-
number_of_supported_levels = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.SupportedSensitivityLevels)
80+
number_of_supported_levels = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.SupportedSensitivityLevels)
8581
asserts.assert_less_equal(number_of_supported_levels, 10, "SupportedSensitivityLevels attribute is out of range")
8682
asserts.assert_greater_equal(number_of_supported_levels, 2, "SupportedSensitivityLevels attribute is out of range")
8783
else:
8884
logging.info("Test step skipped")
8985

9086
self.step(4)
9187
if attributes.CurrentSensitivityLevel.attribute_id in attribute_list:
92-
current_sensitivity_level_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.CurrentSensitivityLevel)
88+
current_sensitivity_level_dut = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.CurrentSensitivityLevel)
9389
asserts.assert_less_equal(current_sensitivity_level_dut, number_of_supported_levels,
9490
"CurrentSensitivityLevel is not in valid range")
9591
else:
9692
logging.info("Test step skipped")
9793

9894
self.step(5)
9995
if attributes.DefaultSensitivityLevel.attribute_id in attribute_list:
100-
default_sensitivity_level_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultSensitivityLevel)
96+
default_sensitivity_level_dut = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.DefaultSensitivityLevel)
10197
asserts.assert_less_equal(default_sensitivity_level_dut, number_of_supported_levels,
10298
"DefaultSensitivityLevel is not in valid range")
10399
else:
104100
logging.info("Test step skipped")
105101

106102
self.step(6)
107103
if attributes.AlarmsActive.attribute_id in attribute_list:
108-
alarms_active_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsActive)
104+
alarms_active_dut = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.AlarmsActive)
109105
asserts.assert_equal(alarms_active_dut & ~all_alarm_mode_bitmap_bits, 0, "AlarmsActive is not in valid range")
110106
else:
111107
logging.info("Test step skipped")
112108

113109
self.step(7)
114110
if attributes.AlarmsSuppressed.attribute_id in attribute_list:
115-
alarms_suppressed_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsSuppressed)
111+
alarms_suppressed_dut = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.AlarmsSuppressed)
116112
asserts.assert_equal(alarms_suppressed_dut & ~all_alarm_mode_bitmap_bits, 0, "AlarmsSuppressed is not in valid range")
117113
else:
118114
logging.info("Test step skipped")
119115

120116
self.step(8)
121117
if attributes.AlarmsEnabled.attribute_id in attribute_list:
122-
alarms_enabled_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsEnabled)
118+
alarms_enabled_dut = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.AlarmsEnabled)
123119
asserts.assert_equal(alarms_enabled_dut & ~all_alarm_mode_bitmap_bits, 0, "AlarmsEnabled is not in valid range")
124120
else:
125121
logging.info("Test step skipped")
126122

127123
self.step(9)
128124
if attributes.AlarmsSupported.attribute_id in attribute_list:
129-
alarms_supported_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsSupported)
125+
alarms_supported_dut = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.AlarmsSupported)
130126
asserts.assert_equal(alarms_supported_dut & ~all_alarm_mode_bitmap_bits, 0, "AlarmsSupported is not in valid range")
131127
else:
132128
logging.info("Test step skipped")
133129

134130
self.step(10)
135131
if attributes.SensorFault.attribute_id in attribute_list:
136-
sensor_fault_dut = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.SensorFault)
132+
sensor_fault_dut = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.SensorFault)
137133
asserts.assert_equal(sensor_fault_dut & ~all_sensor_fault_bitmap_bits, 0, "SensorFault is not in valid range")
138134
else:
139135
logging.info("Test step skipped")

src/python_testing/TC_BOOLCFG_3_1.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434

3535

3636
class TC_BOOLCFG_3_1(MatterBaseTest):
37-
async def read_boolcfg_attribute_expect_success(self, endpoint, attribute):
38-
cluster = Clusters.Objects.BooleanStateConfiguration
39-
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)
40-
4137
def desc_TC_BOOLCFG_3_1(self) -> str:
4238
return "[TC-BOOLCFG-3.1] SensitivityLevel with DUT as Server"
4339

@@ -74,7 +70,7 @@ async def test_TC_BOOLCFG_3_1(self):
7470
attributes = Clusters.BooleanStateConfiguration.Attributes
7571

7672
self.step("2a")
77-
feature_map = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.FeatureMap)
73+
feature_map = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.FeatureMap)
7874
is_sens_level_feature_supported = feature_map & Clusters.BooleanStateConfiguration.Bitmaps.Feature.kSensitivityLevel
7975

8076
self.step("2b")
@@ -91,19 +87,19 @@ async def test_TC_BOOLCFG_3_1(self):
9187
logging.info("Test step skipped")
9288

9389
self.step("2c")
94-
attribute_list = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AttributeList)
90+
attribute_list = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.AttributeList)
9591

9692
self.step(3)
97-
numberOfSupportedLevels = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.SupportedSensitivityLevels)
93+
numberOfSupportedLevels = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.SupportedSensitivityLevels)
9894

9995
self.step(4)
10096
if attributes.DefaultSensitivityLevel.attribute_id in attribute_list:
101-
default_level = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultSensitivityLevel)
97+
default_level = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.DefaultSensitivityLevel)
10298
else:
10399
logging.info("Test step skipped")
104100

105101
self.step(5)
106-
current_level = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.CurrentSensitivityLevel)
102+
current_level = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.CurrentSensitivityLevel)
107103

108104
self.step(6)
109105
for sens_level in range(numberOfSupportedLevels):

src/python_testing/TC_BOOLCFG_4_1.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232

3333

3434
class TC_BOOLCFG_4_1(MatterBaseTest):
35-
async def read_boolcfg_attribute_expect_success(self, endpoint, attribute):
36-
cluster = Clusters.Objects.BooleanStateConfiguration
37-
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)
38-
3935
def desc_TC_BOOLCFG_4_1(self) -> str:
4036
return "[TC-BOOLCFG-4.1] AlarmsSupported attribute with DUT as Server"
4137

@@ -66,14 +62,14 @@ async def test_TC_BOOLCFG_4_1(self):
6662
attributes = Clusters.BooleanStateConfiguration.Attributes
6763

6864
self.step(2)
69-
feature_map = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.FeatureMap)
65+
feature_map = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.FeatureMap)
7066

7167
is_vis_feature_supported = feature_map & Clusters.BooleanStateConfiguration.Bitmaps.Feature.kVisual
7268
is_aud_feature_supported = feature_map & Clusters.BooleanStateConfiguration.Bitmaps.Feature.kAudible
7369

7470
self.step(3)
7571
if is_vis_feature_supported or is_aud_feature_supported:
76-
supportedAlarms = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsSupported)
72+
supportedAlarms = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.AlarmsSupported)
7773
else:
7874
logging.info("Test step skipped")
7975

src/python_testing/TC_BOOLCFG_4_2.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636

3737

3838
class TC_BOOLCFG_4_2(MatterBaseTest):
39-
async def read_boolcfg_attribute_expect_success(self, endpoint, attribute):
40-
cluster = Clusters.Objects.BooleanStateConfiguration
41-
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)
4239

4340
def desc_TC_BOOLCFG_4_2(self) -> str:
4441
return "[TC-BOOLCFG-4.2] AlarmsActive attribute with DUT as Server"
@@ -84,13 +81,13 @@ async def test_TC_BOOLCFG_4_2(self):
8481
attributes = Clusters.BooleanStateConfiguration.Attributes
8582

8683
self.step("2a")
87-
feature_map = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.FeatureMap)
84+
feature_map = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.FeatureMap)
8885

8986
is_vis_feature_supported = feature_map & Clusters.BooleanStateConfiguration.Bitmaps.Feature.kVisual
9087
is_aud_feature_supported = feature_map & Clusters.BooleanStateConfiguration.Bitmaps.Feature.kAudible
9188

9289
self.step("2b")
93-
attribute_list = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AttributeList)
90+
attribute_list = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.AttributeList)
9491

9592
self.step("3a")
9693
enabledAlarms = 0
@@ -131,7 +128,7 @@ async def test_TC_BOOLCFG_4_2(self):
131128
activeAlarms = 0
132129

133130
if is_vis_feature_supported or is_aud_feature_supported:
134-
activeAlarms = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsActive)
131+
activeAlarms = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.AlarmsActive)
135132
asserts.assert_not_equal(activeAlarms, 0, "AlarmsActive is 0")
136133
else:
137134
logging.info("Test step skipped")
@@ -176,7 +173,7 @@ async def test_TC_BOOLCFG_4_2(self):
176173

177174
self.step(9)
178175
if is_vis_feature_supported or is_aud_feature_supported:
179-
activeAlarms = await self.read_boolcfg_attribute_expect_success(endpoint=endpoint, attribute=attributes.AlarmsActive)
176+
activeAlarms = await self.read_single_attribute_check_success(endpoint=endpoint, attribute=attributes.AlarmsActive)
180177
asserts.assert_equal(activeAlarms, 0, "AlarmsActive is not 0")
181178
else:
182179
logging.info("Test step skipped")

0 commit comments

Comments
 (0)