From 917dc6f6d8cc22e4df046dd46a951d50dd3268d9 Mon Sep 17 00:00:00 2001 From: sstovbyra Date: Tue, 11 Jul 2023 18:22:54 +0300 Subject: [PATCH] add_wait_for_service_to_be_in_state --- src/frostfs_testlib/hosting/docker_host.py | 4 ++++ src/frostfs_testlib/hosting/interfaces.py | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/frostfs_testlib/hosting/docker_host.py b/src/frostfs_testlib/hosting/docker_host.py index 5dcac9e..3934d9f 100644 --- a/src/frostfs_testlib/hosting/docker_host.py +++ b/src/frostfs_testlib/hosting/docker_host.py @@ -135,6 +135,10 @@ class DockerHost(Host): timeout=service_attributes.start_timeout, ) + def wait_for_service_to_be_in_state(self, systemd_service_name: str, expected_state: str, timeout: int) -> None: + raise NotImplementedError("Not implemented for docker") + + def get_data_directory(self, service_name: str) -> str: service_attributes = self._get_service_attributes(service_name) return service_attributes.data_directory_path diff --git a/src/frostfs_testlib/hosting/interfaces.py b/src/frostfs_testlib/hosting/interfaces.py index 8d889da..cdd3379 100644 --- a/src/frostfs_testlib/hosting/interfaces.py +++ b/src/frostfs_testlib/hosting/interfaces.py @@ -266,3 +266,16 @@ class Host(ABC): True if message found in logs in the given time frame. False otherwise. """ + + + @abstractmethod + def wait_for_service_to_be_in_state(self, systemd_service_name: str, expected_state: str, timeout: int) -> None: + """ + Waites for service to be in specified state. + + Args: + systemd_service_name: Service to wait state of. + expected_state: State to wait for + timeout: Seconds to wait + + """