Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(inventory): Add tag support to filter test execution (#112)
* feat(inventory): Add initial support for tags Add support for tags in inventory module as per issue #44 ```yaml anta_inventory: hosts: - host: 192.168.0.10 tags: [] - host: 192.168.0.11 tags: [] networks: - network: 192.168.110.0/24 tags: [] ranges: - start: 10.0.0.9 end: 10.0.0.11 tags: [] ``` * doc: Fix typo in docstring * feat(inventory): Add method to filter inventory per tags - Update inventory module to support tag filtering in get_inventory - Update check-devices.py to support tags Inventory example: ```yaml anta_inventory: hosts: - host: 192.168.0.10 tags: ['test'] - host: 192.168.0.11 tags: ['dc1'] - host: 192.168.0.12 tags: ['dc1'] - host: 192.168.0.13 tags: ['dc2'] - host: 192.168.0.14 - host: 192.168.0.15 - host: 10.73.252.11 tags: ['dc1'] ranges: - start: 10.73.252.12 end: 10.73.252.50 tags: ['clab'] ``` Code execution ```bash python scripts/check-devices.py -i .personal/avd-lab.yml -c .personal/ceos-catalog.yml --table --tags dc1 [08:07:43] INFO Inventory .personal/avd-lab.yml loaded check-devices.py INFO starting running test on inventory ... check-devices.p [08:07:44] INFO testing done ! All tests results ┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Device IP ┃ Test Name ┃ Test Status ┃ Message(s) ┃ ┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ 10.73.252.11 │ verify_eos_version │ failure │ device is running version 4.27.2F-26069621.4272F (engineering build) not in expected versions: ['4.25.4M', '4.26.1F'] │ │ 10.73.252.11 │ verify_field_notice_44_resolution │ skipped │ verify_field_notice_44_resolution test is not supported on cEOSLab. │ │ 10.73.252.11 │ verify_uptime │ success │ │ │ 10.73.252.11 │ verify_zerotouch │ success │ │ │ 10.73.252.11 │ verify_running_config_diffs │ success │ │ │ 10.73.252.11 │ verify_mlag_status │ success │ │ │ 10.73.252.11 │ verify_mlag_interfaces │ success │ │ │ 10.73.252.11 │ verify_mlag_config_sanity │ success │ │ │ 10.73.252.11 │ verify_routing_protocol_model │ success │ │ └──────────────┴───────────────────────────────────┴─────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ ``` * doc: Update rwith tag support
- Loading branch information