HomeClusterLabs Projects

Feature: python: Support matching by regex in regession tests.

Description

Feature: python: Support matching by regex in regession tests.

Up to now, "pattern" has really just been a substring that's searched
for in the log output. This adds support for actual regexes without
requiring changing a bunch of the existing strings by using a regex=
argument and defaulting it to False.

Instead of adding a bunch more lists, I've also added a Pattern object
with various attributes and then condensed everything down into just a
single list of patterns.

I've made the matching logic a little more straightforward at the
expense of performance. We now iterate over the entire output log once
for every pattern. However, it's not expected that there will ever be
more than a handful of patterns in a single test, nor should the log
files be especially large.

Details

Provenance
clumensAuthored on Feb 7 2023, 11:46 AM
Parents
rP376f1d78bbde: Refactor: python: Get rid of the add_negative_log_pattern function.
Branches
Unknown
Tags
Unknown