From patchwork Thu Dec 14 22:10:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135212 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 1ACCB436F4; Thu, 14 Dec 2023 23:11:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1893243366; Thu, 14 Dec 2023 23:11:22 +0100 (CET) Received: from mail-il1-f226.google.com (mail-il1-f226.google.com [209.85.166.226]) by mails.dpdk.org (Postfix) with ESMTP id 336B143360 for ; Thu, 14 Dec 2023 23:11:20 +0100 (CET) Received: by mail-il1-f226.google.com with SMTP id e9e14a558f8ab-35f884515fbso340935ab.3 for ; Thu, 14 Dec 2023 14:11:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1702591879; x=1703196679; 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=Q2v8RIONMum9ln+0hPM1VCLD+M8aHtuCD3628pqq45E2sDCmvjUXRrkPJL2ou8L7i4 0bqMJYmJxbhDPyEvndCJUG3MLvm1OjddflaXX5VNEKrlOhBdjV+gi7/2p9cCghdN1fqd blEICa2usaH3W9BPVwKIwNedEVc7bl9D7Mz+c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702591879; x=1703196679; 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=lPSIz3AkzERBCl1/5N5ALpt2rTuzFILWQ1M8YeaQ54YYnnfbkfEhKz1YwZZu9fNxTy uWby9WwWrHTHLZlP5IWIh+sZxW6gGV0BAn+qvb+4eJ4lwjzox6eRMzmLFHv3KnMivsYe tuUXI+oEEguLmX9ss2kNYhkQ1tTxiWuFGfLZxAHgJdWf4TOVOcjIzbt6CC5EyZugB22C LPG9ulNAwI1YivgpAh6tFt8XwYQuqlYIyNQYy5bb9qakbqhPggVUfSi461xoy5huMibo cQuf4aemccnOX9bQfNL9qR4ned6hf5wQUcoEhpaCoKQOh6gU6NdIoqmCsGAG/zLBqJ55 /Syw== X-Gm-Message-State: AOJu0Yw7DV+xnrYm5uPA3yAc7CP998wd4I5ZK8lIv3RFqv6kTAoYrehn WIWHtjl/HaSHz+fIG34lVnSue+2/qa52v4YZbQ05OLJ3kww5h9hAq1e/2MGux/npHQ== X-Google-Smtp-Source: AGHT+IGB9+SyUBHK6T6HEjGl6vU7Qly4+rReJt1TMrICOT0PrXNk4/MuGJ3fp6/D1R4/9yFX0SNBsujHyUFS X-Received: by 2002:a05:6e02:134e:b0:35f:71e9:a0b5 with SMTP id k14-20020a056e02134e00b0035f71e9a0b5mr3814744ilr.61.1702591879508; Thu, 14 Dec 2023 14:11:19 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id j11-20020a92ca0b000000b0035d56982785sm1220080ils.77.2023.12.14.14.11.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Dec 2023 14:11:19 -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 98E60605C312; Thu, 14 Dec 2023 17:11:18 -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: Thu, 14 Dec 2023 17:10:08 -0500 Message-ID: <20231214221012.9598-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.