8000 feat(anta.tests): Added testcase to verify vlan internal allocation policy by MaheshGSLAB · Pull Request #528 · aristanetworks/anta · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(anta.tests): Added testcase to verify vlan internal allocation policy #528

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 5 commits into from
Feb 23, 2024

Conversation

MaheshGSLAB
Copy link
Collaborator
@MaheshGSLAB MaheshGSLAB commented Jan 17, 2024

Description

Added testcase to verify vlan internal allocation policy.

success: The test will pass if the VLAN internal allocation policy is either ascending or descending and the VLANs are within the specified range.

failure: The test will fail if the VLAN internal allocation policy is neither ascending nor descending or the VLANs are outside the specified range.

Fixes #527

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 self-assigned this Jan 17, 2024
@MaheshGSLAB MaheshGSLAB marked this pull request as ready for review January 17, 2024 07:36
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 vlan.py is a new module, you need to create the documentation: anta/docs/api/tests.vlan.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]
VlanPolicy = Literal["ascending", "descending"]
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 custom type will be reused in another test so you can specify the type directly in the model.

class Input(AntaTest.Input):
"""Inputs for the VerifyVlanInternalPolicy test."""

policy: VlanPolicy
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
policy: VlanPolicy
policy: Literal["ascending", "descending"]

# 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.vlan.py

Copy link
Contributor

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

@@ -27,6 +27,7 @@ This section describes all the available tests provided by ANTA package.
- [Software](tests.software.md)
- [STP](tests.stp.md)
- [System](tests.system.md)
- [Vlan](tests.vlan.md)
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
- [Vlan](tests.vlan.md)
- [VLAN](tests.vlan.md)

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

@carl-baillargeon carl-baillargeon merged commit 0871246 into aristanetworks:main Feb 23, 2024
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 test case to verify the internal VLAN allocation
2 participants
0