Skip to content

Commit c3599a8

Browse files
committed
DpdkInstall: move constant args to private variables
Allowing extension of the class for the 32bit build
1 parent 6d58f96 commit c3599a8

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Diff for: microsoft/testsuites/dpdk/dpdktestpmd.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ class DpdkSourceInstall(Installer):
199199
"multi_process/client_server_mp/mp_server",
200200
"multi_process/client_server_mp/mp_client",
201201
]
202+
_library_bashrc_lines = [
203+
"export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib64/pkgconfig/",
204+
"export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib64/",
205+
]
206+
_meson_arguments: List[str] = []
207+
_build_dir: str = "build"
202208

203209
def _check_if_installed(self) -> bool:
204210
try:
@@ -258,14 +264,15 @@ def get_installed_version(self) -> VersionInfo:
258264
def _install(self) -> None:
259265
super()._install()
260266
if self._sample_applications:
261-
sample_apps = f"-Dexamples={','.join(self._sample_applications)}"
262-
else:
263-
sample_apps = ""
267+
self._meson_arguments += f"-Dexamples={','.join(self._sample_applications)}"
268+
264269
node = self._node
265270
# save the pythonpath for later
266271
python_path = node.tools[Python].get_python_path()
267272
self.dpdk_build_path = node.tools[Meson].setup(
268-
args=sample_apps, build_dir="build", cwd=self.asset_path
273+
args=" ".join(self._meson_arguments),
274+
build_dir=self._build_dir,
275+
cwd=self.asset_path,
269276
)
270277
node.tools[Ninja].run(
271278
cwd=self.dpdk_build_path,
@@ -300,12 +307,8 @@ def _install(self) -> None:
300307
expected_exit_code=0,
301308
expected_exit_code_failure_message="ldconfig failed, check for error spew.",
302309
)
303-
library_bashrc_lines = [
304-
"export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib64/pkgconfig/",
305-
"export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib64/",
306-
]
307310
node.tools[Echo].write_to_file(
308-
";".join(library_bashrc_lines),
311+
";".join(self._library_bashrc_lines),
309312
node.get_pure_path("$HOME/.bashrc"),
310313
append=True,
311314
)

0 commit comments

Comments
 (0)