-
Notifications
You must be signed in to change notification settings - Fork 29
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
fix(anta.tests): VerifySpecificPath testcase with the latest changes #965
base: main
Are you sure you want to change the base?
fix(anta.tests): VerifySpecificPath testcase with the latest changes #965
Conversation
CodSpeed Performance ReportMerging #965 will not alter performanceComparing Summary
|
anta/tests/path_selection.py
Outdated
path_group_details = get_value(peer_details, f"dpsGroups..{path_group}..dpsPaths", separator="..") | ||
# If the expected pathgroup is not found for the peer, the test fails. | ||
if not path_group_details: | ||
self.result.is_failure(f"{router_path} - Path-group not found") |
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.
self.result.is_failure(f"{router_path} - Path-group not found") | |
self.result.is_failure(f"{router_path} - DPS paths not found") |
anta/tests/path_selection.py
Outdated
path_data = next((path for path in path_group_details.values() if (path.get("source") == source and path.get("destination") == destination)), None) | ||
# If the expected and actual source and destion address of the pathgroup are not matched, test fails. | ||
if not path_data: | ||
self.result.is_failure(f"{router_path} - Source and/or Destination address not found") |
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.
self.result.is_failure(f"{router_path} - Source and/or Destination address not found") | |
self.result.is_failure(f"{router_path} - path not found") |
anta/tests/path_selection.py
Outdated
if path_state not in ["ipsecEstablished", "routeResolved"]: | ||
self.result.is_failure(f"Path state for `peer: {peer} source: {source} destination: {destination}` in path-group {path_group} is `{path_state}`.") | ||
if path_state not in expected_state: | ||
self.result.is_failure(f"{router_path} - Incorrect path state - Expected: {' or '.join(expected_state)} Actual: {path_state}") |
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.
We can use comma(,) to join. Please ensure the CSV report once.
anta/tests/path_selection.py
Outdated
self.result.is_failure( | ||
f"Telemetry state for path `peer: {peer} source: {source} destination: {destination}` in path-group {path_group} is `inactive`." | ||
) | ||
self.result.is_failure(f"{router_path} - Incorrect telemetry state - Expected: active Actual: inactive") |
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.
self.result.is_failure(f"{router_path} - Incorrect telemetry state - Expected: active Actual: inactive") | |
self.result.is_failure(f"{router_path} - Telemetry state inactive") |
anta/tests/path_selection.py
Outdated
@@ -70,16 +68,21 @@ def test(self) -> None: | |||
|
|||
|
|||
class VerifySpecificPath(AntaTest): | |||
"""Verifies the path and telemetry state of a specific path for an IPv4 peer under router path-selection. | |||
"""Verifies the path and telemetry state of a specific path for an IPv4 peer. |
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 path and telemetry state of a specific path for an IPv4 peer. | |
"""Verifies the DPS path and telemetry state of an IPv4 peer. |
Quality Gate passedIssues Measures |
Description
Refactoring PathSelection (VerifySpecificPath) tests module to address the following issues:
Checklist:
pre-commit run
)tox -e testenv
)