Skip to content
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 DNS ip name server #537

Merged
merged 4 commits into from
Feb 23, 2024

Conversation

MaheshGSLAB
Copy link
Contributor

Description

Added testcase to verify DNS ip name server

Fixes #535

  • success: The test will pass if the DNS server specified in the input is configured with the correct VRF and priority.
  • failure: The test will fail if the DNS server is not configured or if the VRF and priority of the DNS server do not match the input.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have run pre-commit for code linting and typing (pre-commit run)
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (tox -e testenv)

@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review January 22, 2024 10:22
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Contributor

@carl-baillargeon carl-baillargeon left a 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

@@ -66,3 +66,4 @@ def interface_case_sensitivity(v: str) -> str:
EncryptionAlgorithm = Literal["RSA", "ECDSA"]
RsaKeySize = Literal[2048, 3072, 4096]
EcdsaKeySize = Literal[256, 384, 521]
DnsServerPriority = Annotated[int, Field(ge=0, le=4)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt this will be used in another test so you can use it directly in the model.

Suggested change
DnsServerPriority = Annotated[int, Field(ge=0, le=4)]

"""The IPv4/IPv6 address of the DNS server."""
vrf: str = "default"
"""The VRF for the DNS server. Defaults to 'default' if not provided."""
priority: DnsServerPriority
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
priority: DnsServerPriority
priority: int = Field(ge=0, le=4)

vrf: str = "default"
"""The VRF for the DNS server. Defaults to 'default' if not provided."""
priority: DnsServerPriority
"""The priority of the DNS server."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""The priority of the DNS server."""
"""The priority of the DNS server from 0 to 4, lower is first."""

# 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tests for anta.tests.security.py
Tests for anta.tests.services.py

anta/tests/services.py Show resolved Hide resolved
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link
Contributor

github-actions bot commented Feb 7, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Contributor

@carl-baillargeon carl-baillargeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@carl-baillargeon carl-baillargeon merged commit 0f0f1a9 into aristanetworks:main Feb 23, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the testcase to verify DNS status
2 participants