Skip to content

Commit 5c8d3ad

Browse files
committedJan 15, 2025
1 parent b1508b1 commit 5c8d3ad

File tree

10 files changed

+219
-216
lines changed

10 files changed

+219
-216
lines changed
 

‎.github/workflows/tests.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ jobs:
500500
--target linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang \
501501
--target linux-x64-fabric-sync-ipv6only-no-ble-no-wifi-clang \
502502
--target linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang \
503+
--target linux-x64-terms-and-conditions \
503504
--target linux-x64-python-bindings \
504505
build \
505506
--copy-artifacts-to objdir-clone \
@@ -518,6 +519,7 @@ jobs:
518519
echo "FABRIC_BRIDGE_APP: out/linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang/fabric-bridge-app" >> /tmp/test_env.yaml
519520
echo "FABRIC_SYNC_APP: out/linux-x64-fabric-sync-ipv6only-no-ble-no-wifi-clang/fabric-sync" >> /tmp/test_env.yaml
520521
echo "LIGHTING_APP_NO_UNIQUE_ID: out/linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang/chip-lighting-app" >> /tmp/test_env.yaml
522+
echo "TERMS_AND_CONDITIONS_APP: out/linux-x64-terms-and-conditions/chip-terms-and-conditions-app" >> /tmp/test_env.yaml
521523
echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
522524
echo "TRACE_TEST_JSON: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
523525
echo "TRACE_TEST_PERFETTO: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml

‎integrations/docker/images/chip-cert-bins/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ RUN case ${TARGETPLATFORM} in \
168168
--target linux-x64-fabric-admin-rpc-ipv6only \
169169
--target linux-x64-light-data-model-no-unique-id-ipv6only \
170170
--target linux-x64-network-manager-ipv6only \
171+
--target linux-x64-terms-and-conditions \
171172
build \
172173
&& mv out/linux-x64-chip-tool-ipv6only-platform-mdns/chip-tool out/chip-tool \
173174
&& mv out/linux-x64-shell-ipv6only-platform-mdns/chip-shell out/chip-shell \
@@ -192,6 +193,7 @@ RUN case ${TARGETPLATFORM} in \
192193
&& mv out/linux-x64-fabric-admin-rpc-ipv6only/fabric-admin out/fabric-admin \
193194
&& mv out/linux-x64-light-data-model-no-unique-id-ipv6only/chip-lighting-app out/chip-lighting-data-model-no-unique-id-app \
194195
&& mv out/linux-x64-network-manager-ipv6only/matter-network-manager-app out/matter-network-manager-app \
196+
&& mv out/linux-x64-terms-and-conditions/chip-terms-and-conditions-app out/chip-terms-and-conditions-app \
195197
;; \
196198
"linux/arm64")\
197199
set -x \
@@ -220,6 +222,7 @@ RUN case ${TARGETPLATFORM} in \
220222
--target linux-arm64-fabric-admin-rpc-ipv6only \
221223
--target linux-arm64-light-data-model-no-unique-id-ipv6only \
222224
--target linux-arm64-network-manager-ipv6only \
225+
--target linux-arm64-terms-and-conditions \
223226
build \
224227
&& mv out/linux-arm64-chip-tool-ipv6only-platform-mdns/chip-tool out/chip-tool \
225228
&& mv out/linux-arm64-shell-ipv6only-platform-mdns/chip-shell out/chip-shell \
@@ -244,6 +247,7 @@ RUN case ${TARGETPLATFORM} in \
244247
&& mv out/linux-arm64-fabric-admin-rpc-ipv6only/fabric-admin out/fabric-admin \
245248
&& mv out/linux-arm64-light-data-model-no-unique-id-ipv6only/chip-lighting-app out/chip-lighting-data-model-no-unique-id-app \
246249
&& mv out/linux-arm64-network-manager-ipv6only/matter-network-manager-app out/matter-network-manager-app \
250+
&& mv out/linux-arm64-terms-and-conditions/chip-terms-and-conditions-app out/chip-terms-and-conditions-app \
247251
;; \
248252
*) ;; \
249253
esac
@@ -283,6 +287,7 @@ COPY --from=chip-build-cert-bins /root/connectedhomeip/out/fabric-bridge-app app
283287
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/fabric-admin apps/fabric-admin
284288
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-lighting-data-model-no-unique-id-app apps/chip-lighting-data-model-no-unique-id-app
285289
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/matter-network-manager-app apps/matter-network-manager-app
290+
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-terms-and-conditions-app apps/chip-terms-and-conditions-app
286291

287292
# Create symbolic links for now since this allows users to use existing configurations
288293
# for running just `app-name` instead of `apps/app-name`

‎scripts/tests/local.py

+1
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ def as_runner(path):
387387
FABRIC_SYNC_APP: {
388388
as_runner(f'out/{target_prefix}-fabric-sync-no-ble-no-wifi-ipv6only-clang-boringssl/fabric-sync')}
389389
LIGHTING_APP_NO_UNIQUE_ID: {as_runner(f'out/{target_prefix}-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang/chip-lighting-app')}
390+
TERMS_AND_CONDITIONS_APP: {as_runner(f'out/{target_prefix}-terms-and-conditions/chip-terms-and-conditions-app')}
390391
TRACE_APP: out/trace_data/app-{{SCRIPT_BASE_NAME}}
391392
TRACE_TEST_JSON: out/trace_data/test-{{SCRIPT_BASE_NAME}}
392393
TRACE_TEST_PERFETTO: out/trace_data/test-{{SCRIPT_BASE_NAME}}

‎src/python_testing/TC_CGEN_2_10.py

+30-49
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# --custom-flow 2
2727
# --capabilities 6
2828
# script-args:
29-
# --in-test-commissioning-method on-network
29+
# --commissioning-method on-network
3030
# --tc-version-to-simulate 1
3131
# --tc-user-response-to-simulate 1
3232
# --qr-code MT:-24J0AFN00KA0648G00
@@ -48,109 +48,90 @@ def desc_TC_CGEN_2_10(self) -> str:
4848

4949
def steps_TC_CGEN_2_10(self) -> list[TestStep]:
5050
return [
51-
TestStep(1, "Read TCAcceptedVersion attribute"),
52-
TestStep(2, "Read TCAcknowledgements attribute"),
53-
TestStep(3, "Send SetTCAcknowledgements with TCVersion=0 and TCUserResponse=65535"),
54-
TestStep(4, "Verify TCAcceptedVersion unchanged"),
55-
TestStep(5, "Verify TCAcknowledgements unchanged"),
56-
TestStep(6, "Send SetTCAcknowledgements with TCVersion=acceptedVersion+1 and TCUserResponse=0"),
57-
TestStep(7, "Verify TCAcceptedVersion unchanged"),
58-
TestStep(8, "Verify TCAcknowledgements unchanged")
51+
TestStep(1, "TH reads from the DUT the attribute TCAcceptedVersion. Store the value as acceptedVersion."),
52+
TestStep(2, "TH reads from the DUT the attribute TCAcknowledgements. Store the value as userAcknowledgements."),
53+
TestStep(3, "TH Sends the SetTCAcknowledgements command to the DUT with the fields set as follows:\n* TCVersion: 0\n* TCUserResponse: 65535"),
54+
TestStep(4, "TH reads from the DUT the attribute TCAcceptedVersion."),
55+
TestStep(5, "TH reads from the DUT the attribute TCAcknowledgements."),
56+
TestStep(6, "TH Sends the SetTCAcknowledgements command to the DUT with the fields set as follows:\n* TCVersion: acceptedVersion + 1\n* TCUserResponse: 0"),
57+
TestStep(7, "TH reads from the DUT the attribute TCAcceptedVersion."),
58+
TestStep(8, "TH reads from the DUT the attribute TCAcknowledgements."),
5959
]
6060

6161
@async_test_body
6262
async def test_TC_CGEN_2_10(self):
6363
commissioner: ChipDeviceCtrl.ChipDeviceController = self.default_controller
64+
await self.commission_devices()
6465

6566
# Step 1: Read TCAcceptedVersion
6667
self.step(1)
67-
response = await commissioner.ReadAttribute(
68-
nodeid=self.dut_node_id,
69-
attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
68+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
7069
accepted_version = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion]
7170

7271
# Step 2: Read TCAcknowledgements
7372
self.step(2)
74-
response = await commissioner.ReadAttribute(
75-
nodeid=self.dut_node_id,
76-
attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
73+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
7774
user_acknowledgements = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcknowledgements]
7875

7976
# Step 3: Send SetTCAcknowledgements with invalid version
8077
self.step(3)
8178
response = await commissioner.SendCommand(
8279
nodeid=self.dut_node_id,
8380
endpoint=ROOT_ENDPOINT_ID,
84-
payload=Clusters.GeneralCommissioning.Commands.SetTCAcknowledgements(
85-
TCVersion=0,
86-
TCUserResponse=65535),
87-
timedRequestTimeoutMs=1000)
81+
payload=Clusters.GeneralCommissioning.Commands.SetTCAcknowledgements(TCVersion=0, TCUserResponse=65535),
82+
)
8883

8984
# Verify TCMinVersionNotMet error
9085
asserts.assert_equal(
9186
response.errorCode,
9287
Clusters.GeneralCommissioning.Enums.CommissioningErrorEnum.kTCMinVersionNotMet,
93-
'Expected TCMinVersionNotMet error')
88+
"Expected TCMinVersionNotMet error",
89+
)
9490

9591
# Step 4: Verify TCAcceptedVersion unchanged
9692
self.step(4)
97-
response = await commissioner.ReadAttribute(
98-
nodeid=self.dut_node_id,
99-
attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
93+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
10094
current_version = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion]
101-
asserts.assert_equal(
102-
current_version,
103-
accepted_version,
104-
'TCAcceptedVersion changed unexpectedly')
95+
asserts.assert_equal(current_version, accepted_version, "TCAcceptedVersion changed unexpectedly")
10596

10697
# Step 5: Verify TCAcknowledgements unchanged
10798
self.step(5)
108-
response = await commissioner.ReadAttribute(
109-
nodeid=self.dut_node_id,
110-
attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
99+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
111100
current_acknowledgements = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcknowledgements]
112-
asserts.assert_equal(
113-
current_acknowledgements,
114-
user_acknowledgements,
115-
'TCAcknowledgements changed unexpectedly')
101+
asserts.assert_equal(current_acknowledgements, user_acknowledgements, "TCAcknowledgements changed unexpectedly")
116102

117103
# Step 6: Send SetTCAcknowledgements with invalid response
118104
self.step(6)
119105
response = await commissioner.SendCommand(
120106
nodeid=self.dut_node_id,
121107
endpoint=ROOT_ENDPOINT_ID,
122108
payload=Clusters.GeneralCommissioning.Commands.SetTCAcknowledgements(
123-
TCVersion=accepted_version + 1,
124-
TCUserResponse=0),
125-
timedRequestTimeoutMs=1000)
109+
TCVersion=accepted_version + 1, TCUserResponse=0
110+
),
111+
)
126112

127113
# Verify RequiredTCNotAccepted error
128114
asserts.assert_equal(
129115
response.errorCode,
130116
Clusters.GeneralCommissioning.Enums.CommissioningErrorEnum.kRequiredTCNotAccepted,
131-
'Expected RequiredTCNotAccepted error')
117+
"Expected RequiredTCNotAccepted error",
118+
)
132119

133120
# Step 7: Verify TCAcceptedVersion still unchanged
134121
self.step(7)
135-
response = await commissioner.ReadAttribute(
136-
nodeid=self.dut_node_id,
137-
attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
122+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
138123
current_version = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion]
139-
asserts.assert_equal(
140-
current_version,
141-
accepted_version,
142-
'TCAcceptedVersion changed unexpectedly after second attempt')
124+
asserts.assert_equal(current_version, accepted_version, "TCAcceptedVersion changed unexpectedly after second attempt")
143125

144126
# Step 8: Verify TCAcknowledgements still unchanged
145127
self.step(8)
146-
response = await commissioner.ReadAttribute(
147-
nodeid=self.dut_node_id,
148-
attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
128+
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
149129
current_acknowledgements = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcknowledgements]
150130
asserts.assert_equal(
151131
current_acknowledgements,
152132
user_acknowledgements,
153-
'TCAcknowledgements changed unexpectedly after second attempt')
133+
"TCAcknowledgements changed unexpectedly after second attempt",
134+
)
154135

155136

156137
if __name__ == "__main__":

0 commit comments

Comments
 (0)