4ac89b8ac7
* Added Integration tests * Corrected lint errors * Added fix for bug # 54400 * Revert "Added fix for bug # 54400" This reverts commitbf42db4269
. * Revert "Adding files for RM static_routes" This reverts commitdafdd92d43
. * Revert "Added Integration tests" This reverts commit129dc87682
. * Bug Fix 65332 * Added testcase for #66517 * Removed unnecessary commit * fixing conflicts * fixing conflicts * addressed mikeweibe's comments * Corrected lint errors * Added idempotent tc for add vlans * Added replaced and overridded tcs for trunk vlan add
99 lines
2.3 KiB
YAML
99 lines
2.3 KiB
YAML
---
|
|
- debug:
|
|
msg: "Start nxos_l2_interfaces merged integration tests connection={{ ansible_connection }}"
|
|
|
|
- set_fact: test_int1="{{ nxos_int1 }}"
|
|
|
|
- name: setup
|
|
cli_config: &cleanup
|
|
config: |
|
|
default interface {{ test_int1 }}
|
|
ignore_errors: yes
|
|
|
|
- block:
|
|
- name: setup2
|
|
cli_config:
|
|
config: |
|
|
interface {{ test_int1 }}
|
|
switchport
|
|
|
|
- name: Merged
|
|
nxos_l2_interfaces: &merged
|
|
config:
|
|
- name: "{{ test_int1 }}"
|
|
access:
|
|
vlan: 6
|
|
trunk:
|
|
allowed_vlans: 200
|
|
state: merged
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- "result.before|length == 0"
|
|
- "'interface {{ test_int1 }}' in result.commands"
|
|
- "'switchport access vlan 6' in result.commands"
|
|
- "result.commands|length == 3"
|
|
|
|
- name: Gather l2_interfaces facts
|
|
nxos_facts:
|
|
gather_subset:
|
|
- '!all'
|
|
- '!min'
|
|
gather_network_resources: l2_interfaces
|
|
|
|
- assert:
|
|
that:
|
|
- "ansible_facts.network_resources.l2_interfaces|symmetric_difference(result.after)|length == 0"
|
|
|
|
- name: Idempotence - Merged
|
|
nxos_l2_interfaces: *merged
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
- "result.commands|length == 0"
|
|
|
|
- name: Merge with existing vlans
|
|
nxos_l2_interfaces: &vlanadd
|
|
config:
|
|
- name: "{{ test_int1 }}"
|
|
trunk:
|
|
allowed_vlans: "10-12"
|
|
state: merged
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- "'interface {{ test_int1 }}' in result.commands"
|
|
- "'switchport trunk allowed vlan add 10,11,12' in result.commands"
|
|
- "result.commands|length == 2"
|
|
|
|
- name: Gather l2_interfaces facts
|
|
nxos_facts:
|
|
gather_subset:
|
|
- '!all'
|
|
- '!min'
|
|
gather_network_resources: l2_interfaces
|
|
|
|
- assert:
|
|
that:
|
|
- "ansible_facts.network_resources.l2_interfaces|symmetric_difference(result.after)|length == 0"
|
|
|
|
- name: Idempotence - with newly added vlans
|
|
nxos_l2_interfaces: *vlanadd
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
- "result.commands|length == 0"
|
|
|
|
|
|
always:
|
|
- name: teardown
|
|
cli_config: *cleanup
|
|
ignore_errors: yes
|