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 4031C4557F; Fri, 6 Sep 2024 15:27:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40CF042F05; Fri, 6 Sep 2024 15:27:02 +0200 (CEST) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by mails.dpdk.org (Postfix) with ESMTP id 25B6D42EFF for ; Fri, 6 Sep 2024 15:27:01 +0200 (CEST) Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-5356aa9a0afso3416616e87.2 for ; Fri, 06 Sep 2024 06:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1725629220; x=1726234020; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PTQktfFELtDsDL9FWUb4T5p/M9tQtt7GwjO8txPmB88=; b=Bc2RjvMc3/Y/Cct/CM149ea1l+CUaTIOCXC5pG42YxygK5mArvN/jIbGV3TwfdfAlO 2/xdo9NChHMzch82PD5dAaT1YrBRFxsq2ae63t3DSvwe1hFoB+F3xqb4mPDddvSYkc2d Kuf2TJphBXaxaQdvvRdT4kc2XlHps2G3WW04u71Ol9Oy20CnSCBAfsmiaaMXTeo2uPso amhjxdBtAKrsHfv/6XPmqw8KAnYWIgBQtCXkrxu5PWqAJDxBJLeS1A1YIbAYhNJO4kBs c6c2hhUfHaU1+C/WBKlgdcJB4/dGPqXUp8A5RLQpnFGjJ+8O3feYWboOE7ccHqXDom6D XvVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725629220; x=1726234020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PTQktfFELtDsDL9FWUb4T5p/M9tQtt7GwjO8txPmB88=; b=a5tsHPUD0k032dVauYH0SLcb+yP3W/eWksFB4T1LyUqB3S+FMbeDTIb319natVKDxX hnsEvnL0mgINeWjig+Zw70UP5chNYCGC2n4omLKK6LJmUrlW7cuZ4uQ7YPt9PEUSmKCS k301qWEurJHtYsszTxtKkjdUKXfxPOdBTxGsK8JEb6ZEDPQie8E4aOJl/TfrTDv7SKAb g1Zo+nWVr6TFWnLY+Umho7KnjAZJHBDuITIMlhfjkobJvAd8dx01F7E6TMtY7l0/TKRH CWA4j9EXkSh2KBLjqSwpTRWkWmCphyPN6poi3SrTdReS7/MG/tYnvd4NH8fe2cFhJw8v 5kGg== X-Gm-Message-State: AOJu0YwkSZ2SggTI+uQgiO/ymoTVR5TxqqGOvIwZaTIVnMhx26n8/gBV H1IPmXT+I6Qb3DstTh9IIjA4gzQaUSBFsEQHSOUwr+Ebxscb9Qc07oeCTRZf7Lc= X-Google-Smtp-Source: AGHT+IGntQwzQ8sI2X7DFigcsG0roal+WQacsaOU3I4JjlPTscfclhsK49pM+sPjb0NoYqSYWFzo5Q== X-Received: by 2002:a05:6512:3a85:b0:535:6951:9e1c with SMTP id 2adb3069b0e04-536587ada96mr2036193e87.15.1725629219963; Fri, 06 Sep 2024 06:26:59 -0700 (PDT) Received: from jlinkes-PT-Latitude-5530.. ([84.245.121.62]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8a7c504701sm168943566b.25.2024.09.06.06.26.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 06:26:59 -0700 (PDT) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, alex.chapman@arm.com, probb@iol.unh.edu, jspewock@iol.unh.edu, npratte@iol.unh.edu, dmarx@iol.unh.edu Cc: dev@dpdk.org, =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Eurovec?= Subject: [RFC PATCH v1 01/12] dts: rename build target to DPDK build Date: Fri, 6 Sep 2024 15:26:45 +0200 Message-ID: <20240906132656.21729-2-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240906132656.21729-1-juraj.linkes@pantheon.tech> References: <20240906132656.21729-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Tomáš Ďurovec 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 7d95016e68..d43e6fcfeb 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 df60a5030e..598d7101ed 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. @@ -447,7 +447,7 @@ class TestRunConfiguration: vdevs: The names of virtual devices to test. """ - build_targets: list[BuildTargetConfiguration] + dpdk_builds: list[DPDKBuildConfiguration] perf: bool func: bool skip_smoke_tests: bool @@ -464,7 +464,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. @@ -475,8 +475,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"] @@ -498,7 +498,7 @@ def from_dict( d["system_under_test_node"]["vdevs"] if "vdevs" in d["system_under_test_node"] else [] ) return cls( - build_targets=build_targets, + dpdk_builds=dpdk_builds, perf=d["perf"], func=d["func"], skip_smoke_tests=skip_smoke_tests, @@ -548,7 +548,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 f02a310bb5..4b63e9710e 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 }, @@ -383,7 +383,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 cf16556403..703d9eb48e 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 6b6f6a05f5..2b5403e51c 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. """ @@ -30,8 +30,8 @@ from framework.testbed_model.tg_node import TGNode from .config import ( - BuildTargetConfiguration, Configuration, + DPDKBuildConfiguration, TestRunConfiguration, TestSuiteConfig, load_config, @@ -45,7 +45,7 @@ from .logger import DTSLogger, DtsStage, get_dts_logger from .settings import SETTINGS from .test_result import ( - BuildTargetResult, + DPDKBuildResult, DTSResult, Result, TestCaseResult, @@ -69,9 +69,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. """ @@ -97,16 +97,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 @@ -116,7 +116,7 @@ def run(self) -> None: #. Test run setup - #. Build target setup + #. DPDK build setup #. Test suite setup @@ -126,7 +126,7 @@ def run(self) -> None: #. Test suite teardown - #. Build target teardown + #. DPDK build teardown #. Test run teardown @@ -414,7 +414,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: @@ -437,13 +437,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, ) @@ -457,88 +457,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( @@ -550,8 +549,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 f6303066d4..2b8c583853 100644 --- a/dts/framework/settings.py +++ b/dts/framework/settings.py @@ -270,7 +270,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 694b2eba65..c473b91c5a 100644 --- a/dts/framework/test_suite.py +++ b/dts/framework/test_suite.py @@ -65,7 +65,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.43.0