pytest_mh.utils.journald
Classes
|
Perform journald related tasks. |
- class pytest_mh.utils.journald.JournaldUtils(*args, **kwargs)
Bases:
MultihostUtility[MultihostHost]Perform journald related tasks.
- Parameters:
host (MultihostHost) – Remote host instance.
- property now: str
- Returns:
Current date and time that can be used to filter the journal.
- Return type:
- get_artifacts_list(host: MultihostHost, artifacts_type: Literal['pytest_setup', 'pytest_teardown', 'topology_setup', 'topology_teardown', 'test']) set[str]
Dump journald into file that can be collected.
- Parameters:
host (MultihostHost) – Host where the artifacts are being collected.
artifacts_type (MultihostArtifactsType) – Type of artifacts that are being collected.
- Returns:
List of artifacts to collect.
- Return type:
- journalctl(current: bool = True, *, unit: str | None = None, lines: int | None = None, since: str | None = None, reverse: bool = False, grep: str | None = None, output: str | None = None, identifier: str | None = None, system: bool = False, user: bool = False, args: list[Any] | None = None) ProcessResult
Execute journalctl with given arguments. Show messages only for current test run, by default. Note that raise_on_error is False and the command may return non-zero return code.
- Parameters:
current (bool, optional) – Show messages only for current test run, defaults to True
unit (str | None, optional) – Show messages for the specified systemd unit, defaults to None
lines (int | None, optional) – Show the most recent journal events and limit the number of events shown, defaults to None
since (str | None, optional) – Start showing entries on or newer than the specified date, defaults to None
reverse (bool, optional) – Reverse output so that the newest entries are displayed first, defaults to False
grep (str | None, optional) – Filter output to entries where the MESSAGE= field matches specified regex, defaults to None
output (str | None, optional) – Controls the formatting of the journal entries, defaults to None
identifier (str | None, optional) – Show messages for the specified syslog identifier SYSLOG_IDENTIFIER, defaults to None
system (bool, optional) – Show messages from system services and the kernel, defaults to False
user (bool, optional) – Show messages from service of current user, defaults to False
args (list[Any] | None, optional) – Additional options, defaults to None
- Returns:
SSH process result
- Return type: