Skip to content

Commit f8ebf92

Browse files
Bug506 - No commissioning pre-condition or step fix (#37671)
* TC_IDM_4_2 commissioning * TC_IDM_4_2 commissioning * TC_DRLK_2_5 commissioning * TC_DRLK_2_9 commissioning * TC_MCORE_FS_1_2 commissioning * TC_MCORE_FS_1_5 commissioning * TC_MCORE_FS_1_1 commissioning * addresses pr comments * adds "precondition" as pre-step 1 * fix step mismatch * fix duplicate precondition steps * fixes step numbering mismatch --------- Co-authored-by: C Freeman <[email protected]>
1 parent 3a8727a commit f8ebf92

File tree

6 files changed

+65
-53
lines changed

6 files changed

+65
-53
lines changed

src/python_testing/TC_DRLK_2_5.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ class TC_DRLK_2_5(MatterBaseTest):
5151

5252
def steps_TC_DRLK_2_5(self) -> list[TestStep]:
5353
steps = [
54-
55-
54+
TestStep("precondition", "Commissioning already done.", is_commissioning=True),
5655
TestStep("1", "TH reads NumberOfWeekDaySchedulesSupportedPerUser attribute.",
5756
"Verify that TH is able to read the attribute successfully."),
5857
TestStep("2a", "TH sends SetUser Command to DUT.", "Verify that the DUT sends SUCCESS response."),
@@ -195,6 +194,9 @@ async def test_TC_DRLK_2_5(self):
195194
end_Hour = 16
196195
end_Minute = 55
197196

197+
# Commissioning
198+
self.step("precondition")
199+
198200
self.step("1")
199201
if self.pics_guard(self.check_pics("DRLK.S.F04") and self.check_pics("DRLK.S.A0014")):
200202
number_week_day_schedules_supported_per_user = await self.read_attributes_from_dut(endpoint=self.app_cluster_endpoint,

src/python_testing/TC_DRLK_2_9.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
class TC_DRLK_2_9(MatterBaseTest, DRLK_COMMON):
5555

5656
def steps_TC_DRLK_2_9(self) -> list[TestStep]:
57-
return [
57+
steps = [
58+
TestStep("precondition", "Commissioning already done.", is_commissioning=True),
5859
TestStep("1", "TH reads NumberOfTotalUsersSupported attribute.",
5960
"Verify that TH is able to read the attribute successfully."),
6061
TestStep("2a", "TH sends SetUser Command to DUT.", "Verify that the DUT sends SUCCESS response"),
@@ -160,6 +161,8 @@ def steps_TC_DRLK_2_9(self) -> list[TestStep]:
160161
"Verify that the DUT sends SUCCESS response."),
161162
]
162163

164+
return steps
165+
163166
async def read_attributes_from_dut(self, endpoint, cluster, attribute, expected_status: Status = Status.Success):
164167
try:
165168
attribute_value = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster,
@@ -389,6 +392,9 @@ async def test_TC_DRLK_2_9(self):
389392
aliroevictableendpointkey2 = bytes.fromhex(
390393
"047a4c662d753924cdf3779a3c84fec2debaa6f0b3084450878acc7ddcce7856ae57b1ebbe2561015103dd7474c2a183675378ec55f1e465ac3436bf3dd5ca54d4")
391394

395+
# Commissioning
396+
self.step("precondition")
397+
392398
self.step("1")
393399
if self.pics_guard(self.check_pics("DRLK.S.F08") and self.check_pics("DRLK.S.A0011")):
394400
self.numberoftotaluserssupported = await self.read_attributes_from_dut(endpoint=self.app_cluster_endpoint,

src/python_testing/TC_IDM_4_2.py

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -68,33 +68,33 @@
6868
class TC_IDM_4_2(MatterBaseTest):
6969

7070
def steps_TC_IDM_4_2(self):
71-
return [TestStep('precondition', "TH commissions DUT if required", is_commissioning=True),
72-
TestStep(0, "CR1 reads the ServerList attribute from the Descriptor cluster on EP0.",
71+
return [TestStep("precondition", "Commissioning already done.", is_commissioning=True),
72+
TestStep(1, "CR1 reads the ServerList attribute from the Descriptor cluster on EP0.",
7373
"If the ICD Management cluster ID (70,0x46) is present, set SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT_SEC = IdleModeDuration and min_interval_floor_s to 0, otherwise, set SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT_SEC = 60 mins and min_interval_floor_s to 3."),
74-
TestStep(1, "CR1 sends a subscription message to the DUT with MaxIntervalCeiling set to a value greater than subscription_max_interval_publisher_limit_sec. DUT sends a report data action to the TH. CR1 sends a success status response to the DUT. DUT sends a Subscribe Response Message to the CR1 to activate the subscription.",
74+
TestStep(2, "CR1 sends a subscription message to the DUT with MaxIntervalCeiling set to a value greater than subscription_max_interval_publisher_limit_sec. DUT sends a report data action to the TH. CR1 sends a success status response to the DUT. DUT sends a Subscribe Response Message to the CR1 to activate the subscription.",
7575
"Verify on the CR1, a report data message is received. Verify it contains the following data Report data - data of the attribute/event requested earlier. Verify on the CR1 the Subscribe Response has the following fields, SubscriptionId - Verify it is of type uint32. MaxInterval - Verify it is of type uint32. Verify that the MaxInterval is less than or equal to MaxIntervalCeiling."),
76-
TestStep(2, "CR1 sends a subscription message to the DUT with MaxIntervalCeiling set to a value less than subscription_max_interval_publisher_limit_sec. DUT sends a report data action to the CR1. CR1 sends a success status response to the DUT. DUT sends a Subscribe Response Message to the CR1 to activate the subscription.",
76+
TestStep(3, "CR1 sends a subscription message to the DUT with MaxIntervalCeiling set to a value less than subscription_max_interval_publisher_limit_sec. DUT sends a report data action to the CR1. CR1 sends a success status response to the DUT. DUT sends a Subscribe Response Message to the CR1 to activate the subscription.",
7777
"Verify on the CR1, a report data message is received. Verify it contains the following data: Report data - data of the attribute/event requested earlier. Verify on the CR1 the Subscribe Response has the following fields, SubscriptionId - Verify it is of type uint32. MaxInterval - Verify it is of type uint32. Verify that the MaxInterval is less than or equal to SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT."),
78-
TestStep(3, "Setup CR2 such that it does not have access to a specific cluster. CR2 sends a subscription message to subscribe to an attribute on that cluster for which it does not have access.",
78+
TestStep(4, "Setup CR2 such that it does not have access to a specific cluster. CR2 sends a subscription message to subscribe to an attribute on that cluster for which it does not have access.",
7979
"Verify that the DUT returns a \"INVALID_ACTION\" status response."),
80-
TestStep(4, "Setup CR2 such that it does not have access to all attributes on a specific cluster and endpoint. CR2 sends a subscription request to subscribe to all attributes for which it does not have access.",
80+
TestStep(5, "Setup CR2 such that it does not have access to all attributes on a specific cluster and endpoint. CR2 sends a subscription request to subscribe to all attributes for which it does not have access.",
8181
"Verify that the DUT returns a \"INVALID_ACTION\" status response."),
82-
TestStep(5, "Setup CR2 such that it does not have access to an Endpoint. CR2 sends a subscription request to subscribe to all attributes on all clusters on a specific Endpoint for which it does not have access.",
82+
TestStep(6, "Setup CR2 such that it does not have access to an Endpoint. CR2 sends a subscription request to subscribe to all attributes on all clusters on a specific Endpoint for which it does not have access.",
8383
"Verify that the DUT returns a \"INVALID_ACTION\" status response."),
84-
TestStep(6, "Setup CR2 such that it does not have access to the Node. CR2 sends a subscription request to subscribe to all attributes on all clusters on all endpoints on a Node for which it does not have access.",
84+
TestStep(7, "Setup CR2 such that it does not have access to the Node. CR2 sends a subscription request to subscribe to all attributes on all clusters on all endpoints on a Node for which it does not have access.",
8585
"Verify that the DUT returns a \"INVALID_ACTION\" status response."),
86-
TestStep(7, "CR1 sends a subscription request action for an attribute with an empty DataVersionFilters field. DUT sends a report data action with the data of the attribute along with the data version. Tear down the subscription for that attribute. Start another subscription with the DataVersionFilter field set to the data version received above.",
86+
TestStep(8, "CR1 sends a subscription request action for an attribute with an empty DataVersionFilters field. DUT sends a report data action with the data of the attribute along with the data version. Tear down the subscription for that attribute. Start another subscription with the DataVersionFilter field set to the data version received above.",
8787
"Verify that the subscription is activated between CR1 and DUT."),
88-
TestStep(8, "CR1 sends a subscription request action for an attribute and sets the MinIntervalFloor to min_interval_floor_sec and MaxIntervalCeiling to 10. Activate the Subscription between CR1 and DUT and record the time when the priming ReportDataMessage is received as t_report_sec. Save the returned MaxInterval from the SubscribeResponseMessage as max_interval_sec."),
89-
TestStep(9, "CR1 modifies the attribute which has been subscribed to on the DUT and waits for an incoming ReportDataMessage",
88+
TestStep(9, "CR1 sends a subscription request action for an attribute and sets the MinIntervalFloor to min_interval_floor_sec and MaxIntervalCeiling to 10. Activate the Subscription between CR1 and DUT and record the time when the priming ReportDataMessage is received as t_report_sec. Save the returned MaxInterval from the SubscribeResponseMessage as max_interval_sec."),
89+
TestStep(10, "CR1 modifies the attribute which has been subscribed to on the DUT and waits for an incoming ReportDataMessage",
9090
"Verify that t_update - t_report is greater than min_interval_floor_s and less than the ReadClient SubscriptionTimeout (calculated by the ReadClient using max_interval_s and the maximum estimated network delay based on the MRP parameters for retries with backoff)"),
91-
TestStep(10, "CR1 sends a subscription request action for an attribute and set the MinIntervalFloor value to be greater than MaxIntervalCeiling.",
91+
TestStep(11, "CR1 sends a subscription request action for an attribute and set the MinIntervalFloor value to be greater than MaxIntervalCeiling.",
9292
"Verify that the DUT sends an error message and the subscription is not established."),
93-
TestStep(11, "CR1 sends a subscription request to subscribe to a specific global attribute from all clusters on all endpoints.",
93+
TestStep(12, "CR1 sends a subscription request to subscribe to a specific global attribute from all clusters on all endpoints.",
9494
"Verify that the Subscription succeeds and the DUT sends back the attribute values for the global attribute."),
95-
TestStep(12, "CR1 sends a subscription request to subscribe to a global attribute on an endpoint on all clusters.",
95+
TestStep(13, "CR1 sends a subscription request to subscribe to a global attribute on an endpoint on all clusters.",
9696
"Verify that the Subscription succeeds and the DUT sends back the attribute values for the global attribute. Verify no data from other endpoints is sent back."),
97-
TestStep(13, "CR1 sends a subscription request to the DUT with both AttributeRequests and EventRequests as empty.",
97+
TestStep(14, "CR1 sends a subscription request to the DUT with both AttributeRequests and EventRequests as empty.",
9898
"Verify that the Subscription does not succeed and the DUT sends back a Status Response Action with the INVALID_ACTION Status Code")
9999
]
100100

@@ -204,12 +204,12 @@ async def test_TC_IDM_4_2(self):
204204
paaTrustStorePath=str(self.matter_test_config.paa_trust_store_path),
205205
)
206206

207-
# *** Step 0 ***
207+
# *** Step 1 ***
208208
# CR1 reads the ServerList attribute from the Descriptor cluster on EP0. If the ICDManagement cluster ID
209209
# (70,0x46) is present, set SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT_SEC = IdleModeDuration and
210210
# min_interval_floor_s to 0, otherwise, set SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT_SEC = 60 mins and
211211
# min_interval_floor_s to 3.
212-
self.step(0)
212+
self.step(1)
213213

214214
# Reads the ServerList attribute
215215
ep0_servers = await self.get_descriptor_server_list(CR1)
@@ -234,12 +234,12 @@ async def test_TC_IDM_4_2(self):
234234
logging.info(
235235
f"Set SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT_SEC to {subscription_max_interval_publisher_limit_sec} seconds")
236236

237-
# *** Step 1 ***
237+
# *** Step 2 ***
238238
# CR1 sends a subscription message to the DUT with MaxIntervalCeiling set to a value greater than
239239
# SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT_SEC. DUT sends a report data action to the TH. CR1 sends
240240
# a success status response to the DUT. DUT sends a Subscribe Response Message to the CR1 to activate
241241
# the subscription.
242-
self.step(1)
242+
self.step(2)
243243

244244
max_interval_ceiling_sec = subscription_max_interval_publisher_limit_sec + 5
245245
asserts.assert_greater(max_interval_ceiling_sec, min_interval_floor_sec,
@@ -275,12 +275,12 @@ async def test_TC_IDM_4_2(self):
275275

276276
sub_cr1_step1.Shutdown()
277277

278-
# *** Step 2 ***
278+
# *** Step 3 ***
279279
# CR1 sends a subscription message to the DUT with MaxIntervalCeiling set to a value less than
280280
# subscription_max_interval_publisher_limit_sec. DUT sends a report data action to the CR1.
281281
# CR1 sends a success status response to the DUT. DUT sends a Subscribe Response Message to the
282282
# CR1 to activate the subscription.
283-
self.step(2)
283+
self.step(3)
284284

285285
min_interval_floor_sec = 0
286286

@@ -318,10 +318,10 @@ async def test_TC_IDM_4_2(self):
318318

319319
sub_cr1_step2.Shutdown()
320320

321-
# *** Step 3 ***
321+
# *** Step 4 ***
322322
# Setup CR2 such that it does not have access to a specific cluster. CR2 sends a subscription
323323
# message to subscribe to an attribute on that cluster for which it does not have access.
324-
self.step(3)
324+
self.step(4)
325325

326326
# Setting max_interval_ceiling_sec value for steps 3-8
327327
max_interval_ceiling_sec = 10
@@ -352,11 +352,11 @@ async def test_TC_IDM_4_2(self):
352352
asserts.assert_equal(cm.exception.err, INVALID_ACTION_ERROR_CODE,
353353
"Incorrect error response for subscription to unallowed cluster")
354354

355-
# *** Step 4 ***
355+
# *** Step 5 ***
356356
# Setup CR2 such that it does not have access to all attributes on a specific cluster and
357357
# endpoint. CR2 sends a subscription request to subscribe to all attributes for which it
358358
# does not have access.
359-
self.step(4)
359+
self.step(5)
360360

361361
# Limited ACE for controller 2 with single cluster access and specific endpoint
362362
CR2_limited_ace = Clusters.AccessControl.Structs.AccessControlEntryStruct(
@@ -390,11 +390,11 @@ async def test_TC_IDM_4_2(self):
390390
acl_list = await self.get_dut_acl(CR1)
391391
print(f'acl_list - reset 4: {acl_list}')
392392

393-
# *** Step 5 ***
393+
# *** Step 6 ***
394394
# Setup CR2 such that it does not have access to an Endpoint. CR2 sends a subscription
395395
# request to subscribe to all attributes on all clusters on a specific Endpoint for which
396396
# it does not have access.
397-
self.step(5)
397+
self.step(6)
398398

399399
# Get first value of parts list for the endpoint
400400
parts_list = await self.get_descriptor_parts_list(CR1)
@@ -427,11 +427,11 @@ async def test_TC_IDM_4_2(self):
427427
asserts.assert_equal(cm.exception.err, INVALID_ACTION_ERROR_CODE,
428428
"Incorrect error response for subscription to unallowed endpoint")
429429

430-
# *** Step 6 ***
430+
# *** Step 7 ***
431431
# Setup CR2 such that it does not have access to the Node. CR2 sends a subscription
432432
# request to subscribe to all attributes on all clusters on all endpoints on a Node
433433
# for which it does not have access.
434-
self.step(6)
434+
self.step(7)
435435

436436
# Skip setting an ACE for controller 2 so the DUT node rejects subscribing to it
437437

@@ -453,13 +453,14 @@ async def test_TC_IDM_4_2(self):
453453
# Verify that the DUT returns an "INVALID_ACTION" status response
454454
asserts.assert_equal(cm.exception.err, INVALID_ACTION_ERROR_CODE,
455455
"Incorrect error response for subscription to unallowed node")
456-
# *** Step 7 ***
456+
457+
# *** Step 8 ***
457458
# CR1 sends a subscription request action for an attribute with an empty
458459
# DataVersionFilters field. DUT sends a report data action with the data
459460
# of the attribute along with the data version. Tear down the subscription
460461
# for that attribute. Start another subscription with the DataVersionFilter
461462
# field set to the data version received above.
462-
self.step(7)
463+
self.step(8)
463464

464465
# Subscribe to attribute with empty dataVersionFilters
465466
sub_cr1_empty_dvf = await CR1.ReadAttribute(
@@ -493,13 +494,13 @@ async def test_TC_IDM_4_2(self):
493494

494495
sub_cr1_step7.Shutdown()
495496

496-
# *** Step 8 ***
497+
# *** Step 9 ***
497498
# CR1 sends a subscription request action for an attribute and sets the
498499
# MinIntervalFloor to min_interval_floor_sec and MaxIntervalCeiling to 10.
499500
# Activate the Subscription between CR1 and DUT and record the time when
500501
# the priming ReportDataMessage is received as t_report_sec. Save the
501502
# returned MaxInterval from the SubscribeResponseMessage as max_interval_sec.
502-
self.step(8)
503+
self.step(9)
503504

504505
# Subscribe to attribute
505506
sub_cr1_update_value = await CR1.ReadAttribute(
@@ -512,10 +513,10 @@ async def test_TC_IDM_4_2(self):
512513
# Record the time when the priming ReportDataMessage is received
513514
t_report_sec = time.time()
514515

515-
# *** Step 9 ***
516+
# *** Step 10 ***
516517
# CR1 modifies the attribute which has been subscribed to on the DUT
517518
# and waits for an incoming ReportDataMessage
518-
self.step(9)
519+
self.step(10)
519520

520521
# Saving the returned MaxInterval from the SubscribeResponseMessage
521522
min_interval_floor_sec, max_interval_sec = sub_cr1_update_value.GetReportingIntervalsSeconds()
@@ -551,10 +552,10 @@ async def test_TC_IDM_4_2(self):
551552

552553
sub_cr1_update_value.Shutdown()
553554

554-
# *** Step 10 ***
555+
# *** Step 11 ***
555556
# CR1 sends a subscription request action for an attribute and set the MinIntervalFloor
556557
# value to be greater than MaxIntervalCeiling.
557-
self.step(10)
558+
self.step(11)
558559

559560
# Subscribe to attribute with invalid reportInterval arguments, expect an error
560561
sub_cr1_invalid_intervals = None
@@ -570,10 +571,10 @@ async def test_TC_IDM_4_2(self):
570571
with asserts.assert_raises(AttributeError):
571572
sub_cr1_invalid_intervals.subscriptionId
572573

573-
# *** Step 11 ***
574+
# *** Step 12 ***
574575
# CR1 sends a subscription request to subscribe to a specific global attribute from
575576
# all clusters on all endpoints.
576-
self.step(11)
577+
self.step(12)
577578

578579
# Setting max_interval_ceiling_sec value for steps 11-13
579580
max_interval_ceiling_sec = 10
@@ -610,9 +611,9 @@ async def test_TC_IDM_4_2(self):
610611

611612
sub_cr1_step11.Shutdown()
612613

613-
# *** Step 12 ***
614+
# *** Step 13 ***
614615
# CR1 sends a subscription request to subscribe to a global attribute on an endpoint on all clusters.
615-
self.step(12)
616+
self.step(13)
616617

617618
# Specifying single endpoint 0
618619
requested_ep = 0
@@ -650,9 +651,9 @@ async def test_TC_IDM_4_2(self):
650651

651652
sub_cr1_step12.Shutdown()
652653

653-
# *** Step 13 ***
654+
# *** Step 14 ***
654655
# CR1 sends a subscription request to the DUT with both AttributeRequests and EventRequests as empty.
655-
self.step(13)
656+
self.step(14)
656657

657658
# Attempt a subscription with both AttributeRequests and EventRequests as empty
658659
sub_cr1_step13 = None

0 commit comments

Comments
 (0)