Skip to content

Commit

Permalink
DpdkInstall: move constant args to private variables
Browse files Browse the repository at this point in the history
Allowing extension of the class for the 32bit build
  • Loading branch information
mcgov committed Jan 10, 2025
1 parent 6d58f96 commit c3599a8
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions microsoft/testsuites/dpdk/dpdktestpmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ class DpdkSourceInstall(Installer):
"multi_process/client_server_mp/mp_server",
"multi_process/client_server_mp/mp_client",
]
_library_bashrc_lines = [
"export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib64/pkgconfig/",
"export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib64/",
]
_meson_arguments: List[str] = []
_build_dir: str = "build"

def _check_if_installed(self) -> bool:
try:
Expand Down Expand Up @@ -258,14 +264,15 @@ def get_installed_version(self) -> VersionInfo:
def _install(self) -> None:
super()._install()
if self._sample_applications:
sample_apps = f"-Dexamples={','.join(self._sample_applications)}"
else:
sample_apps = ""
self._meson_arguments += f"-Dexamples={','.join(self._sample_applications)}"

node = self._node
# save the pythonpath for later
python_path = node.tools[Python].get_python_path()
self.dpdk_build_path = node.tools[Meson].setup(
args=sample_apps, build_dir="build", cwd=self.asset_path
args=" ".join(self._meson_arguments),
build_dir=self._build_dir,
cwd=self.asset_path,
)
node.tools[Ninja].run(
cwd=self.dpdk_build_path,
Expand Down Expand Up @@ -300,12 +307,8 @@ def _install(self) -> None:
expected_exit_code=0,
expected_exit_code_failure_message="ldconfig failed, check for error spew.",
)
library_bashrc_lines = [
"export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib64/pkgconfig/",
"export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib64/",
]
node.tools[Echo].write_to_file(
";".join(library_bashrc_lines),
";".join(self._library_bashrc_lines),
node.get_pure_path("$HOME/.bashrc"),
append=True,
)
Expand Down

0 comments on commit c3599a8

Please sign in to comment.