MCPcopy Create free account
hub / github.com/F-Stack/f-stack / SutNode

Class SutNode

dpdk/dts/framework/testbed_model/sut_node.py:72–406  ·  view source on GitHub ↗

A class for managing connections to the System under Test, providing methods that retrieve the necessary information about the node (such as CPU, memory and NIC details) and configuration capabilities. Another key capability is building DPDK according to given build target.

Source from the content-addressed store, hash-verified

70
71
72class SutNode(Node):
73 """
74 A class for managing connections to the System under Test, providing
75 methods that retrieve the necessary information about the node (such as
76 CPU, memory and NIC details) and configuration capabilities.
77 Another key capability is building DPDK according to given build target.
78 """
79
80 config: SutNodeConfiguration
81 _dpdk_prefix_list: list[str]
82 _dpdk_timestamp: str
83 _build_target_config: BuildTargetConfiguration | None
84 _env_vars: dict
85 _remote_tmp_dir: PurePath
86 __remote_dpdk_dir: PurePath | None
87 _app_compile_timeout: float
88 _dpdk_kill_session: OSSession | None
89 _dpdk_version: str | None
90 _node_info: NodeInfo | None
91 _compiler_version: str | None
92 _path_to_devbind_script: PurePath | None
93
94 def __init__(self, node_config: SutNodeConfiguration):
95 super(SutNode, self).__init__(node_config)
96 self._dpdk_prefix_list = []
97 self._build_target_config = None
98 self._env_vars = {}
99 self._remote_tmp_dir = self.main_session.get_remote_tmp_dir()
100 self.__remote_dpdk_dir = None
101 self._app_compile_timeout = 90
102 self._dpdk_kill_session = None
103 self._dpdk_timestamp = (
104 f"{str(os.getpid())}_{time.strftime('%Y%m%d%H%M%S', time.localtime())}"
105 )
106 self._dpdk_version = None
107 self._node_info = None
108 self._compiler_version = None
109 self._path_to_devbind_script = None
110 self._logger.info(f"Created node: {self.name}")
111
112 @property
113 def _remote_dpdk_dir(self) -> PurePath:
114 if self.__remote_dpdk_dir is None:
115 self.__remote_dpdk_dir = self._guess_dpdk_remote_dir()
116 return self.__remote_dpdk_dir
117
118 @_remote_dpdk_dir.setter
119 def _remote_dpdk_dir(self, value: PurePath) -> None:
120 self.__remote_dpdk_dir = value
121
122 @property
123 def remote_dpdk_build_dir(self) -> PurePath:
124 if self._build_target_config:
125 return self.main_session.join_remote_path(
126 self._remote_dpdk_dir, self._build_target_config.name
127 )
128 else:
129 return self.main_session.join_remote_path(self._remote_dpdk_dir, "build")

Callers 1

run_allFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected