diff --git a/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-missing-evpn-multicast-l3-with-pim.yml b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-missing-evpn-multicast-l3-with-pim.yml index e7f30f7ab60..cdd741458d1 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-missing-evpn-multicast-l3-with-pim.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-missing-evpn-multicast-l3-with-pim.yml @@ -42,4 +42,5 @@ tenants: enabled: true expected_error_message: >- - 'pim: enabled' set on l3_interface 'Ethernet1' on 'failure-missing-evpn-multicast-l3-with-pim' requires evpn_l3_multicast: enabled: true under VRF 'Tenant_A_OP_Zone_MC' or Tenant 'FABRIC' + 'pim: enabled' set on l3_interface 'Ethernet1' on 'failure-missing-evpn-multicast-l3-with-pim' + requires 'evpn_l3_multicast.enabled: true' under VRF 'Tenant_A_OP_Zone_MC' or Tenant 'FABRIC' diff --git a/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-missing-evpn-multicast-with-pim.yml b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-missing-evpn-multicast-with-pim.yml new file mode 100644 index 00000000000..5331621e5ed --- /dev/null +++ b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/host_vars/failure-missing-evpn-multicast-with-pim.yml @@ -0,0 +1,48 @@ +type: l3leaf +underlay_multicast: true +# When this is set to false, the VRF won't have evpn_l3_multicast enabled +# and PIM will fail +evpn_multicast: false + +l3leaf: + defaults: + # LOOPBACK AND VTEP MANAGEMENT + loopback_ipv4_pool: 10.10.0.0/24 + vtep_loopback_ipv4_pool: 10.11.0.0/24 + vtep_loopback: Loopback1 + nodes: + - name: failure-missing-evpn-multicast-with-pim + id: 3 + bgp_as: 65101 + filter: + tags: ['evpn-multicast-pegs'] + +tenants: + - name: FABRIC + mac_vrf_vni_base: 10000 + evpn_l3_multicast: + enabled: true + evpn_underlay_l3_multicast_group_ipv4_pool: 232.0.0.0/20 + vrfs: + - name: Tenant_A_OP_Zone_MC + description: "Tenant_A_OP_Zone" + vrf_vni: 10 + vtep_diagnostic: + loopback: 31 + loopback_ip_range: 10.255.1.0/24 + svis: + - id: 210 + name: Tenant_A_OP_Zone_1 + tags: ['evpn-multicast-l3'] + l3_interfaces: + - nodes: [ failure-missing-evpn-multicast-with-pim ] + interfaces: [ Ethernet1 ] + ip_addresses: [ 10.254.248.0/31 ] + descriptions: [ "L3 Link to RPs" ] + enabled: true + pim: + enabled: true + +expected_error_message: >- + 'pim: enabled' set on l3_interface 'Ethernet1' on 'failure-missing-evpn-multicast-with-pim' + requires 'evpn_multicast: true' at the fabric level diff --git a/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml index ebe5116c2d7..a5a4b58d768 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_negative_unit_tests/inventory/hosts.yml @@ -96,6 +96,7 @@ all: failure-missing-evpn-vlan-bundle_svi: failure-missing-evpn-multicast-l3-with-pim: failure-missing-evpn-multicast-peg-rps: + failure-missing-evpn-multicast-with-pim: failure-duplicate-evpn-vlan-bundle-name: failure-no-local-path-group-in-default-policy: ipv4-acl-in-missing-on-wan-interface: diff --git a/python-avd/pyavd/_eos_designs/structured_config/network_services/ethernet_interfaces.py b/python-avd/pyavd/_eos_designs/structured_config/network_services/ethernet_interfaces.py index dfb6251ef4a..b763346b6ac 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/network_services/ethernet_interfaces.py +++ b/python-avd/pyavd/_eos_designs/structured_config/network_services/ethernet_interfaces.py @@ -132,10 +132,18 @@ def ethernet_interfaces(self: AvdStructuredConfigNetworkServices) -> list | None if get(l3_interface, "pim.enabled"): if not vrf.get("_evpn_l3_multicast_enabled"): - raise AristaAvdError( - f"'pim: enabled' set on l3_interface '{interface_name}' on '{self.shared_utils.hostname}' requires evpn_l3_multicast:" - f" enabled: true under VRF '{vrf['name']}' or Tenant '{tenant['name']}'" - ) + # Possibly the key was not set because `evpn_multicast` is not set to `true`. + if not self.shared_utils.evpn_multicast: + msg = ( + f"'pim: enabled' set on l3_interface '{interface_name}' on '{self.shared_utils.hostname}' requires " + "'evpn_multicast: true' at the fabric level" + ) + else: + msg = ( + f"'pim: enabled' set on l3_interface '{interface_name}' on '{self.shared_utils.hostname}' requires " + f"'evpn_l3_multicast.enabled: true' under VRF '{vrf['name']}' or Tenant '{tenant['name']}'" + ) + raise AristaAvdError(msg) if not vrf.get("_pim_rp_addresses"): raise AristaAvdError(