netascode / ansible-dc-vxlan

Ansible Collection for configuring a VXLAN Fabric using Direct to Controller (DTC) or Direct To Device (DTD) workflows.
https://galaxy.ansible.com/ui/repo/published/cisco/nac_dc_vxlan/
MIT License
6 stars 6 forks source link

Validate Interface attribute vrf Robot test fails for default VRF #159

Closed marehler closed 1 month ago

marehler commented 1 month ago

Sample configuration:

---
vxlan:
  topology:
    switches:
      - name: N9Kv-SPINE3
        <...>
        interfaces:
          - name: Ethernet1/3
            mode: routed

Robot test fails because NDFC returns "default" instead of "not_defined":

Verify Interface ('N9Kv-SPINE3', 'Ethernet1/3')                         
  Traceback (most recent call last):
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Users/marehler/nac-vxlan/ansible-dc-vxlan-example/tests/results/config/topology/interfaces.robot:32
    T:  Verify Interface ('N9Kv-SPINE3', 'Ethernet1/3')    
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Users/marehler/nac-vxlan/ansible-dc-vxlan-example/tests/results/config/topology/interfaces.robot:310
      Should Be Equal As Strings    ${api_interface_vrf}    not_defined    msg=vrf
      |  ${api_interface_vrf} = default (str)
______________________________________________________________________________
| FAIL |
vrf: default != not_defined

Root cause:

The NDFC API returns "INTF_VRF": "" for most interfaces, but "INTF_VRF": "default" for some interfaces changed by NaC VXLAN, although the interface VRF has not been modified and is actually the same i.e. "default".

I think the NDFC API behaves inconsistently. I suggest to modify the "Validate Interface attribute vrf" Robot test to either accept both "not_defined" or "default", or to simply validate non-default VRF configuration only.

mtarking commented 1 month ago

Discussed with @marehler and issue will be relocated.