Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/124468/?format=api
http://patches.dpdk.org/api/patches/124468/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230223152840.634183-8-juraj.linkes@pantheon.tech/", "project": { "id": 1, "url": "http://patches.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": "<20230223152840.634183-8-juraj.linkes@pantheon.tech>", "list_archive_url": "https://inbox.dpdk.org/dev/20230223152840.634183-8-juraj.linkes@pantheon.tech", "date": "2023-02-23T15:28:37", "name": "[v5,07/10] dts: add hello world testsuite", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "2fe882c7427d12f7bd3a93eaea361a8b96d8a6cc", "submitter": { "id": 1626, "url": "http://patches.dpdk.org/api/people/1626/?format=api", "name": "Juraj Linkeš", "email": "juraj.linkes@pantheon.tech" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230223152840.634183-8-juraj.linkes@pantheon.tech/mbox/", "series": [ { "id": 27159, "url": "http://patches.dpdk.org/api/series/27159/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27159", "date": "2023-02-23T15:28:30", "name": "dts: add hello world testcase", "version": 5, "mbox": "http://patches.dpdk.org/series/27159/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/124468/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/124468/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 71FBD41D52;\n\tThu, 23 Feb 2023 16:29:49 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 499304304B;\n\tThu, 23 Feb 2023 16:29:01 +0100 (CET)", "from mail-ed1-f53.google.com (mail-ed1-f53.google.com\n [209.85.208.53]) by mails.dpdk.org (Postfix) with ESMTP id C726242D65\n for <dev@dpdk.org>; Thu, 23 Feb 2023 16:28:52 +0100 (CET)", "by mail-ed1-f53.google.com with SMTP id d30so2235757eda.4\n for <dev@dpdk.org>; Thu, 23 Feb 2023 07:28:52 -0800 (PST)", "from localhost.localdomain ([84.245.121.112])\n by smtp.gmail.com with ESMTPSA id\n r6-20020a50c006000000b004af6a8617ffsm1158892edb.46.2023.02.23.07.28.51\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 23 Feb 2023 07:28:52 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=pantheon-tech.20210112.gappssmtp.com; s=20210112;\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=f0DT2TcxLQmRocxSFXZcWJCAdu9+N2gg4K+Sovehhno=;\n b=RPvQSHVNbekowXz8GNDCw+isjPq9Ob//KRS6zpgm4Y87F7+eazjY9swfEbP2fyGeD2\n eft3gea15jbl0ahk3E2uq8DjHR/bxMeHbTuaGdA8VO1Ai0St9m/9L9DMX2mO4G18HOBm\n nKDoWITmIZWsEELzzLqRRbzqgcDHiDHWa/VH7FWaU9Tr4DAslh3xsbquAkaS51e/+b1i\n ScTNYmn6Od7SjMfZrpBpenkHXVgkpE0wYL7BaRL3TY8m5fqZ9Bojdi89L+evfdzqpamF\n FLUfpr/OkDeOHgxqfkppfxlIbMIBFYnsMecFZ7Pjo6jHAIog3flIWt7nIshP8k4Bo9jh\n ptJQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\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=f0DT2TcxLQmRocxSFXZcWJCAdu9+N2gg4K+Sovehhno=;\n b=cwNrGtvAE/HdYUCO+whpXaMXiK1J4aLt0XHx7XAIzXYK47al395hO0dUKe2Ssnm4Ro\n JbVynQD4JKuSkExAndaAeZWjbKA8WbD4WD7BHagt7f+Cv+X1iAlADTrHXsgJdNI52NJp\n cB4GEcSYy4VbeUAxH2SmztGOel5uZQsUdjov5l6K6zcSWOz9xGw0EpaXpGWA3Vm+AvJs\n TFfRkaeR8+VU632AgYJ9YxQ7KQ/NHyI7v3YXvlE3vTYHdhwwOnKStBjUw4GYFwaK0kmN\n P6db0lwlWrlhwCK36bBscXY9ehORmv910aI0QQvg9CXcq/w0t/1iuI7l61uCICCzQw7b\n jpbA==", "X-Gm-Message-State": "AO0yUKXFRQv+MLq4dxBYfPejfuKWMfvFBWkLSvJFgmFvivhbjNwImZH7\n vngjvlS859zIoaBqUmlV9uCERA==", "X-Google-Smtp-Source": "\n AK7set/Gd1s7hyBIc9Xkc+NT/OXMoiCpwLS+80kHBAHaSjzDeRwEiMVdj/7fZZT1K6rVzR5r2XkecA==", "X-Received": "by 2002:aa7:d412:0:b0:4ae:eae1:946a with SMTP id\n z18-20020aa7d412000000b004aeeae1946amr14710603edq.13.1677166132546;\n Thu, 23 Feb 2023 07:28:52 -0800 (PST)", "From": "=?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "To": "thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, lijuan.tu@intel.com,\n bruce.richardson@intel.com, probb@iol.unh.edu", "Cc": "dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "Subject": "[PATCH v5 07/10] dts: add hello world testsuite", "Date": "Thu, 23 Feb 2023 16:28:37 +0100", "Message-Id": "<20230223152840.634183-8-juraj.linkes@pantheon.tech>", "X-Mailer": "git-send-email 2.30.2", "In-Reply-To": "<20230223152840.634183-1-juraj.linkes@pantheon.tech>", "References": "<20230213152846.284191-1-juraj.linkes@pantheon.tech>\n <20230223152840.634183-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 test suite implements test cases defined in the corresponding test\nplan.\n\nSigned-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>\n---\n dts/framework/remote_session/__init__.py | 2 +-\n dts/framework/remote_session/os_session.py | 16 ++++-\n .../remote_session/remote/__init__.py | 2 +-\n dts/framework/testbed_model/__init__.py | 1 +\n dts/framework/testbed_model/sut_node.py | 12 +++-\n dts/tests/TestSuite_hello_world.py | 64 +++++++++++++++++++\n 6 files changed, 93 insertions(+), 4 deletions(-)\n create mode 100644 dts/tests/TestSuite_hello_world.py", "diff": "diff --git a/dts/framework/remote_session/__init__.py b/dts/framework/remote_session/__init__.py\nindex 747316c78a..ee221503df 100644\n--- a/dts/framework/remote_session/__init__.py\n+++ b/dts/framework/remote_session/__init__.py\n@@ -17,7 +17,7 @@\n \n from .linux_session import LinuxSession\n from .os_session import OSSession\n-from .remote import RemoteSession, SSHSession\n+from .remote import CommandResult, RemoteSession, SSHSession\n \n \n def create_session(\ndiff --git a/dts/framework/remote_session/os_session.py b/dts/framework/remote_session/os_session.py\nindex 4753c70e91..2731a7ca0a 100644\n--- a/dts/framework/remote_session/os_session.py\n+++ b/dts/framework/remote_session/os_session.py\n@@ -12,7 +12,7 @@\n from framework.testbed_model import LogicalCore, MesonArgs\n from framework.utils import EnvVarsDict\n \n-from .remote import RemoteSession, create_remote_session\n+from .remote import CommandResult, RemoteSession, create_remote_session\n \n \n class OSSession(ABC):\n@@ -50,6 +50,20 @@ def is_alive(self) -> bool:\n \"\"\"\n return self.remote_session.is_alive()\n \n+ def send_command(\n+ self,\n+ command: str,\n+ timeout: float,\n+ verify: bool = False,\n+ env: EnvVarsDict | None = None,\n+ ) -> CommandResult:\n+ \"\"\"\n+ An all-purpose API in case the command to be executed is already\n+ OS-agnostic, such as when the path to the executed command has been\n+ constructed beforehand.\n+ \"\"\"\n+ return self.remote_session.send_command(command, timeout, verify, env)\n+\n @abstractmethod\n def guess_dpdk_remote_dir(self, remote_dir) -> PurePath:\n \"\"\"\ndiff --git a/dts/framework/remote_session/remote/__init__.py b/dts/framework/remote_session/remote/__init__.py\nindex f3092f8bbe..8a1512210a 100644\n--- a/dts/framework/remote_session/remote/__init__.py\n+++ b/dts/framework/remote_session/remote/__init__.py\n@@ -6,7 +6,7 @@\n from framework.config import NodeConfiguration\n from framework.logger import DTSLOG\n \n-from .remote_session import RemoteSession\n+from .remote_session import CommandResult, RemoteSession\n from .ssh_session import SSHSession\n \n \ndiff --git a/dts/framework/testbed_model/__init__.py b/dts/framework/testbed_model/__init__.py\nindex 22c7c16708..485fc57703 100644\n--- a/dts/framework/testbed_model/__init__.py\n+++ b/dts/framework/testbed_model/__init__.py\n@@ -13,6 +13,7 @@\n from .hw import (\n LogicalCore,\n LogicalCoreCount,\n+ LogicalCoreCountFilter,\n LogicalCoreList,\n LogicalCoreListFilter,\n VirtualDevice,\ndiff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py\nindex a9ae2e4a6f..12b4c5573b 100644\n--- a/dts/framework/testbed_model/sut_node.py\n+++ b/dts/framework/testbed_model/sut_node.py\n@@ -8,7 +8,7 @@\n from pathlib import PurePath\n \n from framework.config import BuildTargetConfiguration, NodeConfiguration\n-from framework.remote_session import OSSession\n+from framework.remote_session import CommandResult, OSSession\n from framework.settings import SETTINGS\n from framework.utils import EnvVarsDict, skip_setup\n \n@@ -248,3 +248,13 @@ def create_eal_parameters(\n vdevs=vdevs,\n other_eal_param=other_eal_param,\n )\n+\n+ def run_dpdk_app(\n+ self, app_path: PurePath, eal_args: EalParameters, timeout: float = 30\n+ ) -> CommandResult:\n+ \"\"\"\n+ Run DPDK application on the remote node.\n+ \"\"\"\n+ return self.main_session.send_command(\n+ f\"{app_path} {eal_args}\", timeout, verify=True\n+ )\ndiff --git a/dts/tests/TestSuite_hello_world.py b/dts/tests/TestSuite_hello_world.py\nnew file mode 100644\nindex 0000000000..7e3d95c0cf\n--- /dev/null\n+++ b/dts/tests/TestSuite_hello_world.py\n@@ -0,0 +1,64 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2010-2014 Intel Corporation\n+\n+\"\"\"\n+Run the helloworld example app and verify it prints a message for each used core.\n+No other EAL parameters apart from cores are used.\n+\"\"\"\n+\n+from framework.test_suite import TestSuite\n+from framework.testbed_model import (\n+ LogicalCoreCount,\n+ LogicalCoreCountFilter,\n+ LogicalCoreList,\n+)\n+\n+\n+class TestHelloWorld(TestSuite):\n+ def set_up_suite(self) -> None:\n+ \"\"\"\n+ Setup:\n+ Build the app we're about to test - helloworld.\n+ \"\"\"\n+ self.app_helloworld_path = self.sut_node.build_dpdk_app(\"helloworld\")\n+\n+ def test_hello_world_single_core(self) -> None:\n+ \"\"\"\n+ Steps:\n+ Run the helloworld app on the first usable logical core.\n+ Verify:\n+ The app prints a message from the used core:\n+ \"hello from core <core_id>\"\n+ \"\"\"\n+\n+ # get the first usable core\n+ lcore_amount = LogicalCoreCount(1, 1, 1)\n+ lcores = LogicalCoreCountFilter(self.sut_node.lcores, lcore_amount).filter()\n+ eal_para = self.sut_node.create_eal_parameters(\n+ lcore_filter_specifier=lcore_amount\n+ )\n+ result = self.sut_node.run_dpdk_app(self.app_helloworld_path, eal_para)\n+ self.verify(\n+ f\"hello from core {int(lcores[0])}\" in result.stdout,\n+ f\"helloworld didn't start on lcore{lcores[0]}\",\n+ )\n+\n+ def test_hello_world_all_cores(self) -> None:\n+ \"\"\"\n+ Steps:\n+ Run the helloworld app on all usable logical cores.\n+ Verify:\n+ The app prints a message from all used cores:\n+ \"hello from core <core_id>\"\n+ \"\"\"\n+\n+ # get the maximum logical core number\n+ eal_para = self.sut_node.create_eal_parameters(\n+ lcore_filter_specifier=LogicalCoreList(self.sut_node.lcores)\n+ )\n+ result = self.sut_node.run_dpdk_app(self.app_helloworld_path, eal_para, 50)\n+ for lcore in self.sut_node.lcores:\n+ self.verify(\n+ f\"hello from core {int(lcore)}\" in result.stdout,\n+ f\"helloworld didn't start on lcore{lcore}\",\n+ )\n", "prefixes": [ "v5", "07/10" ] }{ "id": 124468, "url": "