DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/7] DTS external DPDK build
@ 2024-09-27 16:08 Tomáš Ďurovec
  2024-09-27 16:08 ` [PATCH 1/7] dts: rename build target to " Tomáš Ďurovec
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Tomáš Ďurovec @ 2024-09-27 16:08 UTC (permalink / raw)
  To: dev, Luca.Vizzarro, probb, npratte, dmarx; +Cc: Tomáš Ďurovec

This patch series adds ability to use pre-build DPDK in various options of usage. User can specify 
this option from config file or cmd arguments/environment variables:
* The source of DPDK (tarball or tree),
* The build dir witch will be located in a subdirectory of DPDK tree root directory, otherwise will 
  be used build configuration from config file, 
* Location where the DPDK source will be stored either in SUT node or local filesystem.

Tomáš Ďurovec (7):
  dts: rename build target to DPDK build
  dts: one dpdk build per test run
  dts: fix remote session file transfer vars
  dts: add the ability to copy directories via remote
  dts: add support for externally compiled DPDK
  doc: update argument options for external DPDK build
  dts: remove git ref option

 doc/guides/tools/dts.rst                      |  18 +-
 dts/conf.yaml                                 |  17 +-
 dts/framework/config/__init__.py              | 140 ++++++-
 dts/framework/config/conf_yaml_schema.json    |  72 +++-
 dts/framework/config/types.py                 |  19 +-
 dts/framework/exception.py                    |   4 +-
 dts/framework/logger.py                       |   4 -
 dts/framework/remote_session/dpdk_shell.py    |   2 +-
 .../remote_session/remote_session.py          |  24 +-
 dts/framework/remote_session/ssh_session.py   |  18 +-
 dts/framework/runner.py                       | 139 ++-----
 dts/framework/settings.py                     | 200 +++++++---
 dts/framework/test_result.py                  | 124 ++----
 dts/framework/test_suite.py                   |   2 +-
 dts/framework/testbed_model/node.py           |  22 +-
 dts/framework/testbed_model/os_session.py     | 209 ++++++++--
 dts/framework/testbed_model/posix_session.py  | 141 ++++++-
 dts/framework/testbed_model/sut_node.py       | 366 ++++++++++++------
 dts/framework/utils.py                        | 164 ++++----
 dts/tests/TestSuite_smoke_tests.py            |   2 +-
 20 files changed, 1078 insertions(+), 609 deletions(-)

-- 
2.46.1


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH 0/7] DTS external DPDK build
@ 2024-09-30 16:18 Tomáš Ďurovec
  2024-09-30 16:18 ` [PATCH 6/7] doc: update argument options for " Tomáš Ďurovec
  0 siblings, 1 reply; 11+ messages in thread
From: Tomáš Ďurovec @ 2024-09-30 16:18 UTC (permalink / raw)
  To: dev; +Cc: Tomáš Ďurovec

This patch series adds ability to use pre-build DPDK in various options of usage. User can specify 
this option from config file or cmd arguments/environment variables:
* The source of DPDK (tarball or tree),
* The build dir witch will be located in a subdirectory of DPDK tree root directory, otherwise will 
  be used build configuration from config file, 
* Location where the DPDK source will be stored either in SUT node or local filesystem.

Tomáš Ďurovec (7):
  dts: rename build target to DPDK build
  dts: one dpdk build per test run
  dts: fix remote session file transfer vars
  dts: add the ability to copy directories via remote
  dts: add support for externally compiled DPDK
  doc: update argument options for external DPDK build
  dts: remove git ref option

 doc/guides/tools/dts.rst                      |  18 +-
 dts/conf.yaml                                 |  17 +-
 dts/framework/config/__init__.py              | 140 ++++++-
 dts/framework/config/conf_yaml_schema.json    |  72 +++-
 dts/framework/config/types.py                 |  19 +-
 dts/framework/exception.py                    |   4 +-
 dts/framework/logger.py                       |   4 -
 dts/framework/remote_session/dpdk_shell.py    |   2 +-
 .../remote_session/remote_session.py          |  24 +-
 dts/framework/remote_session/ssh_session.py   |  18 +-
 dts/framework/runner.py                       | 139 ++-----
 dts/framework/settings.py                     | 200 +++++++---
 dts/framework/test_result.py                  | 124 ++----
 dts/framework/test_suite.py                   |   2 +-
 dts/framework/testbed_model/node.py           |  22 +-
 dts/framework/testbed_model/os_session.py     | 209 ++++++++--
 dts/framework/testbed_model/posix_session.py  | 141 ++++++-
 dts/framework/testbed_model/sut_node.py       | 366 ++++++++++++------
 dts/framework/utils.py                        | 164 ++++----
 dts/tests/TestSuite_smoke_tests.py            |   2 +-
 20 files changed, 1078 insertions(+), 609 deletions(-)

-- 
2.46.1


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH 0/7] DTS external DPDK build
@ 2024-09-30 16:01 Tomáš Ďurovec
  2024-09-30 16:02 ` [PATCH 6/7] doc: update argument options for " Tomáš Ďurovec
  0 siblings, 1 reply; 11+ messages in thread
From: Tomáš Ďurovec @ 2024-09-30 16:01 UTC (permalink / raw)
  To: dev; +Cc: Tomáš Ďurovec

This patch series adds ability to use pre-build DPDK in various options of usage. User can specify 
this option from config file or cmd arguments/environment variables:
* The source of DPDK (tarball or tree),
* The build dir witch will be located in a subdirectory of DPDK tree root directory, otherwise will 
  be used build configuration from config file, 
* Location where the DPDK source will be stored either in SUT node or local filesystem.

Tomáš Ďurovec (7):
  dts: rename build target to DPDK build
  dts: one dpdk build per test run
  dts: fix remote session file transfer vars
  dts: add the ability to copy directories via remote
  dts: add support for externally compiled DPDK
  doc: update argument options for external DPDK build
  dts: remove git ref option

 doc/guides/tools/dts.rst                      |  18 +-
 dts/conf.yaml                                 |  17 +-
 dts/framework/config/__init__.py              | 140 ++++++-
 dts/framework/config/conf_yaml_schema.json    |  72 +++-
 dts/framework/config/types.py                 |  19 +-
 dts/framework/exception.py                    |   4 +-
 dts/framework/logger.py                       |   4 -
 dts/framework/remote_session/dpdk_shell.py    |   2 +-
 .../remote_session/remote_session.py          |  24 +-
 dts/framework/remote_session/ssh_session.py   |  18 +-
 dts/framework/runner.py                       | 139 ++-----
 dts/framework/settings.py                     | 200 +++++++---
 dts/framework/test_result.py                  | 124 ++----
 dts/framework/test_suite.py                   |   2 +-
 dts/framework/testbed_model/node.py           |  22 +-
 dts/framework/testbed_model/os_session.py     | 209 ++++++++--
 dts/framework/testbed_model/posix_session.py  | 141 ++++++-
 dts/framework/testbed_model/sut_node.py       | 366 ++++++++++++------
 dts/framework/utils.py                        | 164 ++++----
 dts/tests/TestSuite_smoke_tests.py            |   2 +-
 20 files changed, 1078 insertions(+), 609 deletions(-)

-- 
2.46.1


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH 1/7] dts: rename build target to DPDK build
@ 2024-09-27 15:38 Tomáš Ďurovec
  2024-09-27 15:38 ` [PATCH 6/7] doc: update argument options for external " Tomáš Ďurovec
  0 siblings, 1 reply; 11+ messages in thread
From: Tomáš Ďurovec @ 2024-09-27 15:38 UTC (permalink / raw)
  To: dev; +Cc: Tomáš Ďurovec

Since the DPDK may already be built, some more general name
is needed that includes both the DPDK location and the build
config (if we are going to build).

Signed-off-by: Tomáš Ďurovec <tomas.durovec@pantheon.tech>
---
 dts/conf.yaml                              |   2 +-
 dts/framework/config/__init__.py           |  26 ++---
 dts/framework/config/conf_yaml_schema.json |  10 +-
 dts/framework/config/types.py              |   4 +-
 dts/framework/logger.py                    |   4 +-
 dts/framework/runner.py                    | 112 ++++++++++-----------
 dts/framework/settings.py                  |   2 +-
 dts/framework/test_result.py               |  72 +++++++------
 dts/framework/test_suite.py                |   2 +-
 dts/framework/testbed_model/sut_node.py    |  55 +++++-----
 dts/tests/TestSuite_smoke_tests.py         |   2 +-
 11 files changed, 142 insertions(+), 149 deletions(-)

diff --git a/dts/conf.yaml b/dts/conf.yaml
index ca5e87636e..1363e93580 100644
--- a/dts/conf.yaml
+++ b/dts/conf.yaml
@@ -4,7 +4,7 @@
 
 test_runs:
   # define one test run environment
-  - build_targets:
+  - dpdk_builds:
       - arch: x86_64
         os: linux
         cpu: native
diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.py
index 269d9ec318..c243716010 100644
--- a/dts/framework/config/__init__.py
+++ b/dts/framework/config/__init__.py
@@ -45,8 +45,8 @@
 from typing_extensions import Self
 
 from framework.config.types import (
-    BuildTargetConfigDict,
     ConfigurationDict,
+    DPDKBuildConfigDict,
     NodeConfigDict,
     PortConfigDict,
     TestRunConfigDict,
@@ -335,7 +335,7 @@ class NodeInfo:
 
 
 @dataclass(slots=True, frozen=True)
-class BuildTargetConfiguration:
+class DPDKBuildConfiguration:
     """DPDK build configuration.
 
     The configuration used for building DPDK.
@@ -358,7 +358,7 @@ class BuildTargetConfiguration:
     name: str
 
     @classmethod
-    def from_dict(cls, d: BuildTargetConfigDict) -> Self:
+    def from_dict(cls, d: DPDKBuildConfigDict) -> Self:
         r"""A convenience method that processes the inputs before creating an instance.
 
         `arch`, `os`, `cpu` and `compiler` are converted to :class:`Enum`\s and
@@ -368,7 +368,7 @@ def from_dict(cls, d: BuildTargetConfigDict) -> Self:
             d: The configuration dictionary.
 
         Returns:
-            The build target configuration instance.
+            The DPDK build configuration instance.
         """
         return cls(
             arch=Architecture(d["arch"]),
@@ -381,8 +381,8 @@ def from_dict(cls, d: BuildTargetConfigDict) -> Self:
 
 
 @dataclass(slots=True, frozen=True)
-class BuildTargetInfo:
-    """Various versions and other information about a build target.
+class DPDKBuildInfo:
+    """Various versions and other information about a DPDK build.
 
     Attributes:
         dpdk_version: The DPDK version that was built.
@@ -437,7 +437,7 @@ class TestRunConfiguration:
     and with what DPDK build.
 
     Attributes:
-        build_targets: A list of DPDK builds to test.
+        dpdk_builds: A list of DPDK builds to test.
         perf: Whether to run performance tests.
         func: Whether to run functional tests.
         skip_smoke_tests: Whether to skip smoke tests.
@@ -448,7 +448,7 @@ class TestRunConfiguration:
         random_seed: The seed to use for pseudo-random generation.
     """
 
-    build_targets: list[BuildTargetConfiguration]
+    dpdk_builds: list[DPDKBuildConfiguration]
     perf: bool
     func: bool
     skip_smoke_tests: bool
@@ -466,7 +466,7 @@ def from_dict(
     ) -> Self:
         """A convenience method that processes the inputs before creating an instance.
 
-        The build target and the test suite config are transformed into their respective objects.
+        The DPDK build and the test suite config are transformed into their respective objects.
         SUT and TG configurations are taken from `node_map`. The other (:class:`bool`) attributes
         are just stored.
 
@@ -477,8 +477,8 @@ def from_dict(
         Returns:
             The test run configuration instance.
         """
-        build_targets: list[BuildTargetConfiguration] = list(
-            map(BuildTargetConfiguration.from_dict, d["build_targets"])
+        dpdk_builds: list[DPDKBuildConfiguration] = list(
+            map(DPDKBuildConfiguration.from_dict, d["dpdk_builds"])
         )
         test_suites: list[TestSuiteConfig] = list(map(TestSuiteConfig.from_dict, d["test_suites"]))
         sut_name = d["system_under_test_node"]["node_name"]
@@ -501,7 +501,7 @@ def from_dict(
         )
         random_seed = d.get("random_seed", None)
         return cls(
-            build_targets=build_targets,
+            dpdk_builds=dpdk_builds,
             perf=d["perf"],
             func=d["func"],
             skip_smoke_tests=skip_smoke_tests,
@@ -552,7 +552,7 @@ class Configuration:
     def from_dict(cls, d: ConfigurationDict) -> Self:
         """A convenience method that processes the inputs before creating an instance.
 
-        Build target and test suite config are transformed into their respective objects.
+        DPDK build and test suite config are transformed into their respective objects.
         SUT and TG configurations are taken from `node_map`. The other (:class:`bool`) attributes
         are just stored.
 
diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json
index df390e8ae2..927a73ac6c 100644
--- a/dts/framework/config/conf_yaml_schema.json
+++ b/dts/framework/config/conf_yaml_schema.json
@@ -110,9 +110,9 @@
         "mscv"
       ]
     },
-    "build_target": {
+    "dpdk_build": {
       "type": "object",
-      "description": "Targets supported by DTS",
+      "description": "DPDK build configuration supported by DTS.",
       "properties": {
         "arch": {
           "type": "string",
@@ -327,10 +327,10 @@
       "items": {
         "type": "object",
         "properties": {
-          "build_targets": {
+          "dpdk_builds": {
             "type": "array",
             "items": {
-              "$ref": "#/definitions/build_target"
+              "$ref": "#/definitions/dpdk_build"
             },
             "minimum": 1
           },
@@ -387,7 +387,7 @@
         },
         "additionalProperties": false,
         "required": [
-          "build_targets",
+          "dpdk_builds",
           "perf",
           "func",
           "test_suites",
diff --git a/dts/framework/config/types.py b/dts/framework/config/types.py
index ce7b784ac8..4f450267d1 100644
--- a/dts/framework/config/types.py
+++ b/dts/framework/config/types.py
@@ -71,7 +71,7 @@ class NodeConfigDict(TypedDict):
     traffic_generator: TrafficGeneratorConfigDict
 
 
-class BuildTargetConfigDict(TypedDict):
+class DPDKBuildConfigDict(TypedDict):
     """Allowed keys and values."""
 
     #:
@@ -108,7 +108,7 @@ class TestRunConfigDict(TypedDict):
     """Allowed keys and values."""
 
     #:
-    build_targets: list[BuildTargetConfigDict]
+    dpdk_builds: list[DPDKBuildConfigDict]
     #:
     perf: bool
     #:
diff --git a/dts/framework/logger.py b/dts/framework/logger.py
index 9420323d38..3fbe618219 100644
--- a/dts/framework/logger.py
+++ b/dts/framework/logger.py
@@ -33,7 +33,7 @@ class DtsStage(StrEnum):
     #:
     test_run_setup = auto()
     #:
-    build_target_setup = auto()
+    dpdk_build_setup = auto()
     #:
     test_suite_setup = auto()
     #:
@@ -41,7 +41,7 @@ class DtsStage(StrEnum):
     #:
     test_suite_teardown = auto()
     #:
-    build_target_teardown = auto()
+    dpdk_build_teardown = auto()
     #:
     test_run_teardown = auto()
     #:
diff --git a/dts/framework/runner.py b/dts/framework/runner.py
index ab98de8353..d63b1821e7 100644
--- a/dts/framework/runner.py
+++ b/dts/framework/runner.py
@@ -8,11 +8,11 @@
 The module is responsible for running DTS in a series of stages:
 
     #. Test run stage,
-    #. Build target stage,
+    #. DPDK build stage,
     #. Test suite stage,
     #. Test case stage.
 
-The test run and build target stages set up the environment before running test suites.
+The test run and DPDK build stages set up the environment before running test suites.
 The test suite stage sets up steps common to all test cases
 and the test case stage runs test cases individually.
 """
@@ -31,8 +31,8 @@
 from framework.testbed_model.tg_node import TGNode
 
 from .config import (
-    BuildTargetConfiguration,
     Configuration,
+    DPDKBuildConfiguration,
     TestRunConfiguration,
     TestSuiteConfig,
     load_config,
@@ -46,7 +46,7 @@
 from .logger import DTSLogger, DtsStage, get_dts_logger
 from .settings import SETTINGS
 from .test_result import (
-    BuildTargetResult,
+    DPDKBuildResult,
     DTSResult,
     Result,
     TestCaseResult,
@@ -70,9 +70,9 @@ class DTSRunner:
     :class:`~.framework.exception.DTSError`\s.
 
     Example:
-        An error occurs in a build target setup. The current build target is aborted,
+        An error occurs in a DPDK build setup. The current DPDK build is aborted,
         all test suites and their test cases are marked as blocked and the run continues
-        with the next build target. If the errored build target was the last one in the
+        with the next DPDK build. If the errored DPDK build was the last one in the
         given test run, the next test run begins.
     """
 
@@ -98,16 +98,16 @@ def __init__(self):
         self._perf_test_case_regex = r"test_perf_"
 
     def run(self) -> None:
-        """Run all build targets in all test runs from the test run configuration.
+        """Run all DPDK build in all test runs from the test run configuration.
 
-        Before running test suites, test runs and build targets are first set up.
-        The test runs and build targets defined in the test run configuration are iterated over.
-        The test runs define which tests to run and where to run them and build targets define
+        Before running test suites, test runs and DPDK builds are first set up.
+        The test runs and DPDK builds defined in the test run configuration are iterated over.
+        The test runs define which tests to run and where to run them and DPDK builds define
         the DPDK build setup.
 
-        The tests suites are set up for each test run/build target tuple and each discovered
+        The tests suites are set up for each test run/DPDK build tuple and each discovered
         test case within the test suite is set up, executed and torn down. After all test cases
-        have been executed, the test suite is torn down and the next build target will be tested.
+        have been executed, the test suite is torn down and the next DPDK build will be tested.
 
         In order to properly mark test suites and test cases as blocked in case of a failure,
         we need to have discovered which test suites and test cases to run before any failures
@@ -117,7 +117,7 @@ def run(self) -> None:
 
             #. Test run setup
 
-                #. Build target setup
+                #. DPDK build setup
 
                     #. Test suite setup
 
@@ -127,7 +127,7 @@ def run(self) -> None:
 
                     #. Test suite teardown
 
-                #. Build target teardown
+                #. DPDK build teardown
 
             #. Test run teardown
 
@@ -416,7 +416,7 @@ def _run_test_run(
     ) -> None:
         """Run the given test run.
 
-        This involves running the test run setup as well as running all build targets
+        This involves running the test run setup as well as running all DPDK builds
         in the given test run. After that, the test run teardown is run.
 
         Args:
@@ -439,13 +439,13 @@ def _run_test_run(
             test_run_result.update_setup(Result.FAIL, e)
 
         else:
-            for build_target_config in test_run_config.build_targets:
-                build_target_result = test_run_result.add_build_target(build_target_config)
-                self._run_build_target(
+            for dpdk_build_config in test_run_config.dpdk_builds:
+                dpdk_build_result = test_run_result.add_dpdk_build(dpdk_build_config)
+                self._run_dpdk_build(
                     sut_node,
                     tg_node,
-                    build_target_config,
-                    build_target_result,
+                    dpdk_build_config,
+                    dpdk_build_result,
                     test_suites_with_cases,
                 )
 
@@ -459,88 +459,87 @@ def _run_test_run(
                 self._logger.exception("Test run teardown failed.")
                 test_run_result.update_teardown(Result.FAIL, e)
 
-    def _run_build_target(
+    def _run_dpdk_build(
         self,
         sut_node: SutNode,
         tg_node: TGNode,
-        build_target_config: BuildTargetConfiguration,
-        build_target_result: BuildTargetResult,
+        dpdk_build_config: DPDKBuildConfiguration,
+        dpdk_build_result: DPDKBuildResult,
         test_suites_with_cases: Iterable[TestSuiteWithCases],
     ) -> None:
-        """Run the given build target.
+        """Run the given DPDK build.
 
-        This involves running the build target setup as well as running all test suites
-        of the build target's test run.
-        After that, build target teardown is run.
+        This involves running the DPDK build setup as well as running all test suites
+        of the DPDK build's test run.
+        After that, DPDK build teardown is run.
 
         Args:
             sut_node: The test run's sut node.
             tg_node: The test run's tg node.
-            build_target_config: A build target's test run configuration.
-            build_target_result: The build target level result object associated
-                with the current build target.
+            dpdk_build_config: A DPDK build's test run configuration.
+            dpdk_build_result: The DPDK build level result object associated
+                with the current DPDK build.
             test_suites_with_cases: The test suites with test cases to run.
         """
-        self._logger.set_stage(DtsStage.build_target_setup)
-        self._logger.info(f"Running build target '{build_target_config.name}'.")
+        self._logger.set_stage(DtsStage.dpdk_build_setup)
+        self._logger.info(f"Running DPDK build '{dpdk_build_config.name}'.")
 
         try:
-            sut_node.set_up_build_target(build_target_config)
+            sut_node.set_up_dpdk(dpdk_build_config)
             self._result.dpdk_version = sut_node.dpdk_version
-            build_target_result.add_build_target_info(sut_node.get_build_target_info())
-            build_target_result.update_setup(Result.PASS)
+            dpdk_build_result.add_dpdk_build_info(sut_node.get_dpdk_build_info())
+            dpdk_build_result.update_setup(Result.PASS)
         except Exception as e:
-            self._logger.exception("Build target setup failed.")
-            build_target_result.update_setup(Result.FAIL, e)
+            self._logger.exception("DPDK build setup failed.")
+            dpdk_build_result.update_setup(Result.FAIL, e)
 
         else:
-            self._run_test_suites(sut_node, tg_node, build_target_result, test_suites_with_cases)
+            self._run_test_suites(sut_node, tg_node, dpdk_build_result, test_suites_with_cases)
 
         finally:
             try:
-                self._logger.set_stage(DtsStage.build_target_teardown)
-                sut_node.tear_down_build_target()
-                build_target_result.update_teardown(Result.PASS)
+                self._logger.set_stage(DtsStage.dpdk_build_teardown)
+                sut_node.tear_down_dpdk()
+                dpdk_build_result.update_teardown(Result.PASS)
             except Exception as e:
-                self._logger.exception("Build target teardown failed.")
-                build_target_result.update_teardown(Result.FAIL, e)
+                self._logger.exception("DPDK build teardown failed.")
+                dpdk_build_result.update_teardown(Result.FAIL, e)
 
     def _run_test_suites(
         self,
         sut_node: SutNode,
         tg_node: TGNode,
-        build_target_result: BuildTargetResult,
+        dpdk_build_result: DPDKBuildResult,
         test_suites_with_cases: Iterable[TestSuiteWithCases],
     ) -> None:
-        """Run `test_suites_with_cases` with the current build target.
+        """Run `test_suites_with_cases` with the current DPDK build.
 
-        The method assumes the build target we're testing has already been built on the SUT node.
-        The current build target thus corresponds to the current DPDK build present on the SUT node.
+        The method assumes the DPDK we're testing has already been built on the SUT node.
 
         If a blocking test suite (such as the smoke test suite) fails, the rest of the test suites
-        in the current build target won't be executed.
+        in the current DPDK build won't be executed.
 
         Args:
             sut_node: The test run's SUT node.
             tg_node: The test run's TG node.
-            build_target_result: The build target level result object associated
-                with the current build target.
+            dpdk_build_result: The DPDK build level result object associated
+                with the current DPDK build.
             test_suites_with_cases: The test suites with test cases to run.
         """
-        end_build_target = False
+        end_dpdk_build = False
         for test_suite_with_cases in test_suites_with_cases:
-            test_suite_result = build_target_result.add_test_suite(test_suite_with_cases)
+            test_suite_result = dpdk_build_result.add_test_suite(test_suite_with_cases)
             try:
                 self._run_test_suite(sut_node, tg_node, test_suite_result, test_suite_with_cases)
             except BlockingTestSuiteError as e:
                 self._logger.exception(
                     f"An error occurred within {test_suite_with_cases.test_suite_class.__name__}. "
-                    "Skipping build target..."
+                    "Skipping DPDK build ..."
                 )
                 self._result.add_error(e)
-                end_build_target = True
+                end_dpdk_build = True
             # if a blocking test failed and we need to bail out of suite executions
-            if end_build_target:
+            if end_dpdk_build:
                 break
 
     def _run_test_suite(
@@ -552,8 +551,7 @@ def _run_test_suite(
     ) -> None:
         """Set up, execute and tear down `test_suite_with_cases`.
 
-        The method assumes the build target we're testing has already been built on the SUT node.
-        The current build target thus corresponds to the current DPDK build present on the SUT node.
+        The method assumes the DPDK we're testing has already been built on the SUT node.
 
         Test suite execution consists of running the discovered test cases.
         A test case run consists of setup, execution and teardown of said test case.
diff --git a/dts/framework/settings.py b/dts/framework/settings.py
index 7744e37f54..52a1582d5c 100644
--- a/dts/framework/settings.py
+++ b/dts/framework/settings.py
@@ -278,7 +278,7 @@ def _get_parser() -> _DTSArgumentParser:
         "--config-file",
         default=SETTINGS.config_file_path,
         type=Path,
-        help="The configuration file that describes the test cases, SUTs and targets.",
+        help="The configuration file that describes the test cases, SUTs and DPDK build configs.",
         metavar="FILE_PATH",
         dest="config_file_path",
     )
diff --git a/dts/framework/test_result.py b/dts/framework/test_result.py
index 5694a2482b..95788b7d2e 100644
--- a/dts/framework/test_result.py
+++ b/dts/framework/test_result.py
@@ -8,12 +8,12 @@
 
     * :class:`DTSResult` contains
     * :class:`TestRunResult` contains
-    * :class:`BuildTargetResult` contains
+    * :class:`DPDKBuildResult` contains
     * :class:`TestSuiteResult` contains
     * :class:`TestCaseResult`
 
 Each result may contain multiple lower level results, e.g. there are multiple
-:class:`TestSuiteResult`\s in a :class:`BuildTargetResult`.
+:class:`TestSuiteResult`\s in a :class:`DPDKBuildResult`.
 The results have common parts, such as setup and teardown results, captured in :class:`BaseResult`,
 which also defines some common behaviors in its methods.
 
@@ -33,10 +33,10 @@
 from .config import (
     OS,
     Architecture,
-    BuildTargetConfiguration,
-    BuildTargetInfo,
     Compiler,
     CPUType,
+    DPDKBuildConfiguration,
+    DPDKBuildInfo,
     NodeInfo,
     TestRunConfiguration,
     TestSuiteConfig,
@@ -138,7 +138,7 @@ class BaseResult:
     Stores the results of the setup and teardown portions of the corresponding stage.
     The hierarchical nature of DTS results is captured recursively in an internal list.
     A stage is each level in this particular hierarchy (pre-run or the top-most level,
-    test run, build target, test suite and test case.)
+    test run, DPDK build, test suite and test case.)
 
     Attributes:
         setup_result: The result of the setup of the particular stage.
@@ -223,7 +223,7 @@ class DTSResult(BaseResult):
     """Stores environment information and test results from a DTS run.
 
         * Test run level information, such as testbed and the test suite list,
-        * Build target level information, such as compiler, target OS and cpu,
+        * DPDK build level information, such as compiler, target OS and cpu,
         * Test suite and test case results,
         * All errors that are caught and recorded during DTS execution.
 
@@ -317,7 +317,7 @@ def get_return_code(self) -> int:
 class TestRunResult(BaseResult):
     """The test run specific result.
 
-    The internal list stores the results of all build targets in a given test run.
+    The internal list stores the results of all DPDK builds in a given test run.
 
     Attributes:
         sut_os_name: The operating system of the SUT node.
@@ -342,20 +342,18 @@ def __init__(self, test_run_config: TestRunConfiguration):
         self._config = test_run_config
         self._test_suites_with_cases = []
 
-    def add_build_target(
-        self, build_target_config: BuildTargetConfiguration
-    ) -> "BuildTargetResult":
-        """Add and return the child result (build target).
+    def add_dpdk_build(self, dpdk_build_config: DPDKBuildConfiguration) -> "DPDKBuildResult":
+        """Add and return the child result (DPDK build).
 
         Args:
-            build_target_config: The build target's test run configuration.
+            dpdk_build: The DPDK build's test run configuration.
 
         Returns:
-            The build target's result.
+            The DPDK build's result.
         """
-        result = BuildTargetResult(
+        result = DPDKBuildResult(
             self._test_suites_with_cases,
-            build_target_config,
+            dpdk_build_config,
         )
         self.child_results.append(result)
         return result
@@ -394,22 +392,22 @@ def add_sut_info(self, sut_info: NodeInfo) -> None:
 
     def _block_result(self) -> None:
         r"""Mark the result as :attr:`~Result.BLOCK`\ed."""
-        for build_target in self._config.build_targets:
-            child_result = self.add_build_target(build_target)
+        for dpdk_build in self._config.dpdk_builds:
+            child_result = self.add_dpdk_build(dpdk_build)
             child_result.update_setup(Result.BLOCK)
 
 
-class BuildTargetResult(BaseResult):
-    """The build target specific result.
+class DPDKBuildResult(BaseResult):
+    """The DPDK build specific result.
 
-    The internal list stores the results of all test suites in a given build target.
+    The internal list stores the results of all test suites in a given DPDK build.
 
     Attributes:
-        arch: The DPDK build target architecture.
-        os: The DPDK build target operating system.
-        cpu: The DPDK build target CPU.
-        compiler: The DPDK build target compiler.
-        compiler_version: The DPDK build target compiler version.
+        arch: The DPDK DPDK build architecture.
+        os: The DPDK DPDK build operating system.
+        cpu: The DPDK DPDK build CPU.
+        compiler: The DPDK DPDK build compiler.
+        compiler_version: The DPDK DPDK build compiler version.
         dpdk_version: The built DPDK version.
     """
 
@@ -424,19 +422,19 @@ class BuildTargetResult(BaseResult):
     def __init__(
         self,
         test_suites_with_cases: list[TestSuiteWithCases],
-        build_target_config: BuildTargetConfiguration,
+        dpdk_build_config: DPDKBuildConfiguration,
     ):
-        """Extend the constructor with the build target's config and test suites with cases.
+        """Extend the constructor with the DPDK build's config and test suites with cases.
 
         Args:
-            test_suites_with_cases: The test suites with test cases to be run in this build target.
-            build_target_config: The build target's test run configuration.
+            test_suites_with_cases: The test suites with test cases to be run in this DPDK build.
+            dpdk_build_config: The DPDK build's test run configuration.
         """
         super().__init__()
-        self.arch = build_target_config.arch
-        self.os = build_target_config.os
-        self.cpu = build_target_config.cpu
-        self.compiler = build_target_config.compiler
+        self.arch = dpdk_build_config.arch
+        self.os = dpdk_build_config.os
+        self.cpu = dpdk_build_config.cpu
+        self.compiler = dpdk_build_config.compiler
         self.compiler_version = None
         self.dpdk_version = None
         self._test_suites_with_cases = test_suites_with_cases
@@ -457,8 +455,8 @@ def add_test_suite(
         self.child_results.append(result)
         return result
 
-    def add_build_target_info(self, versions: BuildTargetInfo) -> None:
-        """Add information about the build target gathered at runtime.
+    def add_dpdk_build_info(self, versions: DPDKBuildInfo) -> None:
+        """Add information about the DPDK build gathered at runtime.
 
         Args:
             versions: The additional information.
@@ -484,11 +482,11 @@ class TestSuiteResult(BaseResult):
 
     test_suite_name: str
     _test_suite_with_cases: TestSuiteWithCases
-    _parent_result: BuildTargetResult
+    _parent_result: DPDKBuildResult
     _child_configs: list[str]
 
     def __init__(self, test_suite_with_cases: TestSuiteWithCases):
-        """Extend the constructor with test suite's config and BuildTargetResult.
+        """Extend the constructor with test suite's config and DPDKBuildResult.
 
         Args:
             test_suite_with_cases: The test suite with test cases.
diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
index 051509fb86..dbf33c3bcf 100644
--- a/dts/framework/test_suite.py
+++ b/dts/framework/test_suite.py
@@ -66,7 +66,7 @@ class TestSuite:
     sut_node: SutNode
     tg_node: TGNode
     #: Whether the test suite is blocking. A failure of a blocking test suite
-    #: will block the execution of all subsequent test suites in the current build target.
+    #: will block the execution of all subsequent test suites in the current DPDK build.
     is_blocking: ClassVar[bool] = False
     _logger: DTSLogger
     _port_links: list[PortLink]
diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py
index 2855fe0276..6b6fb894ca 100644
--- a/dts/framework/testbed_model/sut_node.py
+++ b/dts/framework/testbed_model/sut_node.py
@@ -18,8 +18,8 @@
 from pathlib import PurePath
 
 from framework.config import (
-    BuildTargetConfiguration,
-    BuildTargetInfo,
+    DPDKBuildConfiguration,
+    DPDKBuildInfo,
     NodeInfo,
     SutNodeConfiguration,
     TestRunConfiguration,
@@ -57,7 +57,7 @@ class SutNode(Node):
     virtual_devices: list[VirtualDevice]
     dpdk_prefix_list: list[str]
     dpdk_timestamp: str
-    _build_target_config: BuildTargetConfiguration | None
+    _dpdk_build_config: DPDKBuildConfiguration | None
     _env_vars: dict
     _remote_tmp_dir: PurePath
     __remote_dpdk_dir: PurePath | None
@@ -77,7 +77,7 @@ def __init__(self, node_config: SutNodeConfiguration):
         super().__init__(node_config)
         self.virtual_devices = []
         self.dpdk_prefix_list = []
-        self._build_target_config = None
+        self._dpdk_build_config = None
         self._env_vars = {}
         self._remote_tmp_dir = self.main_session.get_remote_tmp_dir()
         self.__remote_dpdk_dir = None
@@ -115,9 +115,9 @@ def remote_dpdk_build_dir(self) -> PurePath:
         This is the directory where DPDK was built.
         We assume it was built in a subdirectory of the extracted tarball.
         """
-        if self._build_target_config:
+        if self._dpdk_build_config:
             return self.main_session.join_remote_path(
-                self._remote_dpdk_dir, self._build_target_config.name
+                self._remote_dpdk_dir, self._dpdk_build_config.name
             )
         else:
             return self.main_session.join_remote_path(self._remote_dpdk_dir, "build")
@@ -140,13 +140,13 @@ def node_info(self) -> NodeInfo:
     def compiler_version(self) -> str:
         """The node's compiler version."""
         if self._compiler_version is None:
-            if self._build_target_config is not None:
+            if self._dpdk_build_config is not None:
                 self._compiler_version = self.main_session.get_compiler_version(
-                    self._build_target_config.compiler.name
+                    self._dpdk_build_config.compiler.name
                 )
             else:
                 self._logger.warning(
-                    "Failed to get compiler version because _build_target_config is None."
+                    "Failed to get compiler version because _dpdk_build_config is None."
                 )
                 return ""
         return self._compiler_version
@@ -160,15 +160,13 @@ def path_to_devbind_script(self) -> PurePath:
             )
         return self._path_to_devbind_script
 
-    def get_build_target_info(self) -> BuildTargetInfo:
-        """Get additional build target information.
+    def get_dpdk_build_info(self) -> DPDKBuildInfo:
+        """Get additional DPDK build information.
 
         Returns:
-            The build target information,
+            The DPDK build information,
         """
-        return BuildTargetInfo(
-            dpdk_version=self.dpdk_version, compiler_version=self.compiler_version
-        )
+        return DPDKBuildInfo(dpdk_version=self.dpdk_version, compiler_version=self.compiler_version)
 
     def _guess_dpdk_remote_dir(self) -> PurePath:
         return self.main_session.guess_dpdk_remote_dir(self._remote_tmp_dir)
@@ -189,40 +187,39 @@ def tear_down_test_run(self) -> None:
         super().tear_down_test_run()
         self.virtual_devices = []
 
-    def set_up_build_target(self, build_target_config: BuildTargetConfiguration) -> None:
+    def set_up_dpdk(self, dpdk_build_config: DPDKBuildConfiguration) -> None:
         """Set up DPDK the SUT node and bind ports.
 
         DPDK setup includes setting all internals needed for the build, the copying of DPDK tarball
         and then building DPDK. The drivers are bound to those that DPDK needs.
 
         Args:
-            build_target_config: The build target test run configuration according to which
+            dpdk_build_config: The DPDK build test run configuration according to which
                 the setup steps will be taken.
         """
-        self._configure_build_target(build_target_config)
+        self._configure_dpdk_build(dpdk_build_config)
         self._copy_dpdk_tarball()
         self._build_dpdk()
         self.bind_ports_to_driver()
 
-    def tear_down_build_target(self) -> None:
+    def tear_down_dpdk(self) -> None:
         """Reset DPDK variables and bind port driver to the OS driver."""
         self._env_vars = {}
-        self._build_target_config = None
+        self._dpdk_build_config = None
         self.__remote_dpdk_dir = None
         self._dpdk_version = None
         self._compiler_version = None
         self.bind_ports_to_driver(for_dpdk=False)
 
-    def _configure_build_target(self, build_target_config: BuildTargetConfiguration) -> None:
-        """Populate common environment variables and set build target config."""
+    def _configure_dpdk_build(self, dpdk_build_config: DPDKBuildConfiguration) -> None:
+        """Populate common environment variables and set DPDK build config."""
         self._env_vars = {}
-        self._build_target_config = build_target_config
-        self._env_vars.update(self.main_session.get_dpdk_build_env_vars(build_target_config.arch))
-        self._env_vars["CC"] = build_target_config.compiler.name
-        if build_target_config.compiler_wrapper:
-            self._env_vars["CC"] = (
-                f"'{build_target_config.compiler_wrapper} {build_target_config.compiler.name}'"
-            )  # fmt: skip
+        self._dpdk_build_config = dpdk_build_config
+        self._env_vars.update(self.main_session.get_dpdk_build_env_vars(dpdk_build_config.arch))
+        self._env_vars["CC"] = dpdk_build_config.compiler.name
+        if dpdk_build_config.compiler_wrapper:
+            self._env_vars["CC"] = f"'{self._dpdk_build_config.compiler_wrapper} "
+            f"{self._dpdk_build_config.compiler.name}'"
 
     @Node.skip_setup
     def _copy_dpdk_tarball(self) -> None:
diff --git a/dts/tests/TestSuite_smoke_tests.py b/dts/tests/TestSuite_smoke_tests.py
index c0b0e6bb00..ac661472b9 100644
--- a/dts/tests/TestSuite_smoke_tests.py
+++ b/dts/tests/TestSuite_smoke_tests.py
@@ -29,7 +29,7 @@ class TestSmokeTests(TestSuite):
 
     Attributes:
         is_blocking: This test suite will block the execution of all other test suites
-            in the build target after it.
+            in the DPDK build after it.
         nics_in_node: The NICs present on the SUT node.
     """
 
-- 
2.46.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-10-02 12:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-27 16:08 [PATCH 0/7] DTS external DPDK build Tomáš Ďurovec
2024-09-27 16:08 ` [PATCH 1/7] dts: rename build target to " Tomáš Ďurovec
2024-09-27 16:08 ` [PATCH 2/7] dts: one dpdk build per test run Tomáš Ďurovec
2024-09-27 16:08 ` [PATCH 3/7] dts: fix remote session file transfer vars Tomáš Ďurovec
2024-09-27 16:08 ` [PATCH 4/7] dts: add the ability to copy directories via remote Tomáš Ďurovec
2024-09-27 16:08 ` [PATCH 5/7] dts: add support for externally compiled DPDK Tomáš Ďurovec
2024-09-27 16:08 ` [PATCH 6/7] doc: update argument options for external DPDK build Tomáš Ďurovec
2024-09-27 16:08 ` [PATCH 7/7] dts: remove git ref option Tomáš Ďurovec
  -- strict thread matches above, loose matches on Subject: below --
2024-09-30 16:18 [PATCH 0/7] DTS external DPDK build Tomáš Ďurovec
2024-09-30 16:18 ` [PATCH 6/7] doc: update argument options for " Tomáš Ďurovec
2024-09-30 16:01 [PATCH 0/7] DTS " Tomáš Ďurovec
2024-09-30 16:02 ` [PATCH 6/7] doc: update argument options for " Tomáš Ďurovec
2024-09-27 15:38 [PATCH 1/7] dts: rename build target to " Tomáš Ďurovec
2024-09-27 15:38 ` [PATCH 6/7] doc: update argument options for external " Tomáš Ďurovec

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).