add_wait_for_service_to_be_in_state #53

Merged
sstovbyra merged 1 commit from add_wait_for_service_to_be_in_state into master 2023-07-12 09:33:20 +00:00
2 changed files with 17 additions and 0 deletions

View file

@ -135,6 +135,10 @@ class DockerHost(Host):
timeout=service_attributes.start_timeout, 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: def get_data_directory(self, service_name: str) -> str:
service_attributes = self._get_service_attributes(service_name) service_attributes = self._get_service_attributes(service_name)
return service_attributes.data_directory_path return service_attributes.data_directory_path

View file

@ -266,3 +266,16 @@ class Host(ABC):
True if message found in logs in the given time frame. True if message found in logs in the given time frame.
False otherwise. 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
"""