From 523fea609415c6897763d95059b7d921e8b7f325 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 5 Feb 2024 16:24:24 +0000 Subject: [PATCH] Added the --app-pid flag to the python matter testing support (#31866) * Added the --app-pid flag to the python matter testing support to provide a way for test scripts to get the PID of the app they are running against. * fixed typo. Co-authored-by: Petru Lauric <81822411+plauric@users.noreply.github.com> --------- Co-authored-by: Petru Lauric <81822411+plauric@users.noreply.github.com> --- src/python_testing/matter_testing_support.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/python_testing/matter_testing_support.py b/src/python_testing/matter_testing_support.py index 9d3c3e2a1fa302..5c3ec57504e0ac 100644 --- a/src/python_testing/matter_testing_support.py +++ b/src/python_testing/matter_testing_support.py @@ -303,6 +303,7 @@ class MatterTestConfig: tests: List[str] = field(default_factory=list) timeout: typing.Union[int, None] = None endpoint: int = 0 + app_pid: int = 0 commissioning_method: Optional[str] = None discriminators: Optional[List[int]] = None @@ -1244,6 +1245,7 @@ def convert_args_to_matter_config(args: argparse.Namespace) -> MatterTestConfig: config.tests = [] if args.tests is None else args.tests config.timeout = args.timeout # This can be none, we pull the default from the test if it's unspecified config.endpoint = 0 if args.endpoint is None else args.endpoint + config.app_pid = 0 if args.app_pid is None else args.app_pid config.controller_node_id = args.controller_node_id config.trace_to = args.trace_to @@ -1296,6 +1298,7 @@ def parse_matter_test_args(argv: List[str]) -> MatterTestConfig: help='Node ID for primary DUT communication, ' 'and NodeID to assign if commissioning (default: %d)' % _DEFAULT_DUT_NODE_ID, nargs="+") basic_group.add_argument('--endpoint', type=int, default=0, help="Endpoint under test") + basic_group.add_argument('--app-pid', type=int, default=0, help="The PID of the app against which the test is going to run") basic_group.add_argument('--timeout', type=int, help="Test timeout in seconds") basic_group.add_argument("--PICS", help="PICS file path", type=str)