nxos_lldp_global: fix regression tests (#64161)

pull/64496/head
Chris Van Heuveln 5 years ago committed by Trishna Guha
parent 351f60b0e1
commit 3b6681f889

@ -2,12 +2,21 @@
- debug:
msg: "Start nxos_lldp_global deleted integration tests connection = {{ ansible_connection }}"
- name: Enable LLDP feature
nxos_feature:
feature: lldp
state: enabled
# N35 skips all tests, image issues.
- block:
- 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
- name: Setup
cli_config:
config: |
@ -16,7 +25,13 @@
no lldp tlv-select dcbxp
lldp tlv-select system-name
no lldp tlv-select system-description
lldp tlv-select power-management
- name: Setup2
cli_config:
config: |
lldp portid-subtype 1
no lldp tlv-select power-management
when: cfg_port_id is defined
- name: Gather lldp_global facts
nxos_facts: &facts
@ -40,6 +55,12 @@
- "result.changed == true "
- "result.after | length == 0"
- assert:
that:
- "'no lldp portid-subtype 1' in result.commands"
- "'lldp tlv-select power-management' in result.commands"
when: cfg_port_id is defined
- name: Gather lldp_global post facts
nxos_facts: *facts
@ -55,9 +76,8 @@
that:
- "result.changed == false"
- "result.commands|length == 0"
always:
- name: teardown
nxos_feature:
feature: lldp
state: disabled
- name: teardown
nxos_feature: *feature_off
when: platform is not search('N35')

@ -2,19 +2,30 @@
- debug:
msg: "Start nxos_lldp_global merged integration tests connection={{ansible_connection}}"
- name: Enable lldp
nxos_feature:
feature: lldp
# N35 skips all tests, image issues.
- block:
- set_fact:
port_id: 1
tlv_power_mgmt:
power_management: false
when: platform is not search('N5K|N6K|N7K') and imagetag is not search("I[2345]")
- name: feature off to cleanup lldp
nxos_feature: &feature_off
feature: lldp
state: disabled
- name: Enable lldp
nxos_feature:
feature: lldp
- name: Merged
nxos_lldp_global: &merged
config:
reinit: 5
timer: 40
port_id: 1
tlv_select:
power_management: false
port_id: "{{port_id|default(omit)}}"
tlv_select: "{{tlv_power_mgmt|default(omit)}}"
state: merged
register: result
@ -24,9 +35,16 @@
- "result.changed == true"
- "'lldp reinit 5' in result.commands"
- "'lldp timer 40' in result.commands"
- assert:
that:
- "'lldp portid-subtype 1' in result.commands"
when: port_id is defined
- assert:
that:
- "'no lldp tlv-select power-management' in result.commands"
- "result.commands | length == 4"
when: tlv_power_mgmt is defined
- name: Gather lldp_global facts
nxos_facts:
@ -47,9 +65,8 @@
that:
- "result.changed == false"
- "result.commands | length == 0"
always:
- name: teardown
nxos_feature:
feature: lldp
state: disabled
nxos_feature: *feature_off
when: platform is not search('N35')

@ -2,20 +2,37 @@
- debug:
msg: "Start nxos_lldp_global replaced integration tests connection = {{ansible_connection}}"
- name: Enable lldp feature
nxos_feature:
feature: lldp
state: enabled
# N35 skips all tests, image issues.
- block:
- set_fact:
port_id: 1
tlv_power_mgmt:
power_management: false
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
- name: Setup
cli_config:
config: |
lldp holdtime 125
lldp portid-subtype 1
lldp tlv-select system-name
no lldp tlv-select port-vlan
- name: Setup2
cli_config:
config: |
lldp portid-subtype 1
no lldp tlv-select power-management
when: port_id is defined
- name: Replaced
nxos_lldp_global: &replaced
@ -36,12 +53,19 @@
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"
- assert:
that:
- "'no lldp portid-subtype 1' in result.commands"
when: port_id is defined
- assert:
that:
- "'lldp tlv-select power-management' in result.commands"
when: tlv_power_mgmt is defined
- name: Gather lldp_global post facts
nxos_facts:
@ -62,9 +86,8 @@
that:
- "result.changed == false"
- "result.commands|length == 0"
always:
- name: teardown
nxos_feature:
feature: lldp
state: disabled
nxos_feature: *feature_off
when: platform is not search('N35')

Loading…
Cancel
Save