ansible/test/integration/targets/eos_static_route/tests/cli/basic.yaml
Ganesh Nalawade 35acae7ea7
Fix eos integration test failure (#33407)
Fixes #33406
Fixes #33405

*  Fix typo in network_cli for sendonly
*  Send `abort` to remote device in case configuration fails
*  Fix indentation issue in eos_static_route integration test

*  Revert network_cli change
2017-11-30 20:47:05 +05:30

114 lines
2.8 KiB
YAML

---
- debug: msg="START cli/basic.yaml"
- name: setup - remove config used in test
eos_config:
lines:
- no ip route 192.168.3.0/24 192.168.0.1
- no ip route 192.168.4.0/24 192.168.0.1
- no ip route 192.168.5.0/24 192.168.0.1
authorize: yes
provider: "{{ cli }}"
- name: configure static route
eos_static_route: &single_route
address: 192.168.3.0/24
next_hop: 192.168.0.1
admin_distance: 2
authorize: yes
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "'ip route 192.168.3.0/24 192.168.0.1 2' in result.commands"
- name: configure static route(Idempotence)
eos_static_route: *single_route
register: result
- assert:
that:
- "result.changed == false"
- name: delete static route
eos_static_route: &delete_single
address: 192.168.3.0/24
next_hop: 192.168.0.1
admin_distance: 2
authorize: yes
provider: "{{ cli }}"
state: absent
register: result
- assert:
that:
- "result.changed == true"
- "'no ip route 192.168.3.0/24 192.168.0.1' in result.commands"
- name: delete static route
eos_static_route: *delete_single
register: result
- assert:
that:
- "result.changed == false"
- name: configure static routes using aggregate
eos_static_route: &configure_aggregate
aggregate:
- { address: 192.168.4.0/24, next_hop: 192.168.0.1 }
- { address: 192.168.5.0/24, next_hop: 192.168.0.1 }
authorize: yes
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "'ip route 192.168.4.0/24 192.168.0.1 1' in result.commands"
- "'ip route 192.168.5.0/24 192.168.0.1 1' in result.commands"
- name: configure static routes using aggregate(Idemporence)
eos_static_route: *configure_aggregate
register: result
- assert:
that:
- "result.changed == false"
- name: delete static routes using aggregate
eos_static_route: &delete_aggregate
aggregate:
- { address: 192.168.4.0/24, next_hop: 192.168.0.1 }
- { address: 192.168.5.0/24, next_hop: 192.168.0.1 }
authorize: yes
state: absent
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "'no ip route 192.168.4.0/24 192.168.0.1' in result.commands"
- "'no ip route 192.168.5.0/24 192.168.0.1' in result.commands"
- name: delete static routes using aggregate(Idempotence)
eos_static_route: *delete_aggregate
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
eos_config:
lines:
- no ip route 192.168.3.0/24 192.168.0.1
- no ip route 192.168.4.0/24 192.168.0.1
- no ip route 192.168.5.0/24 192.168.0.1
authorize: yes
provider: "{{ cli }}"
- debug: msg="END cli/basic.yaml"