ansible/test/integration/targets/nxos_static_route/tests/common/sanity.yaml
Nathaniel Case 82dfa542c2
Replace bogus (but routeable) ip addresses with RFC 5737 example addresses (#40554)
* Remove 1.1.1.1 from *_config tests

* remove from *_smoke and *_system

* Miscellaneous other tests

* Remove from module documentation as well

* Remove from unit tests as well

* Remove accidental duplication from rebase
2018-05-30 13:03:20 -04:00

131 lines
3 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_static_route sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- block:
- name: create static route
nxos_static_route: &configure
prefix: "192.168.20.64/24"
next_hop: "192.0.2.3"
route_name: testing
pref: 100
tag: 5500
vrf: "{{ item }}"
with_items: "{{ vrfs }}"
register: result
- assert: &true
that:
- "result.changed == true"
- name: "Conf Idempotence"
nxos_static_route: *configure
with_items: "{{ vrfs }}"
register: result
- assert: &false
that:
- "result.changed == false"
- name: change static route
nxos_static_route: &configure1
prefix: "192.168.20.64/24"
next_hop: "192.0.2.3"
route_name: default
pref: 10
tag: default
vrf: "{{ item }}"
with_items: "{{ vrfs }}"
register: result
- assert: *true
- name: "Conf1 Idempotence"
nxos_static_route: *configure1
with_items: "{{ vrfs }}"
register: result
- assert: *false
- name: remove static route
nxos_static_route: &remove
prefix: "192.168.20.64/24"
next_hop: "192.0.2.3"
route_name: testing
pref: 100
vrf: "{{ item }}"
state: absent
with_items: "{{ vrfs }}"
register: result
- assert: *true
- name: "Remove Idempotence"
nxos_static_route: *remove
with_items: "{{ vrfs }}"
register: result
- assert: *false
- name: configure static route(aggregate)
nxos_static_route: &conf_agg
aggregate:
- { prefix: "192.168.22.64/24", next_hop: "192.0.2.3" }
- { prefix: "192.168.24.64/24", next_hop: "192.0.2.3" }
register: result
- assert:
that:
- "result.changed == true"
- name: configure static route aggregate(Idempotence)
nxos_static_route: *conf_agg
register: result
- assert:
that:
- "result.changed == false"
- name: remove static route aggregate
nxos_static_route: &remove_agg
aggregate:
- { prefix: "192.168.22.64/24", next_hop: "192.0.2.3" }
- { prefix: "192.168.24.64/24", next_hop: "192.0.2.3" }
state: absent
register: result
- assert:
that:
- "result.changed == true"
- name: remove static route aggregate(Idempotence)
nxos_static_route: *remove_agg
register: result
- assert:
that:
- "result.changed == false"
always:
- name: remove static route
nxos_static_route:
prefix: "192.168.20.64/24"
next_hop: "192.0.2.3"
route_name: testing
pref: 100
tag: 5500
vrf: "{{ item }}"
state: absent
with_items: "{{ vrfs }}"
ignore_errors: yes
- name: remove static route aggregate
nxos_static_route:
aggregate:
- { prefix: "192.168.22.64/24", next_hop: "192.0.2.3" }
- { prefix: "192.168.24.64/24", next_hop: "192.0.2.3" }
state: absent
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_static_route sanity test"