8000 Bug506 - No commissioning pre-condition or step fix by raul-marquez-csa · Pull Request #37671 · project-chip/connectedhomeip · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bug506 - No commissioning pre-condition or step fix #37671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/python_testing/TC_DRLK_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ class TC_DRLK_2_5(MatterBaseTest):

def steps_TC_DRLK_2_5(self) -> list[TestStep]:
steps = [


TestStep("0", "Commissioning already done.", is_commissioning=True),
TestStep("1", "TH reads NumberOfWeekDaySchedulesSupportedPerUser attribute.",
"Verify that TH is able to read the attribute successfully."),
TestStep("2a", "TH sends SetUser Command to DUT.", "Verify that the DUT sends SUCCESS response."),
Expand Down Expand Up @@ -194,6 +193,9 @@ async def test_TC_DRLK_2_5(self):
end_Hour = 16
end_Minute = 55

# Commissioning
self.step("0")

self.step("1")
if self.pics_guard(self.check_pics("DRLK.S.F04") and self.check_pics("DRLK.S.A0014")):
number_week_day_schedules_supported_per_user = await self.read_attributes_from_dut(endpoint=self.app_cluster_endpoint,
Expand Down
5 changes: 4 additions & 1 deletion src/python_testing/TC_DRLK_2_9.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class TC_DRLK_2_9(MatterBaseTest, DRLK_COMMON):

def steps_TC_DRLK_2_9(self) -> list[TestStep]:
steps = [

TestStep("0", "Commissioning already done.", is_commissioning=True),
TestStep("1", "TH reads NumberOfTotalUsersSupported attribute.",
"Verify that TH is able to read the attribute successfully."),
TestStep("2a", "TH sends SetUser Command to DUT.", "Verify that the DUT sends SUCCESS response"),
Expand Down Expand Up @@ -390,6 +390,9 @@ async def test_TC_DRLK_2_9(self):
aliroevictableendpointkey2 = bytes.fromhex(
"047a4c662d753924cdf3779a3c84fec2debaa6f0b3084450878acc7ddcce7856ae57b1ebbe2561015103dd7474c2a183675378ec55f1e465ac3436bf3dd5ca54d4")

# Commissioning
self.step("0")

self.step("1")
if self.pics_guard(self.check_pics("DRLK.S.F08") and self.check_pics("DRLK.S.A0011")):
self.numberoftotaluserssupported = await self.read_attributes_from_dut(endpoint=self.app_cluster_endpoint,
Expand Down
87 changes: 46 additions & 41 deletions src/python_testing/TC_IDM_4_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,32 +66,33 @@
class TC_IDM_4_2(MatterBaseTest):

def steps_TC_IDM_4_2(self):
return [TestStep(0, "CR1 reads the ServerList attribute from the Descriptor cluster on EP0.",
return [TestStep(0, "Commissioning already done.", is_commissioning=True),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just do TestStep("precondition", ...) so we don't have to fiddle with the numbering on the test plan?

TestStep(1, "CR1 reads the ServerList attribute from the Descriptor cluster on EP0.",
"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."),
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.",
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.",
"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."),
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.",
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.",
"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."),
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.",
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.",
"Verify that the DUT returns a \"INVALID_ACTION\" status response."),
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.",
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.",
"Verify that the DUT returns a \"INVALID_ACTION\" status response." 8000 ),
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.",
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.",
"Verify that the DUT returns a \"INVALID_ACTION\" status response."),
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.",
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.",
"Verify that the DUT returns a \"INVALID_ACTION\" status response."),
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.",
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.",
"Verify that the subscription is activated between CR1 and DUT."),
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."),
TestStep(9, "CR1 modifies the attribute which has been subscribed to on the DUT and waits for an incoming ReportDataMessage",
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."),
TestStep(10, "CR1 modifies the attribute which has been subscribed to on the DUT and waits for an incoming ReportDataMessage",
"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)"),
TestStep(10, "CR1 sends a subscription request action for an attribute and set the MinIntervalFloor value to be greater than MaxIntervalCeiling.",
TestStep(11, "CR1 sends a subscription request action for an attribute and set the MinIntervalFloor value to be greater than MaxIntervalCeiling.",
"Verify that the DUT sends an error message and the subscription is not established."),
TestStep(11, "CR1 sends a subscription request to subscribe to a specific global attribute from all clusters on all endpoints.",
TestStep(12, "CR1 sends a subscription request to subscribe to a specific global attribute from all clusters on all endpoints.",
"Verify that the Subscription succeeds and the DUT sends back the attribute values for the global attribute."),
TestStep(12, "CR1 sends a subscription request to subscribe to a global attribute on an endpoint on all clusters.",
TestStep(13, "CR1 sends a subscription request to subscribe to a global attribute on an endpoint on all clusters.",
"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."),
TestStep(13, "CR1 sends a subscription request to the DUT with both AttributeRequests and EventRequests as empty.",
TestStep(14, "CR1 sends a subscription request to the DUT with both AttributeRequests and EventRequests as empty.",
"Verify that the Subscription does not succeed and the DUT sends back a Status Response Action with the INVALID_ACTION Status Code")
]

Expand Down Expand Up @@ -200,11 +201,15 @@ async def test_TC_IDM_4_2(self):
)

# *** Step 0 ***
# Commissioning
self.step(0)

# *** Step 1 ***
# CR1 reads the ServerList attribute from the Descriptor cluster on EP0. If the ICDManagement 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.
self.step(0)
self.step(1)

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

# *** Step 1 ***
# *** Step 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.
self.step(1)
self.step(2)

max_interval_ceiling_sec = subscription_max_interval_publisher_limit_sec + 5
asserts.assert_greater(max_interval_ceiling_sec, min_interval_floor_sec,
Expand Down Expand Up @@ -270,12 +275,12 @@ async def test_TC_IDM_4_2(self):

sub_cr1_step1.Shutdown()

# *** Step 2 ***
# *** Step 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.
self.step(2)
self.step(3)

min_interval_floor_sec = 0

Expand Down Expand Up @@ -313,10 +318,10 @@ async def test_TC_IDM_4_2(self):

sub_cr1_step2.Shutdown()

# *** Step 3 ***
# *** Step 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.
self.step(3)
self.step(4)

# Setting max_interval_ceiling_sec value for steps 3-8
max_interval_ceiling_sec = 10
Expand Down Expand Up @@ -350,11 +355,11 @@ async def test_TC_IDM_4_2(self):
asserts.assert_equal(e.err, INVALID_ACTION_ERROR_CODE,
"Incorrect error response for subscription to unallowed cluster")

# *** Step 4 ***
# *** Step 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.
self.step(4)
self.step(5)

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

# *** Step 5 ***
# *** Step 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.
self.step(5)
self.step(6)

# Get first value of parts list for the endpoint
parts_list = await self.get_descriptor_parts_list(CR1)
Expand Down Expand Up @@ -429,11 +434,11 @@ async def test_TC_IDM_4_2(self):
asserts.assert_equal(e.err, INVALID_ACTION_ERROR_CODE,
"Incorrect error response for subscription to unallowed endpoint")

# *** Step 6 ***
# *** Step 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.
self.step(6)
self.step(7)

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

Expand All @@ -458,13 +463,13 @@ async def test_TC_IDM_4_2(self):
asserts.assert_equal(e.err, INVALID_ACTION_ERROR_CODE,
"Incorrect error response for subscription to unallowed node")

# *** Step 7 ***
# *** Step 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.
self.step(7)
self.step(8)

# Subscribe to attribute with empty dataVersionFilters
sub_cr1_empty_dvf = await CR1.ReadAttribute(
Expand Down Expand Up @@ -498,13 +503,13 @@ async def test_TC_IDM_4_2(self):

sub_cr1_step7.Shutdown()

# *** Step 8 ***
# *** Step 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.
self.step(8)
self.step(9)

# Subscribe to attribute
sub_cr1_update_value = await CR1.ReadAttribute(
Expand All @@ -517,10 +522,10 @@ async def test_TC_IDM_4_2(self):
# Record the time when the priming ReportDataMessage is received
t_report_sec = time.time()

# *** Step 9 ***
# *** Step 10 ***
# CR1 modifies the attribute which has been subscribed to on the DUT
# and waits for an incoming ReportDataMessage
self.step(9)
self.step(10)

# Saving the returned MaxInterval from the SubscribeResponseMessage
min_interval_floor_sec, max_interval_sec = sub_cr1_update_value.GetReportingIntervalsSeconds()
Expand Down Expand Up @@ -555,10 +560,10 @@ async def test_TC_IDM_4_2(self):

sub_cr1_update_value.Shutdown()

# *** Step 10 ***
# *** Step 11 ***
# CR1 sends a subscription request action for an attribute and set the MinIntervalFloor
# value to be greater than MaxIntervalCeiling.
self.step(10)
self.step(11)

# Subscribe to attribute with invalid reportInterval arguments, expect an error
sub_cr1_invalid_intervals = None
Expand All @@ -574,10 +579,10 @@ async def test_TC_IDM_4_2(self):
with asserts.assert_raises(AttributeError):
sub_cr1_invalid_intervals.subscriptionId

# *** Step 11 ***
# *** Step 12 ***
# CR1 sends a subscription request to subscribe to a specific global attribute from
# all clusters on all endpoints.
self.step(11)
self.step(12)

# Setting max_interval_ceiling_sec value for steps 11-13
max_interval_ceiling_sec = 10
Expand Down Expand Up @@ -614,9 +619,9 @@ async def test_TC_IDM_4_2(self):

sub_cr1_step11.Shutdown()

# *** Step 12 ***
# *** Step 13 ***
# CR1 sends a subscription request to subscribe to a global attribute on an endpoint on all clusters.
self.step(12)
self.step(13)

# Specifying single endpoint 0
requested_ep = 0
Expand Down Expand Up @@ -654,9 +659,9 @@ async def test_TC_IDM_4_2(self):

sub_cr1_step12.Shutdown()

# *** Step 13 ***
# *** Step 14 ***
# CR1 sends a subscription request to the DUT with both AttributeRequests and EventRequests as empty.
self.step(13)
self.step(14)

# Attempt a subscription with both AttributeRequests and EventRequests as empty
sub_cr1_step13 = None
Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_MCORE_FS_1_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ async def test_TC_MCORE_FS_1_1(self):

asserts.assert_not_equal(dut_commissioning_control_endpoint, 0, "Invalid aggregator endpoint. Cannot proceed with test.")

# Commissioning
self.step(0)

self.step(1)
self.step(2)
self.step(3)
Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_MCORE_FS_1_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ async def test_TC_MCORE_FS_1_2(self):
min_report_interval_sec = self.user_params.get("min_report_interval_sec", 0)
max_report_interval_sec = self.user_params.get("max_report_interval_sec", 30)

# Commissioning
self.step(0)

self.step(1)
# Subscribe to the PartsList
root_endpoint = 0
Expand Down
Loading
Loading
0