Skip to content

Commit 8356a27

Browse files
Updates steps to step array
1 parent f67b271 commit 8356a27

File tree

1 file changed

+56
-6
lines changed

1 file changed

+56
-6
lines changed

src/python_testing/TC_IDM_4_3.py

+56-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from chip.clusters.Attribute import AttributePath, TypedAttributePath
2727
from chip.exceptions import ChipStackError
2828
from chip.interaction_model import Status
29-
from matter_testing_support import (MatterBaseTest, async_test_body, default_matter_test_main)
29+
from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main)
3030
# from matter_testing_support import (AttributeChangeCallback, MatterBaseTest, async_test_body, default_matter_test_main,
3131
# wait_for_attribute_report)
3232
from mobly import asserts
@@ -46,6 +46,53 @@
4646

4747
class TC_IDM_4_3(MatterBaseTest):
4848

49+
def steps_TC_IDM_4_3(self):
50+
return [TestStep("1a", "DUT and TH activate the subscription.",
51+
"Verify on the TH, a report data message is received. Verify on the TH the Subscribe Response has the following fields: SubscriptionId and MaxInterval In the following Steps 2, 3, 5-10, 13, and 15, the MaxInterval time reference in each step is the MaxInterval presented in the Subscribe Response of the subscription."),
52+
TestStep("1b", "Change the value of the attribute which has been subscribed on the DUT by manually changing some settings on the device. Example: Temperature sensor may update the value of the room temperature. Turning on/off on a light bulb.",
53+
"Verify that there is a report data message sent from the DUT for the changed value of the attribute. Verify that the Report Data is sent when the minimum interval time is reached and before the MaxInterval time."),
54+
# TestStep(2, "DUT and TH activate the subscription. Change the value of the attribute which has been subscribed on the DUT by sending an IMWrite or Invoke message to the DUT from the TH.",
55+
# "Verify that there is a report data message sent from the DUT for the changed value of the attribute. Verify that the Report Data is sent when the minimum interval time is reached and before the MaxInterval time."),
56+
# TestStep(3, "DUT and TH activate the subscription for an attribute. Do not change the value of the attribute which has been subscribed.",
57+
# "Verify that there is an empty report data message sent from the DUT to the TH after MaxInterval time."),
58+
# TestStep(4, "DUT and TH activate the subscription. Change the value of the attribute which has been subscribed on the DUT. TH force sends a status response with an \"invalid subscription\". Change the value of the attribute which has been subscribed on the DUT.",
59+
# "Verify that DUT does not send report data for the second time after the subscription has been terminated."),
60+
# TestStep(5, "Activate the subscription between the DUT and the TH for an attribute of data type bool. Modify that attribute on the DUT. DUT should send the report data with the modified attribute value. Modify the attribute multiple times (3 times) before the MaxInterval time specified during the subscription activation.",
61+
# "Verify on the TH that the DUT sends the correct value of the attribute."),
62+
# TestStep(6, "Activate the subscription between the DUT and the TH for an attribute of data type string. Modify that attribute on the DUT. DUT should send the report data with the modified attribute value Modify the attribute multiple times (3 times) before the MaxInterval time specified during the subscription activation.",
63+
# "Verify on the TH that the DUT sends the correct value of the attribute."),
64+
# TestStep(7, "Activate the subscription between the DUT and the TH for an attribute of data type \"unsigned integer\". Modify that attribute on the DUT. DUT should send the report data with the modified attribute value. Modify the attribute multiple times (3 times) before the MaxInterval time specified during the subscription activation.",
65+
# "Verify on the TH that the DUT sends the correct value of the attribute."),
66+
# TestStep(8, "Activate the subscription between the DUT and the TH for an attribute of data type \"signed integer\". Modify that attribute on the DUT. DUT should send the report data with the modified attribute value. Modify the attribute multiple times (3 times)before the MaxInterval time specified during the subscription activation.",
67+
# "Verify on the TH that the DUT sends the correct value of the attribute."),
68+
# TestStep(9, "Activate the subscription between the DUT and the TH for an attribute of data type \"floating point\". Modify that attribute on the DUT. DUT should send the report data with the modified attribute value. Modify the attribute multiple times (3 times) before the MaxInterval time specified during the subscription activation.",
69+
# "Verify on the TH that the DUT sends the correct value of the attribute."),
70+
# TestStep(10, "Activate the subscription between the DUT and the TH for an attribute of data type list. Modify that attribute on the DUT. DUT should send the report data with the modified attribute value. Modify the attribute multiple times (3 times) before the MaxInterval time specified during the subscription activation.",
71+
# "Verify on the TH that the DUT sends the correct value of the attribute."),
72+
# TestStep(11, "Activate the subscription between the DUT and the TH for any attribute. KeepSubscriptions flag should be set to False After the Maximum interval time is elapsed, TH should send another subscription request message with different parameters than before. KeepSubscriptions flag should be set to False Change the value of the attribute requested on the DUT.",
73+
# "Verify that the DUT sends the changed value of the attribute with the newest subscription id sent with the second request."),
74+
# TestStep(12, "Activate the subscription between the DUT and the TH for any attribute After the Maximum interval time is elapsed, change the value of the attribute requested on the DUT.",
75+
# "Verify that the DUT sends the changed value of the attribute to the TH after the next MinIntervalFloor time has passed."),
76+
# TestStep(13, "Activate the subscription between the DUT and the TH for an attribute There are no attribute value changes before MaxInterval elapses.",
77+
# "Verify that the DUT sends a Report Data action with no data to keep the subscription alive."),
78+
# TestStep(14, "TH sends a subscription request action for an attribute to the DUT with the KeepSubscriptions flag set to True. Activate the subscription between DUT and the TH. Initiate another subscription request action to the DUT for another attribute with the KeepSubscriptions flag set to True. Change both the attribute values on the DUT.",
79+
# "Verify that both the subscriptions are active and the TH receives reports for both these attributes on both subscriptions."),
80+
# TestStep(15, "TH sends a subscription request action for an attribute to the DUT with the KeepSubscriptions flag set to True. Activate the subscription between DUT and the TH. Initiate another subscription request action to the DUT for another attribute with the KeepSubscriptions flag set to False. Change both the attribute values on the DUT.",
81+
# "Verify that both the subscriptions are active and the TH receives notifications for both these attributes. Verify that the first subscription is terminated after the MaxInterval of the first subscription is reached."),
82+
# TestStep(16, "TH sends a subscription request action for an attribute and all events. Set the MinIntervalFloor to some value say \"N\"(seconds). Change the value of the attribute and trigger an action on the DUT to trigger any event.",
83+
# "Verify on TH that DUT sends a report action data for both the attribute and the event after N seconds."),
84+
# TestStep(17, "TH sends a subscription request action for attribute wildcard - AttributePath = [[Endpoint = EndpointID, Cluster = ClusterID]]. Set the MinIntervalFloor to some value say \"N\"(seconds). Change all or few of the attributes on the DUT",
85+
# "Verify that the DUT sends reports for all the attributes that have changed after N seconds."),
86+
# TestStep(18, "TH sends a subscription request to subscribe to an attribute on a specific cluster from all endpoints AttributePath = [[Attribute = Attribute, Cluster = ClusterID ]]. Set the MinIntervalFloor to some value say \"N\"(seconds). Change the attribute on the DUT",
87+
# "Verify that the DUT sends reports for all the attributes that have changed after N seconds."),
88+
# TestStep(19, "TH sends a subscription request to subscribe to all attributes from all clusters from all endpoints. AttributePath = [[]]. Set the MinIntervalFloor to some value say \"N\"(seconds). Change all or few of the attributes on the DUT",
89+
# "Verify that the DUT sends reports for all the attributes that have changed after N seconds."),
90+
# TestStep(20, "TH sends a subscription request to subscribe to all attributes from all clusters on an endpoint. AttributePath = [[Endpoint = EndpointID]]. Set the MinIntervalFloor to some value say \"N\"(seconds). Change all or few of the attributes on the DUT",
91+
# "Verify that the DUT sends reports for all the attributes that have changed after N seconds."),
92+
# TestStep(21, "TH sends a subscription request to subscribe to all attributes from a specific cluster on all endpoints. AttributePath = [[Cluster = ClusterID]]. Set the MinIntervalFloor to some value say \"N\"(seconds). Change all or few of the attributes on the DUT",
93+
# "Verify that the DUT sends reports for all the attributes that have changed after N seconds.")
94+
]
95+
4996
@async_test_body
5097
async def test_TC_IDM_4_3(self):
5198

@@ -55,7 +102,8 @@ async def test_TC_IDM_4_3(self):
55102
TH: ChipDeviceController = self.default_controller
56103

57104
# *** Step 1a ***
58-
self.print_step("1a", "DUT and TH activate the subscription.")
105+
# DUT and TH activate the subscription.
106+
self.step("1a")
59107

60108
# Subscribe to attribute
61109
sub_th_step1a = await TH.ReadAttribute(
@@ -64,7 +112,7 @@ async def test_TC_IDM_4_3(self):
64112
reportInterval=(3, 10),
65113
keepSubscriptions=False
66114
)
67-
115+
68116
# Verify that the subscription is activated between TH and DUT
69117
# Verify on the TH, a report data message is received.
70118
asserts.assert_true(sub_th_step1a.subscriptionId, "Subscription not activated")
@@ -73,14 +121,16 @@ async def test_TC_IDM_4_3(self):
73121
asserts.assert_is_not_none(sub_th_step1a.subscriptionId, "SubscriptionId field not present")
74122

75123
# Verify MaxInterval field is present
76-
sub_th_step1a_intervals = sub_th_step1a.GetReportingIntervalsSeconds()
77-
sub_th_step1a_min_interval_sec, sub_th_step1a_max_interval_sec = sub_th_step1a_intervals
124+
sub_th_step1a_min_interval_sec, sub_th_step1a_max_interval_sec = sub_th_step1a.GetReportingIntervalsSeconds()
78125
asserts.assert_is_not_none(sub_th_step1a_max_interval_sec, "MaxInterval field not present")
79126

80127
sub_th_step1a.Shutdown()
81128

82129
# *** Step 1b ***
83-
self.print_step("1b", "Change the value of the attribute which has been subscribed on the DUT by manually changing some settings on the device.")
130+
# Change the value of the attribute which has been subscribed on the DUT by manually changing some
131+
# settings on the device. Example: Temperature sensor may update the value of the room temperature.
132+
# Turning on/off on a light bulb.
133+
self.step("1b")
84134

85135
# Modify attribute value
86136
new_node_label_write = "NewNodeLabel_11001100"

0 commit comments

Comments
 (0)