ansible/test/integration/targets/nxos_lacp_interfaces/tests/cli/replaced.yaml
Trishna Guha 0acf7be56a
Add nxos_lacp_interfaces resource module (#60313)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2019-08-13 12:13:35 +05:30

62 lines
1.5 KiB
YAML

---
- debug:
msg: "Start nxos_lacp_interfaces replaced integration tests connection={{ ansible_connection }}"
- name: setup1
cli_config: &cleanup
config: |
no interface port-channel10
no feature lacp
- block:
- name: setup2
cli_config:
config: |
feature lacp
interface port-channel10
lacp min-links 5
- name: Gather lacp_interfaces facts
nxos_facts: &facts
gather_subset:
- '!all'
- '!min'
gather_network_resources: lacp_interfaces
- name: Replaced
nxos_lacp_interfaces: &replaced
config:
- name: port-channel10
links:
max: 10
state: replaced
register: result
- assert:
that:
- "ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.before)|length == 0"
- "result.changed == true"
- "'interface port-channel10' in result.commands"
- "'no lacp min-links' in result.commands"
- "'lacp max-bundle 10' in result.commands"
- "result.commands|length == 3"
- name: Gather lacp_interfaces post facts
nxos_facts: *facts
- assert:
that:
- "ansible_facts.network_resources.lacp_interfaces|symmetric_difference(result.after)|length == 0"
- name: Idempotence - Replaced
nxos_lacp_interfaces: *replaced
register: result
- assert:
that:
- "result.changed == false"
- "result.commands|length == 0"
always:
- name: teardown
cli_config: *cleanup