From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 95C7645A48; Sat, 28 Sep 2024 00:13:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F93B402EF; Sat, 28 Sep 2024 00:13:32 +0200 (CEST) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mails.dpdk.org (Postfix) with ESMTP id A73E54025D for ; Fri, 27 Sep 2024 17:38:33 +0200 (CEST) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so20529745e9.3 for ; Fri, 27 Sep 2024 08:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1727451513; x=1728056313; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bcitPiLBjq+8O6NjoAhc9WTg7iNr6mQAj12KgmFleiA=; b=hx/NPnG2Bha2Nt8TqBSIEW5owFIDYkUrRdakZaKZoHA1l0tRw6bOXuBAaaKzQDW7/C wg8WIWBf2LcNtFs6Notme2CDnFJgdEQlOIINGnl5Soz3Cg3ON/yP7yUf2Jk2lDGoMTDj tFAYHqzdZ6/0LSFC0S161UFi2E+sRLU1uUPaDmcy3qetEV2XYQGfGBARL3heqTGCE7Dd Ut7VPieJYxOCzRT7NNCrqpGFE4T3Ql5AiS6JdzEi1Ry2ILzo1cm92Sr2zmqEcxWauU3k jnCWhEFa6F+tQmLx9CVQooAgmdgOWnrEw1uVi+W9YTL4aKB9N6JKHPzBIhipWl56hm+/ 32IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727451513; x=1728056313; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bcitPiLBjq+8O6NjoAhc9WTg7iNr6mQAj12KgmFleiA=; b=S6k3u7KQy3iyIaUlKnew58YicmFZqzAWZGQzSoah4wTs2ZxZtW7wgt6Zmgv9dCA9LZ My/gDDDpZ/Fh7flFTm7OtjrmQkrSq0q6gGtaEUq+ZUeIMQ+vOmdjEyo6rYAcibvqo699 Lh2XxgocV56oux3cnpRKUAJQXJBwnWAuuBHFXJZGC/RDlXq8+Fp8p/yJ8ynjVbMRYLE+ 9VgS0xCQjsnYqwA11yg4bO53DuEUrJoHHMIWs/rgZnRyjRdTVn7kySOZJxRULJNKIfME dWrJSuD4hNRB0+bQZeoLE3WIokLRqdY5Rs/bta+EfiGdO+YgjwT5zW0QGcBw643Bh2Oa buuA== X-Gm-Message-State: AOJu0Yz73WjG3Pr95S2uQv5CrbqK1XOQkFQ3S2u5gShYZlT5tkyI+bgi TdIBhIEsKORPT+bIxQGuaZc1XJPSmDXzorCbQU5i+Eq9rfpY8tQ9I8kEyN+NaZ3Bx8CvrxflvC0 fmjM= X-Google-Smtp-Source: AGHT+IF4mVZRZIYcbUbzVYHq7NwyhvunilOESabwLdlFC/QeaICOqf2LE5Q+sb9mjj2ZowbIRI5u8g== X-Received: by 2002:adf:ab02:0:b0:37c:d49c:3ac7 with SMTP id ffacd0b85a97d-37cd5b0de29mr2411785f8f.48.1727451512880; Fri, 27 Sep 2024 08:38:32 -0700 (PDT) Received: from fedora.. ([185.242.191.25]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd574272dsm2801013f8f.102.2024.09.27.08.38.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 08:38:32 -0700 (PDT) From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Eurovec?= To: dev@dpdk.org Cc: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Eurovec?= Subject: [PATCH 1/7] dts: rename build target to DPDK build Date: Fri, 27 Sep 2024 17:38:23 +0200 Message-ID: <20240927153830.266075-1-tomas.durovec@pantheon.tech> X-Mailer: git-send-email 2.46.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sat, 28 Sep 2024 00:13:28 +0200 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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