Skip to content

Commit

Permalink
Merge branch 'master' into imdm/datamodel-invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin committed Sep 12, 2024
2 parents 95d7a64 + d04a667 commit b5ff4ea
Show file tree
Hide file tree
Showing 28 changed files with 262 additions and 341 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build:54
image: ghcr.io/project-chip/chip-build:74
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
Expand Down Expand Up @@ -316,9 +316,10 @@ jobs:
run: |
scripts/run_in_build_env.sh 'virtualenv pyenv'
source pyenv/bin/activate
pip3 install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl
pip3 install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl
pip3 install ./out/controller/python/chip_repl-0.0-py3-none-any.whl
python -m ensurepip --upgrade
python -m pip install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl
python -m pip install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl
python -m pip install ./out/controller/python/chip_repl-0.0-py3-none-any.whl
- name: Run Python tests
shell: bash
Expand All @@ -334,7 +335,8 @@ jobs:
scripts/run_in_build_env.sh 'scripts/examples/gn_build_example.sh examples/chip-tool out/'
scripts/run_in_build_env.sh 'virtualenv pyenv'
source pyenv/bin/activate
pip3 install -r scripts/setup/requirements.setuppayload.txt
python -m ensurepip --upgrade
python -m pip install -r scripts/setup/requirements.setuppayload.txt
python3 src/setup_payload/tests/run_python_setup_payload_test.py out/chip-tool
build_linux_python_lighting_device:
Expand All @@ -344,7 +346,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build:54
image: ghcr.io/project-chip/chip-build:74
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/examples-infineon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-infineon:54
image: ghcr.io/project-chip/chip-build-infineon:74
env:
# TODO: this should probably be part of the dockerfile itself
CY_TOOLS_PATHS: /opt/Tools/ModusToolbox/tools_3.2
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -522,19 +522,17 @@ jobs:
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'
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'
scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py --all-clusters out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die/chip-all-clusters-app'
scripts/run_in_python_env.sh out/venv './src/python_testing/test_testing/test_TC_ICDM_2_1.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingDeviceType.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestChoiceConformanceSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestMatterTestingSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_ICDM_2_1.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_IDM_10_4.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_SC_7_1.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/TestDecorators.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestMatterTestingSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py'
- name: Uploading core files
Expand Down
10 changes: 9 additions & 1 deletion build/config/linux/pkg-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def main():
dest='dridriverdir')
parser.add_option('--version-as-components', action='store_true',
dest='version_as_components')
parser.add_option('--static', action='store_true',
dest='static')
(options, args) = parser.parse_args()

# Make a list of regular expressions to strip out.
Expand Down Expand Up @@ -203,7 +205,13 @@ def main():
sys.stdout.write(dridriverdir.strip())
return

cmd = [options.pkg_config, "--cflags", "--libs"] + args
cmd = [options.pkg_config, "--cflags", "--libs"]

if options.static:
cmd.append("--static")

cmd.extend(args)

if options.debug:
sys.stderr.write('Running: %s\n' % ' '.join(cmd))

Expand Down
13 changes: 11 additions & 2 deletions build/config/linux/pkg_config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,19 @@ template("pkg_config") {

# Link libraries statically for OSS-Fuzz fuzzer build
if (oss_fuzz) {
# Output libs needed for static linking (direct + transitive/non-direct libs), we will re-execute the script to get those libs
args += [ "--static" ]
pkgresult_static = exec_script(pkg_config_script, args, "value")
libs = []
ldflags = [ "-Wl,-Bstatic" ]
foreach(lib, pkgresult[3]) {
ldflags += [ "-l$lib" ]
foreach(lib, pkgresult_static[3]) {
# dl(dynamic loading) lib is not needed for linking statically and its presence triggers errors.
# example of errors:
# ld.lld: error: undefined symbol: __dlsym
# >>> referenced by dlsym.o:(dlsym) in archive /lib/x86_64-linux-gnu/libdl.a
if (lib != "dl") {
ldflags += [ "-l$lib" ]
}
}
ldflags += [ "-Wl,-Bdynamic" ]
lib_dirs = pkgresult[4]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ directory:**

1. [.github/workflows/tests.yaml](https://github.com/project-chip/connectedhomeip/tree/master/.github/workflows/tests.yaml)
2. [scripts/rules.matterlint](https://github.com/project-chip/connectedhomeip/tree/master/scripts/rules.matterlint)
3. [src/app/zap-templates/zcl/data-model/all.xml](https://github.com/project-chip/connectedhomeip/tree/master/src/app/zap-templates/zcl/data-model/all.xml)
4. [src/app/zap-templates/zcl/zcl-with-test-extensions.json](https://github.com/project-chip/connectedhomeip/tree/master/src/app/zap-templates/zcl/zcl-with-test-extensions.json)
5. [src/app/zap-templates/zcl/zcl.json](https://github.com/project-chip/connectedhomeip/tree/master/src/app/zap-templates/zcl/zcl.json)
6. If it is a derived cluster, add a reference to the base cluster definition.
3. [src/app/zap-templates/zcl/zcl-with-test-extensions.json](https://github.com/project-chip/connectedhomeip/tree/master/src/app/zap-templates/zcl/zcl-with-test-extensions.json)
4. [src/app/zap-templates/zcl/zcl.json](https://github.com/project-chip/connectedhomeip/tree/master/src/app/zap-templates/zcl/zcl.json)
5. If it is a derived cluster, add a reference to the base cluster definition.
(e.g. in mode-base-cluster.xml you may need to add cluster codes - otherwise
you may get strange exceptions which aren't clear when running regen_all.py)

Expand All @@ -31,7 +30,7 @@ directory:**
> </struct>
> ```
7. [src/controller/python/chip/clusters/\_\_init\_\_.py](https://github.com/project-chip/connectedhomeip/tree/master/src/controller/python/chip/clusters/__init__.py)
6. [src/controller/python/chip/clusters/\_\_init\_\_.py](https://github.com/project-chip/connectedhomeip/tree/master/src/controller/python/chip/clusters/__init__.py)
**Enable your new cluster in the Python and Android clients** in
[src/controller/data_model/controller-clusters.zap](https://github.com/project-chip/connectedhomeip/blob/master/src/controller/data_model/controller-clusters.zap)
Expand Down
6 changes: 4 additions & 2 deletions examples/chef/dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM debian:bullseye
FROM debian:trixie

ARG DEVICE_NAME

RUN apt-get update && \
apt-get install -y \
libglib2.0-0 && \
libglib2.0-0 \
libc6 \
libssl3 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down
3 changes: 1 addition & 2 deletions examples/ota-provider-app/esp32/main/BdxOtaSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ void BdxOtaSender::HandleTransferSessionOutput(TransferSession::OutputEvent & ev
{
ChipLogError(BDX, "onTransferComplete Callback not set");
}
mStopPolling = true; // Stop polling the TransferSession only after receiving BlockAckEOF
Reset();
break;
case TransferSession::OutputEventType::kStatusReceived:
Expand Down Expand Up @@ -228,7 +227,7 @@ void BdxOtaSender::Reset()
{
mFabricIndex.ClearValue();
mNodeId.ClearValue();
mTransfer.Reset();
ResetTransfer();
if (mExchangeCtx != nullptr)
{
mExchangeCtx->Close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ void BdxOtaSender::HandleTransferSessionOutput(TransferSession::OutputEvent & ev
break;
case TransferSession::OutputEventType::kAckEOFReceived:
ChipLogDetail(BDX, "Transfer completed, got AckEOF");
mStopPolling = true; // Stop polling the TransferSession only after receiving BlockAckEOF
Reset();
break;
case TransferSession::OutputEventType::kStatusReceived:
Expand Down Expand Up @@ -212,7 +211,7 @@ void BdxOtaSender::Reset()
{
mFabricIndex.ClearValue();
mNodeId.ClearValue();
Responder::ResetTransfer();
ResetTransfer();
if (mExchangeCtx != nullptr)
{
mExchangeCtx->Close();
Expand Down
20 changes: 14 additions & 6 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,10 @@ void BaseApplication::ScheduleFactoryReset()
{
Provision::Manager::GetInstance().SetProvisionRequired(true);
}
#if SL_WIFI
// Removing the matter services on factory reset
chip::Dnssd::ServiceAdvertiser::Instance().RemoveServices();
#endif
PlatformMgr().HandleServerShuttingDown(); // HandleServerShuttingDown calls OnShutdown() which is only implemented for the
// basic information cluster it seems. And triggers and Event flush, which is not
// relevant when there are no fabrics left
Expand Down Expand Up @@ -851,19 +855,23 @@ void BaseApplication::OnPlatformEvent(const ChipDeviceEvent * event, intptr_t)
case DeviceEventType::kThreadConnectivityChange:
case DeviceEventType::kInternetConnectivityChange: {
#ifdef DIC_ENABLE
VerifyOrReturn(event->InternetConnectivityChange.IPv4 == kConnectivity_Established);
if (DIC_OK != dic_init(dic::control::subscribeCB))
if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established)
{
ChipLogError(AppServer, "dic_init failed");
if (DIC_OK != dic_init(dic::control::subscribeCB))
{
ChipLogError(AppServer, "dic_init failed");
}
}
#endif // DIC_ENABLE
#ifdef DISPLAY_ENABLED
SilabsLCD::Screen_e screen;
AppTask::GetLCD().GetScreen(screen);
// Update the LCD screen with SSID and connected state
VerifyOrReturn(screen == SilabsLCD::Screen_e::StatusScreen);
BaseApplication::UpdateLCDStatusScreen(false);
AppTask::GetLCD().SetScreen(screen);
if (screen == SilabsLCD::Screen_e::StatusScreen)
{
BaseApplication::UpdateLCDStatusScreen(false);
AppTask::GetLCD().SetScreen(screen);
}
#endif // DISPLAY_ENABLED
if ((event->ThreadConnectivityChange.Result == kConnectivity_Established) ||
(event->InternetConnectivityChange.IPv6 == kConnectivity_Established))
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ if [ -n "$install_virtual_env" ]; then
fi

source "$ENVIRONMENT_ROOT"/bin/activate
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade pip
"$ENVIRONMENT_ROOT"/bin/pip install --upgrade "${WHEEL[@]}"
"$ENVIRONMENT_ROOT"/bin/python -m ensurepip --upgrade
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade "${WHEEL[@]}"

if [ "$install_pytest_requirements" = "yes" ]; then
YAMLTESTS_GN_LABEL="//scripts:matter_yamltests_distribution._build_wheel"
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_python_device.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ virtualenv --clear "$ENVIRONMENT_ROOT"
WHEEL=("$OUTPUT_ROOT"/controller/python/chip_core*.whl)

source "$ENVIRONMENT_ROOT"/bin/activate
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade pip
"$ENVIRONMENT_ROOT"/bin/pip install --upgrade --force-reinstall --no-cache-dir "${WHEEL[@]}"
"$ENVIRONMENT_ROOT"/bin/python -m ensurepip --upgrade
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade --force-reinstall --no-cache-dir "${WHEEL[@]}"

echo ""
echo_green "Compilation completed and WHL package installed in: "
Expand Down
12 changes: 10 additions & 2 deletions scripts/tools/zap/update_cluster_revisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@
import sys
from pathlib import Path

BASIC_INFORMATION_CLUSTER_ID = int("0x0039", 16)
CHIP_ROOT_DIR = os.path.realpath(
os.path.join(os.path.dirname(__file__), '../../..'))
EXCLUDE_FROM_UPDATE_DICTIONARY = {
BASIC_INFORMATION_CLUSTER_ID: ["lighting-app-data-mode-no-unique-id"]
}


def getTargets():
def getTargets(cluster_id: int):
ROOTS_TO_SEARCH = [
'./examples',
'./src/controller/data_model',
Expand All @@ -40,6 +44,10 @@ def getTargets():
for filepath in Path(root).rglob('*.zap'):
targets.append(filepath)

if cluster_id in EXCLUDE_FROM_UPDATE_DICTIONARY:
for target_to_exclude in EXCLUDE_FROM_UPDATE_DICTIONARY[cluster_id]:
targets = [target for target in targets if target_to_exclude not in target.parts]

return targets


Expand Down Expand Up @@ -130,7 +138,7 @@ def main():

os.chdir(CHIP_ROOT_DIR)

targets = getTargets()
targets = getTargets(args.cluster_id)

if args.dry_run:
for target in targets:
Expand Down
18 changes: 9 additions & 9 deletions src/app/tests/suites/certification/Test_TC_OO_2_7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ tests:
}

- label:
"Step 0b: TH binds GroupIds 0x0001 and 0x0002 with GroupKeySetID
0x01a1 in the GroupKeyMap attribute list on GroupKeyManagement cluster
by writing the GroupKeyMap attribute with two entries as follows:"
"Step 0b: TH binds GroupIds 0x0001 with GroupKeySetID 0x01a1 in the
GroupKeyMap attribute list on GroupKeyManagement cluster by writing
the GroupKeyMap attribute with two entries as follows:"
cluster: "Group Key Management"
endpoint: 0
command: "writeAttribute"
Expand Down Expand Up @@ -142,7 +142,7 @@ tests:
value: 0

- label:
"Step 2b: TH sends a StoreScene command to DUT with the GroupID field
"Step 3: TH sends a StoreScene command to DUT with the GroupID field
set to G1 and the SceneID field set to 0x01."
command: "StoreScene"
arguments:
Expand All @@ -160,7 +160,7 @@ tests:
- name: "SceneID"
value: 0x01

- label: "Step 3: TH sends a AddScene command to DUT with the GroupID field
- label: "Step 4: TH sends a AddScene command to DUT with the GroupID field
set to G1, the SceneID field set to 0x02, the TransitionTime field set
to 1000 (1s) and the ExtensionFieldSets set to: '[{ ClusterID: 0x0006,
AttributeValueList: [{ AttributeID: 0x0000, ValueUnsigned8: 0x01 }]}]'
Expand Down Expand Up @@ -195,7 +195,7 @@ tests:
value: 0x02

- label:
"Step 4a: TH sends a RecallScene command to DUT with the GroupID field
"Step 5a: TH sends a RecallScene command to DUT with the GroupID field
set to G1 and the SceneID field set to 0x02."
PICS: S.S.C05.Rsp
command: "RecallScene"
Expand All @@ -214,15 +214,15 @@ tests:
- name: "ms"
value: 2000

- label: "Step 4b: after a few seconds, TH reads OnOff attribute from DUT"
- label: "Step 5b: after a few seconds, TH reads OnOff attribute from DUT"
cluster: "On/Off"
command: "readAttribute"
attribute: "OnOff"
response:
value: 1

- label:
"Step 5a: TH sends a RecallScene command to DUT with the GroupID field
"Step 6a: TH sends a RecallScene command to DUT with the GroupID field
set to G1 and the SceneID field set to 0x01."
PICS: S.S.C05.Rsp
command: "RecallScene"
Expand All @@ -241,7 +241,7 @@ tests:
- name: "ms"
value: 1000

- label: "Step 5b: after a few seconds, TH reads OnOff attribute from DUT"
- label: "Step 6b: after a few seconds, TH reads OnOff attribute from DUT"
cluster: "On/Off"
command: "readAttribute"
attribute: "OnOff"
Expand Down
Loading

0 comments on commit b5ff4ea

Please sign in to comment.