-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat(anta): Added the test case to Verify SNMP Notification Host #838
base: main
Are you sure you want to change the base?
Conversation
7fa9d7f
to
0c93649
Compare
CodSpeed Performance ReportMerging #838 will not alter performanceComparing Summary
|
bfa02e4
to
da8ba27
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
5a718d9
to
4b31a5d
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
10232ce
to
ce6aa8c
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
ab28ae5
to
1692ea8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix wording before I make another review
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
for more information, see https://pre-commit.ci
dcfad5d
to
a2fe431
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
for more information, see https://pre-commit.ci
Quality Gate passedIssues Measures |
self.result.is_failure(f"{host} Version: {version} - Not configured") | ||
continue | ||
|
||
# If actual notification type do not matches the expected value, test fails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# If actual notification type do not matches the expected value, test fails. | |
# If actual notification type does not match the expected value, test fails. |
|
||
# If actual notification type do not matches the expected value, test fails. | ||
if notification_type != (actual_notification_type := get_value(host_details, "notificationType", default_value)): | ||
self.result.is_failure(f"{host} - Incorrect notification type - Expected: {notification_type} Actual: {actual_notification_type}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.result.is_failure(f"{host} - Incorrect notification type - Expected: {notification_type} Actual: {actual_notification_type}") | |
self.result.is_failure(f"{host} - Incorrect notification type - Expected: {notification_type}, Actual: {actual_notification_type}") |
if notification_type != (actual_notification_type := get_value(host_details, "notificationType", default_value)): | ||
self.result.is_failure(f"{host} - Incorrect notification type - Expected: {notification_type} Actual: {actual_notification_type}") | ||
|
||
# If actual udp port do not matches the expected value, test fails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# If actual udp port do not matches the expected value, test fails. | |
# If actual UDP port does not match the expected value, test fails. |
|
||
# If actual udp port do not matches the expected value, test fails. | ||
if udp_port != (actual_udp_port := get_value(host_details, "port", default_value)): | ||
self.result.is_failure(f"{host} - Incorrect UDP port - Expected: {udp_port} Actual: {actual_udp_port}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.result.is_failure(f"{host} - Incorrect UDP port - Expected: {udp_port} Actual: {actual_udp_port}") | |
self.result.is_failure(f"{host} - Incorrect UDP port - Expected: {udp_port}, Actual: {actual_udp_port}") |
user_found = user != (actual_user := get_value(host_details, "v3Params.user", default_value)) | ||
version_user_check = (version == "v3", user_found) | ||
|
||
# If SNMP protocol version is v1 or v2c and actual community string do not matches the expected value, test fails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# If SNMP protocol version is v1 or v2c and actual community string do not matches the expected value, test fails. | |
# If SNMP protocol version is v1 or v2c and actual community string does not match the expected value, test fails. |
if version in ["v1", "v2c"] and community_string != (actual_community_string := get_value(host_details, "v1v2cParams.communityString", default_value)): | ||
self.result.is_failure(f"{host} Version: {version} - Incorrect community string - Expected: {community_string} Actual: {actual_community_string}") | ||
|
||
# If SNMP protocol version is v3 and actual user do not matches the expected value, test fails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# If SNMP protocol version is v3 and actual user do not matches the expected value, test fails. | |
# If SNMP protocol version is v3 and actual user does not match the expected value, test fails. |
Description
Verifies the SNMP notification host (SNMP manager) configurations.
Fixes #822
Checklist:
pre-commit run
)tox -e testenv
)