-
Notifications
You must be signed in to change notification settings - Fork 34
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
Conversation
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
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 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
anta/custom_types.py
Outdated
@@ -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"] |
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.
I doubt this custom type will be reused in another test so you can specify the type directly in the model.
anta/tests/vlan.py
Outdated
class Input(AntaTest.Input): | ||
"""Inputs for the VerifyVlanInternalPolicy test.""" | ||
|
||
policy: VlanPolicy |
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.
policy: VlanPolicy | |
policy: Literal["ascending", "descending"] |
tests/units/anta_tests/test_vlan.py
Outdated
# 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.vlan.py |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
docs/api/tests.md
Outdated
@@ -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) |
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.
- [Vlan](tests.vlan.md) | |
- [VLAN](tests.vlan.md) |
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 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:
pre-commit run
)tox -e testenv
)