ansible/test/integration/targets/nxos_hsrp_interfaces/tests/cli/merged.yaml
Chris Van Heuveln 351f60b0e1 nxos_hsrp_interfaces: new module (#61498)
* nxos_hsrp_interfaces: new module

* lint 1

* lint 2

* add normalize_interfaces

* change version /2.9/2.10/

* /2.10/"2.10"/
2019-11-06 15:40:39 +05:30

65 lines
1.5 KiB
YAML

---
- debug:
msg: "Start nxos_hsrp_interfaces merged integration tests connection={{ ansible_connection }}"
- set_fact: test_int1="{{ nxos_int1 }}"
- set_fact: test_int2="{{ nxos_int2 }}"
- set_fact:
bfd_enable: enable
bfd_disable: disable
when: platform is not search('N35')
- block:
- name: setup1
cli_config: &setup_teardown
config: |
no feature bfd
no feature hsrp
default interface {{ test_int1 }}
default interface {{ test_int2 }}
- name: setup2
cli_config:
config: |
feature bfd
feature hsrp
interface {{ test_int1 }}
no switchport
hsrp bfd
interface {{ test_int2 }}
no switchport
- name: Merged
nxos_hsrp_interfaces: &merged
config:
- name: "{{ test_int1 }}"
bfd: "{{ bfd_disable|default(omit)}}"
state: merged
register: result
- assert:
that:
- "result.changed == true"
- "'no hsrp bfd' in result.commands"
msg: "Assert failed. 'result.commands': {{ result.commands }}"
- name: Gather hsrp_interfaces facts
nxos_facts:
gather_subset:
- '!all'
- '!min'
gather_network_resources: hsrp_interfaces
- name: Idempotence - Merged
nxos_hsrp_interfaces: *merged
register: result
- assert:
that:
- "result.changed == false"
- "result.commands|length == 0"
when: bfd_enable is defined
always:
- name: teardown
cli_config: *setup_teardown