Skip to content

Commit 098248a

Browse files
authored
[TC_CGEN_2_8] Add TC acknowledgement attribute verification steps (#37498) (#37504)
Add additional test steps to verify TC-related attributes before sending CommissioningComplete: - Verify TCAcceptedVersion equals 0 - Verify TCAcknowledgements equals 0 - Verify TCAcknowledgementsRequired equals True
1 parent 09d4f61 commit 098248a

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/python_testing/TC_CGEN_2_8.py

+23-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ def steps_TC_CGEN_2_8(self) -> list[TestStep]:
4949
TestStep(5, "DUT is factory reset."),
5050
TestStep(6, "Perform the necessary actions to put the DUT into a commissionable state."),
5151
TestStep(7, "TH begins commissioning the DUT and performs the steps 'Device discovery and establish commissioning channel' through 'Security setup using CASE', skipping 'Configure information- TC Acknowledgements'"),
52-
TestStep(8, "TH sends CommissioningComplete to DUT."),
52+
TestStep(8, "TH reads from the DUT the attribute TCAcceptedVersion."),
53+
TestStep(9, "TH reads from the DUT the attribute TCAcknowledgements."),
54+
TestStep(10, "TH reads from the DUT the attribute TCAcknowledgementsRequired."),
55+
TestStep(11, "TH sends CommissioningComplete to DUT."),
5356
]
5457

5558
@async_test_body
@@ -135,8 +138,26 @@ async def test_TC_CGEN_2_8(self):
135138
self.matter_test_config.tc_user_response_to_simulate = None
136139
await self.commission_devices()
137140

138-
# Step 8: Verify CommissioningComplete fails
141+
# Step 8: Verify that TCAcceptedVersion equals 0
139142
self.step(8)
143+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
144+
accepted_version = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion]
145+
asserts.assert_equal(accepted_version, 0, "TCAcceptedVersion does not match expected value.")
146+
147+
# Step 9: Verify that TCAcknowledgements equals 0
148+
self.step(9)
149+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
150+
acknowledgements = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcknowledgements]
151+
asserts.assert_equal(acknowledgements, 0, "TCAcknowledgements does not match expected value.")
152+
153+
# Step 10: Verify that TCAcknowledgementsRequired equals True
154+
self.step(10)
155+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgementsRequired)])
156+
tc_acknowledgements_required = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcknowledgementsRequired]
157+
asserts.assert_equal(tc_acknowledgements_required, True, "TCAcknowledgementsRequired should be True.")
158+
159+
# Step 11: Verify CommissioningComplete fails
160+
self.step(11)
140161
response = await commissioner.SendCommand(
141162
nodeid=self.dut_node_id,
142163
endpoint=ROOT_ENDPOINT_ID,

0 commit comments

Comments
 (0)