Skip to content

Commit 09d6301

Browse files
authored
Merge branch 'master' into Tweaks-to-EVSE-Test-plans-based-on-review(Issue-project-chip#31460)
2 parents bc0e1e0 + bf3f996 commit 09d6301

Some content is hidden

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

54 files changed

+2366
-613
lines changed

.github/workflows/darwin-tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ jobs:
106106
run: |
107107
./scripts/run_in_build_env.sh \
108108
"./scripts/tests/run_test_suite.py \
109+
--runner darwin_framework_tool_python \
109110
--chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \
110111
--target-skip-glob '{TestAccessControlConstraints}' \
111112
run \

.github/workflows/issue-labeler.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
triage:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: github/issue-labeler@v3.3 #May not be the latest version
14+
- uses: github/issue-labeler@v3.4 #May not be the latest version
1515
with:
1616
configuration-path: .github/issue-labeler.yml
1717
not-before: 2020-01-15T02:54:32Z

.github/workflows/kotlin-style.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/checkout@v4
2323

2424
- name: "detekt"
25-
uses: natiginfo/action-detekt-all@1.23.4
25+
uses: natiginfo/action-detekt-all@1.23.5
2626
# Detekt seems not to like circular symlinks, so we set up
2727
# explicit paths below
2828
with:

examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def run(self, specs, value, cluster_name: str, typename: str, array: bool):
322322
provided_field_name = provided_field_name[0].lower(
323323
) + provided_field_name[1:]
324324

325-
if provided_field_name in value:
325+
if provided_field_name in value and provided_field_name != field_name:
326326
value[field_name] = self.run(
327327
specs,
328328
value[provided_field_name],

scripts/py_matter_yamltests/matter_yamltests/websocket_runner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def execute(self, request):
7070
return await instance.recv()
7171
return None
7272

73-
async def _start_client(self, url, max_retries=4, interval_between_retries=1):
73+
async def _start_client(self, url, max_retries=5, interval_between_retries=1):
7474
if max_retries:
7575
start = time.time()
7676
try:

scripts/tests/chiptest/__init__.py

+66-3
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,60 @@ def _GetInDevelopmentTests() -> Set[str]:
160160
}
161161

162162

163+
def _GetDarwinFrameworkToolUnsupportedTests() -> Set[str]:
164+
"""Tests that fail in darwin-framework-tool for some reason"""
165+
return {
166+
"DL_LockUnlock", # darwin-framework-tool does not currently support reading or subscribing to Events
167+
"Test_AddNewFabricFromExistingFabric", # darwin-framework-tool does not support the GetCommissionerRootCertificate command.
168+
# The name of the arguments once converted differs for chip-tool and darwin-framework-tool (attribute-ids vs attribute-id. See #31934)
169+
"TestAttributesById",
170+
"TestBasicInformation", # darwin-framework-tool does not support writing readonly attributes by name
171+
"TestClusterComplexTypes", # Darwin framework has no way to represent a present but null optional nullable field.
172+
# When reading TestFabricScoped in TestClusterMultiFabric, the result differs because of missing fields that have been declared in the YAML step with null value to workaround some limitation of the test harness (#29110)
173+
"TestClusterMultiFabric",
174+
"TestCommandsById", # darwin-framework-tool does not support writing readonly attributes by name
175+
"TestDiagnosticLogs", # darwin-framework-tool does not implement a BDXTransferServerDelegate
176+
"TestDiscovery", # darwin-framework-tool does not support dns-sd commands.
177+
"TestEvents", # darwin-framework-tool does not currently support reading or subscribing to Events
178+
"TestEventsById", # darwin-framework-tool does not currently support reading or subscribing to Events
179+
"TestGroupMessaging", # darwin-framework-tool does not support group commands.
180+
"TestIcdManagementCluster", # darwin-framework-tool does not support ICD registration
181+
"TestUnitTestingClusterMei", # darwin-framework-tool does not currently support reading or subscribing to Events
182+
"TestReadNoneSubscribeNone", # darwin-framework-tool does not supports those commands.
183+
184+
"Test_TC_ACE_1_6", # darwin-framework-tool does not support group commands.
185+
"Test_TC_ACL_2_5", # darwin-framework-tool does not currently support reading or subscribing to Events
186+
"Test_TC_ACL_2_6", # darwin-framework-tool does not currently support reading or subscribing to Events
187+
"Test_TC_ACL_2_7", # darwin-framework-tool does not currently support reading or subscribing to Events
188+
"Test_TC_ACL_2_8", # darwin-framework-tool does not currently support reading or subscribing to Events
189+
"Test_TC_ACL_2_9", # darwin-framework-tool does not currently support reading or subscribing to Events
190+
"Test_TC_ACL_2_10", # darwin-framework-tool does not currently support reading or subscribing to Events
191+
"Test_TC_BINFO_2_1", # darwin-framework-tool does not support writing readonly attributes by name
192+
"Test_TC_BINFO_2_2", # darwin-framework-tool does not currently support reading or subscribing to Events
193+
# The name of the arguments once converted differs for chip-tool and darwin-framework-tool (attribute-ids vs attribute-id. See #31934)
194+
"Test_TC_BRBINFO_2_1",
195+
"Test_TC_DGGEN_2_3", # darwin-framework-tool does not currently support reading or subscribing to Events
196+
"Test_TC_DRLK_2_1", # darwin-framework-tool does not support writing readonly attributes by name
197+
"Test_TC_DGTHREAD_2_1", # Thread Network Diagnostics is not implemented under darwin.
198+
"Test_TC_DGTHREAD_2_2", # Thread Network Diagnostics is not implemented under darwin.
199+
"Test_TC_DGTHREAD_2_3", # Thread Network Diagnostics is not implemented under darwin.
200+
"Test_TC_DGTHREAD_2_4", # Thread Network Diagnostics is not implemented under darwin.
201+
"Test_TC_FLABEL_2_1", # darwin-framework-tool does not support writing readonly attributes by name
202+
"Test_TC_GRPKEY_2_1", # darwin-framework-tool does not support writing readonly attributes by name
203+
"Test_TC_LCFG_2_1", # darwin-framework-tool does not support writing readonly attributes by name
204+
"Test_TC_OPCREDS_3_7", # darwin-framework-tool does not support the GetCommissionerRootCertificate command.
205+
"Test_TC_OPSTATE_2_4", # darwin-framework-tool does not currently support reading or subscribing to Events
206+
"Test_TC_SMOKECO_2_2", # darwin-framework-tool does not currently support reading or subscribing to Events
207+
"Test_TC_SMOKECO_2_3", # darwin-framework-tool does not currently support reading or subscribing to Events
208+
"Test_TC_SMOKECO_2_4", # darwin-framework-tool does not currently support reading or subscribing to Events
209+
"Test_TC_SMOKECO_2_5", # darwin-framework-tool does not currently support reading or subscribing to Events
210+
"Test_TC_SMOKECO_2_6", # darwin-framework-tool does not currently support reading or subscribing to Events
211+
"Test_TC_SC_4_1", # darwin-framework-tool does not support dns-sd commands.
212+
"Test_TC_SC_5_2", # darwin-framework-tool does not support group commands.
213+
"Test_TC_S_2_3", # darwin-framework-tool does not support group commands.
214+
}
215+
216+
163217
def _GetChipReplUnsupportedTests() -> Set[str]:
164218
"""Tests that fail in chip-repl for some reason"""
165219
return {
@@ -284,7 +338,7 @@ def tests_with_command(chip_tool: str, is_manual: bool):
284338
)
285339

286340

287-
def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, use_short_run_name: bool):
341+
def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, treat_dft_unsupported_as_in_development: bool, use_short_run_name: bool):
288342
"""
289343
use_short_run_name should be true if we want the run_name to be "Test_ABC" instead of "some/path/Test_ABC.yaml"
290344
"""
@@ -294,6 +348,7 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, use_short
294348
extra_slow_tests = _GetExtraSlowTests()
295349
in_development_tests = _GetInDevelopmentTests()
296350
chip_repl_unsupported_tests = _GetChipReplUnsupportedTests()
351+
treat_dft_unsupported_as_in_development_tests = _GetDarwinFrameworkToolUnsupportedTests()
297352
purposeful_failure_tests = _GetPurposefulFailureTests()
298353

299354
for path in _AllYamlTests():
@@ -327,6 +382,9 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, use_short
327382
else:
328383
run_name = str(path)
329384

385+
if treat_dft_unsupported_as_in_development and run_name in treat_dft_unsupported_as_in_development_tests:
386+
tags.add(TestTag.IN_DEVELOPMENT)
387+
330388
yield TestDefinition(
331389
run_name=run_name,
332390
name=path.stem, # `path.stem` converts "some/path/Test_ABC_1.2.yaml" to "Test_ABC.1.2"
@@ -336,12 +394,17 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, use_short
336394

337395

338396
def AllReplYamlTests():
339-
for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=True, use_short_run_name=False):
397+
for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=True, treat_dft_unsupported_as_in_development=False, use_short_run_name=False):
340398
yield test
341399

342400

343401
def AllChipToolYamlTests():
344-
for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False, use_short_run_name=True):
402+
for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False, treat_dft_unsupported_as_in_development=False, use_short_run_name=True):
403+
yield test
404+
405+
406+
def AllDarwinFrameworkToolYamlTests():
407+
for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False, treat_dft_unsupported_as_in_development=True, use_short_run_name=True):
345408
yield test
346409

347410

scripts/tests/chiptest/test_definition.py

+27-31
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,9 @@ def to_s(self):
251251

252252

253253
class TestRunTime(Enum):
254-
CHIP_TOOL_BUILTIN = auto() # run via chip-tool built-in test commands
255254
CHIP_TOOL_PYTHON = auto() # use the python yaml test parser with chip-tool
255+
DARWIN_FRAMEWORK_TOOL_PYTHON = auto() # use the python yaml test parser with chip-tool
256256
CHIP_REPL_PYTHON = auto() # use the python yaml test runner
257-
DARWIN_FRAMEWORK_TOOL_BUILTIN = auto() # run via darwin-framework-tool built-in test commands
258257

259258

260259
@dataclass
@@ -281,7 +280,7 @@ def tags_str(self) -> str:
281280
return ", ".join([t.to_s() for t in self.tags])
282281

283282
def Run(self, runner, apps_register, paths: ApplicationPaths, pics_file: str,
284-
timeout_seconds: typing.Optional[int], dry_run=False, test_runtime: TestRunTime = TestRunTime.CHIP_TOOL_BUILTIN):
283+
timeout_seconds: typing.Optional[int], dry_run=False, test_runtime: TestRunTime = TestRunTime.CHIP_TOOL_PYTHON):
285284
"""
286285
Executes the given test case using the provided runner for execution.
287286
"""
@@ -333,8 +332,6 @@ def Run(self, runner, apps_register, paths: ApplicationPaths, pics_file: str,
333332
# so it will be commissionable again.
334333
app.factoryReset()
335334

336-
tool_cmd = paths.chip_tool if test_runtime != TestRunTime.CHIP_TOOL_PYTHON else paths.chip_tool_with_python_cmd
337-
338335
if dry_run:
339336
tool_storage_dir = None
340337
tool_storage_args = []
@@ -350,38 +347,37 @@ def Run(self, runner, apps_register, paths: ApplicationPaths, pics_file: str,
350347
app.start()
351348
setupCode = app.setupCode
352349

353-
pairing_cmd = tool_cmd + ['pairing', 'code', TEST_NODE_ID, setupCode]
354-
test_cmd = tool_cmd + ['tests', self.run_name] + ['--PICS', pics_file]
355-
if test_runtime == TestRunTime.CHIP_TOOL_PYTHON:
350+
if test_runtime == TestRunTime.CHIP_REPL_PYTHON:
351+
chip_repl_yaml_tester_cmd = paths.chip_repl_yaml_tester_cmd
352+
python_cmd = chip_repl_yaml_tester_cmd + \
353+
['--setup-code', setupCode] + ['--yaml-path', self.run_name] + ["--pics-file", pics_file]
354+
if dry_run:
355+
logging.info(" ".join(python_cmd))
356+
else:
357+
runner.RunSubprocess(python_cmd, name='CHIP_REPL_YAML_TESTER',
358+
dependencies=[apps_register], timeout_seconds=timeout_seconds)
359+
else:
360+
pairing_cmd = paths.chip_tool_with_python_cmd + ['pairing', 'code', TEST_NODE_ID, setupCode]
361+
test_cmd = paths.chip_tool_with_python_cmd + ['tests', self.run_name] + ['--PICS', pics_file]
356362
server_args = ['--server_path', paths.chip_tool[-1]] + \
357363
['--server_arguments', 'interactive server' +
358364
(' ' if len(tool_storage_args) else '') + ' '.join(tool_storage_args)]
359365
pairing_cmd += server_args
360366
test_cmd += server_args
361-
elif test_runtime == TestRunTime.CHIP_TOOL_BUILTIN:
362-
pairing_cmd += tool_storage_args
363-
test_cmd += tool_storage_args
364-
365-
if dry_run:
366-
# Some of our command arguments have spaces in them, so if we are
367-
# trying to log commands people can run we should quote those.
368-
def quoter(arg): return f"'{arg}'" if ' ' in arg else arg
369-
logging.info(" ".join(map(quoter, pairing_cmd)))
370-
logging.info(" ".join(map(quoter, test_cmd)))
371-
elif test_runtime == TestRunTime.CHIP_REPL_PYTHON:
372-
chip_repl_yaml_tester_cmd = paths.chip_repl_yaml_tester_cmd
373-
python_cmd = chip_repl_yaml_tester_cmd + \
374-
['--setup-code', app.setupCode] + ['--yaml-path', self.run_name] + ["--pics-file", pics_file]
375-
runner.RunSubprocess(python_cmd, name='CHIP_REPL_YAML_TESTER',
376-
dependencies=[apps_register], timeout_seconds=timeout_seconds)
377-
else:
378-
runner.RunSubprocess(pairing_cmd,
379-
name='PAIR', dependencies=[apps_register])
380367

381-
runner.RunSubprocess(
382-
test_cmd,
383-
name='TEST', dependencies=[apps_register],
384-
timeout_seconds=timeout_seconds)
368+
if dry_run:
369+
# Some of our command arguments have spaces in them, so if we are
370+
# trying to log commands people can run we should quote those.
371+
def quoter(arg): return f"'{arg}'" if ' ' in arg else arg
372+
logging.info(" ".join(map(quoter, pairing_cmd)))
373+
logging.info(" ".join(map(quoter, test_cmd)))
374+
else:
375+
runner.RunSubprocess(pairing_cmd,
376+
name='PAIR', dependencies=[apps_register])
377+
runner.RunSubprocess(
378+
test_cmd,
379+
name='TEST', dependencies=[apps_register],
380+
timeout_seconds=timeout_seconds)
385381

386382
except Exception:
387383
logging.error("!!!!!!!!!!!!!!!!!!!! ERROR !!!!!!!!!!!!!!!!!!!!!!")

scripts/tests/run_test_suite.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ class RunContext:
123123
)
124124
@click.option(
125125
'--runner',
126-
type=click.Choice(['codegen', 'chip_repl_python', 'chip_tool_python'], case_sensitive=False),
127-
default='codegen',
126+
type=click.Choice(['chip_repl_python', 'chip_tool_python', 'darwin_framework_tool_python'], case_sensitive=False),
127+
default='chip_tool_python',
128128
help='Run YAML tests using the specified runner.')
129129
@click.option(
130130
'--chip-tool',
@@ -138,18 +138,18 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob,
138138
log_fmt = '%(levelname)-7s %(message)s'
139139
coloredlogs.install(level=__LOG_LEVELS__[log_level], fmt=log_fmt)
140140

141-
runtime = TestRunTime.CHIP_TOOL_BUILTIN
141+
runtime = TestRunTime.CHIP_TOOL_PYTHON
142142
if runner == 'chip_repl_python':
143143
runtime = TestRunTime.CHIP_REPL_PYTHON
144-
elif runner == 'chip_tool_python':
145-
runtime = TestRunTime.CHIP_TOOL_PYTHON
146-
elif chip_tool is not None and os.path.basename(chip_tool) == "darwin-framework-tool":
147-
runtime = TestRunTime.DARWIN_FRAMEWORK_TOOL_BUILTIN
144+
elif runner == 'darwin_framework_tool_python':
145+
runtime = TestRunTime.DARWIN_FRAMEWORK_TOOL_PYTHON
148146

149147
if chip_tool is None and not runtime == TestRunTime.CHIP_REPL_PYTHON:
150-
# non yaml tests REQUIRE chip-tool. Yaml tests should not require chip-tool
151148
paths_finder = PathsFinder()
152-
chip_tool = paths_finder.get('chip-tool')
149+
if runtime == TestRunTime.CHIP_TOOL_PYTHON:
150+
chip_tool = paths_finder.get('chip-tool')
151+
else:
152+
chip_tool = paths_finder.get('darwin-framework-tool')
153153

154154
if include_tags:
155155
include_tags = set([TestTag.__members__[t] for t in include_tags])
@@ -160,10 +160,10 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob,
160160
# Figures out selected test that match the given name(s)
161161
if runtime == TestRunTime.CHIP_REPL_PYTHON:
162162
all_tests = [test for test in chiptest.AllReplYamlTests()]
163-
elif runtime == TestRunTime.CHIP_TOOL_PYTHON and os.path.basename(chip_tool) != "darwin-framework-tool":
164-
all_tests = [test for test in chiptest.AllChipToolYamlTests()]
163+
elif runtime == TestRunTime.DARWIN_FRAMEWORK_TOOL_PYTHON:
164+
all_tests = [test for test in chiptest.AllDarwinFrameworkToolYamlTests()]
165165
else:
166-
all_tests = [test for test in chiptest.AllChipToolTests(chip_tool)]
166+
all_tests = [test for test in chiptest.AllChipToolYamlTests()]
167167

168168
tests = all_tests
169169

@@ -178,7 +178,7 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob,
178178
TestTag.PURPOSEFUL_FAILURE,
179179
}
180180

181-
if runtime != TestRunTime.CHIP_TOOL_PYTHON:
181+
if runtime == TestRunTime.CHIP_REPL_PYTHON:
182182
exclude_tags.add(TestTag.CHIP_TOOL_PYTHON_ONLY)
183183

184184
if 'all' not in target:
@@ -319,7 +319,7 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o
319319
chip_repl_yaml_tester = paths_finder.get('yamltest_with_chip_repl_tester.py')
320320

321321
if chip_tool_with_python is None:
322-
if context.obj.chip_tool and os.path.basename(context.obj.chip_tool) == "darwin-framework-tool":
322+
if context.obj.runtime == TestRunTime.DARWIN_FRAMEWORK_TOOL_PYTHON:
323323
chip_tool_with_python = paths_finder.get('darwinframeworktool.py')
324324
else:
325325
chip_tool_with_python = paths_finder.get('chiptool.py')

src/app/ReadHandler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ using Status = Protocols::InteractionModel::Status;
4646
uint16_t ReadHandler::GetPublisherSelectedIntervalLimit()
4747
{
4848
#if CHIP_CONFIG_ENABLE_ICD_SERVER
49-
return static_cast<uint16_t>(ICDConfigurationData::GetInstance().GetIdleModeDurationSec());
49+
return std::chrono::duration_cast<System::Clock::Seconds16>(ICDConfigurationData::GetInstance().GetIdleModeDuration()).count();
5050
#else
5151
return kSubscriptionMaxIntervalPublisherLimit;
5252
#endif

src/app/SubscriptionsInfoProvider.h

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class SubscriptionsInfoProvider
4242
*
4343
* @param[in] aFabricIndex fabric index of the subject
4444
* @param[in] subjectID NodeId of the subject
45+
* subjectID may encode a CAT in the reserved section of the NodeID.
4546
*
4647
* @return true subject has at least one active subscription with the device
4748
* false subject doesn't have any active subscription with the device
@@ -54,6 +55,7 @@ class SubscriptionsInfoProvider
5455
*
5556
* @param[in] aFabricIndex fabric index of the subject
5657
* @param[in] subjectID NodeId of the subject
58+
* subjectID may encode a CAT in the reserved section of the NodeID
5759
*
5860
* @return true subject has at least one persisted subscription with the device
5961
* false subject doesn't have any persisted subscription with the device

src/app/clusters/door-lock-server/door-lock-server.h

+12
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ struct EmberAfDoorLockEndpointContext
8787
int wrongCodeEntryAttempts;
8888
};
8989

90+
namespace chip {
91+
namespace app {
92+
namespace Clusters {
93+
namespace DoorLock {
94+
95+
void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate);
96+
97+
} // namespace DoorLock
98+
} // namespace Clusters
99+
} // namespace app
100+
} // namespace chip
101+
90102
/**
91103
* @brief Door Lock Server Plugin class.
92104
*/

0 commit comments

Comments
 (0)