diff --git a/tests/common/plugins/loganalyzer/__init__.py b/tests/common/plugins/loganalyzer/__init__.py index 3810d371d6c..8830bb4a79b 100644 --- a/tests/common/plugins/loganalyzer/__init__.py +++ b/tests/common/plugins/loganalyzer/__init__.py @@ -14,11 +14,13 @@ def loganalyzer(duthost, request): loganalyzer = LogAnalyzer(ansible_host=duthost, marker_prefix=request.node.name) logging.info("Add start marker into DUT syslog") marker = loganalyzer.init() + logging.info("Load config and analyze log") + # Read existed common regular expressions located with legacy loganalyzer module + loganalyzer.load_common_config() + yield loganalyzer + if not request.config.getoption("--disable_loganalyzer") and "disable_loganalyzer" not in request.keywords: - logging.info("Load config and analyze log") - # Read existed common regular expressions located with legacy loganalyzer module - loganalyzer.load_common_config() # Parse syslog and process result. Raise "LogAnalyzerError" exception if: total match or expected missing # match is not equal to zero loganalyzer.analyze(marker) diff --git a/tests/common/plugins/loganalyzer/loganalyzer.py b/tests/common/plugins/loganalyzer/loganalyzer.py index e66d8a23401..d63124c23a1 100644 --- a/tests/common/plugins/loganalyzer/loganalyzer.py +++ b/tests/common/plugins/loganalyzer/loganalyzer.py @@ -15,7 +15,7 @@ COMMON_MATCH = join(split(__file__)[0], "loganalyzer_common_match.txt") COMMON_IGNORE = join(split(__file__)[0], "loganalyzer_common_ignore.txt") COMMON_EXPECT = join(split(__file__)[0], "loganalyzer_common_expect.txt") -SYSLOG_TMP_FOLDER = "/tmp/pytest-run/syslog" +SYSLOG_TMP_FOLDER = "/tmp/syslog" class LogAnalyzerError(Exception):