From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 201804373D; Mon, 18 Dec 2023 19:13:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30E4C42DA3; Mon, 18 Dec 2023 19:13:05 +0100 (CET) Received: from mail-io1-f99.google.com (mail-io1-f99.google.com [209.85.166.99]) by mails.dpdk.org (Postfix) with ESMTP id E7E71406BC for ; Mon, 18 Dec 2023 19:13:01 +0100 (CET) Received: by mail-io1-f99.google.com with SMTP id ca18e2360f4ac-7b771176f80so305520639f.2 for ; Mon, 18 Dec 2023 10:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1702923181; x=1703527981; 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=ibySEqR8NVgD4NZnHiW5Tk1C7Z2Ui4tS6uCZgGiv5tN1FWajTeA7+o8yyFytBbWaiu TCpZpQ7YN0+MHdfqBUTZIFuG+kprinmE9aQGnqoGEHLvMWWVy1/1MwBjKqZkxVBpaOmL i526plSH485ZpEowkOPUYIDgqRfiI3eXXcIKA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702923181; x=1703527981; 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=EOXe/EWBH+WlAx9+6Rm+oyfitedtoSCWB8CIbCJtqisGuxDnNXQFmxIYoBIE37lEY0 CCWlR+MnAVE/HtBrIRxxjsEbX3FHARCalBR9UJJpqLRDATpOXKKc5/SpCfb+esSBIUvH 4srQlwtU+n8MkVgQKh/LOPRPAuHJVylOBjw43XHUwdmQQbVxtmHJcZtRt13yabu8v5e9 8xysP6DcgTW3CA3RsbSB5KkCLiv1izjt8LhPjYRZLQZ/NsP75g2r17Uhj9OivF7QMv9x xKosZ6I1RwybkQbPR0VNJR/hR7AigUoMbTaBwit2ZQFCS/ockeIxsYjKYP75p7tScpPq 63Hw== X-Gm-Message-State: AOJu0YwzG7eMYAOwIQbczCwE4YtuWZIwHak6dVjwCG8Cq6OZQVC4RUB/ 5paS3L4bL/TNaJy0y4Xk/SL+iJeZbZ3q2GN8ZTlAiBsAD5GvmA== X-Google-Smtp-Source: AGHT+IFV7VP5qe0whBTtNzopai3tuSf6B2RSWXxyk/pqD3bcE/shh5szqljsQBqaplA/uU5mr2EfLgEupgzk X-Received: by 2002:a05:6602:1a8f:b0:7b7:1298:eb36 with SMTP id bn15-20020a0566021a8f00b007b71298eb36mr23500590iob.33.1702923181326; Mon, 18 Dec 2023 10:13:01 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id j11-20020a0566022ccb00b007a2ad2f0ba0sm1254756iow.21.2023.12.18.10.13.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2023 10:13:01 -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 C65D8605C311; Mon, 18 Dec 2023 13:13:00 -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 13:12:16 -0500 Message-ID: <20231218181221.10057-3-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218181221.10057-1-jspewock@iol.unh.edu> References: <20231218181221.10057-1-jspewock@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. -- 2.43.0