Skip to content
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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

geetanjalimanegslab
Copy link
Collaborator

@geetanjalimanegslab geetanjalimanegslab commented Dec 13, 2024

Description

Refactoring PathSelection (VerifySpecificPath) tests module to address the following issues:

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)

Copy link

codspeed-hq bot commented Dec 13, 2024

CodSpeed Performance Report

Merging #965 will not alter performance

Comparing geetanjalimanegslab:feat_verify_route_path (85a60fa) with main (2a0bf6c)

Summary

✅ 22 untouched benchmarks

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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.result.is_failure(f"{router_path} - Path-group not found")
self.result.is_failure(f"{router_path} - DPS paths not found")

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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.result.is_failure(f"{router_path} - Source and/or Destination address not found")
self.result.is_failure(f"{router_path} - path not found")

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}")
Copy link
Collaborator

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.

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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.result.is_failure(f"{router_path} - Incorrect telemetry state - Expected: active Actual: inactive")
self.result.is_failure(f"{router_path} - Telemetry state inactive")

@@ -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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants