mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Run neighbors intent tests for ios_interface only if show lldp contains netdev (#31539)
This commit is contained in:
parent
24c360287e
commit
bd17edd5ed
1 changed files with 72 additions and 61 deletions
|
@ -61,7 +61,15 @@
|
|||
- "result.failed == true"
|
||||
- "'state eq(up)' in result.failed_conditions"
|
||||
|
||||
- name: Check neighbors intent arguments
|
||||
- name: Register show neighbors detail
|
||||
ios_command:
|
||||
commands:
|
||||
- show lldp neighbors
|
||||
authorize: yes
|
||||
register: show_lldp_neighbors_result
|
||||
|
||||
- block:
|
||||
- name: Check neighbors intent arguments
|
||||
ios_interface:
|
||||
name: Gi0/0
|
||||
neighbors:
|
||||
|
@ -71,11 +79,11 @@
|
|||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
|
||||
- name: Check neighbors intent arguments (failed condition)
|
||||
- name: Check neighbors intent arguments (failed condition)
|
||||
ios_interface:
|
||||
name: Gi0/0
|
||||
neighbors:
|
||||
|
@ -86,11 +94,12 @@
|
|||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- "'host dummy_host' in result.failed_conditions"
|
||||
- "'port dummy_port' in result.failed_conditions"
|
||||
when: '"netdev" in show_lldp_neighbors_result.stdout'
|
||||
|
||||
- name: Aggregate config + intent (pass)
|
||||
ios_interface:
|
||||
|
@ -107,7 +116,8 @@
|
|||
that:
|
||||
- "result.failed == false"
|
||||
|
||||
- name: Aggregate neighbors intent (pass)
|
||||
- block:
|
||||
- name: Aggregate neighbors intent (pass)
|
||||
ios_interface:
|
||||
aggregate:
|
||||
- name: Gi0/0
|
||||
|
@ -119,11 +129,11 @@
|
|||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
|
||||
- name: Aggregate neighbors intent (fail)
|
||||
- name: Aggregate neighbors intent (fail)
|
||||
ios_interface:
|
||||
aggregate:
|
||||
- name: Gi0/0
|
||||
|
@ -137,8 +147,9 @@
|
|||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- "'host dummy_host' in result.failed_conditions"
|
||||
- "'port dummy_port' in result.failed_conditions"
|
||||
when: "'netdev' in show_lldp_neighbors_result.stdout"
|
||||
|
|
Loading…
Reference in a new issue