forked from TrueCloudLab/frostfs-testlib
[#100] Add new method for logs gathering
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
cff5db5a67
commit
e1f3444e92
2 changed files with 48 additions and 4 deletions
|
@ -115,7 +115,6 @@ class Host(ABC):
|
|||
service_name: Name of the service to restart.
|
||||
"""
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def get_data_directory(self, service_name: str) -> str:
|
||||
"""
|
||||
|
@ -126,7 +125,6 @@ class Host(ABC):
|
|||
service_name: Name of storage node service.
|
||||
"""
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def wait_success_suspend_process(self, process_name: str) -> None:
|
||||
"""Search for a service ID by its name and stop the process
|
||||
|
@ -251,6 +249,27 @@ class Host(ABC):
|
|||
filter_regex: regex to filter output
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def get_filtered_logs(
|
||||
self,
|
||||
filter_regex: str,
|
||||
since: Optional[datetime] = None,
|
||||
until: Optional[datetime] = None,
|
||||
unit: Optional[str] = None,
|
||||
) -> str:
|
||||
"""Get logs from host filtered by regex.
|
||||
|
||||
Args:
|
||||
filter_regex: regex filter for logs.
|
||||
since: If set, limits the time from which logs should be collected. Must be in UTC.
|
||||
until: If set, limits the time until which logs should be collected. Must be in UTC.
|
||||
unit: required unit.
|
||||
|
||||
Returns:
|
||||
Found entries as str if any found.
|
||||
Empty string otherwise.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def is_message_in_logs(
|
||||
self,
|
||||
|
@ -270,10 +289,11 @@ 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:
|
||||
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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue