From patchwork Thu Nov 9 23:07:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134042 X-Patchwork-Delegate: thomas@monjalon.net 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 7A117432EC; Fri, 10 Nov 2023 00:09:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8FD53427D8; Fri, 10 Nov 2023 00:09:15 +0100 (CET) Received: from mail-pf1-f226.google.com (mail-pf1-f226.google.com [209.85.210.226]) by mails.dpdk.org (Postfix) with ESMTP id DAF974064C for ; Fri, 10 Nov 2023 00:09:10 +0100 (CET) Received: by mail-pf1-f226.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso1212812b3a.1 for ; Thu, 09 Nov 2023 15:09:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699571350; x=1700176150; 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=rxomyntegdrXYkBv8b690HuDHshTcpLqZU8Wlt/jce4=; b=HHJ7Ho4RTfIwCQL8y/XVqYNGh1bLMYNnir6xZ42Iic+D9tW2UoTubxruB0rP7jIsPP Ol0KMXSdUK/aomItj+Le7QmBdAKrNMA7McoYrfiuNgU5wDEu2nse63J8scWQtWizrqzo xQOxPtKHfRaMPyd5LhJlu11f49i7gA7Zkk6GQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699571350; x=1700176150; 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=rxomyntegdrXYkBv8b690HuDHshTcpLqZU8Wlt/jce4=; b=PuXkLN6GguL5zFAnuObhiWfRYI/iGxTblFkrrrShXYbEXo/vWGH6Wfcwns/F1x8JiR ynX/kRtiL+K/3OKYeaaZykG5ZBVi54LAgfdRTWng2bercReEa6/GLW2/QQYdx5tdNU+C i0iJKWMMTpQs1VKz1abyJ/U4WzJSCgDfxBHUXc+XW6xXGwHe/DPpyucoT/E0DBCCA/FW +Q3/hCoOrMGV0LyKg3ptGp7p/X/bL+wr5C2nggZfA4ZDo1hyxcMdpPih1294gqjWlgR6 6eBNPomGgCmm2opDOSZs3ej6Lvk+Ry8AUdjoErCNHvYdedd+S6bzPL0+D+NOqeRmvvz8 cdag== X-Gm-Message-State: AOJu0Yx/JVxEtiloQtydyXW02Lu6DIHzWPA9jJS/EShwXpt6P+SgA311 nSx80PHqEgF1JZLDWknVvoJT5WHdsJhBc9BEd0jCkJcs+rdTqA== X-Google-Smtp-Source: AGHT+IGKOniTesvfCvLs5YMds8+B91YwUsKLoF/PQzldzk3Tcbc2YHHUCawIprdHIVuWLamZjjOz4IixoiX4 X-Received: by 2002:a05:6a20:729a:b0:181:63e5:d500 with SMTP id o26-20020a056a20729a00b0018163e5d500mr1131316pzk.6.1699571350075; Thu, 09 Nov 2023 15:09:10 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id w32-20020a634920000000b005b64e8336dcsm927286pga.20.2023.11.09.15.09.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:09:10 -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 49F42605C318; Thu, 9 Nov 2023 18:09:09 -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 v1 4/7] dts: allow passing parameters into interactive apps Date: Thu, 9 Nov 2023 18:07:34 -0500 Message-ID: <20231109230900.24572-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109230900.24572-1-jspewock@iol.unh.edu> References: <20231109230900.24572-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 --- dts/framework/remote_session/remote/testpmd_shell.py | 2 +- dts/framework/testbed_model/sut_node.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dts/framework/remote_session/remote/testpmd_shell.py b/dts/framework/remote_session/remote/testpmd_shell.py index 3ea16c7ab3..3f6a86aa35 100644 --- a/dts/framework/remote_session/remote/testpmd_shell.py +++ b/dts/framework/remote_session/remote/testpmd_shell.py @@ -32,7 +32,7 @@ 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 get_devices(self) -> list[TestPmdDevice]: diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 4161d3a4d5..bcac939e72 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -377,7 +377,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 | str = "", + app_parameters: str = "", ) -> InteractiveShellType: """Factory method for creating a handler for an interactive session. @@ -392,12 +393,14 @@ 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: + if not eal_parameters and shell_cls.dpdk_app: eal_parameters = self.create_eal_parameters() - + eal_parameters = f"{eal_parameters} --" # We need to append the build directory for DPDK apps if shell_cls.dpdk_app: shell_cls.path = self.main_session.join_remote_path( @@ -405,7 +408,7 @@ def create_interactive_shell( ) return super().create_interactive_shell( - shell_cls, timeout, privileged, str(eal_parameters) + shell_cls, timeout, privileged, f"{eal_parameters} {app_parameters}" ) def bind_ports_to_driver(self, for_dpdk: bool = True) -> None: