3ebc96e5c7
* (WIP) nxos_l3_interfaces: fix states, add new minor attributes * sa cleanup * more regression fixes * test_8 for add'l code coverage * Fix regressions to handle mgmt w/o IP * add 'no system default switchport' to regression setups * add err msg to terminal_stderr_re so that cli_config will catch L2 failures * regression test change: /int4/int3/ * Add default rsvd_intf_len for Zuul CI * Fix replaced-with-no-ipaddr and ip redirect issues
84 lines
2.3 KiB
YAML
84 lines
2.3 KiB
YAML
---
|
|
- debug:
|
|
msg: "Start nxos_l3_interfaces overridden integration tests connection={{ ansible_connection }}"
|
|
|
|
- set_fact: test_int1="{{ nxos_int1 }}"
|
|
- set_fact: test_int2="{{ nxos_int2 }}"
|
|
- set_fact: test_int3="{{ nxos_int3 }}"
|
|
|
|
- name: setup1
|
|
cli_config: &cleanup
|
|
config: |
|
|
no system default switchport
|
|
default interface {{ test_int1 }}
|
|
default interface {{ test_int2 }}
|
|
default interface {{ test_int3 }}
|
|
interface {{ test_int1 }}
|
|
no switchport
|
|
interface {{ test_int2 }}
|
|
no switchport
|
|
interface {{ test_int3 }}
|
|
no switchport
|
|
ignore_errors: yes
|
|
|
|
- name: setup2 cleanup all L3 states on all interfaces
|
|
nxos_l3_interfaces:
|
|
state: deleted
|
|
|
|
- block:
|
|
- name: setup3
|
|
cli_config:
|
|
config: |
|
|
interface {{ test_int1 }}
|
|
ip address 192.168.10.2/24 tag 5
|
|
interface {{ test_int2 }}
|
|
ip address 10.1.1.1/24
|
|
|
|
- name: Gather l3_interfaces facts
|
|
nxos_facts: &facts
|
|
gather_subset:
|
|
- '!all'
|
|
- '!min'
|
|
gather_network_resources: l3_interfaces
|
|
|
|
- name: Overridden
|
|
nxos_l3_interfaces: &overridden
|
|
config:
|
|
- name: "{{ test_int3 }}"
|
|
ipv4:
|
|
- address: 10.1.1.3/24
|
|
state: overridden
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.before|length == (ansible_facts.network_resources.l3_interfaces|length|int - rsvd_intf_len|int)"
|
|
- "result.changed == true"
|
|
- "'interface {{ test_int1 }}' in result.commands"
|
|
- "'no ip address' in result.commands"
|
|
- "'interface {{ test_int2 }}' in result.commands"
|
|
- "'no ip address' in result.commands"
|
|
- "'interface {{ test_int3 }}' in result.commands"
|
|
- "'ip address 10.1.1.3/24' in result.commands"
|
|
- "result.commands|length == 6"
|
|
|
|
- name: Gather l3_interfaces post facts
|
|
nxos_facts: *facts
|
|
|
|
- assert:
|
|
that:
|
|
- "result.after|length == (ansible_facts.network_resources.l3_interfaces|length|int - rsvd_intf_len|int)"
|
|
|
|
- name: Idempotence - Overridden
|
|
nxos_l3_interfaces: *overridden
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
- "result.commands|length == 0"
|
|
|
|
always:
|
|
- name: teardown
|
|
cli_config: *cleanup
|
|
ignore_errors: yes
|