Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tests/common/plugins/loganalyzer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/common/plugins/loganalyzer/loganalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down