2019-08-27 11:22:24 +02:00
|
|
|
---
|
|
|
|
- debug:
|
|
|
|
msg: "Start nxos_lldp_global deleted integration tests connection = {{ ansible_connection }}"
|
|
|
|
|
2019-11-06 11:11:40 +01:00
|
|
|
# N35 skips all tests, image issues.
|
2019-08-27 11:22:24 +02:00
|
|
|
- block:
|
2019-11-06 11:11:40 +01:00
|
|
|
- set_fact: cfg_port_id=True
|
|
|
|
when: platform is not search('N[567]K') and imagetag is not search("I[2345]")
|
|
|
|
|
|
|
|
- name: feature off to cleanup lldp
|
|
|
|
nxos_feature: &feature_off
|
|
|
|
feature: lldp
|
|
|
|
state: disabled
|
|
|
|
|
|
|
|
- name: Enable LLDP feature
|
|
|
|
nxos_feature:
|
|
|
|
feature: lldp
|
|
|
|
state: enabled
|
|
|
|
|
2019-08-27 11:22:24 +02:00
|
|
|
- name: Setup
|
|
|
|
cli_config:
|
|
|
|
config: |
|
|
|
|
lldp holdtime 125
|
|
|
|
lldp timer 32
|
2019-11-06 11:11:40 +01:00
|
|
|
no lldp tlv-select dcbxp
|
2019-08-27 11:22:24 +02:00
|
|
|
lldp tlv-select system-name
|
|
|
|
no lldp tlv-select system-description
|
2019-11-06 11:11:40 +01:00
|
|
|
|
|
|
|
- name: Setup2
|
|
|
|
cli_config:
|
|
|
|
config: |
|
|
|
|
lldp portid-subtype 1
|
|
|
|
no lldp tlv-select power-management
|
|
|
|
when: cfg_port_id is defined
|
2019-08-27 11:22:24 +02:00
|
|
|
|
|
|
|
- name: Gather lldp_global facts
|
|
|
|
nxos_facts: &facts
|
|
|
|
gather_subset:
|
|
|
|
- '!all'
|
|
|
|
- '!min'
|
|
|
|
gather_network_resources: lldp_global
|
|
|
|
|
|
|
|
- name: Deleted
|
|
|
|
nxos_lldp_global: &deleted
|
|
|
|
state: deleted
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "ansible_facts.network_resources.lldp_global == result.before"
|
|
|
|
- "'no lldp holdtime 125' in result.commands"
|
|
|
|
- "'no lldp timer 32' in result.commands"
|
|
|
|
- "'lldp tlv-select dcbxp' in result.commands"
|
|
|
|
- "'lldp tlv-select system-description' in result.commands"
|
|
|
|
- "result.changed == true "
|
|
|
|
- "result.after | length == 0"
|
|
|
|
|
2019-11-06 11:11:40 +01:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "'no lldp portid-subtype 1' in result.commands"
|
|
|
|
- "'lldp tlv-select power-management' in result.commands"
|
|
|
|
when: cfg_port_id is defined
|
|
|
|
|
2019-08-27 11:22:24 +02:00
|
|
|
- name: Gather lldp_global post facts
|
|
|
|
nxos_facts: *facts
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "ansible_facts.network_resources == {} "
|
|
|
|
|
|
|
|
- name: Idempotence - deleted
|
|
|
|
nxos_lldp_global: *deleted
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
- "result.commands|length == 0"
|
|
|
|
always:
|
2019-11-06 11:11:40 +01:00
|
|
|
- name: teardown
|
|
|
|
nxos_feature: *feature_off
|
|
|
|
|
|
|
|
when: platform is not search('N35')
|