Skip to content

Commit dc0588f

Browse files
committed
[TC_CGEN_2_8] Add TC acknowledgement attribute verification steps
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 f2339f8 commit dc0588f

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
@@ -61,7 +61,10 @@ def steps_TC_CGEN_2_8(self) -> list[TestStep]:
6161
TestStep(5, "DUT is factory reset."),
6262
TestStep(6, "Perform the necessary actions to put the DUT into a commissionable state."),
6363
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'"),
64-
TestStep(8, "TH sends CommissioningComplete to DUT."),
64+
TestStep(8, "TH reads from the DUT the attribute TCAcceptedVersion."),
65+
TestStep(9, "TH reads from the DUT the attribute TCAcknowledgements."),
66+
TestStep(10, "TH reads from the DUT the attribute TCAcknowledgementsRequired."),
67+
TestStep(11, "TH sends CommissioningComplete to DUT."),
6568
]
6669

6770
@async_test_body
@@ -147,8 +150,26 @@ async def test_TC_CGEN_2_8(self):
147150
self.matter_test_config.tc_user_response_to_simulate = None
148151
await self.commission_devices()
149152

150-
# Step 8: Verify CommissioningComplete fails
153+
# Step 8: Verify that TCAcceptedVersion equals 0
151154
self.step(8)
155+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
156+
accepted_version = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion]
157+
asserts.assert_equal(accepted_version, 0, "TCAcceptedVersion does not match expected value.")
158+
159+
# Step 9: Verify that TCAcknowledgements equals 0
160+
self.step(9)
161+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
162+
acknowledgements = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcknowledgements]
163+
asserts.assert_equal(acknowledgements, 0, "TCAcknowledgements does not match expected value.")
164+
165+
# Step 10: Verify that TCAcknowledgementsRequired equals True
166+
self.step(10)
167+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgementsRequired)])
168+
tc_acknowledgements_required = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcknowledgementsRequired]
169+
asserts.assert_equal(tc_acknowledgements_required, True, "TCAcknowledgementsRequired should be True.")
170+
171+
# Step 11: Verify CommissioningComplete fails
172+
self.step(11)
152173
response = await commissioner.SendCommand(
153174
nodeid=self.dut_node_id,
154175
endpoint=ROOT_ENDPOINT_ID,

0 commit comments

Comments
 (0)