Skip to content

Commit

Permalink
Merge branch 'master' into 27663-remove-previously-provisionally-alia…
Browse files Browse the repository at this point in the history
…sed-resource-monitoring-clusters-from-the-sdk
  • Loading branch information
p0fi committed Jul 17, 2023
2 parents a7618cf + 98c6716 commit 02d094f
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 28 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_ACE_1_3.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_CGEN_2_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_DA_1_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_TIMESYNC_3_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_DA_1_5.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_IDM_1_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestMatterTestingSupport.py"'
Expand Down
6 changes: 3 additions & 3 deletions integrations/cloudbuild/build-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
- "--init"
- "--recursive"
id: Submodules
- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
env:
- PW_ENVIRONMENT_ROOT=/pwenv
args:
Expand All @@ -21,7 +21,7 @@ steps:
path: /pwenv
timeout: 900s

- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
env:
- PW_ENVIRONMENT_ROOT=/pwenv
args:
Expand Down Expand Up @@ -85,7 +85,7 @@ steps:
--target k32w-shell
build
--create-archives /workspace/artifacts/
- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
env:
- PW_ENVIRONMENT_ROOT=/pwenv
args:
Expand Down
6 changes: 3 additions & 3 deletions integrations/cloudbuild/chef.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
steps:
- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
env:
- PW_ENVIRONMENT_ROOT=/pwenv
args:
Expand All @@ -12,7 +12,7 @@ steps:
path: /pwenv
timeout: 2700s

- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
env:
- PW_ENVIRONMENT_ROOT=/pwenv
args:
Expand All @@ -26,7 +26,7 @@ steps:
- name: pwenv
path: /pwenv

- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
env:
- PW_ENVIRONMENT_ROOT=/pwenv
args:
Expand Down
14 changes: 7 additions & 7 deletions integrations/cloudbuild/smoke-test.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
steps:
- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
entrypoint: "bash"
args:
- "-c"
- |
git config --global --add safe.directory "*"
git submodule update --init --recursive
id: Submodules
- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
env:
- PW_ENVIRONMENT_ROOT=/pwenv
args:
Expand All @@ -22,7 +22,7 @@ steps:
path: /pwenv
timeout: 900s

- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
id: ESP32
env:
- PW_ENVIRONMENT_ROOT=/pwenv
Expand All @@ -42,7 +42,7 @@ steps:
volumes:
- name: pwenv
path: /pwenv
- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
id: NRFConnect
env:
- PW_ENVIRONMENT_ROOT=/pwenv
Expand All @@ -63,7 +63,7 @@ steps:
- name: pwenv
path: /pwenv

- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
id: EFR32
env:
- PW_ENVIRONMENT_ROOT=/pwenv
Expand All @@ -85,7 +85,7 @@ steps:
- name: pwenv
path: /pwenv

- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
id: Linux
env:
- PW_ENVIRONMENT_ROOT=/pwenv
Expand Down Expand Up @@ -138,7 +138,7 @@ steps:
- name: pwenv
path: /pwenv

- name: "connectedhomeip/chip-build-vscode:0.7.25"
- name: "ghcr.io/project-chip/chip-build-vscode:1"
id: Android
env:
- PW_ENVIRONMENT_ROOT=/pwenv
Expand Down
3 changes: 2 additions & 1 deletion src/python_testing/TC_TIMESYNC_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ async def read_ts_attribute_expect_success(self, endpoint, attribute):
@async_test_body
async def test_TC_TIMESYNC_2_2(self):

endpoint = self.user_params.get("endpoint", 0)
# Time sync is required to be on endpoint 0 if it is present
endpoint = 0

time_cluster = Clusters.Objects.TimeSynchronization

Expand Down
3 changes: 2 additions & 1 deletion src/python_testing/TC_TIMESYNC_2_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ async def send_set_time_zone_cmd_expect_error(self, tz: typing.List[Clusters.Obj
@async_test_body
async def test_TC_TIMESYNC_2_4(self):

self.endpoint = self.user_params.get("endpoint", 0)
# Time sync is required to be on endpoint 0 if it is present
self.endpoint = 0

time_cluster = Clusters.Objects.TimeSynchronization
tz_struct = time_cluster.Structs.TimeZoneStruct
Expand Down
3 changes: 2 additions & 1 deletion src/python_testing/TC_TIMESYNC_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ async def send_set_dst_cmd_expect_error(self, dst: typing.List[Clusters.Objects.
@async_test_body
async def test_TC_TIMESYNC_2_5(self):

self.endpoint = self.user_params.get("endpoint", 0)
# Time sync is required to be on endpoint 0 if it is present
self.endpoint = 0

time_cluster = Clusters.Objects.TimeSynchronization
dst_struct = time_cluster.Structs.DSTOffsetStruct
Expand Down
3 changes: 2 additions & 1 deletion src/python_testing/TC_TIMESYNC_2_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ async def send_set_default_ntp_cmd_expect_error(self, ntp: typing.Union[Nullable
@async_test_body
async def test_TC_TIMESYNC_2_6(self):

self.endpoint = self.user_params.get("endpoint", 0)
# Time sync is required to be on endpoint 0 if it is present
self.endpoint = 0

self.print_step(0, "Commissioning, already done")
attributes = Clusters.TimeSynchronization.Attributes
Expand Down
5 changes: 4 additions & 1 deletion src/python_testing/TC_TIMESYNC_2_7.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ async def send_set_utc_cmd(self, utc: uint) -> None:
@async_test_body
async def test_TC_TIMESYNC_2_7(self):

self.endpoint = self.user_params.get("endpoint", 0)
# Time sync is required to be on endpoint 0 if it is present
self.endpoint = 0

self.print_step(0, "Commissioning, already done")
time_cluster = Clusters.Objects.TimeSynchronization
Expand Down Expand Up @@ -108,6 +109,8 @@ async def test_TC_TIMESYNC_2_7(self):
if tz_list_size > 1:
th_utc = utc_time_in_matter_epoch()
tz = [tz_struct(offset=3600, validAt=0), tz_struct(offset=7200, validAt=th_utc+1e+7)]
ret = await self.send_set_time_zone_cmd(tz)
asserts.assert_true(ret.DSTOffsetRequired, "DSTOffsetRequired not set to true")

self.print_step(12, "Send SetDSTOffset command")
if tz_list_size > 1:
Expand Down
12 changes: 5 additions & 7 deletions src/python_testing/TC_TIMESYNC_2_8.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ async def send_set_utc_cmd(self, utc: uint) -> None:
@async_test_body
async def test_TC_TIMESYNC_2_8(self):

self.endpoint = self.user_params.get("endpoint", 0)
# Time sync is required to be on endpoint 0 if it is present
self.endpoint = 0

self.print_step(0, "Commissioning, already done")
time_cluster = Clusters.Objects.TimeSynchronization
Expand Down Expand Up @@ -106,10 +107,9 @@ async def test_TC_TIMESYNC_2_8(self):

self.print_step(11, "Read LocalTime")
local = await self.read_ts_attribute_expect_success(local_attr)
compare_time(received=local, offset=timedelta(), tolerance=timedelta(seconds=5))
asserts.assert_equal(local, NullValue, "LocalTime cannot be calculated since DST is empty")

self.print_step(12, "Send SetDSTOffset command")
th_utc = utc_time_in_matter_epoch()
dst = [dst_struct(offset=3600, validStarting=0, validUntil=NullValue)]
await self.send_set_dst_cmd(dst)

Expand Down Expand Up @@ -164,19 +164,17 @@ async def test_TC_TIMESYNC_2_8(self):
self.print_step(24, "Read LocalTime")
if dst_list_size > 1:
local = await self.read_ts_attribute_expect_success(local_attr)
compare_time(received=local, offset=timedelta(), tolerance=timedelta(seconds=5))
asserts.assert_equal(local, NullValue, "LocalTime cannot be calculated since DST is empty")

self.print_step(25, "Send SetDSTOffset command")
th_utc = utc_time_in_matter_epoch()
dst = [dst_struct(offset=3600, validStarting=0, validUntil=NullValue)]
dst = [dst_struct(offset=-3600, validStarting=0, validUntil=NullValue)]
await self.send_set_dst_cmd(dst)

self.print_step(26, "Read LocalTime")
local = await self.read_ts_attribute_expect_success(local_attr)
compare_time(received=local, offset=timedelta(seconds=-3600), tolerance=timedelta(seconds=5))

self.print_step(27, "Send SetDSTOffset command")
th_utc = utc_time_in_matter_epoch()
dst = [dst_struct(offset=0, validStarting=0, validUntil=NullValue)]
await self.send_set_dst_cmd(dst)

Expand Down
3 changes: 2 additions & 1 deletion src/python_testing/TC_TIMESYNC_2_9.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ async def send_set_utc_cmd(self, utc: uint) -> None:
@async_test_body
async def test_TC_TIMESYNC_2_9(self):

self.endpoint = self.user_params.get("endpoint", 0)
# Time sync is required to be on endpoint 0 if it is present
self.endpoint = 0

self.print_step(0, "Commissioning, already done")
time_cluster = Clusters.Objects.TimeSynchronization
Expand Down
48 changes: 48 additions & 0 deletions src/python_testing/TC_TIMESYNC_3_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Copyright (c) 2023 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.
#

import chip.clusters as Clusters
from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main
from mobly import asserts


class TC_TIMESYNC_3_1(MatterBaseTest):

@async_test_body
async def test_TC_TIMESYNC_3_1(self):
self.print_step(1, "Wildcard read of time sync cluster")
utc_time_attr = Clusters.TimeSynchronization.Attributes.UTCTime
ret = await self.default_controller.ReadAttribute(nodeid=self.dut_node_id, attributes=[(utc_time_attr)])
asserts.assert_equal(len(ret.keys()), 1, 'More than one time cluster found on the node')
asserts.assert_equal(next(iter(ret)), 0, 'Time cluster found on non-root endpoint')

self.print_step(2, "Wildcard read of descriptor cluster")
server_list_attr = Clusters.Descriptor.Attributes.ServerList
ret = await self.default_controller.ReadAttribute(nodeid=self.dut_node_id, attributes=[(server_list_attr)])
print(ret)
for endpoint, servers in ret.items():
server_list = servers[Clusters.Descriptor][Clusters.Descriptor.Attributes.ServerList]
if endpoint == 0:
asserts.assert_true(Clusters.TimeSynchronization.id in server_list,
'Time cluster id is not listed in server list for root endpoint')
else:
asserts.assert_false(Clusters.TimeSynchronization.id in server_list,
f'Time cluster id is incorrectly listed in the server list for ep {endpoint}')


if __name__ == "__main__":
default_matter_test_main()
2 changes: 1 addition & 1 deletion third_party/mbedtls/repo
Submodule repo updated from b18d45 to 4e73af
2 changes: 1 addition & 1 deletion third_party/openthread/repo
Submodule repo updated 60 files
+1 −0 .github/workflows/build.yml
+2 −2 .github/workflows/codeql.yml
+1 −1 .github/workflows/scorecards.yml
+1 −0 etc/cmake/options.cmake
+6 −0 include/openthread/border_agent.h
+1 −1 include/openthread/instance.h
+189 −6 include/openthread/mesh_diag.h
+1 −0 include/openthread/netdata.h
+31 −0 include/openthread/netdiag.h
+87 −122 include/openthread/srp_server.h
+57 −0 include/openthread/thread.h
+179 −1 src/cli/README.md
+3 −0 src/cli/README_NETDATA.md
+446 −9 src/cli/cli.cpp
+18 −0 src/cli/cli.hpp
+5 −0 src/cli/cli_network_data.cpp
+17 −19 src/cli/cli_srp_server.cpp
+1 −0 src/core/BUILD.gn
+1 −0 src/core/CMakeLists.txt
+24 −0 src/core/api/mesh_diag_api.cpp
+36 −17 src/core/api/srp_server_api.cpp
+20 −0 src/core/api/thread_api.cpp
+67 −29 src/core/border_router/routing_manager.cpp
+15 −9 src/core/border_router/routing_manager.hpp
+11 −9 src/core/common/time.hpp
+8 −1 src/core/common/tlvs.cpp
+37 −0 src/core/common/tlvs.hpp
+52 −0 src/core/config/mesh_forwarder.h
+8 −27 src/core/meshcop/commissioner.cpp
+0 −2 src/core/meshcop/commissioner.hpp
+39 −41 src/core/net/dnssd_server.cpp
+9 −12 src/core/net/dnssd_server.hpp
+252 −438 src/core/net/srp_server.cpp
+94 −160 src/core/net/srp_server.hpp
+30 −0 src/core/thread/mesh_forwarder.cpp
+71 −0 src/core/thread/mesh_forwarder.hpp
+49 −41 src/core/thread/mle.cpp
+1 −0 src/core/thread/mle.hpp
+5 −0 src/core/thread/mle_router.cpp
+10 −0 src/core/thread/network_data_tlvs.hpp
+6 −0 src/core/thread/network_data_types.cpp
+401 −15 src/core/thread/network_diagnostic.cpp
+65 −2 src/core/thread/network_diagnostic.hpp
+152 −0 src/core/thread/network_diagnostic_tlvs.cpp
+500 −22 src/core/thread/network_diagnostic_tlvs.hpp
+390 −53 src/core/utils/mesh_diag.cpp
+135 −11 src/core/utils/mesh_diag.hpp
+1 −1 src/lib/spinel/radio_spinel_impl.hpp
+9 −9 tests/scripts/thread-cert/Cert_5_7_02_CoapDiagCommands.py
+4 −4 tests/scripts/thread-cert/Cert_5_7_03_CoapDiagCommands.py
+24 −0 tests/scripts/thread-cert/test_mle_msg_key_seq_jump.py
+9 −9 tests/toranj/cli/test-021-br-route-prf.py
+164 −0 tests/toranj/cli/test-023-mesh-diag.py
+0 −24 tests/toranj/openthread-core-toranj-config-posix.h
+2 −50 tests/toranj/openthread-core-toranj-config-simulation.h
+4 −471 tests/toranj/openthread-core-toranj-config.h
+1 −0 tests/toranj/start.sh
+2 −0 tests/unit/test_network_data.cpp
+70 −61 tests/unit/test_routing_manager.cpp
+11 −4 tests/unit/test_timer.cpp

0 comments on commit 02d094f

Please sign in to comment.