Skip to content

Commit 4e5f15a

Browse files
committed
Update following code review comments on test spec
1 parent 0fcfb23 commit 4e5f15a

File tree

1 file changed

+86
-84
lines changed

1 file changed

+86
-84
lines changed

src/python_testing/TC_EWATERHTR_2_3.py

+86-84
Original file line numberDiff line numberDiff line change
@@ -50,89 +50,90 @@ def pics_TC_EWATERHTR_2_3(self):
5050
def steps_TC_EWATERHTR_2_3(self) -> list[TestStep]:
5151
steps = [
5252
TestStep("1", "Commission DUT to TH (can be skipped if done in a preceding test)"),
53-
TestStep("2", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster",
53+
TestStep("2", "Set up a subscription to all WaterHeaterManagement cluster events"),
54+
TestStep("3", "TH reads TestEventTriggersEnabled attribute from General Diagnostics Cluster",
5455
"Value has to be 1 (True)"),
55-
TestStep("3", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Basic installation Test Event",
56+
TestStep("4", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Basic installation Test Event",
5657
"Verify DUT responds w/ status SUCCESS(0x00)"),
57-
TestStep("3a", "TH reads from the DUT the HeatDemand",
58+
TestStep("4a", "TH reads from the DUT the HeatDemand",
5859
"Value has to be 0x00 (no demand on any source)"),
59-
TestStep("3b", "TH reads from the DUT the BoostState",
60+
TestStep("4b", "TH reads from the DUT the BoostState",
6061
"Value has to be 0 (Inactive)"),
61-
TestStep("3c", "TH reads from the DUT the TankPercentage",
62+
TestStep("4c", "TH reads from the DUT the TankPercentage",
6263
"Value has to be 0%"),
63-
TestStep("3d", "TH reads from the DUT the HeaterTypes",
64+
TestStep("4d", "TH reads from the DUT the HeaterTypes",
6465
"Value has to be greater than 0x00 (at least one type supported) and Store the value as HeaterTypes"),
65-
TestStep("4", "TH sends command Boost with Duration=600s,TargetPercentage=100%",
66-
"Verify DUT responds w/ status SUCCESS(0x00)"),
67-
TestStep("4a", "TH reads from the DUT the HeatDemand",
68-
"Value has to be greater than 0x00 (demand on at least one source) and (HeaterDemand & (!HeaterTypes)) is zero (demand is only from declared supported types)"),
69-
TestStep("4b", "TH reads from the DUT the BoostState",
70-
"Value has to be 1 (Active)"),
71-
TestStep("5", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Water Temperature 61C Test Event",
72-
"Verify DUT responds w/ status SUCCESS(0x00)"),
66+
TestStep("5", "TH sends command Boost with Duration=600s,TargetPercentage=100%",
67+
"Verify DUT responds w/ status SUCCESS(0x00) and Event EWATERHTR.S.E00(BoostStarted) sent with Duration=600 and TargetPercentage=100"),
7368
TestStep("5a", "TH reads from the DUT the HeatDemand",
74-
"Value has to be 0x00 (no demand on any source)"),
69+
"Value has to be greater than 0x00 (demand on at least one source) and (HeaterDemand & (!HeaterTypes)) is zero (demand is only from declared supported types)"),
7570
TestStep("5b", "TH reads from the DUT the BoostState",
7671
"Value has to be 1 (Active)"),
77-
TestStep("5c", "TH reads from the DUT the TankPercentage",
78-
"Value has to be 100%"),
79-
TestStep("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Draw off hot water Test Event",
72+
TestStep("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Water Temperature 61C Test Event",
8073
"Verify DUT responds w/ status SUCCESS(0x00)"),
8174
TestStep("6a", "TH reads from the DUT the HeatDemand",
82-
"Value has to be greater than 0x00 (demand on at least one source) and (HeaterDemand & (!HeaterTypes)) is zero (demand is only from declared supported types)"),
75+
"Value has to be 0x00 (no demand on any source)"),
8376
TestStep("6b", "TH reads from the DUT the BoostState",
8477
"Value has to be 1 (Active)"),
8578
TestStep("6c", "TH reads from the DUT the TankPercentage",
86-
"Value has to be 75%"),
87-
TestStep("7", "TH sends command CancelBoost",
79+
"Value has to be 100%"),
80+
TestStep("7", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Draw off hot water Test Event",
8881
"Verify DUT responds w/ status SUCCESS(0x00)"),
8982
TestStep("7a", "TH reads from the DUT the HeatDemand",
90-
"Value has to be 0x00 (no demand on any source)"),
83+
"Value has to be greater than 0x00 (demand on at least one source) and (HeaterDemand & (!HeaterTypes)) is zero (demand is only from declared supported types)"),
9184
TestStep("7b", "TH reads from the DUT the BoostState",
92-
"Value has to be 0 (Inactive)"),
85+
"Value has to be 1 (Active)"),
9386
TestStep("7c", "TH reads from the DUT the TankPercentage",
94-
"Value has to be 75%"),
95-
TestStep("8", "TH sends command Boost with Duration=600s,TargetPercentage=100%,TargetReheat=65%",
96-
"Verify DUT responds w/ status SUCCESS(0x00)"),
87+
"Value has to be 76%"),
88+
TestStep("8", "TH sends command CancelBoost",
89+
"Verify DUT responds w/ status SUCCESS(0x00) and Event EWATERHTR.S.E00(BoostEnded) sent"),
9790
TestStep("8a", "TH reads from the DUT the HeatDemand",
98-
"Value has to be greater than 0x00 (demand on at least one source) and (HeaterDemand & (!HeaterTypes)) is zero (demand is only from declared supported types)"),
91+
"Value has to be 0x00 (no demand on any source)"),
9992
TestStep("8b", "TH reads from the DUT the BoostState",
100-
"Value has to be 1 (Active)"),
93+
"Value has to be 0 (Inactive)"),
10194
TestStep("8c", "TH reads from the DUT the TankPercentage",
102-
"Value has to be 75%"),
103-
TestStep("9", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Water Temperature 61C Test Event",
104-
"Verify DUT responds w/ status SUCCESS(0x00)"),
95+
"Value has to be 76%"),
96+
TestStep("9", "TH sends command Boost with Duration=400s,TargetPercentage=100%,TargetReheat=65%",
97+
"Verify DUT responds w/ status SUCCESS(0x00) and Event EWATERHTR.S.E00(BoostStarted) sent with Duration=600 and TargetPercentage=100 and TargetReheat=65"),
10598
TestStep("9a", "TH reads from the DUT the HeatDemand",
106-
"Value has to be 0x00 (no demand on any source)"),
99+
"Value has to be greater than 0x00 (demand on at least one source) and (HeaterDemand & (!HeaterTypes)) is zero (demand is only from declared supported types)"),
107100
TestStep("9b", "TH reads from the DUT the BoostState",
108101
"Value has to be 1 (Active)"),
109102
TestStep("9c", "TH reads from the DUT the TankPercentage",
110-
"Value has to be 100%"),
111-
TestStep("10", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Draw off hot water Test Event",
103+
"Value has to be 76%"),
104+
TestStep("10", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Water Temperature 61C Test Event",
112105
"Verify DUT responds w/ status SUCCESS(0x00)"),
113106
TestStep("10a", "TH reads from the DUT the HeatDemand",
114107
"Value has to be 0x00 (no demand on any source)"),
115108
TestStep("10b", "TH reads from the DUT the BoostState",
116109
"Value has to be 1 (Active)"),
117110
TestStep("10c", "TH reads from the DUT the TankPercentage",
118-
"Value has to be 75%"),
111+
"Value has to be 100%"),
119112
TestStep("11", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Draw off hot water Test Event",
120113
"Verify DUT responds w/ status SUCCESS(0x00)"),
121114
TestStep("11a", "TH reads from the DUT the HeatDemand",
122-
"Value has to be greater than 0x00 (demand on at least one source) and (HeaterDemand & (!HeaterTypes)) is zero (demand is only from declared supported types)"),
115+
"Value has to be 0x00 (no demand on any source)"),
123116
TestStep("11b", "TH reads from the DUT the BoostState",
124117
"Value has to be 1 (Active)"),
125118
TestStep("11c", "TH reads from the DUT the TankPercentage",
126-
"Value has to be 50%"),
127-
TestStep("12", "TH sends command CancelBoost",
119+
"Value has to be 76%"),
120+
TestStep("12", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Draw off hot water Test Event",
128121
"Verify DUT responds w/ status SUCCESS(0x00)"),
129122
TestStep("12a", "TH reads from the DUT the HeatDemand",
130-
"Value has to be 0x00 (no demand on any source)"),
123+
"Value has to be greater than 0x00 (demand on at least one source) and (HeaterDemand & (!HeaterTypes)) is zero (demand is only from declared supported types)"),
131124
TestStep("12b", "TH reads from the DUT the BoostState",
132-
"Value has to be 0 (Inactive)"),
125+
"Value has to be 1 (Active)"),
133126
TestStep("12c", "TH reads from the DUT the TankPercentage",
134-
"Value has to be 50%"),
135-
TestStep("13", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Basic installation Test Event Clear",
127+
"Value has to be 57%"),
128+
TestStep("13", "TH sends command CancelBoost",
129+
"Verify DUT responds w/ status SUCCESS(0x00) and Event EWATERHTR.S.E00(BoostEnded) sent"),
130+
TestStep("13a", "TH reads from the DUT the HeatDemand",
131+
"Value has to be 0x00 (no demand on any source)"),
132+
TestStep("13b", "TH reads from the DUT the BoostState",
133+
"Value has to be 0 (Inactive)"),
134+
TestStep("13c", "TH reads from the DUT the TankPercentage",
135+
"Value has to be 57%"),
136+
TestStep("14", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EWATERHTR.TESTEVENT_TRIGGERKEY and EventTrigger field set to PIXIT.EWATERHTR.TESTEVENTTRIGGER for Basic installation Test Event Clear",
136137
"Verify DUT responds w/ status SUCCESS(0x00)"),
137138
]
138139

@@ -144,159 +145,160 @@ async def test_TC_EWATERHTR_2_3(self):
144145
self.step("1")
145146
# Commission DUT - already done
146147

148+
self.step("2")
147149
# Subscribe to Events and when they are sent push them to a queue for checking later
148150
events_callback = EventChangeCallback(Clusters.WaterHeaterManagement)
149151
await events_callback.start(self.default_controller,
150152
self.dut_node_id,
151153
self.matter_test_config.endpoint)
152154

153-
self.step("2")
155+
self.step("3")
154156
await self.check_test_event_triggers_enabled()
155157

156-
self.step("3")
158+
self.step("4")
157159
await self.send_test_event_trigger_basic_installation_test_event()
158160

159-
self.step("3a")
161+
self.step("4a")
160162
await self.check_whm_attribute("HeatDemand", 0)
161163

162-
self.step("3b")
164+
self.step("4b")
163165
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kInactive)
164166

165-
self.step("3c")
167+
self.step("4c")
166168
await self.check_whm_attribute("TankPercentage", 0)
167169

168-
self.step("3d")
170+
self.step("4d")
169171
heaterTypes = await self.read_whm_attribute_expect_success(attribute="HeaterTypes")
170172
asserts.assert_greater(heaterTypes, 0)
171173

172-
self.step("4")
174+
self.step("5")
173175
await self.send_boost_command(duration=600, target_percentage=100)
174176

175177
event_data = events_callback.wait_for_event_report(Clusters.WaterHeaterManagement.Events.BoostStarted)
176178
asserts.assert_equal(event_data.boostInfo.duration, 600)
177179
asserts.assert_equal(event_data.boostInfo.targetPercentage, 100)
178180

179-
self.step("4a")
181+
self.step("5a")
180182
heatDemand = await self.read_whm_attribute_expect_success(attribute="HeatDemand")
181183
asserts.assert_greater(heatDemand, 0)
182184
asserts.assert_equal(heatDemand & (~heaterTypes), 0, "heatDemand should only be from declared supported types"),
183185

184-
self.step("4b")
186+
self.step("5b")
185187
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kActive)
186188

187-
self.step("5")
189+
self.step("6")
188190
await self.send_test_event_trigger_water_temperature61C_test_event()
189191

190-
self.step("5a")
192+
self.step("6a")
191193
heatDemand = await self.read_whm_attribute_expect_success(attribute="HeatDemand")
192194
asserts.assert_equal(heatDemand, 0)
193195

194-
self.step("5b")
196+
self.step("6b")
195197
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kActive)
196198

197-
self.step("5c")
199+
self.step("6c")
198200
await self.check_whm_attribute("TankPercentage", 100)
199201

200-
self.step("6")
202+
self.step("7")
201203
await self.send_test_event_trigger_draw_off_hot_water_test_event()
202204

203-
self.step("6a")
205+
self.step("7a")
204206
heatDemand = await self.read_whm_attribute_expect_success(attribute="HeatDemand")
205207
asserts.assert_greater(heatDemand, 0)
206208
asserts.assert_equal(heatDemand & (~heaterTypes), 0, "heatDemand should only be from declared supported types"),
207209

208-
self.step("6b")
210+
self.step("7b")
209211
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kActive)
210212

211-
self.step("6c")
213+
self.step("7c")
212214
await self.check_whm_attribute("TankPercentage", 76)
213215

214-
self.step("7")
216+
self.step("8")
215217
await self.send_cancel_boost_command()
216218

217219
event_data = events_callback.wait_for_event_report(Clusters.WaterHeaterManagement.Events.BoostEnded)
218220

219-
self.step("7a")
221+
self.step("8a")
220222
await self.check_whm_attribute("HeatDemand", 0)
221223

222-
self.step("7b")
224+
self.step("8b")
223225
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kInactive)
224226

225-
self.step("7c")
227+
self.step("8c")
226228
await self.check_whm_attribute("TankPercentage", 76)
227229

228-
self.step("8")
230+
self.step("9")
229231
await self.send_boost_command(duration=400, target_percentage=100, target_reheat=65)
230232

231233
event_data = events_callback.wait_for_event_report(Clusters.WaterHeaterManagement.Events.BoostStarted)
232234
asserts.assert_equal(event_data.boostInfo.duration, 400)
233235
asserts.assert_equal(event_data.boostInfo.targetPercentage, 100)
234236
asserts.assert_equal(event_data.boostInfo.targetReheat, 65)
235237

236-
self.step("8a")
238+
self.step("9a")
237239
heatDemand = await self.read_whm_attribute_expect_success(attribute="HeatDemand")
238240
asserts.assert_greater(heatDemand, 0)
239241
asserts.assert_equal(heatDemand & (~heaterTypes), 0, "heatDemand should only be from declared supported types"),
240242

241-
self.step("8b")
243+
self.step("9b")
242244
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kActive)
243245

244-
self.step("8c")
246+
self.step("9c")
245247
await self.check_whm_attribute("TankPercentage", 76)
246248

247-
self.step("9")
249+
self.step("10")
248250
await self.send_test_event_trigger_water_temperature61C_test_event()
249251

250-
self.step("9a")
252+
self.step("10a")
251253
await self.check_whm_attribute("HeatDemand", 0)
252254

253-
self.step("9b")
255+
self.step("10b")
254256
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kActive)
255257

256-
self.step("9c")
258+
self.step("10c")
257259
await self.check_whm_attribute("TankPercentage", 100)
258260

259-
self.step("10")
261+
self.step("11")
260262
await self.send_test_event_trigger_draw_off_hot_water_test_event()
261263

262-
self.step("10a")
264+
self.step("11a")
263265
await self.check_whm_attribute("HeatDemand", 0)
264266

265-
self.step("10b")
267+
self.step("11b")
266268
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kActive)
267269

268-
self.step("10c")
270+
self.step("11c")
269271
await self.check_whm_attribute("TankPercentage", 76)
270272

271-
self.step("11")
273+
self.step("12")
272274
await self.send_test_event_trigger_draw_off_hot_water_test_event()
273275

274-
self.step("11a")
276+
self.step("12a")
275277
heatDemand = await self.read_whm_attribute_expect_success(attribute="HeatDemand")
276278
asserts.assert_greater(heatDemand, 0)
277279
asserts.assert_equal(heatDemand & (~heaterTypes), 0, "heatDemand should only be from declared supported types"),
278280

279-
self.step("11b")
281+
self.step("12b")
280282
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kActive)
281283

282-
self.step("11c")
284+
self.step("12c")
283285
await self.check_whm_attribute("TankPercentage", 57)
284286

285-
self.step("12")
287+
self.step("13")
286288
await self.send_cancel_boost_command()
287289

288290
event_data = events_callback.wait_for_event_report(Clusters.WaterHeaterManagement.Events.BoostEnded)
289291

290-
self.step("12a")
292+
self.step("13a")
291293
await self.check_whm_attribute("HeatDemand", 0)
292294

293-
self.step("12b")
295+
self.step("13b")
294296
await self.check_whm_attribute("BoostState", Clusters.WaterHeaterManagement.Enums.BoostStateEnum.kInactive)
295297

296-
self.step("12c")
298+
self.step("13c")
297299
await self.check_whm_attribute("TankPercentage", 57)
298300

299-
self.step("13")
301+
self.step("14")
300302
await self.send_test_event_trigger_basic_installation_test_event_clear()
301303

302304

0 commit comments

Comments
 (0)