-
Couldn't load subscription status.
- Fork 257
Feat(anta_runner): Vxlan1 being down is failing VerifyInterfacesStatus when no tenants are defined #6005
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
base: devel
Are you sure you want to change the base?
Feat(anta_runner): Vxlan1 being down is failing VerifyInterfacesStatus when no tenants are defined #6005
Conversation
…s when no tenants are defined
|
Review docs on Read the Docs To test this pull request: # Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-6005
# Activate the virtual environment
source test-avd-pr-6005/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/vitthalmagadum/avd.git@anta_runner/vxlan#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/vitthalmagadum/avd.git#/ansible_collections/arista/avd/,anta_runner/vxlan --force
# Optional: Install AVD examples
cd test-avd-pr-6005
ansible-playbook arista.avd.install_examples |
d3ae7a1 to
774e72b
Compare
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
1 similar comment
|
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. |
fdbd3c0 to
03a310d
Compare
...sta/avd/extensions/molecule/anta_runner/anta/avd_catalogs/allow_bgp_vrfs_run/dc1-spine1.json
Outdated
Show resolved
Hide resolved
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, just update the host vars custom structure config comment more descriptive about what we are testing so in future we dont need to look what is the test for.
|
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. |
|
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. |
| if self.device.is_vtep: | ||
| interfaces.append(InterfaceState(name="Vxlan1", status="up")) | ||
| if self.structured_config.vxlan_interface.vxlan1.vxlan.shutdown: | ||
| interfaces.append(InterfaceState(name="Vxlan1", status="down")) |
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.
| interfaces.append(InterfaceState(name="Vxlan1", status="down")) | |
| interfaces.append(InterfaceState(name="Vxlan1", status="adminDown")) |
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!!
| self.logger_adapter.debug( | ||
| LogMessage.SOURCE_INTERFACE_SHUTDOWN, interface="Vxlan1", source_interface=self.device.vxlan_source_interface_status.name | ||
| ) | ||
| elif not self.structured_config.vxlan_interface.vxlan1.vxlan.vlans and not self.structured_config.vxlan_interface.vxlan1.vxlan.vrfs: |
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 also need to check for vlan_range.
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 check. Thanks!!
| LogMessage.SOURCE_INTERFACE_SHUTDOWN, interface="Vxlan1", source_interface=self.device.vxlan_source_interface_status.name | ||
| ) | ||
| elif not self.structured_config.vxlan_interface.vxlan1.vxlan.vlans and not self.structured_config.vxlan_interface.vxlan1.vxlan.vrfs: | ||
| self.logger_adapter.debug(LogMessage.VNI_NOT_CONFIGURED, interface="Vxlan1") |
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.
See if you can use the existing LogMessage.INPUT_MISSING_FIELDS.
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 might lose the original message here.
| interfaces.append(InterfaceState(name="Vxlan1", status="up")) | ||
| if self.structured_config.vxlan_interface.vxlan1.vxlan.shutdown: | ||
| interfaces.append(InterfaceState(name="Vxlan1", status="down")) | ||
| elif self.device.vxlan_source_interface_status and self.device.vxlan_source_interface_status.shutdown: |
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.
Since we don't need this in other tests, let's just use a small helper function in AntaTestInputFactory to check if the Loopback (or DPS) interface is not shutdown. The helper could return a bool.
The VXLAN interface will also be down if an IP address is not configured on the source interface so we need to check if the Loopback (or DPS) has ip_address configured or ipv6_address if the VXLAN encapsulation is IPv6 (vxlan_interface.vxlan1.vxlan.encapsulations.ipv6).
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 this checks inside helper. Thanks!!
|



Change Summary
Vxlan1 being down is failing VerifyInterfacesStatus when no tenants are defined
Related Issue(s)
Fixes #5880
Component(s) name
arista.avd.anta_runnerProposed changes
Vxlan1 being down is failing VerifyInterfacesStatus when no tenants are defined
How to test
run molecule
Checklist
User Checklist
Repository Checklist