From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
To: thomas@monjalon.net, david.marchand@redhat.com,
ronan.randles@intel.com, Honnappa.Nagarahalli@arm.com,
ohilyard@iol.unh.edu, lijuan.tu@intel.com
Cc: dev@dpdk.org, "Juraj Linkeš" <juraj.linkes@pantheon.tech>
Subject: [RFC PATCH v1 01/10] dts: hello world config options
Date: Wed, 24 Aug 2022 16:24:45 +0000 [thread overview]
Message-ID: <20220824162454.394285-2-juraj.linkes@pantheon.tech> (raw)
In-Reply-To: <20220824162454.394285-1-juraj.linkes@pantheon.tech>
There are two categories of new config options: DPDK build/config
options and testing options.
Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
dts/conf.yaml | 20 ++-
dts/framework/config/__init__.py | 141 ++++++++++++++++++++-
dts/framework/config/conf_yaml_schema.json | 139 +++++++++++++++++++-
3 files changed, 289 insertions(+), 11 deletions(-)
diff --git a/dts/conf.yaml b/dts/conf.yaml
index cb12ea3d0f..36399c6e74 100644
--- a/dts/conf.yaml
+++ b/dts/conf.yaml
@@ -1,7 +1,21 @@
executions:
- - system_under_test: "SUT 1"
+ - target_descriptions:
+ - cpu: native
+ compiler: gcc
+ arch: x86_64
+ os: linux
+ perf: false
+ func: true
+ test_suites:
+ - hello_world
+ system_under_test: "SUT 1"
nodes:
- name: "SUT 1"
- hostname: "SUT IP address or hostname"
+ hostname: sut1.change.me.localhost
+ os: linux
user: root
- password: "Leave blank to use SSH keys"
+ password: a
+ arch: x86_64
+ bypass_core0: true
+ cores: 1
+ memory_channels: 4
diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.py
index a0fdffcd77..158baac143 100644
--- a/dts/framework/config/__init__.py
+++ b/dts/framework/config/__init__.py
@@ -6,11 +6,14 @@
"""
Generic port and topology nodes configuration file load function
"""
+import abc
import json
import os.path
import pathlib
+from abc import abstractmethod
from dataclasses import dataclass
-from typing import Any, Optional
+from enum import Enum, auto, unique
+from typing import Any, Optional, TypedDict, Union
import warlock
import yaml
@@ -18,6 +21,53 @@
from framework.settings import SETTINGS
+class StrEnum(Enum):
+ @staticmethod
+ def _generate_next_value_(
+ name: str, start: int, count: int, last_values: object
+ ) -> str:
+ return name
+
+
+@unique
+class OS(StrEnum):
+ linux = auto()
+ freebsd = auto()
+ windows = auto()
+
+
+@unique
+class Architecture(StrEnum):
+ i686 = auto()
+ x86_64 = auto()
+ x86_32 = auto()
+ arm64 = auto()
+ ppc64le = auto()
+
+
+@unique
+class Compiler(StrEnum):
+ gcc = auto()
+ clang = auto()
+ icc = auto()
+ msvc = auto()
+
+
+@unique
+class CPU(StrEnum):
+ native = auto()
+ armv8a = auto()
+ dpaa2 = auto()
+ thunderx = auto()
+ xgene1 = auto()
+
+
+@unique
+class NodeType(StrEnum):
+ physical = auto()
+ virtual = auto()
+
+
# Slots enables some optimizations, by pre-allocating space for the defined
# attributes in the underlying data structure.
#
@@ -28,7 +78,12 @@ class NodeConfiguration:
name: str
hostname: str
user: str
+ os: OS
+ arch: Architecture
password: Optional[str]
+ bypass_core0: bool
+ cores: str
+ memory_channels: int
@staticmethod
def from_dict(d: dict) -> "NodeConfiguration":
@@ -36,20 +91,101 @@ def from_dict(d: dict) -> "NodeConfiguration":
name=d["name"],
hostname=d["hostname"],
user=d["user"],
+ os=OS(d["os"]),
+ arch=Architecture(d["arch"]),
password=d.get("password"),
+ bypass_core0=d.get("bypass_core0", False),
+ cores=d["cores"],
+ memory_channels=d["memory_channels"],
)
+@dataclass(slots=True, frozen=True)
+class TargetDescription:
+ cpu: CPU
+ compiler: Compiler
+ arch: Architecture
+ os: OS
+
+ @staticmethod
+ def from_dict(d: dict) -> "TargetDescription":
+ return TargetDescription(
+ cpu=CPU(d["cpu"]),
+ compiler=Compiler(d["compiler"]),
+ arch=Architecture(d["arch"]),
+ os=OS(d["os"]),
+ )
+
+ def __str__(self):
+ return f"{self.arch}-{self.os}-{self.cpu}-{self.compiler}"
+
+
+class TestSuiteConfigDict(TypedDict):
+ suite: str
+ cases: list[str]
+
+
+# https://github.com/python/mypy/issues/5374
+@dataclass(slots=True, frozen=True) # type: ignore
+class TestSuiteConfig(abc.ABC):
+ test_suite: str
+
+ @staticmethod
+ def from_dict(
+ entry: str | TestSuiteConfigDict,
+ ) -> Union["AllTestCasesTestSuiteConfig", "SelectedTestCasesTestSuiteConfig"]:
+ if isinstance(entry, str):
+ return AllTestCasesTestSuiteConfig(test_suite=entry)
+ elif isinstance(entry, dict):
+ return SelectedTestCasesTestSuiteConfig(
+ test_suite=entry["suite"], test_cases=entry["cases"]
+ )
+ else:
+ raise TypeError(f"{type(entry)} is not valid for a test suite config.")
+
+ @abstractmethod
+ def get_requested_test_cases(self) -> Optional[list[str]]:
+ raise NotImplementedError()
+
+
+@dataclass(slots=True, frozen=True)
+class AllTestCasesTestSuiteConfig(TestSuiteConfig):
+ def get_requested_test_cases(self) -> Optional[list[str]]:
+ return None
+
+
+@dataclass(slots=True, frozen=True)
+class SelectedTestCasesTestSuiteConfig(TestSuiteConfig):
+ test_cases: list[str]
+
+ def get_requested_test_cases(self) -> Optional[list[str]]:
+ return self.test_cases
+
+
@dataclass(slots=True, frozen=True)
class ExecutionConfiguration:
+ target_descriptions: list[TargetDescription]
+ perf: bool
+ func: bool
+ test_suites: list[TestSuiteConfig]
system_under_test: NodeConfiguration
@staticmethod
def from_dict(d: dict, node_map: dict) -> "ExecutionConfiguration":
+ target_descriptions: list[TargetDescription] = list(
+ map(TargetDescription.from_dict, d["target_descriptions"])
+ )
+ test_suites: list[TestSuiteConfig] = list(
+ map(TestSuiteConfig.from_dict, d["test_suites"])
+ )
sut_name = d["system_under_test"]
assert sut_name in node_map, f"Unknown SUT {sut_name} in execution {d}"
return ExecutionConfiguration(
+ target_descriptions=target_descriptions,
+ perf=d["perf"],
+ func=d["func"],
+ test_suites=test_suites,
system_under_test=node_map[sut_name],
)
@@ -57,6 +193,7 @@ def from_dict(d: dict, node_map: dict) -> "ExecutionConfiguration":
@dataclass(slots=True, frozen=True)
class Configuration:
executions: list[ExecutionConfiguration]
+ nodes: list[NodeConfiguration]
@staticmethod
def from_dict(d: dict) -> "Configuration":
@@ -74,7 +211,7 @@ def from_dict(d: dict) -> "Configuration":
)
)
- return Configuration(executions=executions)
+ return Configuration(executions=executions, nodes=nodes)
def load_config() -> Configuration:
diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json
index 04b2bec3a5..d1cc990fd5 100644
--- a/dts/framework/config/conf_yaml_schema.json
+++ b/dts/framework/config/conf_yaml_schema.json
@@ -6,13 +6,88 @@
"type": "string",
"description": "A unique identifier for a node"
},
- "node_role": {
+ "OS": {
"type": "string",
- "description": "The role a node plays in DTS",
"enum": [
- "system_under_test",
- "traffic_generator"
+ "linux"
]
+ },
+ "ARCH": {
+ "type": "string",
+ "enum": [
+ "x86_64"
+ ]
+ },
+ "compiler": {
+ "type": "string",
+ "enum": [
+ "gcc",
+ "clang",
+ "icc",
+ "mscv"
+ ]
+ },
+ "cpu": {
+ "type": "string",
+ "description": "Native should be the default on x86",
+ "enum": [
+ "native",
+ "armv8a",
+ "dpaa2",
+ "thunderx",
+ "xgene1"
+ ]
+ },
+ "target": {
+ "type": "object",
+ "description": "Targets supported by DTS",
+ "properties": {
+ "arch": {
+ "type": "string",
+ "enum": [
+ "ALL",
+ "x86_64",
+ "arm64",
+ "ppc64le",
+ "other"
+ ]
+ },
+ "cpu": {
+ "$ref": "#/definitions/cpu"
+ },
+ "os": {
+ "$ref": "#/definitions/OS"
+ },
+ "compiler": {
+ "$ref": "#/definitions/compiler"
+ }
+ },
+ "additionalProperties": false
+ },
+ "test_suite": {
+ "type": "string",
+ "enum": [
+ "hello_world"
+ ]
+ },
+ "test_target": {
+ "type": "object",
+ "properties": {
+ "suite": {
+ "$ref": "#/definitions/test_suite"
+ },
+ "cases": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "minimum": 1
+ }
+ },
+ "required": [
+ "suite"
+ ],
+ "additionalProperties": false
}
},
"type": "object",
@@ -34,16 +109,36 @@
"type": "string",
"description": "The user to access this node with."
},
+ "os": {
+ "$ref": "#/definitions/OS"
+ },
+ "arch": {
+ "$ref": "#/definitions/ARCH"
+ },
"password": {
"type": "string",
"description": "The password to use on this node. SSH keys are preferred."
+ },
+ "bypass_core0": {
+ "type": "boolean",
+ "description": "Indicate whether DPDK should omit using the first core or not."
+ },
+ "cores": {
+ "type": "string",
+ "description": "Comma-separated list of cores to use, e.g.: 1,2,3,4,5,18-22"
+ },
+ "memory_channels": {
+ "type": "integer",
+ "description": "How many memory channels to use."
}
},
"additionalProperties": false,
"required": [
"name",
+ "os",
+ "user",
"hostname",
- "user"
+ "arch"
]
},
"minimum": 1
@@ -55,11 +150,43 @@
"properties": {
"system_under_test": {
"$ref": "#/definitions/node_name"
+ },
+ "target_descriptions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/target"
+ },
+ "minimum": 1
+ },
+ "test_suites": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/test_suite"
+ },
+ {
+ "$ref": "#/definitions/test_target"
+ }
+ ]
+ }
+ },
+ "perf": {
+ "type": "boolean",
+ "description": "Enable performance testing"
+ },
+ "func": {
+ "type": "boolean",
+ "description": "Enable functional testing"
}
},
"additionalProperties": false,
"required": [
- "system_under_test"
+ "system_under_test",
+ "target_descriptions",
+ "perf",
+ "func",
+ "test_suites"
]
},
"minimum": 1
--
2.30.2
next prev parent reply other threads:[~2022-08-24 16:25 UTC|newest]
Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 16:24 [RFC PATCH v1 00/10] dts: add hello world testcase Juraj Linkeš
2022-08-24 16:24 ` Juraj Linkeš [this message]
2022-08-24 16:24 ` [RFC PATCH v1 02/10] dts: hello world cli parameters and env vars Juraj Linkeš
2022-08-24 16:24 ` [RFC PATCH v1 03/10] dts: ssh connection additions for hello world Juraj Linkeš
2022-08-24 16:24 ` [RFC PATCH v1 04/10] dts: add basic node management methods Juraj Linkeš
2022-08-24 16:24 ` [RFC PATCH v1 05/10] dts: add system under test node Juraj Linkeš
2022-08-24 16:24 ` [RFC PATCH v1 06/10] dts: add traffic generator node Juraj Linkeš
2022-08-24 16:24 ` [RFC PATCH v1 07/10] dts: add testcase and basic test results Juraj Linkeš
2022-08-24 16:24 ` [RFC PATCH v1 08/10] dts: add test runner and statistics collector Juraj Linkeš
2022-08-24 16:24 ` [RFC PATCH v1 09/10] dts: add hello world testplan Juraj Linkeš
2022-08-24 16:24 ` [RFC PATCH v1 10/10] dts: add hello world testsuite Juraj Linkeš
2022-11-14 16:54 ` [RFC PATCH v2 00/10] dts: add hello world testcase Juraj Linkeš
2022-11-14 16:54 ` [RFC PATCH v2 01/10] dts: add node and os abstractions Juraj Linkeš
2022-11-14 16:54 ` [RFC PATCH v2 02/10] dts: add ssh command verification Juraj Linkeš
2022-11-14 16:54 ` [RFC PATCH v2 03/10] dts: add dpdk build on sut Juraj Linkeš
2022-11-16 13:15 ` Owen Hilyard
[not found] ` <30ad4f7d087d4932845b6ca13934b1d2@pantheon.tech>
[not found] ` <CAHx6DYDOFMuEm4xc65OTrtUmGBtk8Z6UtSgS2grnR_RBY5HcjQ@mail.gmail.com>
2022-11-23 12:37 ` Juraj Linkeš
2022-11-14 16:54 ` [RFC PATCH v2 04/10] dts: add dpdk execution handling Juraj Linkeš
2022-11-16 13:28 ` Owen Hilyard
[not found] ` <df13ee41efb64e7bb37791f21ae5bac1@pantheon.tech>
[not found] ` <CAHx6DYCEYxZ0Osm6fKhp3Jx8n7s=r7qVh8R41c6nCan8Or-dpA@mail.gmail.com>
2022-11-23 13:03 ` Juraj Linkeš
2022-11-28 13:05 ` Owen Hilyard
2022-11-14 16:54 ` [RFC PATCH v2 05/10] dts: add node memory setup Juraj Linkeš
2022-11-16 13:47 ` Owen Hilyard
2022-11-23 13:58 ` Juraj Linkeš
2022-11-14 16:54 ` [RFC PATCH v2 06/10] dts: add test results module Juraj Linkeš
2022-11-14 16:54 ` [RFC PATCH v2 07/10] dts: add simple stats report Juraj Linkeš
2022-11-16 13:57 ` Owen Hilyard
2022-11-14 16:54 ` [RFC PATCH v2 08/10] dts: add testsuite class Juraj Linkeš
2022-11-16 15:15 ` Owen Hilyard
2022-11-14 16:54 ` [RFC PATCH v2 09/10] dts: add hello world testplan Juraj Linkeš
2022-11-14 16:54 ` [RFC PATCH v2 10/10] dts: add hello world testsuite Juraj Linkeš
2023-01-17 15:48 ` [PATCH v3 00/10] dts: add hello world testcase Juraj Linkeš
2023-01-17 15:48 ` [PATCH v3 01/10] dts: add node and os abstractions Juraj Linkeš
2023-01-17 15:48 ` [PATCH v3 02/10] dts: add ssh command verification Juraj Linkeš
2023-01-17 15:48 ` [PATCH v3 03/10] dts: add dpdk build on sut Juraj Linkeš
2023-01-17 15:49 ` [PATCH v3 04/10] dts: add dpdk execution handling Juraj Linkeš
2023-01-17 15:49 ` [PATCH v3 05/10] dts: add node memory setup Juraj Linkeš
2023-01-17 15:49 ` [PATCH v3 06/10] dts: add test suite module Juraj Linkeš
2023-01-17 15:49 ` [PATCH v3 07/10] dts: add hello world testplan Juraj Linkeš
2023-01-17 15:49 ` [PATCH v3 08/10] dts: add hello world testsuite Juraj Linkeš
2023-01-17 15:49 ` [PATCH v3 09/10] dts: add test suite config and runner Juraj Linkeš
2023-01-17 15:49 ` [PATCH v3 10/10] dts: add test results module Juraj Linkeš
2023-01-19 16:16 ` [PATCH v3 00/10] dts: add hello world testcase Owen Hilyard
2023-02-09 16:47 ` Patrick Robb
2023-02-13 15:28 ` [PATCH v4 " Juraj Linkeš
2023-02-13 15:28 ` [PATCH v4 01/10] dts: add node and os abstractions Juraj Linkeš
2023-02-17 17:44 ` Bruce Richardson
2023-02-20 13:24 ` Juraj Linkeš
2023-02-13 15:28 ` [PATCH v4 02/10] dts: add ssh command verification Juraj Linkeš
2023-02-13 15:28 ` [PATCH v4 03/10] dts: add dpdk build on sut Juraj Linkeš
2023-02-22 16:44 ` Bruce Richardson
2023-02-13 15:28 ` [PATCH v4 04/10] dts: add dpdk execution handling Juraj Linkeš
2023-02-13 15:28 ` [PATCH v4 05/10] dts: add node memory setup Juraj Linkeš
2023-02-13 15:28 ` [PATCH v4 06/10] dts: add test suite module Juraj Linkeš
2023-02-13 15:28 ` [PATCH v4 07/10] dts: add hello world testsuite Juraj Linkeš
2023-02-13 15:28 ` [PATCH v4 08/10] dts: add test suite config and runner Juraj Linkeš
2023-02-13 15:28 ` [PATCH v4 09/10] dts: add test results module Juraj Linkeš
2023-02-13 15:28 ` [PATCH v4 10/10] doc: update DTS setup and test suite cookbook Juraj Linkeš
2023-02-17 17:26 ` [PATCH v4 00/10] dts: add hello world testcase Bruce Richardson
2023-02-20 10:13 ` Juraj Linkeš
2023-02-20 11:56 ` Bruce Richardson
2023-02-22 16:39 ` Bruce Richardson
2023-02-23 8:27 ` Juraj Linkeš
2023-02-23 9:17 ` Bruce Richardson
2023-02-23 15:28 ` [PATCH v5 " Juraj Linkeš
2023-02-23 15:28 ` [PATCH v5 01/10] dts: add node and os abstractions Juraj Linkeš
2023-02-23 15:28 ` [PATCH v5 02/10] dts: add ssh command verification Juraj Linkeš
2023-02-23 15:28 ` [PATCH v5 03/10] dts: add dpdk build on sut Juraj Linkeš
2023-02-23 15:28 ` [PATCH v5 04/10] dts: add dpdk execution handling Juraj Linkeš
2023-02-23 15:28 ` [PATCH v5 05/10] dts: add node memory setup Juraj Linkeš
2023-02-23 15:28 ` [PATCH v5 06/10] dts: add test suite module Juraj Linkeš
2023-02-23 15:28 ` [PATCH v5 07/10] dts: add hello world testsuite Juraj Linkeš
2023-02-23 15:28 ` [PATCH v5 08/10] dts: add test suite config and runner Juraj Linkeš
2023-02-23 15:28 ` [PATCH v5 09/10] dts: add test results module Juraj Linkeš
2023-02-23 15:28 ` [PATCH v5 10/10] doc: update DTS setup and test suite cookbook Juraj Linkeš
2023-03-03 8:31 ` Huang, ChenyuX
2023-02-23 16:13 ` [PATCH v5 00/10] dts: add hello world testcase Bruce Richardson
2023-02-26 19:11 ` Wathsala Wathawana Vithanage
2023-02-27 8:28 ` Juraj Linkeš
2023-02-28 15:27 ` Wathsala Wathawana Vithanage
2023-03-01 8:35 ` Juraj Linkeš
2023-03-03 10:24 ` [PATCH v6 00/10] dts: add hello world test case Juraj Linkeš
2023-03-03 10:24 ` [PATCH v6 01/10] dts: add node and os abstractions Juraj Linkeš
2023-03-03 10:24 ` [PATCH v6 02/10] dts: add ssh command verification Juraj Linkeš
2023-03-03 10:25 ` [PATCH v6 03/10] dts: add dpdk build on sut Juraj Linkeš
2023-03-20 8:30 ` David Marchand
2023-03-20 13:12 ` Juraj Linkeš
2023-03-20 13:22 ` David Marchand
2023-03-03 10:25 ` [PATCH v6 04/10] dts: add dpdk execution handling Juraj Linkeš
2023-03-03 10:25 ` [PATCH v6 05/10] dts: add node memory setup Juraj Linkeš
2023-03-03 10:25 ` [PATCH v6 06/10] dts: add test suite module Juraj Linkeš
2023-03-03 10:25 ` [PATCH v6 07/10] dts: add hello world testsuite Juraj Linkeš
2023-03-03 10:25 ` [PATCH v6 08/10] dts: add test suite config and runner Juraj Linkeš
2023-03-03 10:25 ` [PATCH v6 09/10] dts: add test results module Juraj Linkeš
2023-03-03 10:25 ` [PATCH v6 10/10] doc: update dts setup and test suite cookbook Juraj Linkeš
2023-03-09 21:47 ` Patrick Robb
2023-03-19 15:26 ` [PATCH v6 00/10] dts: add hello world test case Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220824162454.394285-2-juraj.linkes@pantheon.tech \
--to=juraj.linkes@pantheon.tech \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=lijuan.tu@intel.com \
--cc=ohilyard@iol.unh.edu \
--cc=ronan.randles@intel.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).