ansible/test/integration/targets/eos_static_routes/tests/cli/gathered.yaml

76 lines
2 KiB
YAML
Raw Normal View History

---
- debug:
msg: "START eos_static_routes gathered integration tests on connection={{ ansible_connection }}"
- include_tasks: _remove_config.yaml
- include_tasks: _populate.yaml
- block:
- name: Gathered the provided configuration with the exisiting running configuration
eos_static_routes: &gathered
config:
state: gathered
become: yes
register: result
- set_fact:
config:
- address_families:
- afi: ipv4
routes:
- dest: 10.1.1.0/24
next_hops:
- interface: Management1
- admin_distance: 200
forward_router_address: 20.1.1.3
interface: Ethernet1
track: bfd
- dest: 10.50.0.0/16
next_hops:
- interface: Management1
- dest: 23.1.0.0/16
next_hops:
- nexthop_grp: testgrp
tag: 42
- afi: ipv6
routes:
- dest: 1000:10::/64
next_hops:
- admin_distance: 67
interface: Ethernet1
tag: 98
- address_families:
- afi: ipv4
routes:
- dest: 77.77.1.0/24
next_hops:
- interface: 33.1.1.1
vrf: vrftest1
- address_families:
- afi: ipv4
routes:
- dest: 120.1.1.0/24
next_hops:
- admin_distance: 23
interface: Ethernet1
vrf: testvrf
- name: Assert that gathered dicts was correctly generated
assert:
that:
- " config | symmetric_difference(result['gathered']) == []"
- name: Gather the existing running configuration (IDEMPOTENT)
eos_static_routes: *gathered
become: yes
register: result
- name: Assert that the previous task was idempotent
assert:
that:
- "result['changed'] == false"
always:
- include_tasks: _remove_config.yaml