network-unit-testing-system / nuts

NUTS defines a desired network state and checks it against a real network using pytest and nornir.
https://nuts.readthedocs.io/
MIT License
106 stars 5 forks source link

Vlans are not return in order #98

Closed marcom4rtinez closed 5 months ago

marcom4rtinez commented 5 months ago

https://github.com/network-unit-testing-system/nuts/blob/ac06b1c39565176ce2d7b9b3eeb24f41c89c8fd3/nuts/base_tests/napalm_get_vlans.py#L41-L43

The napalm vlan check doesnt return vlan in order. On some devices therefore the checks fail

@pytest.mark.nuts("vlan_tags")
    def test_no_rogue_vlans(self, single_result, vlan_tags):
>       assert list(single_result.result.keys()) == sorted(vlan_tags)
E       assert [1, 1198, 119...94, 1193, ...] == [1, 1193, 119...96, 1197, ...]
E         At index 1 diff: 1198 != 1193
E         Full diff:
E         - [1, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 4093, 4094]
E         + [1, 1198, 1199, 4093, 4094, 1193, 1195, 1194, 1197, 1196]