Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync csa branch with main #276

Merged
merged 24 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8b302e6
test: Implement TC acknowledgement test cases (#37015)
swan-amazon Feb 9, 2025
e86768b
[Docker] Add terms and conditions app to chip-cert-bins image (#37474)
swan-amazon Feb 9, 2025
f2339f8
removing OccupancySensing Cluster. (#37469)
gd-mauri Feb 10, 2025
df5ee33
[Telink] Update Docker image (Zephyr SDK update) (#37357)
s07641069 Feb 10, 2025
da6a512
Fix regular expression for variable splitting. (#37493)
andy31415 Feb 10, 2025
48e81c4
[TC_CGEN_2_8] Add TC acknowledgement attribute verification steps (#3…
swan-amazon Feb 11, 2025
91c2b7e
Add `--coverage` option for local.py, make clang coverage builds use …
andy31415 Feb 11, 2025
03fe653
[Darwin] Support MTRCommandWithRequiredResponse being nested in XPC (…
anush-apple Feb 11, 2025
0573578
[HVAC] Implement TC-TSTAT-2.2 (#36023)
hasty Feb 11, 2025
c36e74b
[Telink] Update build configurations & Update compatible builds to do…
s07641069 Feb 11, 2025
cbfa554
Move `::WriteAttribute` validation inside Interaction Model Write Han…
andy31415 Feb 11, 2025
c0f11e7
Log attempts to commission a device in Matter.framework. (#37502)
bzbarsky-apple Feb 11, 2025
6e759ae
decouple java docker from android docker (#37470)
yunhanw-google Feb 11, 2025
aea195c
Fix typo in CC13x4_26x4 Lighting App README (#37473)
maddymarsh Feb 11, 2025
952a5d2
Enhance assert_list_element_type with optional empty list handling (#…
asirko-soft Feb 11, 2025
21a5cf5
Remove obsolete references to CommitPresetsSchedulesRequest from ther…
hasty Feb 11, 2025
63f9782
DM XMLs: 1.5 0.7 ballot (#37329)
cecille Feb 11, 2025
cb137f0
[bouffalo lab] update scripts and documents to support more options t…
wy-hh Feb 11, 2025
953c20e
[bouffalolab] update macro define for header reserve size and etherne…
wy-hh Feb 11, 2025
16e3971
disable werror for java (#37456)
yunhanw-google Feb 11, 2025
9c8cb33
[bouffalo lab] open commission window when last fabric is removed (#3…
wy-hh Feb 11, 2025
8b73e8a
[Darwin] Add logging for sync storage duration over a threshold (#37501)
jtung-apple Feb 11, 2025
9b62718
Reset backoff on successful subscription in MTRDevice. (#37503)
bzbarsky-apple Feb 11, 2025
b154ce6
Back off extra python version of diagnostic test cases (#37475)
yufengwangca Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ jobs:
--target linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang \
--target linux-x64-fabric-sync-ipv6only-no-ble-no-wifi-clang \
--target linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang \
--target linux-x64-terms-and-conditions \
--target linux-x64-python-bindings \
build \
--copy-artifacts-to objdir-clone \
Expand All @@ -520,6 +521,7 @@ jobs:
echo "FABRIC_BRIDGE_APP: out/linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang/fabric-bridge-app" >> /tmp/test_env.yaml
echo "FABRIC_SYNC_APP: out/linux-x64-fabric-sync-ipv6only-no-ble-no-wifi-clang/fabric-sync" >> /tmp/test_env.yaml
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
echo "TERMS_AND_CONDITIONS_APP: out/linux-x64-terms-and-conditions/chip-terms-and-conditions-app" >> /tmp/test_env.yaml
echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
echo "TRACE_TEST_JSON: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
echo "TRACE_TEST_PERFETTO: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
Expand Down
5 changes: 5 additions & 0 deletions integrations/docker/images/chip-cert-bins/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ RUN case ${TARGETPLATFORM} in \
--target linux-x64-fabric-admin-rpc-ipv6only \
--target linux-x64-light-data-model-no-unique-id-ipv6only \
--target linux-x64-network-manager-ipv6only \
--target linux-x64-terms-and-conditions \
build \
&& mv out/linux-x64-chip-tool-ipv6only-platform-mdns/chip-tool out/chip-tool \
&& mv out/linux-x64-shell-ipv6only-platform-mdns/chip-shell out/chip-shell \
Expand All @@ -192,6 +193,7 @@ RUN case ${TARGETPLATFORM} in \
&& mv out/linux-x64-fabric-admin-rpc-ipv6only/fabric-admin out/fabric-admin \
&& mv out/linux-x64-light-data-model-no-unique-id-ipv6only/chip-lighting-app out/chip-lighting-data-model-no-unique-id-app \
&& mv out/linux-x64-network-manager-ipv6only/matter-network-manager-app out/matter-network-manager-app \
&& mv out/linux-x64-terms-and-conditions/chip-terms-and-conditions-app out/chip-terms-and-conditions-app \
;; \
"linux/arm64")\
set -x \
Expand Down Expand Up @@ -220,6 +222,7 @@ RUN case ${TARGETPLATFORM} in \
--target linux-arm64-fabric-admin-rpc-ipv6only \
--target linux-arm64-light-data-model-no-unique-id-ipv6only \
--target linux-arm64-network-manager-ipv6only \
--target linux-arm64-terms-and-conditions \
build \
&& mv out/linux-arm64-chip-tool-ipv6only-platform-mdns/chip-tool out/chip-tool \
&& mv out/linux-arm64-shell-ipv6only-platform-mdns/chip-shell out/chip-shell \
Expand All @@ -244,6 +247,7 @@ RUN case ${TARGETPLATFORM} in \
&& mv out/linux-arm64-fabric-admin-rpc-ipv6only/fabric-admin out/fabric-admin \
&& mv out/linux-arm64-light-data-model-no-unique-id-ipv6only/chip-lighting-app out/chip-lighting-data-model-no-unique-id-app \
&& mv out/linux-arm64-network-manager-ipv6only/matter-network-manager-app out/matter-network-manager-app \
&& mv out/linux-arm64-terms-and-conditions/chip-terms-and-conditions-app out/chip-terms-and-conditions-app \
;; \
*) ;; \
esac
Expand Down Expand Up @@ -283,6 +287,7 @@ COPY --from=chip-build-cert-bins /root/connectedhomeip/out/fabric-bridge-app app
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/fabric-admin apps/fabric-admin
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
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/matter-network-manager-app apps/matter-network-manager-app
COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-terms-and-conditions-app apps/chip-terms-and-conditions-app

# Create symbolic links for now since this allows users to use existing configurations
# for running just `app-name` instead of `apps/app-name`
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/builders/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ def OutputNames(self):
yield 'water-leak-detector-app'
yield 'water-leak-detector-app.map'
elif self == HostApp.TERMS_AND_CONDITIONS:
yield 'terms-and-conditions-app'
yield 'terms-and-conditions-app.map'
yield 'chip-terms-and-conditions-app'
yield 'chip-terms-and-conditions-app.map'
else:
raise Exception('Unknown app type: %r' % self)

Expand Down
1 change: 1 addition & 0 deletions scripts/tests/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ def as_runner(path):
FABRIC_SYNC_APP: {
as_runner(f'out/{target_prefix}-fabric-sync-no-ble-no-wifi-ipv6only-clang-boringssl/fabric-sync')}
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')}
TERMS_AND_CONDITIONS_APP: {as_runner(f'out/{target_prefix}-terms-and-conditions/chip-terms-and-conditions-app')}
TRACE_APP: out/trace_data/app-{{SCRIPT_BASE_NAME}}
TRACE_TEST_JSON: out/trace_data/test-{{SCRIPT_BASE_NAME}}
TRACE_TEST_PERFETTO: out/trace_data/test-{{SCRIPT_BASE_NAME}}
Expand Down
17 changes: 17 additions & 0 deletions src/app/tests/suites/certification/PICS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3632,6 +3632,23 @@ PICS:
CommissioningCompleteResponse command?"
id: CGEN.S.C05.Tx

#
# server / features
#
- label:
"Does the device implement the General Commissioning cluster's terms
and conditions feature?"
id: CGEN.S.F00

- label: "The device's failsafe expiration limit."
id: PIXIT.CGEN.FailsafeExpiryLengthSeconds

- label: "The device's required terms and conditions acknowledgements."
id: PIXIT.CGEN.RequiredTCAcknowledgements

- label: "The device's required minimum terms and conditions revision."
id: PIXIT.CGEN.TCRevision

# General Diagnostics Cluster Test Plan
- label:
"Does the device implement the General Diagnostics cluster as a
Expand Down
9 changes: 8 additions & 1 deletion src/app/tests/suites/certification/ci-pics-values
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ SWTCH.C.AO-READ=0
SWTCH.C.AO-WRITE=0

# General Commissioning Cluster
CGEN.C=1
CGEN.S=1
CGEN.S.A0000=1
CGEN.S.A0001=1
Expand All @@ -742,7 +743,13 @@ CGEN.S.C03.Tx=1
CGEN.S.C04.Rsp=1
CGEN.S.C05.Tx=1

CGEN.C=1
#Feature
CGEN.S.F00=1

#PIXIT
PIXIT.CGEN.FailsafeExpiryLengthSeconds=0
PIXIT.CGEN.RequiredTCAcknowledgements=1
PIXIT.CGEN.TCRevision=1

# LAUNDRY WASHER MODE CLUSTER
LWM.S=1
Expand Down
154 changes: 154 additions & 0 deletions src/python_testing/TC_CGEN_2_10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#
# Copyright (c) 2025 Project CHIP Authors
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# === BEGIN CI TEST ARGUMENTS ===
# test-runner-runs:
# run1:
# app: ${TERMS_AND_CONDITIONS_APP}
# app-args: >
# --tc-min-required-version 1
# --tc-required-acknowledgements 1
# --custom-flow 2
# --capabilities 6
# script-args:
# --PICS src/app/tests/suites/certification/ci-pics-values
# --in-test-commissioning-method on-network
# --tc-version-to-simulate 1
# --tc-user-response-to-simulate 1
# --qr-code MT:-24J0AFN00KA0648G00
# --trace-to json:log
# factoryreset: True
# quiet: True
# === END CI TEST ARGUMENTS ===

import chip.clusters as Clusters
from chip import ChipDeviceCtrl
from chip.commissioning import ROOT_ENDPOINT_ID
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
from mobly import asserts


class TC_CGEN_2_10(MatterBaseTest):
def desc_TC_CGEN_2_10(self) -> str:
return "[TC-CGEN-2.10] Verification that required terms can't be unset from TCAcknowledgements with SetTCAcknowledgements [DUT as Server]"

def pics_TC_CGEN_2_10(self) -> list[str]:
""" This function returns a list of PICS for this test case that must be True for the test to be run"""
return ["CGEN.S", "CGEN.S.F00"]

def steps_TC_CGEN_2_10(self) -> list[TestStep]:
return [
TestStep(0, description="", expectation="", is_commissioning=False),
TestStep(1, "TH reads from the DUT the attribute TCAcceptedVersion. Store the value as acceptedVersion."),
TestStep(2, "TH reads from the DUT the attribute TCAcknowledgements. Store the value as userAcknowledgements."),
TestStep(3, "TH Sends the SetTCAcknowledgements command to the DUT with the fields set as follows:\n* TCVersion: 0\n* TCUserResponse: 65535"),
TestStep(4, "TH reads from the DUT the attribute TCAcceptedVersion."),
TestStep(5, "TH reads from the DUT the attribute TCAcknowledgements."),
TestStep(6, "TH Sends the SetTCAcknowledgements command to the DUT with the fields set as follows:\n* TCVersion: acceptedVersion + 1\n* TCUserResponse: 0"),
TestStep(7, "TH reads from the DUT the attribute TCAcceptedVersion."),
TestStep(8, "TH reads from the DUT the attribute TCAcknowledgements."),
]

@async_test_body
async def test_TC_CGEN_2_10(self):
commissioner: ChipDeviceCtrl.ChipDeviceController = self.default_controller

self.step(0)
if not self.check_pics("CGEN.S.F00"):
asserts.skip('Root endpoint does not support the [commissioning] feature under test')
return

# Step 1: Begin commissioning with PASE and failsafe
commissioner.SetSkipCommissioningComplete(True)
self.matter_test_config.commissioning_method = self.matter_test_config.in_test_commissioning_method
self.matter_test_config.tc_version_to_simulate = None
self.matter_test_config.tc_user_response_to_simulate = None
await self.commission_devices()

# Step 1: Read TCAcceptedVersion
self.step(1)
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
accepted_version = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion]

# Step 2: Read TCAcknowledgements
self.step(2)
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
user_acknowledgements = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcknowledgements]

# Step 3: Send SetTCAcknowledgements with invalid version
self.step(3)
response = await commissioner.SendCommand(
nodeid=self.dut_node_id,
endpoint=ROOT_ENDPOINT_ID,
payload=Clusters.GeneralCommissioning.Commands.SetTCAcknowledgements(TCVersion=0, TCUserResponse=65535),
)

# Verify TCMinVersionNotMet error
asserts.assert_equal(
response.errorCode,
Clusters.GeneralCommissioning.Enums.CommissioningErrorEnum.kTCMinVersionNotMet,
"Expected TCMinVersionNotMet error",
)

# Step 4: Verify TCAcceptedVersion unchanged
self.step(4)
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
current_version = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion]
asserts.assert_equal(current_version, accepted_version, "TCAcceptedVersion changed unexpectedly")

# Step 5: Verify TCAcknowledgements unchanged
self.step(5)
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
current_acknowledgements = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcknowledgements]
asserts.assert_equal(current_acknowledgements, user_acknowledgements, "TCAcknowledgements changed unexpectedly")

# Step 6: Send SetTCAcknowledgements with invalid response
self.step(6)
response = await commissioner.SendCommand(
nodeid=self.dut_node_id,
endpoint=ROOT_ENDPOINT_ID,
payload=Clusters.GeneralCommissioning.Commands.SetTCAcknowledgements(
TCVersion=accepted_version + 1, TCUserResponse=0
),
)

# Verify RequiredTCNotAccepted error
asserts.assert_equal(
response.errorCode,
Clusters.GeneralCommissioning.Enums.CommissioningErrorEnum.kRequiredTCNotAccepted,
"Expected RequiredTCNotAccepted error",
)

# Step 7: Verify TCAcceptedVersion still unchanged
self.step(7)
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion)])
current_version = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcceptedVersion]
asserts.assert_equal(current_version, accepted_version, "TCAcceptedVersion changed unexpectedly after second attempt")

# Step 8: Verify TCAcknowledgements still unchanged
self.step(8)
response = await commissioner.ReadAttribute(nodeid=self.dut_node_id, attributes=[(ROOT_ENDPOINT_ID, Clusters.GeneralCommissioning.Attributes.TCAcknowledgements)])
current_acknowledgements = response[ROOT_ENDPOINT_ID][Clusters.GeneralCommissioning][Clusters.GeneralCommissioning.Attributes.TCAcknowledgements]
asserts.assert_equal(
current_acknowledgements,
user_acknowledgements,
"TCAcknowledgements changed unexpectedly after second attempt",
)


if __name__ == "__main__":
default_matter_test_main()
Loading
Loading