Dpdk: ring_ping allow re-initialization to force source build

This commit is contained in:
Matthew G McGovern 2024-10-11 21:21:03 -07:00
Родитель 23c0ab73c7
Коммит 28638da236
4 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@ -391,6 +391,10 @@ class InitializableMixin:
self._is_initialized = False
raise identifier
def reinitialize(self, *args: Any, **kwargs: Any) -> None:
self._is_initialized = False
self.initialize()
class BaseClassMixin:
@classmethod

Просмотреть файл

@ -192,7 +192,7 @@ class Installer:
self._download_assets()
# remove an installation
def _uninstall(self) -> None:
def uninstall(self) -> None:
raise NotImplementedError(f"_clean_previous_installation {self._err_msg}")
# install the dependencies
@ -216,7 +216,7 @@ class Installer:
def do_installation(self, required_version: Optional[VersionInfo] = None) -> None:
self._setup_node()
if self._should_install():
self._uninstall()
self.uninstall()
self._install_dependencies()
self._install()
@ -243,7 +243,7 @@ class PackageManagerInstall(Installer):
super().__init__(node, os_dependencies)
# uninstall from the package manager
def _uninstall(self) -> None:
def uninstall(self) -> None:
if not (isinstance(self._os, Posix) and self._check_if_installed()):
return
if self._os_dependencies is not None:

Просмотреть файл

@ -28,6 +28,7 @@ from lisa.tools.hugepages import HugePageSize
from lisa.util.constants import SIGINT
from microsoft.testsuites.dpdk.common import (
DPDK_STABLE_GIT_REPO,
PackageManagerInstall,
force_dpdk_default_source,
)
from microsoft.testsuites.dpdk.dpdknffgo import DpdkNffGo
@ -527,7 +528,10 @@ class Dpdk(TestSuite):
except (NotEnoughMemoryException, UnsupportedOperationException) as err:
raise SkippedException(err)
testpmd = test_kit.testpmd
if isinstance(testpmd.installer, PackageManagerInstall):
testpmd.installer.uninstall()
testpmd.reinitialize()
testpmd.install()
# grab a nic and run testpmd
git = node.tools[Git]
make = node.tools[Make]

Просмотреть файл

@ -208,7 +208,7 @@ class DpdkSourceInstall(Installer):
self._node.tools[Ninja].install()
self._node.tools[Pip].install_packages("pyelftools")
def _uninstall(self) -> None:
def uninstall(self) -> None:
# undo source installation (thanks ninja)
if not self._check_if_installed():
return