From patchwork Mon Dec 18 17:22:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135287 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E4E104373D; Mon, 18 Dec 2023 18:23:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87BD042DA3; Mon, 18 Dec 2023 18:23:36 +0100 (CET) Received: from mail-oi1-f226.google.com (mail-oi1-f226.google.com [209.85.167.226]) by mails.dpdk.org (Postfix) with ESMTP id 3D7BF42DA1 for ; Mon, 18 Dec 2023 18:23:35 +0100 (CET) Received: by mail-oi1-f226.google.com with SMTP id 5614622812f47-3b9d8bfe845so2807841b6e.0 for ; Mon, 18 Dec 2023 09:23:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1702920214; x=1703525014; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8PkZFNIb4FYyzi/xXyZ+4+3TKRrd7iSse1Ifxnl7lPQ=; b=HiNoPIxN4FL6RxG/aXNPT9u582D9Lsw8DQooK2ECwpbyiiCO2fn+9MvePV35iBf2zn KEUbIohZ1FQzpgBjmrZ6L053TZB/wrBFkCNdE4WUbBZUicPYQ7pUqgSfgEMl/QcLjxiR GrADdkcrQPyYIhvv/un164k/rxRea4iPe14fw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702920214; x=1703525014; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8PkZFNIb4FYyzi/xXyZ+4+3TKRrd7iSse1Ifxnl7lPQ=; b=MdcDOkpFNSbgzi5pi224kylF/2sQpw4RxzgylIHjwPidood+DBuDIxNh3mPVRW5nsO T55Anx9VkAXOx63OYXWLH47Hj+U9hxOiKw5D3JPkUtjaVCzDTZ37TG7atpOEpcZ6uIG2 dPsHk195lhwL+GKC4tiuZIUdm6Mw9JyHZOb6qiJ5auaqCM3p59n6BlElr1KHByCQMnyW OqGXQsjYhJA9qej2WVW2i7uVg7eYsGdHVo2KgJJrfl4FVe9O7L5uAELGmYw6kJO3t+UW ObD2mavQQkq6EMxxBeUqs9Z/+8d6SLoa96xU2nyF/kXrbCo76Ha94sKWIBQlSyEh1rEO Ok/g== X-Gm-Message-State: AOJu0Yzr3mz8UnHcqQom5Sd3LNyQuyVGPbNbQA3Sa7aOtW9p2w0jNbJa o5sdZCcEK7U/Ki8r5Te95bRmWYEFqM/NeqwvpVNZOGFJ8FF8aQ== X-Google-Smtp-Source: AGHT+IHh7B5sPXMgWUBj0XZlCoggwPEZlnLCdDq+eKjnJTOaSNODxTcugsmZHgImifsBiTQuhqhDz/hQ7eFq X-Received: by 2002:a05:6870:961d:b0:1fb:d30:c160 with SMTP id d29-20020a056870961d00b001fb0d30c160mr19989843oaq.3.1702920214446; Mon, 18 Dec 2023 09:23:34 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id an39-20020a056871b1a700b00203b08465b9sm61813oac.40.2023.12.18.09.23.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2023 09:23:34 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f]) by postal.iol.unh.edu (Postfix) with ESMTP id 7F0AA605C312; Mon, 18 Dec 2023 12:23:33 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v4 2/7] dts: allow passing parameters into interactive apps Date: Mon, 18 Dec 2023 12:22:02 -0500 Message-ID: <20231218172206.8488-4-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231113202833.12900-1-jspewock@iol.unh.edu> References: <20231113202833.12900-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Modified interactive applications to allow for the ability to pass parameters into the app on start up. Also modified the way EAL parameters are handled so that the trailing "--" separator is added be default after all EAL parameters. Signed-off-by: Jeremy Spewock --- .../remote_session/remote/testpmd_shell.py | 2 +- dts/framework/testbed_model/sut_node.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dts/framework/remote_session/remote/testpmd_shell.py b/dts/framework/remote_session/remote/testpmd_shell.py index b5e4cba9b3..369807a33e 100644 --- a/dts/framework/remote_session/remote/testpmd_shell.py +++ b/dts/framework/remote_session/remote/testpmd_shell.py @@ -62,7 +62,7 @@ class TestPmdShell(InteractiveShell): def _start_application(self, get_privileged_command: Callable[[str], str] | None) -> None: """See "_start_application" in InteractiveShell.""" - self._app_args += " -- -i" + self._app_args += " -i" super()._start_application(get_privileged_command) def start(self, verify: bool = True) -> None: diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 7f75043bd3..9c92232d9e 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -361,7 +361,8 @@ def create_interactive_shell( shell_cls: Type[InteractiveShellType], timeout: float = SETTINGS.timeout, privileged: bool = False, - eal_parameters: EalParameters | str | None = None, + eal_parameters: EalParameters | None = None, + app_parameters: str = "", ) -> InteractiveShellType: """Factory method for creating a handler for an interactive session. @@ -376,19 +377,22 @@ def create_interactive_shell( eal_parameters: List of EAL parameters to use to launch the app. If this isn't provided or an empty string is passed, it will default to calling create_eal_parameters(). + app_parameters: Additional arguments to pass into the application on the + command-line. Returns: Instance of the desired interactive application. """ - if not eal_parameters: - eal_parameters = self.create_eal_parameters() - - # We need to append the build directory for DPDK apps + # We need to append the build directory and add EAL parameters for DPDK apps if shell_cls.dpdk_app: + if not eal_parameters: + eal_parameters = self.create_eal_parameters() + app_parameters = f"{eal_parameters} -- {app_parameters}" + shell_cls.path = self.main_session.join_remote_path( self.remote_dpdk_build_dir, shell_cls.path ) - return super().create_interactive_shell(shell_cls, timeout, privileged, str(eal_parameters)) + return super().create_interactive_shell(shell_cls, timeout, privileged, app_parameters) def bind_ports_to_driver(self, for_dpdk: bool = True) -> None: """Bind all ports on the SUT to a driver.