diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h index 3a3a6d8d64efdd..0f5015e4711c71 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h @@ -45,6 +45,8 @@ class CHIPCommandBridge : public Command { AddArgument("paa-trust-store-path", &mPaaTrustStorePath, "Path to directory holding PAA certificate information. Can be absolute or relative to the current working " "directory."); + AddArgument( + "storage-directory", &mStorageDirectory, "This option does nothing. It is here for API compatibility with chip-tool."); AddArgument("commissioner-vendor-id", 0, UINT16_MAX, &mCommissionerVendorId, "The vendor id to use for darwin-framework-tool. If not provided, chip::VendorId::TestVendor1 (65521, 0xFFF1) will be " "used."); diff --git a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm index ab55be5a245cfe..6fe3522dcd909b 100644 --- a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm +++ b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm @@ -380,7 +380,7 @@ el_status_t StopFunction() ClearLine(); - *status = mHandler->RunInteractive(command); + *status = mHandler->RunInteractive(command, GetStorageDirectory()); return YES; } diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index 17124a6d9b24c1..6894693a0fa500 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -160,7 +160,7 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob, # Figures out selected test that match the given name(s) if runtime == TestRunTime.CHIP_REPL_PYTHON: all_tests = [test for test in chiptest.AllReplYamlTests()] - elif runtime == TestRunTime.CHIP_TOOL_PYTHON: + elif runtime == TestRunTime.CHIP_TOOL_PYTHON and os.path.basename(chip_tool) != "darwin-framework-tool": all_tests = [test for test in chiptest.AllChipToolYamlTests()] else: all_tests = [test for test in chiptest.AllChipToolTests(chip_tool)] @@ -313,7 +313,10 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o chip_repl_yaml_tester = paths_finder.get('yamltest_with_chip_repl_tester.py') if chip_tool_with_python is None: - chip_tool_with_python = paths_finder.get('chiptool.py') + if context.obj.chip_tool and os.path.basename(context.obj.chip_tool) == "darwin-framework-tool": + chip_tool_with_python = paths_finder.get('darwinframeworktool.py') + else: + chip_tool_with_python = paths_finder.get('chiptool.py') # Command execution requires an array paths = chiptest.ApplicationPaths( diff --git a/scripts/tests/yaml/chiptool.py b/scripts/tests/yaml/chiptool.py index 60fc542d572311..f3a08aa8156d1a 100755 --- a/scripts/tests/yaml/chiptool.py +++ b/scripts/tests/yaml/chiptool.py @@ -26,6 +26,7 @@ _DEFAULT_EXTENSIONS_DIR = 'scripts/tests/yaml/extensions' _DEFAULT_PICS_FILE = 'src/app/tests/suites/certification/ci-pics-values' +_DEFAULT_SPECIFICATIONS_DIR = 'src/app/zap-templates/zcl/data-model/chip/*.xml' def chiptool_runner_options(f): @@ -45,6 +46,8 @@ def chiptool_runner_options(f): help='Add a delay between each test suite steps.')(f) f = click.option('--continueOnFailure', type=bool, default=False, show_default=True, help='Do not stop running the test suite on first error.')(f) + f = click.option('--specifications_paths', type=click.Path(), show_default=True, default=_DEFAULT_SPECIFICATIONS_DIR, + help='Path to a set of files containing clusters definitions.')(f) f = click.option('--PICS', type=click.Path(exists=True), show_default=True, default=_DEFAULT_PICS_FILE, help='Path to the PICS file to use.')(f) f = click.option('--additional_pseudo_clusters_directory', type=click.Path(), show_default=True, default=_DEFAULT_EXTENSIONS_DIR, @@ -80,14 +83,14 @@ def maybe_update_stop_on_error(ctx): @click.argument('commands', nargs=-1) @chiptool_runner_options @click.pass_context -def chiptool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, trace_file: str, trace_decode: bool, delay_in_ms: int, continueonfailure: bool, pics: str, additional_pseudo_clusters_directory: str): +def chiptool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, trace_file: str, trace_decode: bool, delay_in_ms: int, continueonfailure: bool, specifications_paths: str, pics: str, additional_pseudo_clusters_directory: str): success = False server_arguments = maybe_update_server_arguments(ctx) maybe_update_stop_on_error(ctx) if len(commands) > 1 and commands[0] == 'tests': - success = send_yaml_command(chiptool, commands[1], server_path, server_arguments, show_adapter_logs, pics, + success = send_yaml_command(chiptool, commands[1], server_path, server_arguments, show_adapter_logs, specifications_paths, pics, additional_pseudo_clusters_directory, commands[2:]) else: if server_path is None and server_name: diff --git a/scripts/tests/yaml/darwinframeworktool.py b/scripts/tests/yaml/darwinframeworktool.py index 77ab3d8b813716..64648e57d371f4 100755 --- a/scripts/tests/yaml/darwinframeworktool.py +++ b/scripts/tests/yaml/darwinframeworktool.py @@ -26,6 +26,7 @@ _DEFAULT_EXTENSIONS_DIR = 'scripts/tests/yaml/extensions' _DEFAULT_PICS_FILE = 'src/app/tests/suites/certification/ci-pics-values' +_DEFAULT_SPECIFICATIONS_DIR = 'src/app/zap-templates/zcl/data-model/chip/*.xml' def darwinframeworktool_runner_options(f): @@ -41,6 +42,8 @@ def darwinframeworktool_runner_options(f): help='Add a delay between each test suite steps.')(f) f = click.option('--continueOnFailure', type=bool, default=False, show_default=True, help='Do not stop running the test suite on first error.')(f) + f = click.option('--specifications_paths', type=click.Path(), show_default=True, default=_DEFAULT_SPECIFICATIONS_DIR, + help='Path to a set of files containing clusters definitions.')(f) f = click.option('--PICS', type=click.Path(exists=True), show_default=True, default=_DEFAULT_PICS_FILE, help='Path to the PICS file to use.')(f) f = click.option('--additional_pseudo_clusters_directory', type=click.Path(), show_default=True, default=_DEFAULT_EXTENSIONS_DIR, @@ -63,14 +66,14 @@ def maybe_update_stop_on_error(ctx): @click.argument('commands', nargs=-1) @darwinframeworktool_runner_options @click.pass_context -def darwinframeworktool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, delay_in_ms: int, continueonfailure: bool, pics: str, additional_pseudo_clusters_directory: str): +def darwinframeworktool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, delay_in_ms: int, continueonfailure: bool, specifications_paths: str, pics: str, additional_pseudo_clusters_directory: str): success = False server_arguments = ctx.params['server_arguments'] maybe_update_stop_on_error(ctx) if len(commands) > 1 and commands[0] == 'tests': - success = send_yaml_command(darwinframeworktool, commands[1], server_path, server_arguments, show_adapter_logs, pics, + success = send_yaml_command(darwinframeworktool, commands[1], server_path, server_arguments, show_adapter_logs, specifications_paths, pics, additional_pseudo_clusters_directory, commands[2:]) else: if server_path is None and server_name: diff --git a/scripts/tests/yaml/tests_tool.py b/scripts/tests/yaml/tests_tool.py index 65883a4bf8def5..a4baaf228b0604 100644 --- a/scripts/tests/yaml/tests_tool.py +++ b/scripts/tests/yaml/tests_tool.py @@ -26,8 +26,8 @@ @click.pass_context -def send_yaml_command(ctx, test_tool, test_name: str, server_path: str, server_arguments: str, show_adapter_logs: bool, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]): - kwargs = {'test_name': test_name, 'show_adapter_logs': show_adapter_logs, 'pics': pics, +def send_yaml_command(ctx, test_tool, test_name: str, server_path: str, server_arguments: str, show_adapter_logs: bool, specifications_paths: str, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]): + kwargs = {'test_name': test_name, 'show_adapter_logs': show_adapter_logs, 'specifications_paths': specifications_paths, 'pics': pics, 'additional_pseudo_clusters_directory': additional_pseudo_clusters_directory} index = 0 @@ -37,6 +37,7 @@ def send_yaml_command(ctx, test_tool, test_name: str, server_path: str, server_a ctx.invoke(runner_base, **kwargs) del ctx.params['commands'] + del ctx.params['specifications_paths'] del ctx.params['pics'] del ctx.params['additional_pseudo_clusters_directory']