diff --git a/microsoft/testsuites/dpdk/common.py b/microsoft/testsuites/dpdk/common.py index 43de6feac0..f68723aeef 100644 --- a/microsoft/testsuites/dpdk/common.py +++ b/microsoft/testsuites/dpdk/common.py @@ -101,7 +101,7 @@ def download(self) -> PurePath: self._git_repo, cwd=self._node.get_working_path(), ref=self._git_ref, - fail_on_exists=True, + fail_on_exists=False, ) return self.asset_path @@ -139,7 +139,6 @@ def download(self) -> PurePath: self._tar_url, file_path=str(work_path), overwrite=False, - force_run=True, ) remote_path = node.get_pure_path(tarfile) self.tar_filename = remote_path.name @@ -171,8 +170,10 @@ class Installer: # setup the node before starting # ex: updating the kernel, enabling features, checking drivers, etc. + # First we download the assets to ensure asset_path is set + # even if we end up skipping re-installation def _setup_node(self) -> None: - raise NotImplementedError(f"_setup_node {self._err_msg}") + self._download_assets() # check if the package is already installed: # Is the package installed from source? Or from the package manager? @@ -189,7 +190,7 @@ def _download_assets(self) -> None: # do the build and installation def _install(self) -> None: - self._download_assets() + ... # remove an installation def _uninstall(self) -> None: @@ -269,10 +270,6 @@ def _check_if_installed(self) -> bool: break return True - # installing dependencies is the installation in this case, so just return - def _install(self) -> None: - return - def force_dpdk_default_source(variables: Dict[str, Any]) -> None: if not variables.get("dpdk_source", None): diff --git a/microsoft/testsuites/dpdk/dpdktestpmd.py b/microsoft/testsuites/dpdk/dpdktestpmd.py index f6a361867e..56d5d6dce8 100644 --- a/microsoft/testsuites/dpdk/dpdktestpmd.py +++ b/microsoft/testsuites/dpdk/dpdktestpmd.py @@ -166,6 +166,10 @@ def _setup_node(self) -> None: elif isinstance(self._os, Fedora): self._os.install_epel() + # super setup node last in this case, since we must set + # repo args before download/install + super()._setup_node() + def get_installed_version(self) -> VersionInfo: return self._os.get_package_information("dpdk", use_cached=False) @@ -197,6 +201,7 @@ def _check_if_installed(self) -> bool: return False def _setup_node(self) -> None: + super()._setup_node() if isinstance(self._os, Debian): self._package_manager_extra_args = get_debian_backport_repo_args(self._os) if isinstance(self._os, Ubuntu) and self._os.information.version < "22.4.0": @@ -299,7 +304,7 @@ def download(self) -> PurePath: self._git_ref = git.get_tag( self.asset_path, filter_=r"^v.*" # starts w 'v' ) - git.checkout(self._git_ref, cwd=self.asset_path) + git.checkout(self._git_ref, cwd=self.asset_path, force_run=False) return self.asset_path diff --git a/microsoft/testsuites/dpdk/dpdkutil.py b/microsoft/testsuites/dpdk/dpdkutil.py index 7918dc419e..786a70c9f5 100644 --- a/microsoft/testsuites/dpdk/dpdkutil.py +++ b/microsoft/testsuites/dpdk/dpdkutil.py @@ -333,6 +333,11 @@ def initialize_node_resources( sample_apps=sample_apps, force_net_failsafe_pmd=force_net_failsafe_pmd, ) + # Tools will skip installation if the binary is present, so + # force invoke install. Installer will skip if the correct + # *type* of installation is already installed, + # taking it's creation arguments into account. + testpmd.install() # init and enable hugepages (required by dpdk) hugepages = node.tools[Hugepages] diff --git a/microsoft/testsuites/dpdk/rdmacore.py b/microsoft/testsuites/dpdk/rdmacore.py index 8a9df3c72c..0a0d650e1b 100644 --- a/microsoft/testsuites/dpdk/rdmacore.py +++ b/microsoft/testsuites/dpdk/rdmacore.py @@ -121,6 +121,7 @@ def _setup_node(self) -> None: self._os.install_epel() if isinstance(self._os, Debian): self._package_manager_extra_args = get_debian_backport_repo_args(self._os) + super()._setup_node() def get_installed_version(self) -> VersionInfo: return self._os.get_package_information("rdma-core", use_cached=False) @@ -131,9 +132,6 @@ def _check_if_installed(self) -> bool: # implement SourceInstall for DPDK class RdmaCoreSourceInstaller(Installer): - def _download_assets(self) -> None: - super()._download_assets() - def _check_if_installed(self) -> bool: try: package_manager_install = self._os.package_exists("rdma-core") @@ -154,6 +152,7 @@ def _setup_node(self) -> None: self._os.uninstall_packages("rdma-core") if isinstance(self._os, Fedora): self._os.group_install_packages("Development Tools") + super()._setup_node() def _uninstall(self) -> None: # undo source installation (thanks ninja)