ansible/test/integration/targets/nxos_lldp_global/tests/cli/replaced.yml
Adharsh Srivats R ee05d6bde2 Added nxos_lldp_global resource module (#60072)
* Added nxos_lldp_global module

Tests

Correction

remove q

* Added tests

* Corrections

Changes

Last few changes please

Final

Finall

Finalll

* Key error and punctuation changes

* .gitignore edit

* Facts file edit

* Changed facts collection and 'replaced' state

Changed facts collection and replaced state

Changed facts collection and replaced state

* Spacing and module error correction

* return facts as empty dict not list

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2019-08-27 14:52:24 +05:30

70 lines
1.8 KiB
YAML

---
- debug:
msg: "Start nxos_lldp_global replaced integration tests connection = {{ansible_connection}}"
- name: Enable lldp feature
nxos_feature:
feature: lldp
state: enabled
- block:
- name: Setup
cli_config:
config: |
lldp holdtime 125
lldp portid-subtype 1
lldp tlv-select system-name
no lldp tlv-select port-vlan
no lldp tlv-select power-management
- name: Replaced
nxos_lldp_global: &replaced
config:
holdtime: 125
timer: 35
tlv_select:
system:
name: false
description: false
port:
vlan: false
dcbxp: false
state: replaced
register: result
- assert:
that:
- "result.changed == true"
- "'lldp timer 35' in result.commands"
- "'lldp tlv-select power-management' in result.commands"
- "'no lldp portid-subtype 1' in result.commands"
- "'no lldp tlv-select system-name' in result.commands"
- "'no lldp tlv-select system-description' in result.commands"
- "'no lldp tlv-select dcbxp' in result.commands"
- "result.commands|length == 6"
- name: Gather lldp_global post facts
nxos_facts:
gather_subset:
- '!all'
- '!min'
gather_network_resources: lldp_global
- assert:
that:
- "ansible_facts.network_resources.lldp_global == result.after"
- name: Idempotence - Replaced
nxos_lldp_global: *replaced
register: result
- assert:
that:
- "result.changed == false"
- "result.commands|length == 0"
always:
- name: teardown
nxos_feature:
feature: lldp
state: disabled