From patchwork Thu Nov 9 23:20:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134051 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 9A8EF432EC; Fri, 10 Nov 2023 00:23:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6186F42C24; Fri, 10 Nov 2023 00:23:32 +0100 (CET) Received: from mail-il1-f228.google.com (mail-il1-f228.google.com [209.85.166.228]) by mails.dpdk.org (Postfix) with ESMTP id 4F5AC42D0B for ; Fri, 10 Nov 2023 00:23:30 +0100 (CET) Received: by mail-il1-f228.google.com with SMTP id e9e14a558f8ab-3594c100735so3828075ab.1 for ; Thu, 09 Nov 2023 15:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699572209; x=1700177009; 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=Cxxp2MzcJEbKd2fbvi0OiiYqd26k/H7qtwv/bwIxUb+H6rGFvkhkkN3/H8raszMaOt NEYOLpp6dbq/WtbVkCiEUZazmNDMsxX4uI0n9SqEApiqB/PLnfEClvhg3b+Tx5vKlFxu 9JcUnKYeNuOepqmkf7o7l91vq4hPWnGcC1tm8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699572209; x=1700177009; 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=FtCEcL2dWQwb3iQ5x6l6rLrWC3dFcn06FJPzFrsPKK0iJUhYaF15aiLxJtPDjXN4rP azrRiSeDzdGJ9ZLcMkcpKm0gK4kL0RCYI+MjX/iVjtMkX5ckIctVtZnl3jszUhRBX4no ICznJU1DOWLoUQ7wVLB1V/SAeKL77D3X5jV5B4bx1AiREmWPvhTvV3ePTXqNsXFr29iU /QtZddnqj6Ct+1y8aV9VPPA/pA97IZFbEGE0PrIrqhcc6C016NdkbXu95ViBf8sww9Cx aN23A+zZx9kIor1oE0/1W5swkC+/LVPUfUhSRFuiRymEE4TfatyEj5K6e07+iJgTOCzH DIDQ== X-Gm-Message-State: AOJu0YxQNpLbqcsQWMKTO28/YFPRLxudBZFYs0FlyDkVHvbM1fcAFdL8 cdZcAkWgKGdu5YqShPg9HQudjeNdR0z+Y8B4Z7uFS/unR3XX1A== X-Google-Smtp-Source: AGHT+IEGrrU6sNkGojY/pkPgWFVyci8oklFL2VRhoiTcG8jFCrckpGnf8hCWkf0qTPDM0ImSGd9mkctHBE3r X-Received: by 2002:a92:c56a:0:b0:351:134d:ce3d with SMTP id b10-20020a92c56a000000b00351134dce3dmr875578ilj.7.1699572209763; Thu, 09 Nov 2023 15:23:29 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id q5-20020a056e0215c500b00359b544531csm953358ilu.51.2023.11.09.15.23.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:23:29 -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 392B0605C318; Thu, 9 Nov 2023 18:23:29 -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 v2 4/7] dts: allow passing parameters into interactive apps Date: Thu, 9 Nov 2023 18:20:14 -0500 Message-ID: <20231109232223.25644-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109232223.25644-2-jspewock@iol.unh.edu> References: <20231109232223.25644-2-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: