diff --git a/lisa/operating_system.py b/lisa/operating_system.py index 73850647af..62f449b5a0 100644 --- a/lisa/operating_system.py +++ b/lisa/operating_system.py @@ -475,9 +475,7 @@ def capture_system_information(self, saved_path: Path) -> None: try: systemd_analyze_tool = self._node.tools[SystemdAnalyze] - boot_time = systemd_analyze_tool.get_boot_time() - boot_time.information.update(self._node.get_information()) - notifier.notify(boot_time) + systemd_analyze_tool.send_boot_time_messages() except Exception as e: self._node.log.debug(f"error on get boot time: {e}") diff --git a/lisa/tools/systemd_analyze.py b/lisa/tools/systemd_analyze.py index 5c67824bca..3ff7df90f4 100644 --- a/lisa/tools/systemd_analyze.py +++ b/lisa/tools/systemd_analyze.py @@ -5,6 +5,7 @@ from retry import retry +from lisa import notifier from lisa.executable import Tool from lisa.messages import ProvisionBootTimeMessage from lisa.util import LisaException, find_groups_in_lines @@ -78,6 +79,16 @@ def get_boot_time(self, force_run: bool = True) -> ProvisionBootTimeMessage: boot_time.provision_time = self.node.provision_time return boot_time + def send_boot_time_messages(self) -> None: + """ + Send boot time messages as ProvisionBootTimeMessage. + """ + boot_time = self.get_boot_time() + boot_time.information.update(self.node.get_information()) + + # Send ProvisionBootTimeMessage + notifier.notify(boot_time) + def plot(self, output_file: PurePath, sudo: bool = False) -> None: self.run(f"plot > {output_file}", shell=True, sudo=sudo, expected_exit_code=0)