Log content validator class provides methods to fix the log content before test is started, and validate the content of log during test execution, according to predefined patterns. Predefined patterns are:
- Logs which should be skipped. Skip further checks on particular line if matched
- Logs which should cause failure of test.
- Logs which are expected to be matched, otherwise fail.
The priority of patterns to be checked are defined in above order. Skipping patterns have priority over other ones, to be possible to skip particular ERROR log, but fail for wider range of other ERRORs.
- remote_filename – path to the remote log file
- skip_patterns – array of skip regex patterns
- failure_patterns – array of failure regex patterns
- matched_patterns – array of expected regex patterns to be matched
.. code-block:: python evm_tail = LogValidator('/var/www/miq/vmdb/log/evm.log', skip_patterns=['PARTICULAR_ERROR'], failure_patterns=['.*ERROR.*'], matched_patterns=['PARTICULAR_INFO']) evm_tail.fix_before_start() evm_tail.validate_logs()