-
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.tests): Added testcase to verify domain name to IP address translation #534
Conversation
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.
Thanks Mahesh. Since services.py is a new module, you need to create the documentation: anta/docs/api/tests.services.md and add the section in anta/docs/api/tests.md.
Finally add your newly created MD file to mkdocs.yml. Double check the doc with mkdocs serve.
Thanks
anta/tests/services.py
Outdated
|
||
class VerifyDNSLookup(AntaTest): | ||
""" | ||
This class verifies the DNS(Domain name service) name to IP address translation. |
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.
This class verifies the DNS(Domain name service) name to IP address translation. | |
This class verifies the DNS (Domain name service) name to IP address translation. |
anta/tests/services.py
Outdated
domain = command.params["domain"] | ||
output = command.json_output["messages"][0] | ||
if f"Can't find {domain}: No answer" in output: | ||
self.result.is_failure(f"Domain {domain} is not resolved to an IP address.") |
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.
Can you add the failed domains in a list or set and have a single failure message like: The following domain(s) are not resolved to an IP address: google.ca, arista.com
anta/tests/services.py
Outdated
""" | ||
|
||
name = "VerifyDNSLookup" | ||
description = "Verifies the DNS(Domain name service) name to IP address translation." |
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.
description = "Verifies the DNS(Domain name service) name to IP address translation." | |
description = "Verifies the DNS (Domain name service) name to IP address translation." |
# Use of this source code is governed by the Apache License 2.0 | ||
# that can be found in the LICENSE file. | ||
""" | ||
Tests for anta.tests.security.py |
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.
Tests for anta.tests.security.py | |
Tests for anta.tests.services.py |
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. |
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.
LGTM
Description
Added testcase to verify domain name to IP address translation.
Fixes #533
Checklist:
pre-commit run
)tox -e testenv
)