get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/139772/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 139772,
    "url": "http://patchwork.dpdk.org/api/patches/139772/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240501161623.26672-4-jspewock@iol.unh.edu/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20240501161623.26672-4-jspewock@iol.unh.edu>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240501161623.26672-4-jspewock@iol.unh.edu",
    "date": "2024-05-01T16:16:23",
    "name": "[v2,3/3] dts: Improve logging for interactive shells",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "3bd22cbdd7a82a9a291e500bc53b76cafaa5836e",
    "submitter": {
        "id": 2772,
        "url": "http://patchwork.dpdk.org/api/people/2772/?format=api",
        "name": "Jeremy Spewock",
        "email": "jspewock@iol.unh.edu"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240501161623.26672-4-jspewock@iol.unh.edu/mbox/",
    "series": [
        {
            "id": 31856,
            "url": "http://patchwork.dpdk.org/api/series/31856/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31856",
            "date": "2024-05-01T16:16:20",
            "name": "Improve interactive shell output gathering and logging",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/31856/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/139772/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/139772/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 59B7843F5D;\n\tWed,  1 May 2024 18:17:41 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 698F340633;\n\tWed,  1 May 2024 18:17:33 +0200 (CEST)",
            "from mail-qv1-f97.google.com (mail-qv1-f97.google.com\n [209.85.219.97]) by mails.dpdk.org (Postfix) with ESMTP id C5472402A7\n for <dev@dpdk.org>; Wed,  1 May 2024 18:17:31 +0200 (CEST)",
            "by mail-qv1-f97.google.com with SMTP id\n 6a1803df08f44-69b514d3cf4so75967166d6.0\n for <dev@dpdk.org>; Wed, 01 May 2024 09:17:31 -0700 (PDT)",
            "from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84])\n by smtp-relay.gmail.com with ESMTPS id\n b6-20020a0cfe66000000b006a0acd9db7fsm1139541qvv.69.2024.05.01.09.17.31\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Wed, 01 May 2024 09:17:31 -0700 (PDT)",
            "from iol.unh.edu (unknown\n [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f])\n by postal.iol.unh.edu (Postfix) with ESMTP id CB66D6052514;\n Wed,  1 May 2024 12:17:30 -0400 (EDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=iol.unh.edu; s=unh-iol; t=1714580251; x=1715185051; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=fyUAKes1V0sUW115fIJqfu/xF5FBEoeRWIDtsRAc5gI=;\n b=ZbY+ylTO1dpqK5dHWIC7BXKOghIbrk7JeGTuTXhUB3ZfGPtr3DC/o+dBptPtpuIfcv\n siKxXZJFHLeDVvFxQgbZ5SdhMC6F8FSRc6KR4FjFjC84Oz3JNUncdCHGCo/sCCznZAb1\n AODfIRtmUYswophGig4xLn5tvqJ9FMkyd9UMw=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1714580251; x=1715185051;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=fyUAKes1V0sUW115fIJqfu/xF5FBEoeRWIDtsRAc5gI=;\n b=NaYThfTneGhwrgzZf/JFGkwCI3hwW3KK3PvxZ+0C7ie8T6VCZifne49mTOXj5oOzYn\n 8XW95X4sPtw3oFkVaPSyXB/aZ9AsJx1mfAsE4i9JwMcnoszhyIxM9+9HBn/yfnVUQw1z\n D9EoYowjjyHSWgrOrTB1QjOaR6WDml62fXEBUvNubK7jRnXx7DqYLx7xCaEkh9jUTjgE\n Ms0DHuc7TaOKrDII2+sxxnlg65VhqNejblxRXHUKSzZSC+A9JwcPcyqMpBv/4DMhhXBf\n rJmZ5394fRQbleTlC6jJfDRbexxeXHBL5t9OmEc+TbYiWHimSa1PXcYP5LAxh9tKrtRE\n 4lBQ==",
        "X-Gm-Message-State": "AOJu0YxMjx9wDbxPVgPLKe2j3GrAVgVmlvV8HKMCsFSM+Fu7T9TJC5nn\n 7y4wSyVOu+8yc+7I7HE+kYUoMGEDkdInaak/NveHy8G5hbY1jvDOivl/ehDdte1xdKr9oPEfes/\n 0O2tSICxZu/iJr3GsDXVPTSXj8xcjR/W7",
        "X-Google-Smtp-Source": "\n AGHT+IGZbOtz8MI9dN00EPplcExVa4hmN6eu8W//whKKe6gkjm+u4PowNpanKrEfctGY8we1W1L3Sv9+XGjN",
        "X-Received": "by 2002:a05:6214:21ab:b0:6a0:cb4d:7948 with SMTP id\n t11-20020a05621421ab00b006a0cb4d7948mr2738077qvc.40.1714580251245;\n Wed, 01 May 2024 09:17:31 -0700 (PDT)",
        "X-Relaying-Domain": "iol.unh.edu",
        "From": "jspewock@iol.unh.edu",
        "To": "Luca.Vizzarro@arm.com, wathsala.vithanage@arm.com,\n yoan.picchi@foss.arm.com, juraj.linkes@pantheon.tech,\n paul.szczepanek@arm.com, probb@iol.unh.edu, thomas@monjalon.net,\n Honnappa.Nagarahalli@arm.com",
        "Cc": "dev@dpdk.org,\n\tJeremy Spewock <jspewock@iol.unh.edu>",
        "Subject": "[PATCH v2 3/3] dts: Improve logging for interactive shells",
        "Date": "Wed,  1 May 2024 12:16:23 -0400",
        "Message-ID": "<20240501161623.26672-4-jspewock@iol.unh.edu>",
        "X-Mailer": "git-send-email 2.44.0",
        "In-Reply-To": "<20240501161623.26672-1-jspewock@iol.unh.edu>",
        "References": "<20240312172558.11844-1-jspewock@iol.unh.edu>\n <20240501161623.26672-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 <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "From: Jeremy Spewock <jspewock@iol.unh.edu>\n\nThe messages being logged by interactive shells currently are using the\nsame logger as the node they were created from. Because of this, when\nsending interactive commands, the logs make no distinction between when\nyou are sending a command directly to the host and when you are using an\ninteractive shell on the host. This change adds names to interactive\nshells so that they are able to use their own loggers with distinct\nnames.\n\nSigned-off-by: Jeremy Spewock <jspewock@iol.unh.edu>\n---\n dts/framework/remote_session/interactive_shell.py      | 9 +++++----\n dts/framework/testbed_model/node.py                    | 7 +++++++\n dts/framework/testbed_model/os_session.py              | 6 ++++--\n dts/framework/testbed_model/sut_node.py                | 7 ++++++-\n dts/framework/testbed_model/traffic_generator/scapy.py | 2 +-\n 5 files changed, 23 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/dts/framework/remote_session/interactive_shell.py b/dts/framework/remote_session/interactive_shell.py\nindex 0b0ccdb545..eb9c9b6843 100644\n--- a/dts/framework/remote_session/interactive_shell.py\n+++ b/dts/framework/remote_session/interactive_shell.py\n@@ -24,7 +24,7 @@\n     InteractiveSSHSessionDeadError,\n     InteractiveSSHTimeoutError,\n )\n-from framework.logger import DTSLogger\n+from framework.logger import DTSLogger, get_dts_logger\n from framework.settings import SETTINGS\n \n from .interactive_remote_session import InteractiveRemoteSession\n@@ -66,8 +66,8 @@ class InteractiveShell(ABC):\n \n     def __init__(\n         self,\n+        name: str,\n         interactive_session: InteractiveRemoteSession,\n-        logger: DTSLogger,\n         get_privileged_command: Callable[[str], str] | None,\n         app_args: str = \"\",\n         timeout: float = SETTINGS.timeout,\n@@ -75,8 +75,9 @@ def __init__(\n         \"\"\"Create an SSH channel during initialization.\n \n         Args:\n+            name: Name for the interactive shell to use for logging. This name will be appended to\n+                the name of the underlying node which it is running on.\n             interactive_session: The SSH session dedicated to interactive shells.\n-            logger: The logger instance this session will use.\n             get_privileged_command: A method for modifying a command to allow it to use\n                 elevated privileges. If :data:`None`, the application will not be started\n                 with elevated privileges.\n@@ -91,7 +92,7 @@ def __init__(\n         self._stdout = self._ssh_channel.makefile(\"r\")\n         self._ssh_channel.settimeout(timeout)\n         self._ssh_channel.set_combine_stderr(True)  # combines stdout and stderr streams\n-        self._logger = logger\n+        self._logger = get_dts_logger(f\"{interactive_session._node_config.name}.{name}\")\n         self._timeout = timeout\n         self._app_args = app_args\n         self._start_application(get_privileged_command)\ndiff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_model/node.py\nindex 74061f6262..a5beeae7e7 100644\n--- a/dts/framework/testbed_model/node.py\n+++ b/dts/framework/testbed_model/node.py\n@@ -199,6 +199,7 @@ def create_interactive_shell(\n         shell_cls: Type[InteractiveShellType],\n         timeout: float = SETTINGS.timeout,\n         privileged: bool = False,\n+        name: str = \"\",\n         app_args: str = \"\",\n     ) -> InteractiveShellType:\n         \"\"\"Factory for interactive session handlers.\n@@ -210,6 +211,8 @@ def create_interactive_shell(\n             timeout: Timeout for reading output from the SSH channel. If you are reading from\n                 the buffer and don't receive any data within the timeout it will throw an error.\n             privileged: Whether to run the shell with administrative privileges.\n+            name: The name to use for the interactive application in the logs. If not specified,\n+                this will default to the name of `shell_cls`.\n             app_args: The arguments to be passed to the application.\n \n         Returns:\n@@ -218,10 +221,14 @@ def create_interactive_shell(\n         if not shell_cls.dpdk_app:\n             shell_cls.path = self.main_session.join_remote_path(shell_cls.path)\n \n+        if name == \"\":\n+            name = shell_cls.__name__\n+\n         return self.main_session.create_interactive_shell(\n             shell_cls,\n             timeout,\n             privileged,\n+            name,\n             app_args,\n         )\n \ndiff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py\nindex d5bf7e0401..1f6d8257ed 100644\n--- a/dts/framework/testbed_model/os_session.py\n+++ b/dts/framework/testbed_model/os_session.py\n@@ -134,6 +134,7 @@ def create_interactive_shell(\n         shell_cls: Type[InteractiveShellType],\n         timeout: float,\n         privileged: bool,\n+        name: str,\n         app_args: str,\n     ) -> InteractiveShellType:\n         \"\"\"Factory for interactive session handlers.\n@@ -146,14 +147,15 @@ def create_interactive_shell(\n                 reading from the buffer and don't receive any data within the timeout\n                 it will throw an error.\n             privileged: Whether to run the shell with administrative privileges.\n+            name: Name for the shell to use in the logs.\n             app_args: The arguments to be passed to the application.\n \n         Returns:\n             An instance of the desired interactive application shell.\n         \"\"\"\n         return shell_cls(\n-            self.interactive_session.session,\n-            self._logger,\n+            name,\n+            self.interactive_session,\n             self._get_privileged_command if privileged else None,\n             app_args,\n             timeout,\ndiff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py\nindex 97aa26d419..0bddef6f44 100644\n--- a/dts/framework/testbed_model/sut_node.py\n+++ b/dts/framework/testbed_model/sut_node.py\n@@ -442,6 +442,7 @@ def create_interactive_shell(\n         shell_cls: Type[InteractiveShellType],\n         timeout: float = SETTINGS.timeout,\n         privileged: bool = False,\n+        name: str = \"\",\n         app_parameters: str = \"\",\n         eal_parameters: EalParameters | None = None,\n     ) -> InteractiveShellType:\n@@ -459,6 +460,8 @@ def create_interactive_shell(\n                 reading from the buffer and don't receive any data within the timeout\n                 it will throw an error.\n             privileged: Whether to run the shell with administrative privileges.\n+            name: The name to use for the interactive application in the logs. If not specified,\n+                this will default to the name `shell_cls`.\n             eal_parameters: List of EAL parameters to use to launch the app. If this\n                 isn't provided or an empty string is passed, it will default to calling\n                 :meth:`create_eal_parameters`.\n@@ -478,7 +481,9 @@ def create_interactive_shell(\n                 self.remote_dpdk_build_dir, shell_cls.path\n             )\n \n-        return super().create_interactive_shell(shell_cls, timeout, privileged, app_parameters)\n+        return super().create_interactive_shell(\n+            shell_cls, timeout, privileged, name, app_parameters\n+        )\n \n     def bind_ports_to_driver(self, for_dpdk: bool = True) -> None:\n         \"\"\"Bind all ports on the SUT to a driver.\ndiff --git a/dts/framework/testbed_model/traffic_generator/scapy.py b/dts/framework/testbed_model/traffic_generator/scapy.py\nindex d0e0a7c64e..5676235119 100644\n--- a/dts/framework/testbed_model/traffic_generator/scapy.py\n+++ b/dts/framework/testbed_model/traffic_generator/scapy.py\n@@ -262,7 +262,7 @@ def __init__(self, tg_node: Node, config: ScapyTrafficGeneratorConfig):\n         ), \"Linux is the only supported OS for scapy traffic generation\"\n \n         self.session = self._tg_node.create_interactive_shell(\n-            PythonShell, timeout=5, privileged=True\n+            PythonShell, timeout=5, privileged=True, name=\"ScapyXMLRPCServer\"\n         )\n \n         # import libs in remote python console\n",
    "prefixes": [
        "v2",
        "3/3"
    ]
}