get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139640,
    "url": "http://patchwork.dpdk.org/api/patches/139640/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240423091252.62924-5-juraj.linkes@pantheon.tech/",
    "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": "<20240423091252.62924-5-juraj.linkes@pantheon.tech>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240423091252.62924-5-juraj.linkes@pantheon.tech",
    "date": "2024-04-23T09:12:52",
    "name": "[v1,4/4] dts: refine pre-test setup and teardown steps",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "08edb5ec76774f67fcb15d49fc76ad0074753c81",
    "submitter": {
        "id": 1626,
        "url": "http://patchwork.dpdk.org/api/people/1626/?format=api",
        "name": "Juraj Linkeš",
        "email": "juraj.linkes@pantheon.tech"
    },
    "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/20240423091252.62924-5-juraj.linkes@pantheon.tech/mbox/",
    "series": [
        {
            "id": 31808,
            "url": "http://patchwork.dpdk.org/api/series/31808/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31808",
            "date": "2024-04-23T09:12:48",
            "name": "node and inheritance improvements",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/31808/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/139640/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/139640/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 25DA243EE8;\n\tTue, 23 Apr 2024 11:13:24 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D280540F16;\n\tTue, 23 Apr 2024 11:13:02 +0200 (CEST)",
            "from mail-ed1-f52.google.com (mail-ed1-f52.google.com\n [209.85.208.52]) by mails.dpdk.org (Postfix) with ESMTP id B68AD40ED6\n for <dev@dpdk.org>; Tue, 23 Apr 2024 11:12:58 +0200 (CEST)",
            "by mail-ed1-f52.google.com with SMTP id\n 4fb4d7f45d1cf-56e1baf0380so6341177a12.3\n for <dev@dpdk.org>; Tue, 23 Apr 2024 02:12:58 -0700 (PDT)",
            "from jlinkes-PT-Latitude-5530.pantheon.local\n (81.89.53.154.host.vnet.sk. [81.89.53.154])\n by smtp.gmail.com with ESMTPSA id\n be12-20020a0564021a2c00b0056bf7f92346sm6440534edb.50.2024.04.23.02.12.57\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 23 Apr 2024 02:12:57 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=pantheon.tech; s=google; t=1713863578; x=1714468378; 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=D8KFfjKjySeDHyHvuEdeBQcDpTwTmqzSHRmB+Cnwggo=;\n b=vYiEkQ40c3nTjPBSFInb0WTrilEgOhAVwaynXgc2yk0b6Ht9UXORfiAESfyxh7KNdr\n 94RK9SKdsDSv+Z6IhrOILZS65lbYCrCBLFWMjC814v1/mBhrjWNKRX1k44eQaUL70N7s\n i8ASM80Cpiaa04VaWRf4fPmWeavnksdEPH3SSzTSNzqUij2ORUL7wb94AxOMSVsWHgyO\n CiTUXDDtC7KNumbYf7R0dkK1AdbHOhzakHaqOIAyheczxMtuzhQu/d6tLYI5FhJNoinA\n /GPzNpRohqwbrqawigH/30Lcs/+DxcTwXsocXGf9ZuKIJJ2Crcj0WNegd6OIk87klIrg\n Ybyg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1713863578; x=1714468378;\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=D8KFfjKjySeDHyHvuEdeBQcDpTwTmqzSHRmB+Cnwggo=;\n b=LeUj7gA/ruSLkH+nQBUS7UO6iMdFhLRCzMgFp5FPRm9R2RHOqMg0fUeadb6wFufRRe\n 1i56XxyJVi2eR9gzraHZ6fj64zLRpDlbSV6ejgUrWvRBidhJkV1HLRIkc/0+oDCtKeUT\n 0X1DXwXP9PK6H6CFvKUJfH9r5NRR4AepQw7x/d+u8aKzL0AsZbj1Y6XUTwbduEPJcR6g\n g3/heHnTJjZ+b0Mh2LOygwjfImO3sOAi2AsQemWSOGv8DZ2RToM3qf8Do8iHXyzvcwgl\n uxF2QA4nQW/DuASwHiQVf6Ypv3ThBdo7A+Jud8qo6i3624oQ6mg0hMjsTQOkhoETQ7Zd\n aL0w==",
        "X-Gm-Message-State": "AOJu0YxgYaUhmKY0cDRqsWBJnCU7D9DVqJuGJUOJ+5P4RuUlJwv5bZ52\n jWbX5Hly9yMmYrgn6StmJHc/fqor1FT+L2UH7auqd8RT7CMVjJu+szE/kkDB1mqgmmrQLl76kxo\n +iso=",
        "X-Google-Smtp-Source": "\n AGHT+IEofA+sGkb+sv4LYoii0OEbQ1PmechdFnInbYx3oh1Tev8MdhcIefsWHs9GUl5R00q6BcYdsA==",
        "X-Received": "by 2002:a50:d5ce:0:b0:568:bfcd:e895 with SMTP id\n g14-20020a50d5ce000000b00568bfcde895mr6851427edj.41.1713863578401;\n Tue, 23 Apr 2024 02:12:58 -0700 (PDT)",
        "From": "=?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>",
        "To": "thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, jspewock@iol.unh.edu,\n probb@iol.unh.edu, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com,\n npratte@iol.unh.edu",
        "Cc": "dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>",
        "Subject": "[PATCH v1 4/4] dts: refine pre-test setup and teardown steps",
        "Date": "Tue, 23 Apr 2024 11:12:52 +0200",
        "Message-Id": "<20240423091252.62924-5-juraj.linkes@pantheon.tech>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240423091252.62924-1-juraj.linkes@pantheon.tech>",
        "References": "<20240423091252.62924-1-juraj.linkes@pantheon.tech>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "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": "The major part is the removal of _set_up_execution() and\n_tear_down_execution() of Node in lieu of using super() in the\nsuperclasses, which simplifies the code while achieving the same thing.\n\nThe minor changes are the move of virtual devices and build target\nsetup/teardown into SutNode from Node since both are DPDK-related which\nare only going to run on the SutNode.\n\nSigned-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>\n---\n dts/framework/testbed_model/node.py     | 65 ++-----------------------\n dts/framework/testbed_model/sut_node.py | 49 ++++++++++++++-----\n 2 files changed, 40 insertions(+), 74 deletions(-)",
    "diff": "diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_model/node.py\nindex 74061f6262..1a98209822 100644\n--- a/dts/framework/testbed_model/node.py\n+++ b/dts/framework/testbed_model/node.py\n@@ -16,12 +16,7 @@\n from ipaddress import IPv4Interface, IPv6Interface\n from typing import Any, Callable, Type, Union\n \n-from framework.config import (\n-    OS,\n-    BuildTargetConfiguration,\n-    ExecutionConfiguration,\n-    NodeConfiguration,\n-)\n+from framework.config import OS, ExecutionConfiguration, NodeConfiguration\n from framework.exception import ConfigurationError\n from framework.logger import DTSLogger, get_dts_logger\n from framework.settings import SETTINGS\n@@ -36,7 +31,6 @@\n from .linux_session import LinuxSession\n from .os_session import InteractiveShellType, OSSession\n from .port import Port\n-from .virtual_device import VirtualDevice\n \n \n class Node(ABC):\n@@ -55,7 +49,6 @@ class Node(ABC):\n         lcores: The list of logical cores that DTS can use on the node.\n             It's derived from logical cores present on the node and the test run configuration.\n         ports: The ports of this node specified in the test run configuration.\n-        virtual_devices: The virtual devices used on the node.\n     \"\"\"\n \n     main_session: OSSession\n@@ -65,8 +58,6 @@ class Node(ABC):\n     ports: list[Port]\n     _logger: DTSLogger\n     _other_sessions: list[OSSession]\n-    _execution_config: ExecutionConfiguration\n-    virtual_devices: list[VirtualDevice]\n \n     def __init__(self, node_config: NodeConfiguration):\n         \"\"\"Connect to the node and gather info during initialization.\n@@ -94,7 +85,6 @@ def __init__(self, node_config: NodeConfiguration):\n         ).filter()\n \n         self._other_sessions = []\n-        self.virtual_devices = []\n         self._init_ports()\n \n     def _init_ports(self) -> None:\n@@ -106,67 +96,20 @@ def _init_ports(self) -> None:\n     def set_up_execution(self, execution_config: ExecutionConfiguration) -> None:\n         \"\"\"Execution setup steps.\n \n-        Configure hugepages and call :meth:`_set_up_execution` where\n-        the rest of the configuration steps (if any) are implemented.\n+        Configure hugepages on all DTS node types. Additional steps can be added by\n+        extending the method in subclasses with the use of super().\n \n         Args:\n             execution_config: The execution test run configuration according to which\n                 the setup steps will be taken.\n         \"\"\"\n         self._setup_hugepages()\n-        self._set_up_execution(execution_config)\n-        self._execution_config = execution_config\n-        for vdev in execution_config.vdevs:\n-            self.virtual_devices.append(VirtualDevice(vdev))\n-\n-    def _set_up_execution(self, execution_config: ExecutionConfiguration) -> None:\n-        \"\"\"Optional additional execution setup steps for subclasses.\n-\n-        Subclasses should override this if they need to add additional execution setup steps.\n-        \"\"\"\n \n     def tear_down_execution(self) -> None:\n         \"\"\"Execution teardown steps.\n \n         There are currently no common execution teardown steps common to all DTS node types.\n-        \"\"\"\n-        self.virtual_devices = []\n-        self._tear_down_execution()\n-\n-    def _tear_down_execution(self) -> None:\n-        \"\"\"Optional additional execution teardown steps for subclasses.\n-\n-        Subclasses should override this if they need to add additional execution teardown steps.\n-        \"\"\"\n-\n-    def set_up_build_target(self, build_target_config: BuildTargetConfiguration) -> None:\n-        \"\"\"Build target setup steps.\n-\n-        There are currently no common build target setup steps common to all DTS node types.\n-\n-        Args:\n-            build_target_config: The build target test run configuration according to which\n-                the setup steps will be taken.\n-        \"\"\"\n-        self._set_up_build_target(build_target_config)\n-\n-    def _set_up_build_target(self, build_target_config: BuildTargetConfiguration) -> None:\n-        \"\"\"Optional additional build target setup steps for subclasses.\n-\n-        Subclasses should override this if they need to add additional build target setup steps.\n-        \"\"\"\n-\n-    def tear_down_build_target(self) -> None:\n-        \"\"\"Build target teardown steps.\n-\n-        There are currently no common build target teardown steps common to all DTS node types.\n-        \"\"\"\n-        self._tear_down_build_target()\n-\n-    def _tear_down_build_target(self) -> None:\n-        \"\"\"Optional additional build target teardown steps for subclasses.\n-\n-        Subclasses should override this if they need to add additional build target teardown steps.\n+        Additional steps can be added by extending the method in subclasses with the use of super().\n         \"\"\"\n \n     def create_session(self, name: str) -> OSSession:\ndiff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py\nindex 800fbef860..ead6cc5a43 100644\n--- a/dts/framework/testbed_model/sut_node.py\n+++ b/dts/framework/testbed_model/sut_node.py\n@@ -20,6 +20,7 @@\n from framework.config import (\n     BuildTargetConfiguration,\n     BuildTargetInfo,\n+    ExecutionConfiguration,\n     NodeInfo,\n     SutNodeConfiguration,\n )\n@@ -107,10 +108,12 @@ class SutNode(Node):\n     or the git commit ID, tag ID or tree ID to test.\n \n     Attributes:\n-        config: The SUT node configuration\n+        config: The SUT node configuration.\n+        virtual_devices: The virtual devices used on the node.\n     \"\"\"\n \n     config: SutNodeConfiguration\n+    virtual_devices: list[VirtualDevice]\n     _dpdk_prefix_list: list[str]\n     _dpdk_timestamp: str\n     _build_target_config: BuildTargetConfiguration | None\n@@ -131,6 +134,7 @@ def __init__(self, node_config: SutNodeConfiguration):\n             node_config: The SUT node's test run configuration.\n         \"\"\"\n         super().__init__(node_config)\n+        self.virtual_devices = []\n         self._dpdk_prefix_list = []\n         self._build_target_config = None\n         self._env_vars = {}\n@@ -228,25 +232,44 @@ def get_build_target_info(self) -> BuildTargetInfo:\n     def _guess_dpdk_remote_dir(self) -> PurePath:\n         return self.main_session.guess_dpdk_remote_dir(self._remote_tmp_dir)\n \n-    def _set_up_build_target(self, build_target_config: BuildTargetConfiguration) -> None:\n-        \"\"\"Setup DPDK on the SUT node.\n+    def set_up_execution(self, execution_config: ExecutionConfiguration) -> None:\n+        \"\"\"Extend the execution setup with vdev config.\n \n-        Additional build target setup steps on top of those in :class:`Node`.\n+        Args:\n+            execution_config: The execution test run configuration according to which\n+                the setup steps will be taken.\n+        \"\"\"\n+        super().set_up_execution(execution_config)\n+        for vdev in execution_config.vdevs:\n+            self.virtual_devices.append(VirtualDevice(vdev))\n+\n+    def tear_down_execution(self) -> None:\n+        \"\"\"Extend the execution teardown with virtual device teardown.\"\"\"\n+        super().tear_down_execution()\n+        self.virtual_devices = []\n+\n+    def set_up_build_target(self, build_target_config: BuildTargetConfiguration) -> None:\n+        \"\"\"Set up DPDK the SUT node and bind ports.\n+\n+        DPDK setup includes setting all internals needed for the build, the copying of DPDK tarball\n+        and then building DPDK. The drivers are bound to those that DPDK needs.\n+\n+        Args:\n+            build_target_config: The build target test run configuration according to which\n+                the setup steps will be taken.\n         \"\"\"\n-        # we want to ensure that dpdk_version and compiler_version is reset for new\n-        # build targets\n-        self._dpdk_version = None\n-        self._compiler_version = None\n         self._configure_build_target(build_target_config)\n         self._copy_dpdk_tarball()\n         self._build_dpdk()\n         self.bind_ports_to_driver()\n \n-    def _tear_down_build_target(self) -> None:\n-        \"\"\"Bind ports to the operating system drivers.\n-\n-        Additional build target teardown steps on top of those in :class:`Node`.\n-        \"\"\"\n+    def tear_down_build_target(self) -> None:\n+        \"\"\"Reset DPDK variables and bind port driver to the OS driver.\"\"\"\n+        self._env_vars = {}\n+        self._build_target_config = None\n+        self.__remote_dpdk_dir = None\n+        self._dpdk_version = None\n+        self._compiler_version = None\n         self.bind_ports_to_driver(for_dpdk=False)\n \n     def _configure_build_target(self, build_target_config: BuildTargetConfiguration) -> None:\n",
    "prefixes": [
        "v1",
        "4/4"
    ]
}