Skip to content

Commit 36af6e4

Browse files
authored
Merge branch 'master' into 34100-tc-eevse-2224-25-python-script-has-to-be-updated-as-per-the-test-plan-changes
2 parents 99c46eb + 1e1fe1e commit 36af6e4

File tree

294 files changed

+13818
-7437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+13818
-7437
lines changed

.github/.wordlist.txt

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ AdvSendAdvert
3737
AE
3838
aef
3939
AES
40+
AFL
4041
AIDL
4142
algs
4243
alloc
@@ -570,6 +571,7 @@ fsync
570571
ftd
571572
fullclean
572573
fuzzer
574+
fuzztest
573575
FW
574576
gbl
575577
gcloud
@@ -1008,6 +1010,7 @@ optionOverride
10081010
optionsMask
10091011
optionsOverride
10101012
orgs
1013+
OSS
10111014
OTA
10121015
OTADownloader
10131016
otaDownloadPath

.github/workflows/examples-nxp.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
if: github.actor != 'restyled-io[bot]'
151151

152152
container:
153-
image: ghcr.io/project-chip/chip-build-rw61x:74
153+
image: ghcr.io/project-chip/chip-build-nxp:74
154154
volumes:
155155
- "/tmp/bloat_reports:/tmp/bloat_reports"
156156
steps:

.github/workflows/tests.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,9 @@ jobs:
486486
--target linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test \
487487
--target linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test \
488488
--target linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test \
489+
--target linux-x64-fabric-admin-rpc-ipv6only-clang \
490+
--target linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang \
491+
--target linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang \
489492
--target linux-x64-python-bindings \
490493
build \
491494
--copy-artifacts-to objdir-clone \
@@ -500,6 +503,9 @@ jobs:
500503
echo "CHIP_MICROWAVE_OVEN_APP: out/linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-microwave-oven-app" >> /tmp/test_env.yaml
501504
echo "CHIP_RVC_APP: out/linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-rvc-app" >> /tmp/test_env.yaml
502505
echo "NETWORK_MANAGEMENT_APP: out/linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test/matter-network-manager-app" >> /tmp/test_env.yaml
506+
echo "FABRIC_ADMIN_APP: out/linux-x64-fabric-admin-rpc-ipv6only-clang/fabric-admin" >> /tmp/test_env.yaml
507+
echo "FABRIC_BRIDGE_APP: out/linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang/fabric-bridge-app" >> /tmp/test_env.yaml
508+
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
503509
echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
504510
echo "TRACE_TEST_JSON: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
505511
echo "TRACE_TEST_PERFETTO: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
@@ -509,17 +515,19 @@ jobs:
509515
mkdir -p out/trace_data
510516
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/controller/python/test/test_scripts/mobile-device-test.py'
511517
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/execute_python_tests.py --env-file /tmp/test_env.yaml --search-directory src/python_testing'
512-
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestMatterTestingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
513-
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestSpecParsingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
514518
scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py'
515519
scripts/run_in_python_env.sh out/venv './src/python_testing/test_testing/test_TC_ICDM_2_1.py'
516520
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py'
517521
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingDeviceType.py'
522+
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py'
523+
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py'
518524
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceSupport.py'
519525
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestChoiceConformanceSupport.py'
520526
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_IDM_10_4.py'
521527
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_SC_7_1.py'
522528
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/TestDecorators.py'
529+
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestMatterTestingSupport.py'
530+
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py'
523531
524532
525533
- name: Uploading core files

.gitmodules

+16
Original file line numberDiff line numberDiff line change
@@ -329,3 +329,19 @@
329329
path = third_party/infineon/psoc6/psoc6_sdk/libs/lwip-network-interface-integration
330330
url = https://github.com/Infineon/lwip-network-interface-integration.git
331331
platforms = infineon
332+
[submodule "third_party/abseil-cpp/src"]
333+
path = third_party/abseil-cpp/src
334+
url = https://github.com/abseil/abseil-cpp.git
335+
platforms = linux,darwin
336+
[submodule "third_party/fuzztest"]
337+
path = third_party/fuzztest
338+
url = https://github.com/google/fuzztest.git
339+
platforms = linux,darwin
340+
[submodule "third_party/googletest"]
341+
path = third_party/googletest
342+
url = https://github.com/google/googletest
343+
platforms = linux,darwin
344+
[submodule "third_party/re2/src"]
345+
path = third_party/re2/src
346+
url = https://github.com/google/re2.git
347+
platforms = linux,darwin

BUILD.gn

+16
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
6262
}
6363
}
6464

65+
if (pw_enable_fuzz_test_targets) {
66+
group("pw_fuzz_tests") {
67+
deps = [
68+
"${chip_root}/src/credentials/tests:fuzz-chip-cert-pw(//build/toolchain/pw_fuzzer:chip_pw_fuzztest)",
69+
"${chip_root}/src/lib/core/tests:fuzz-tlv-reader-pw(//build/toolchain/pw_fuzzer:chip_pw_fuzztest)",
70+
"${chip_root}/src/lib/dnssd/minimal_mdns/tests:fuzz-minmdns-packet-parsing-pw(//build/toolchain/pw_fuzzer:chip_pw_fuzztest)",
71+
"${chip_root}/src/lib/format/tests:fuzz-payload-decoder-pw(//build/toolchain/pw_fuzzer:chip_pw_fuzztest)",
72+
"${chip_root}/src/setup_payload/tests:fuzz-setup-payload-base38-pw(//build/toolchain/pw_fuzzer:chip_pw_fuzztest)",
73+
]
74+
}
75+
}
76+
6577
# Matter's in-tree pw_python_package or pw_python_distribution targets.
6678
_matter_python_packages = [
6779
"//examples/chef",
@@ -140,6 +152,10 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
140152
deps += [ "//:fuzz_tests" ]
141153
}
142154

155+
if (pw_enable_fuzz_test_targets) {
156+
deps += [ "//:pw_fuzz_tests" ]
157+
}
158+
143159
if (chip_device_platform != "none") {
144160
deps += [ "${chip_root}/src/app/server" ]
145161
}

build/chip/fuzz_test.gni

+59
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@
1414

1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
17+
import("//build_overrides/pigweed.gni")
18+
1719
import("${build_root}/config/compiler/compiler.gni")
1820
import("${chip_root}/build/chip/tests.gni")
21+
import("${dir_pw_unit_test}/test.gni")
1922

2023
declare_args() {
2124
enable_fuzz_test_targets = is_clang && chip_build_tests &&
2225
(current_os == "linux" || current_os == "mac")
26+
27+
pw_enable_fuzz_test_targets = false
2328
}
2429

2530
# Define a fuzz target for chip.
@@ -66,3 +71,57 @@ template("chip_fuzz_target") {
6671
}
6772
}
6873
}
74+
75+
# Define a fuzz target for Matter using pw_fuzzer and Google FuzzTest Framework.
76+
#
77+
# Google FuzzTest is only supported on Linux and MacOS using Clang:
78+
#
79+
# Sample usage
80+
#
81+
# chip_pw_fuzz_target("fuzz-target-name") {
82+
# test_source = [
83+
# "FuzzTarget.cpp", # Fuzz target
84+
# ]
85+
#
86+
# public_deps = [
87+
# "${chip_root}/src/lib/foo", # add dependencies here
88+
# ]
89+
# }
90+
#
91+
#
92+
template("chip_pw_fuzz_target") {
93+
if (defined(invoker.test_source)) {
94+
_test_output_dir = "${root_out_dir}/tests"
95+
96+
if (defined(invoker.output_dir)) {
97+
_test_output_dir = invoker.output_dir
98+
}
99+
100+
pw_test(target_name) {
101+
forward_variables_from(invoker,
102+
[
103+
"deps",
104+
"public_deps",
105+
"cflags",
106+
"configs",
107+
"remove_configs",
108+
])
109+
110+
# TODO: remove this after pw_fuzzer's integration with OSS-Fuzz is complete.
111+
#just a test for running FuzzTest with libfuzzer-compatibility mode, since this is the mode supported by OSS-fuzz
112+
# defines = [
113+
# "FUZZTEST_COMPATIBILITY_MODE=libfuzzer",
114+
# "MAKE_BUILD_TYPE=RelWithDebug",
115+
# ]
116+
117+
sources = invoker.test_source
118+
output_dir = _test_output_dir
119+
120+
deps = [ "$dir_pw_fuzzer:fuzztest" ]
121+
122+
# this is necessary so FuzzTest is compiled into an executable in third_party/pigweed/repo/pw_unit_test/test.gni
123+
# otherwise it will be built successfully but with FuzzTarget.DISABLED.ninja and no executable.
124+
enable_if = true
125+
}
126+
}
127+
}

build/toolchain/pw_fuzzer/BUILD.gn

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright (c) 2024 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
import("//build_overrides/pigweed.gni")
17+
18+
import("$dir_pigweed/targets/host/target_toolchains.gni")
19+
import("${build_root}/toolchain/gcc_toolchain.gni")
20+
21+
# creating a secondary toolchain to be used with pw_fuzzer FuzzTests
22+
# This toolchain is downstreamed from pigweed's pw_target_toolchain_host.clang_fuzz
23+
# it allows us to specifically use googletest for fuzzing (instead of the lighter version of googletest used for unit testing)
24+
25+
gcc_toolchain("chip_pw_fuzztest") {
26+
forward_variables_from(pw_target_toolchain_host.clang_fuzz, "*", [ "name" ])
27+
28+
toolchain_args = {
29+
# This is needed to have the defaults passed from pw_target_toolchain_host.clang_fuzz to the current scope
30+
forward_variables_from(defaults, "*")
31+
32+
pw_unit_test_MAIN = "$dir_pw_fuzzer:fuzztest_main"
33+
pw_unit_test_BACKEND = "$dir_pw_fuzzer:gtest"
34+
35+
# The next three lines are needed by the gcc_toolchain template
36+
current_os = host_os
37+
current_cpu = host_cpu
38+
is_clang = true
39+
40+
# the upstream pigweed host_clang toolchain defines a default sysroot, which results in build errors
41+
# since it does not include SSL lib and is supposed to be minimal by design.
42+
# by removing this default config, we will use the system's libs. Otherwise we can define our own sysroot.
43+
# discussion on: https://discord.com/channels/691686718377558037/1275092695764959232
44+
remove_default_configs = [ "$dir_pw_toolchain/host_clang:linux_sysroot" ]
45+
46+
# when is_debug = true, we pass -O0 to cflags and ldflags, while upstream pw_fuzzer toolchain defines "optimize_speed" config that passes -O2.
47+
# This condition was added to prevent mixing the flags
48+
if (is_debug) {
49+
remove_default_configs += [ "$dir_pw_build:optimize_speed" ]
50+
}
51+
52+
# removing pigweed downstreamed configs related to warnings
53+
# These are triggering an error related to -Wcast-qual in third_party/nlio
54+
remove_default_configs += [
55+
"$dir_pw_build:strict_warnings",
56+
"$dir_pw_build:extra_strict_warnings",
57+
]
58+
59+
# the third_party abseil-cpp triggers warnings related to [-Wformat-nonliteral]
60+
treat_warnings_as_errors = false
61+
62+
dir_pw_third_party_abseil_cpp = "//third_party/abseil-cpp/src"
63+
dir_pw_third_party_fuzztest = "//third_party/fuzztest"
64+
dir_pw_third_party_googletest = "//third_party/googletest"
65+
66+
# TODO: Seems that re2 support within FuzzTest was deprecated, keeping it defined is triggering warning
67+
# Remove if re2 is indeed not needed
68+
# dir_pw_third_party_re2 = "//third_party/re2/src"
69+
}
70+
}

config/esp32/components/chip/Kconfig

+20
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,26 @@ menu "CHIP Core"
163163
help
164164
Option to enable/disable CHIP data model.
165165

166+
config CHIP_SYSTEM_CONFIG_POOL_USE_HEAP
167+
bool "Use heap memory to allocate object pools"
168+
default n
169+
help
170+
This option enables the use of heap memory to allocate object pools.
171+
When enabled, object pools are not pre-allocated.
172+
Additionally, the maximum number of entries that can be allocated is
173+
only limited by the available heap memory.
174+
175+
This option can be useful if you encounter static DRAM overflow.
176+
177+
NOTE: Since there is no cap on pool sizes, this may lead to issues
178+
where embedded code assumes the pool size is limited, and no other
179+
mechanisms are in place to restrict the size of allocations.
180+
181+
NOTE: If enabled and the free heap is exhausted, this may result in
182+
undefined behavior, potential non-compliance with specifications,
183+
or failure during certification tests. Even if it passes, it may fail
184+
to function properly with actual controllers.
185+
166186
endmenu # "General Options"
167187

168188
menu "Networking Options"

config/nrfconnect/chip-module/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ if (CONFIG_CHIP_ENABLE_ICD_SUPPORT)
147147
matter_add_gn_arg_bool ("chip_enable_icd_lit" CONFIG_CHIP_ICD_LIT_SUPPORT)
148148
matter_add_gn_arg_bool ("chip_enable_icd_checkin" CONFIG_CHIP_ICD_CHECK_IN_SUPPORT)
149149
matter_add_gn_arg_bool ("chip_enable_icd_user_active_mode_trigger" CONFIG_CHIP_ICD_UAT_SUPPORT)
150+
matter_add_gn_arg_bool ("icd_enforce_sit_slow_poll_limit" TRUE)
150151
endif()
151152

152153
if (CONFIG_CHIP_FACTORY_DATA OR CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND)

config/nrfconnect/chip-module/Kconfig.features

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ config CHIP_DFU_OVER_BT_SMP
162162
# Enable custom SMP request to erase settings partition.
163163
select MCUMGR_GRP_ZBASIC
164164
select MCUMGR_GRP_ZBASIC_STORAGE_ERASE
165+
select MCUMGR_TRANSPORT_BT_REASSEMBLY
165166
help
166167
Enables Device Firmware Upgrade over Bluetooth LE with SMP and configures
167168
the set of options related to that feature.

config/zephyr/Kconfig

+9
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,15 @@ config CHIP_ICD_SLOW_POLL_INTERVAL
354354
device is in the idle mode. It determines the fastest frequency at which the device will be able
355355
to receive the messages in the idle mode.
356356

357+
config CHIP_ICD_SIT_SLOW_POLL_LIMIT
358+
int "Intermittently Connected Device slow polling interval limit for device in SIT mode (ms)"
359+
default 15000
360+
range 0 15000
361+
help
362+
Provides the limit for Intermittently Connected Device slow polling interval in milliseconds while the
363+
device is in the SIT mode. By spec, this value cannot exceed 15 s (spec 9.16.1.5). This value can be
364+
used for the LIT device, to limit the slow poll interval used while temporarily working in the SIT mode.
365+
357366
config CHIP_ICD_FAST_POLLING_INTERVAL
358367
int "Intermittently Connected Device fast polling interval (ms)"
359368
default 200

docs/guides/BUILDING.md

+20
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,26 @@ They pick up environment variables such as `$CFLAGS`, `$CXXFLAGS` and
382382
383383
You likely want `libfuzzer` + `asan` builds instead for local testing.
384384
385+
### `pw_fuzzer` `FuzzTests`
386+
387+
An Alternative way for writing and running Fuzz Tests is Google's `FuzzTest`
388+
framework, integrated through `pw_fuzzer`. The Tests will have to be built and
389+
executed manually.
390+
391+
```
392+
./scripts/build/build_examples.py --target linux-x64-tests-clang-pw-fuzztest build
393+
```
394+
395+
NOTE: `asan` is enabled by default in FuzzTest, so please do not add it in
396+
build_examples.py invocation.
397+
398+
Tests will be located in:
399+
`out/linux-x64-tests-clang-pw-fuzztest/chip_pw_fuzztest/tests/` where
400+
`chip_pw_fuzztest` is the name of the toolchain used.
401+
402+
- Details on How To Run Fuzz Tests in
403+
[Running FuzzTests](https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/fuzz_testing.md)
404+
385405
## Build custom configuration
386406
387407
The build is configured by setting build arguments. These you can set in one of

docs/guides/darwin.md

-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ Example:
303303
- [Simulated Linux](./simulated_device_linux.md)
304304
- [Telink](/examples/lighting-app/telink/README.md)
305305
- [TI Platform](./ti/ti_matter_overview.md)
306-
- [TI All Clusters](/examples/all-clusters-app/cc13x4_26x4/README.md)
307306
- [Tizen](/examples/lighting-app/tizen/README.md)
308307

309308
## Providing Feedback to Apple

docs/guides/esp32/setup_idf_chip.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ step.
1616
- [Linux](https://docs.espressif.com/projects/esp-idf/en/v5.3/esp32/get-started/linux-macos-setup.html#for-linux-users)
1717
- [macOS](https://docs.espressif.com/projects/esp-idf/en/v5.3/esp32/get-started/linux-macos-setup.html#for-macos-users)
1818

19-
### Get IDF v5.1.2
19+
### Get ESP-IDF v5.3
2020

2121
- Clone ESP-IDF [v5.3
2222
release](https://github.com/espressif/esp-idf/releases/tag/v5.3

0 commit comments

Comments
 (0)