8000 feat(anta.tests): VerifyLoggingErrors failure message should include the error logs by vitthalmagadum · Pull Request #1144 · aristanetworks/anta · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(anta.tests): VerifyLoggingErrors failure message should include the error logs #1144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2025
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
2 changes: 1 addition & 1 deletion anta/tests/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def test(self) -> None:
if len(command_output) == 0:
self.result.is_success()
else:
self.result.is_failure("Device has reported syslog messages with a severity of ERRORS or higher")
self.result.is_failure(f"Device has reported syslog messages with a severity of ERRORS or higher:\n{command_output}")


class VerifyLoggingEntries(AntaTest):
Expand Down
9 changes: 8 additions & 1 deletion tests/units/anta_tests/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,14 @@
"Aug 2 19:57:42 DC1-LEAF1A Mlag: %FWK-3-SOCKET_CLOSE_REMOTE: Connection to Mlag (pid:27200) at tbt://192.168.0.1:4432/+n closed by peer (EOF)",
],
"inputs": None,
"expected": {"result": "failure", "messages": ["Device has reported syslog messages with a severity of ERRORS or higher"]},
"expected": {
"result": "failure",
"messages": [
"Device has reported syslog messages with a severity of ERRORS or higher:\n"
"Aug 2 19:57:42 DC1-LEAF1A Mlag: %FWK-3-SOCKET_CLOSE_REMOTE: Connection to Mlag "
"(pid:27200) at tbt://192.168.0.1:4432/+n closed by peer (EOF)"
],
},
},
{
"name": "success",
Expand Down
0