diff options
| author | Luca Vizzarro <[email protected]> | 2024-06-19 15:03:00 +0100 |
|---|---|---|
| committer | Thomas Monjalon <[email protected]> | 2024-06-20 05:30:40 +0200 |
| commit | 967fc62b0a4356e353dfec11af45513fd75f7567 (patch) | |
| tree | 8881b23e07d6274465a8cf45b5eb80bbab6f298b /dts/framework/testbed_model/sut_node.py | |
| parent | fd8cd8ee191e4f295706b2d412abbdb665670153 (diff) | |
dts: refactor EAL parameters class
Move EalParams to its own module to avoid circular dependencies.
Also the majority of the attributes are now optional.
Signed-off-by: Luca Vizzarro <[email protected]>
Reviewed-by: Paul Szczepanek <[email protected]>
Reviewed-by: Juraj Linkeš <[email protected]>
Reviewed-by: Jeremy Spewock <[email protected]>
Reviewed-by: Nicholas Pratte <[email protected]>
Diffstat (limited to 'dts/framework/testbed_model/sut_node.py')
| -rw-r--r-- | dts/framework/testbed_model/sut_node.py | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 1a631c2732..b834374c21 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -15,9 +15,8 @@ An SUT node is where this SUT runs. import os import tarfile import time -from dataclasses import dataclass, field from pathlib import PurePath -from typing import Literal, Type +from typing import Type from framework.config import ( BuildTargetConfiguration, @@ -27,6 +26,7 @@ from framework.config import ( TestRunConfiguration, ) from framework.params import Params, Switch +from framework.params.eal import EalParams from framework.remote_session import CommandResult from framework.settings import SETTINGS from framework.utils import MesonArgs @@ -38,44 +38,6 @@ from .port import Port from .virtual_device import VirtualDevice -def _port_to_pci(port: Port) -> str: - return port.pci - - -@dataclass(kw_only=True) -class EalParams(Params): - """The environment abstraction layer parameters. - - Attributes: - lcore_list: The list of logical cores to use. - memory_channels: The number of memory channels to use. - prefix: Set the file prefix string with which to start DPDK, e.g.: ``prefix="vf"``. - no_pci: Switch to disable PCI bus, e.g.: ``no_pci=True``. - vdevs: Virtual devices, e.g.:: - vdevs=[ - VirtualDevice('net_ring0'), - VirtualDevice('net_ring1') - ] - ports: The list of ports to allow. - other_eal_param: user defined DPDK EAL parameters, e.g.: - ``other_eal_param='--single-file-segments'`` - """ - - lcore_list: LogicalCoreList = field(metadata=Params.short("l")) - memory_channels: int = field(metadata=Params.short("n")) - prefix: str = field(metadata=Params.long("file-prefix")) - no_pci: Switch - vdevs: list[VirtualDevice] | None = field( - default=None, metadata=Params.multiple() | Params.long("vdev") - ) - ports: list[Port] | None = field( - default=None, - metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("a"), - ) - other_eal_param: Params | None = None - _separator: Literal[True] = field(default=True, init=False, metadata=Params.short("-")) - - class SutNode(Node): """The system under test node. |
