-
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 interface speed #552
Conversation
anta/tests/interfaces.py
Outdated
|
||
# Collecting actual interface details | ||
actual_interface_output = { | ||
"auto negotiation": auto_negotiation if "auto" in interface.speed else "None", |
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.
"None" need to replace with Null
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.
Why are you using "None"? It looks wrong no?
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.
To create a generalize dict of actual and expected speed details of various type of speeds i used "None" in case that parameter is not needed for verification. For example if speed is 100g-4 in that case we dont need to validate auto negotiation hence updating auto negotiation key as None in both actual and expected output. So while comparing both actual and expected parameters match. I know if speed is 100g-4 in that case we should not define auto negotiation in actual and expected output but to achieve this we will have multiple condition for each type.
Let me know in case we need to change it.
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.
If we need a string let's put N/A
anta/tests/interfaces.py
Outdated
|
||
# Collecting actual interface details | ||
actual_interface_output = { | ||
"auto negotiation": auto_negotiation if "auto" in interface.speed else "None", |
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.
Why are you using "None"? It looks wrong no?
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. |
anta/tests/interfaces.py
Outdated
|
||
# Collecting actual interface details | ||
actual_interface_output = { | ||
"auto negotiation": auto_negotiation if "auto" in interface.speed else "None", |
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.
If we need a string let's put N/A
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. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
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. |
anta/tests/interfaces.py
Outdated
- If the speed is set to auto with a value (e.g., 'auto 10g'), the class verifies that auto-negotiation is successful, | ||
the mode is set to full duplex, and the speed/lanes match the input. | ||
- If the speed is set with a lane value (e.g., '100g-8'), the class verifies that the mode is set to full duplex and | ||
the speed/lanes match the input. |
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.
Does this still reflect the latest changes?
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. Thanks
anta/tests/interfaces.py
Outdated
* Success: The test will pass if an interface is configured correctly with the specified speed, lanes, auto-negotiation status, and mode. | ||
* Failure: The test will fail if an interface is not found, or if the speed, lanes, auto-negotiation status, or mode do not match the input. |
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 don't think this reflects the latest changes since duplex mode is not an input anymore?
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. Thanks
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.
Small adjustments for docstrings otherwise LGTM. Tested locally.
Description
Added testcase to verify the interface speed.
Verifies the speed, lanes, auto-negotiation status, and mode as full duplex for interfaces.
Fixes #542
Checklist:
pre-commit run
)tox -e testenv
)