Skip to content

Commit 05c6db8

Browse files
authored
Merge branch 'master' into feature/app-installation-status-report
2 parents e37775f + 8c8889b commit 05c6db8

25 files changed

+684
-458
lines changed

.github/workflows/build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ jobs:
333333
scripts/run_in_build_env.sh 'virtualenv pyenv'
334334
source pyenv/bin/activate
335335
pip3 install -r src/setup_payload/python/requirements.txt
336-
python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool
336+
python3 src/setup_payload/tests/run_python_setup_payload_test.py out/chip-tool
337337
338338
build_linux_python_lighting_device:
339339
name: Build on Linux (python lighting-app)

.github/workflows/darwin.yaml

+4-9
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ jobs:
9797
bootstrap-logs-framework-${{ matrix.options.flavor }}
9898
- name: Build example All Clusters Server
9999
run: |
100-
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug chip_config_network_layer_ble=false
100+
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/all-clusters-app chip_config_network_layer_ble=false
101101
- name: Build example OTA Provider
102102
run: |
103-
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false
103+
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug/ota-provider-app chip_config_network_layer_ble=false
104104
- name: Build example OTA Requestor
105105
run: |
106106
scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug/ota-requestor-app chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0
@@ -113,13 +113,8 @@ jobs:
113113
run: |
114114
mkdir -p /tmp/darwin/framework-tests
115115
echo "This is a simple log" > /tmp/darwin/framework-tests/end_user_support_log.txt
116-
../../../out/debug/chip-all-clusters-app --interface-id -1 --end_user_support_log /tmp/darwin/framework-tests/end_user_support_log.txt > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) &
117-
../../../out/debug/chip-all-clusters-app --interface-id -1 --dac_provider ../../../credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 --discriminator 3839 --secured-device-port 5539 --KVS /tmp/chip-all-clusters-app-kvs2 > >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid-err.log >&2) &
118-
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 101 --passcode 1001 --KVS /tmp/chip-all-clusters-app-kvs101 --secured-device-port 5531 &
119-
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 102 --passcode 1002 --KVS /tmp/chip-all-clusters-app-kvs102 --secured-device-port 5532 &
120-
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 103 --passcode 1003 --KVS /tmp/chip-all-clusters-app-kvs103 --secured-device-port 5533 &
121-
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 104 --passcode 1004 --KVS /tmp/chip-all-clusters-app-kvs104 --secured-device-port 5534 &
122-
../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 105 --passcode 1005 --KVS /tmp/chip-all-clusters-app-kvs105 --secured-device-port 5535 &
116+
../../../out/debug/all-clusters-app/chip-all-clusters-app --interface-id -1 --end_user_support_log /tmp/darwin/framework-tests/end_user_support_log.txt > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) &
117+
../../../out/debug/all-clusters-app/chip-all-clusters-app --interface-id -1 --dac_provider ../../../credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 --discriminator 3839 --secured-device-port 5539 --KVS /tmp/chip-all-clusters-app-kvs2 > >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid-err.log >&2) &
123118
124119
export TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1
125120

.github/workflows/lint.yml

-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ jobs:
9898
--known-failure controller/ExamplePersistentStorage.cpp \
9999
--known-failure controller/ExamplePersistentStorage.h \
100100
--known-failure app/AttributeAccessToken.h \
101-
--known-failure app/CommandHandler.h \
102101
--known-failure app/CommandHandlerInterface.h \
103102
--known-failure app/CommandResponseSender.h \
104103
--known-failure app/CommandSenderLegacyCallback.h \

docs/testing/yaml.md

+29
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,17 @@ function can be use. See
279279
[TestEqualities](https://github.com/project-chip/connectedhomeip/blob/master/src/app/tests/suites/TestEqualities.yaml)
280280
for an example of how to use this pseudo-cluster.
281281

282+
#### Setting step timeouts
283+
284+
The timeout argument can be used for each individual test step to set the time
285+
the runner will wait for a test step to complete before reporting a failure.
286+
287+
Note that this timeout is different than the subscription report timeout and the
288+
subscription report timeout is not currently adjustable in YAML.
289+
290+
There several other options for configuring test steps as shown in the
291+
[YAML schema](./yaml_schema.md) document.
292+
282293
## Running YAML tests
283294

284295
YAML scripts are parsed and run using a python-based runner program that parses
@@ -304,6 +315,24 @@ There are several options for running tests locally. Because the YAML runner
304315
uses python, it is necessary to compile and install the chip python package
305316
before using any YAML runner script.
306317

318+
First activate the matter environment using either
319+
320+
```
321+
. ./scripts/bootstrap.sh
322+
```
323+
324+
or
325+
326+
```
327+
. ./scripts/activate.sh
328+
```
329+
330+
bootstrap.sh should be used for for the first setup, activate.sh may be used for
331+
subsequent setups as it is faster.
332+
333+
Next build the python wheels and create a venv (called `py` here, but any name
334+
may be used)
335+
307336
```
308337
./scripts/build_python.sh -i py
309338
source py/bin/activate

examples/bridge-app/linux/main.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -899,13 +899,11 @@ void ApplicationInit()
899899
// Setup Mock Devices
900900
Light1.SetReachable(true);
901901
Light2.SetReachable(true);
902-
903902
Light1.SetChangeCallback(&HandleDeviceOnOffStatusChanged);
904903
Light2.SetChangeCallback(&HandleDeviceOnOffStatusChanged);
905904

906905
TempSensor1.SetReachable(true);
907-
TempSensor1.SetReachable(true);
908-
906+
TempSensor2.SetReachable(true);
909907
TempSensor1.SetChangeCallback(&HandleDeviceTempSensorStatusChanged);
910908
TempSensor2.SetChangeCallback(&HandleDeviceTempSensorStatusChanged);
911909

@@ -914,7 +912,6 @@ void ApplicationInit()
914912
ActionLight2.SetReachable(true);
915913
ActionLight3.SetReachable(true);
916914
ActionLight4.SetReachable(true);
917-
918915
ActionLight1.SetChangeCallback(&HandleDeviceOnOffStatusChanged);
919916
ActionLight2.SetChangeCallback(&HandleDeviceOnOffStatusChanged);
920917
ActionLight3.SetChangeCallback(&HandleDeviceOnOffStatusChanged);
@@ -929,7 +926,6 @@ void ApplicationInit()
929926
ComposedTempSensor2.SetReachable(true);
930927
ComposedPowerSource.SetReachable(true);
931928
ComposedPowerSource.SetBatChargeLevel(58);
932-
933929
ComposedTempSensor1.SetChangeCallback(&HandleDeviceTempSensorStatusChanged);
934930
ComposedTempSensor2.SetChangeCallback(&HandleDeviceTempSensorStatusChanged);
935931
ComposedPowerSource.SetChangeCallback(&HandleDevicePowerSourceStatusChanged);

scripts/tools/bouffalolab/factory_qrcode.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
try:
2222
import qrcode
23-
from generate_setup_payload import CommissioningFlow, SetupPayload
23+
from SetupPayload import CommissioningFlow, SetupPayload
2424
except ImportError:
2525
SDK_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
2626
sys.path.append(os.path.join(SDK_ROOT, "src/setup_payload/python"))
2727
try:
2828
import qrcode
29-
from generate_setup_payload import CommissioningFlow, SetupPayload
29+
from SetupPayload import CommissioningFlow, SetupPayload
3030
except ModuleNotFoundError or ImportError:
3131
no_onboarding_modules = True
3232
else:

scripts/tools/generate_esp32_chip_factory_bin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
sys.path.insert(0, os.path.join(CHIP_TOPDIR, 'scripts', 'tools', 'spake2p'))
3131
from spake2p import generate_verifier # noqa: E402 isort:skip
3232
sys.path.insert(0, os.path.join(CHIP_TOPDIR, 'src', 'setup_payload', 'python'))
33-
from generate_setup_payload import CommissioningFlow, SetupPayload # noqa: E402 isort:skip
33+
from SetupPayload import CommissioningFlow, SetupPayload # noqa: E402 isort:skip
3434

3535
if os.getenv('IDF_PATH'):
3636
sys.path.insert(0, os.path.join(os.getenv('IDF_PATH'),

scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232

3333
try:
3434
import qrcode
35-
from generate_setup_payload import CommissioningFlow, SetupPayload
35+
from SetupPayload import CommissioningFlow, SetupPayload
3636
except ImportError:
3737
SDK_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
3838
sys.path.append(os.path.join(SDK_ROOT, "src/setup_payload/python"))
3939
try:
4040
import qrcode
41-
from generate_setup_payload import CommissioningFlow, SetupPayload
41+
from SetupPayload import CommissioningFlow, SetupPayload
4242
except ModuleNotFoundError or ImportError:
4343
no_onboarding_modules = True
4444
else:

src/app/BUILD.gn

+57-8
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ static_library("interaction-model") {
179179
"ReadClient.h", # TODO: cpp is only included conditionally. Needs logic
180180
# fixing
181181
"ReadPrepareParams.h",
182-
"RequiredPrivilege.h",
183-
"StatusResponse.cpp",
184-
"StatusResponse.h",
185182
"SubscriptionResumptionStorage.h",
186183
"TimedHandler.cpp",
187184
"TimedHandler.h",
@@ -210,6 +207,7 @@ static_library("interaction-model") {
210207

211208
public_deps = [
212209
":app_config",
210+
":command-handler",
213211
":constants",
214212
":paths",
215213
":subscription-info-provider",
@@ -248,8 +246,6 @@ static_library("interaction-model") {
248246
"dynamic_server/AccessControl.cpp",
249247
"dynamic_server/AccessControl.h",
250248
"dynamic_server/DynamicDispatcher.cpp",
251-
"util/privilege-storage.cpp",
252-
"util/privilege-storage.h",
253249
]
254250

255251
public_deps += [
@@ -301,6 +297,62 @@ static_library("attribute-access") {
301297
]
302298
}
303299

300+
source_set("required-privileges") {
301+
sources = [ "RequiredPrivilege.h" ]
302+
303+
public_deps = [
304+
":paths",
305+
"${chip_root}/src/access:types",
306+
]
307+
308+
if (chip_build_controller_dynamic_server) {
309+
sources += [
310+
"util/privilege-storage.cpp",
311+
"util/privilege-storage.h",
312+
]
313+
314+
public_deps += [
315+
":global-attributes",
316+
"${chip_root}/src/access",
317+
"${chip_root}/src/app/dynamic_server:mock-codegen-includes",
318+
]
319+
320+
public_configs = [ ":config-controller-dynamic-server" ]
321+
}
322+
}
323+
324+
source_set("status-response") {
325+
sources = [
326+
"StatusResponse.cpp",
327+
"StatusResponse.h",
328+
]
329+
public_deps = [
330+
":constants",
331+
"${chip_root}/src/app/MessageDef",
332+
"${chip_root}/src/messaging",
333+
]
334+
}
335+
336+
source_set("command-handler") {
337+
sources = [
338+
"CommandHandler.cpp",
339+
"CommandHandler.h",
340+
"CommandHandlerExchangeInterface.h",
341+
]
342+
343+
public_deps = [
344+
":paths",
345+
":required-privileges",
346+
":status-response",
347+
"${chip_root}/src/access:types",
348+
"${chip_root}/src/app/MessageDef",
349+
"${chip_root}/src/app/data-model",
350+
"${chip_root}/src/app/util:callbacks",
351+
"${chip_root}/src/lib/support",
352+
"${chip_root}/src/messaging",
353+
]
354+
}
355+
304356
# Note to developpers, instead of continuously adding files in the app librabry, it is recommand to create smaller source_sets that app can depend on.
305357
# This way, we can have a better understanding of dependencies and other componenets can depend on the different source_sets without needing to depend on the entire app library.
306358
static_library("app") {
@@ -312,8 +364,6 @@ static_library("app") {
312364
"AttributePersistenceProvider.h",
313365
"ChunkedWriteCallback.cpp",
314366
"ChunkedWriteCallback.h",
315-
"CommandHandler.cpp",
316-
"CommandHandlerExchangeInterface.h",
317367
"CommandResponseHelper.h",
318368
"CommandResponseSender.cpp",
319369
"DefaultAttributePersistenceProvider.cpp",
@@ -338,7 +388,6 @@ static_library("app") {
338388
# (app depending on im and im including these headers):
339389
# Name with _ so that linter does not recognize it
340390
# "CommandResponseSender._h"
341-
# "CommandHandler._h"
342391
# "ReadHandler._h",
343392
# "WriteHandler._h"
344393
]

src/app/CASESessionManager.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ CHIP_ERROR CASESessionManager::Init(chip::System::Layer * systemLayer, const CAS
2929
return AddressResolve::Resolver::Instance().Init(systemLayer);
3030
}
3131

32+
void CASESessionManager::Shutdown()
33+
{
34+
AddressResolve::Resolver::Instance().Shutdown();
35+
}
36+
3237
void CASESessionManager::FindOrEstablishSession(const ScopedNodeId & peerId, Callback::Callback<OnDeviceConnected> * onConnection,
3338
Callback::Callback<OnDeviceConnectionFailure> * onFailure,
3439
#if CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES

src/app/CASESessionManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class CASESessionManager : public OperationalSessionReleaseDelegate, public Sess
5959
}
6060

6161
CHIP_ERROR Init(chip::System::Layer * systemLayer, const CASESessionManagerConfig & params);
62-
void Shutdown() {}
62+
void Shutdown();
6363

6464
/**
6565
* Find an existing session for the given node ID, or trigger a new session

src/app/CommandHandler.cpp

+3-11
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,20 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*/
18-
19-
/**
20-
* @file
21-
* This file defines object for a CHIP IM Invoke Command Handler
22-
*
23-
*/
24-
25-
#include "CommandHandler.h"
26-
#include "InteractionModelEngine.h"
27-
#include "RequiredPrivilege.h"
28-
#include "messaging/ExchangeContext.h"
18+
#include <app/CommandHandler.h>
2919

3020
#include <access/AccessControl.h>
3121
#include <app-common/zap-generated/cluster-objects.h>
3222
#include <app/RequiredPrivilege.h>
23+
#include <app/StatusResponse.h>
3324
#include <app/util/MatterCallbacks.h>
3425
#include <credentials/GroupDataProvider.h>
3526
#include <lib/core/CHIPConfig.h>
3627
#include <lib/core/TLVData.h>
3728
#include <lib/core/TLVUtilities.h>
3829
#include <lib/support/IntrusiveList.h>
3930
#include <lib/support/TypeTraits.h>
31+
#include <messaging/ExchangeContext.h>
4032
#include <platform/LockTracker.h>
4133
#include <protocols/secure_channel/Constants.h>
4234

src/app/CommandHandler.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030

3131
#pragma once
3232

33-
#include "CommandPathRegistry.h"
34-
3533
#include <app/CommandHandlerExchangeInterface.h>
34+
#include <app/CommandPathRegistry.h>
3635
#include <app/ConcreteCommandPath.h>
3736
#include <app/data-model/Encode.h>
3837
#include <lib/core/CHIPCore.h>

0 commit comments

Comments
 (0)