From ea73202e5f94856d509f016897851c650a4e6898 Mon Sep 17 00:00:00 2001 From: Aditya Nagesh Date: Tue, 12 Nov 2024 15:53:45 +0530 Subject: [PATCH] b4 tool installation: Fallback to pip based installation --- lisa/tools/b4.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisa/tools/b4.py b/lisa/tools/b4.py index a97a6c8f73..5838256a53 100644 --- a/lisa/tools/b4.py +++ b/lisa/tools/b4.py @@ -1,7 +1,8 @@ import pathlib import re from lisa.executable import Tool -from lisa.operating_system import Posix +from lisa.operating_system import Debian +from lisa.tools.python import Pip from lisa.util import get_matched_str @@ -17,8 +18,12 @@ def can_install(self) -> bool: return True def _install(self) -> bool: - if isinstance(self.node.os, Posix): + if isinstance(self.node.os, Debian): self.node.os.install_packages("b4") + installed = self._check_exists() + if not installed: + pip = self.node.tools[Pip] + pip.install_packages("b4", install_to_user=True) return self._check_exists() def am(self, message_id: str, output_dir: pathlib.PurePath) -> pathlib.PurePath: