-
Notifications
You must be signed in to change notification settings - Fork 23
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 vxlan1 source interface and udp port #554
Conversation
anta/custom_types.py
Outdated
@@ -85,6 +85,12 @@ def bgp_multiprotocol_capabilities_abbreviations(value: str) -> str: | |||
BeforeValidator(interface_autocomplete), | |||
BeforeValidator(interface_case_sensitivity), | |||
] | |||
VxlanSrcIntf = Annotated[ | |||
str, | |||
Field(pattern=r"^(Loopback)[0-9]+$"), |
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.
As loopback support 0-8191 so need to update the patter.
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.
Yes and please move this to the test itself. I doubt it will be used elsewhere.
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.
Oh never mind! I saw you added extra validators.
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.
Updated the custom type. Please take a look once.
@carl-baillargeon
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 after minor changes to docstrings and comments.
Thx Mahesh :)
anta/custom_types.py
Outdated
@@ -85,6 +85,12 @@ def bgp_multiprotocol_capabilities_abbreviations(value: str) -> str: | |||
BeforeValidator(interface_autocomplete), | |||
BeforeValidator(interface_case_sensitivity), | |||
] | |||
VxlanSrcIntf = Annotated[ | |||
str, | |||
Field(pattern=r"^(Loopback)[0-9]+$"), |
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.
Yes and please move this to the test itself. I doubt it will be used elsewhere.
anta/custom_types.py
Outdated
@@ -85,6 +85,12 @@ def bgp_multiprotocol_capabilities_abbreviations(value: str) -> str: | |||
BeforeValidator(interface_autocomplete), | |||
BeforeValidator(interface_case_sensitivity), | |||
] | |||
VxlanSrcIntf = Annotated[ | |||
str, | |||
Field(pattern=r"^(Loopback)[0-9]+$"), |
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.
Oh never mind! I saw you added extra validators.
anta/tests/vxlan.py
Outdated
|
||
class VerifyVxlan1ConnSettings(AntaTest): | ||
""" | ||
Verifies the VXLAN source interface and 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.
Verifies the VXLAN source interface and UDP port. | |
Verifies the interface vxlan1 source interface and UDP port. |
anta/tests/vxlan.py
Outdated
Verifies the VXLAN source interface and UDP port. | ||
|
||
Expected Results: | ||
* success: Passes if VXLAN source interface and UDP port are correct. |
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.
* success: Passes if VXLAN source interface and UDP port are correct. | |
* success: Passes if the interface vxlan1 source interface and UDP port are correct. |
anta/tests/vxlan.py
Outdated
|
||
Expected Results: | ||
* success: Passes if VXLAN source interface and UDP port are correct. | ||
* failure: Fails if VXLAN source interface or UDP port are incorrect. |
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.
* failure: Fails if VXLAN source interface or UDP port are incorrect. | |
* failure: Fails if the interface vxlan1 source interface or UDP port are incorrect. |
anta/tests/vxlan.py
Outdated
""" | ||
|
||
name = "VerifyVxlan1ConnSettings" | ||
description = "Verifies the VXLAN source interface and 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.
description = "Verifies the VXLAN source interface and UDP port" | |
description = "Verifies the interface vxlan1 source interface and UDP port." |
anta/tests/vxlan.py
Outdated
source_interface: VxlanSrcIntf | ||
"""Source loopback interface of vxlan1 interface""" | ||
udp_port: int = Field(ge=1024, le=65335) | ||
"""UDP port used for vxlan interface""" |
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.
"""UDP port used for vxlan interface""" | |
"""UDP port used for vxlan1 interface""" |
anta/custom_types.py
Outdated
@@ -23,16 +23,20 @@ def interface_autocomplete(v: str) -> str: | |||
|
|||
Supported alias: | |||
- `et`, `eth` will be changed to `Ethernet` | |||
- `po` will be changed to `Port-Channel`""" | |||
- `po` will be changed to `Port-Channel` | |||
- `lo`, `lb` will be changed to `Loopback`""" |
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.
lb
is not a valid EOS syntax:
DC1-LEAF1A(config-if-Et1)#int lb 0
% Invalid input
DC1-LEAF1A(config-if-Et1)#int lb0
% Invalid input
DC1-LEAF1A(config-if-Et1)#
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 vxlan1 source interface and udp port.
Fixes #553
Verifies the VXLAN source interface and UDP port.
Checklist:
pre-commit run
)tox -e testenv
)