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

feat(anta.tests): New VXLAN tests #431

Merged

Conversation

carl-baillargeon
Copy link
Contributor

Description

New VXLAN tests:

  • VerifyVxlanVniBinding
  • VerifyVxlanVtep

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)

@gmuloc gmuloc added this to the v0.11.0 milestone Oct 17, 2023
Comment on lines 120 to 128
vlan_ = vxlan1["vniBindings"][vni]["vlan"]
elif vni in vxlan1["vniBindingsToVrf"]:
vlan_ = vxlan1["vniBindingsToVrf"][vni]["vlan"]
else:
no_binding.append(vni)
vlan_ = None

if vlan_ and vlan != vlan_:
wrong_binding.append({vni: vlan_})
Copy link
Collaborator

Choose a reason for hiding this comment

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

change vlan_ with retrieved_vlan or something similar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 60aa011

Comment on lines 164 to 166
if len(vteps := vxlan1["vteps"]) == 0:
self.result.is_failure("Vxlan1 interface has no VTEP")
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

what if input.vteps is an empty list ? Maybe someone wants to verify there is no VTEP peers :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 60aa011

@@ -303,7 +303,7 @@
"test": VerifyVxlanVtep,
"eos_data": [{"vteps": {}, "interfaces": {"Vxlan1": {"vteps": ["10.1.1.5", "10.1.1.6"]}}}],
"inputs": {"vteps": []},
"expected": {"result": "failure", "messages": ["Unexpected VTEP peer(s) on Vxlan1 interface: {'10.1.1.5', '10.1.1.6'}"]},
"expected": {"result": "failure", "messages": ["Unexpected VTEP peer(s) on Vxlan1 interface: {'10.1.1.6', '10.1.1.5'}"]},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did the order change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah damn I am using sets that's why CI is failing sometimes...

@carl-baillargeon carl-baillargeon merged commit 4f0e242 into aristanetworks:main Oct 17, 2023
17 checks passed
@carl-baillargeon carl-baillargeon deleted the feat/new-vxlan-tests branch May 18, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants