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,43 +61,52 @@
|
||||||
- "result.failed == true"
|
- "result.failed == true"
|
||||||
- "'state eq(up)' in result.failed_conditions"
|
- "'state eq(up)' in result.failed_conditions"
|
||||||
|
|
||||||
- name: Check neighbors intent arguments
|
- name: Register show neighbors detail
|
||||||
ios_interface:
|
ios_command:
|
||||||
name: Gi0/0
|
commands:
|
||||||
neighbors:
|
- show lldp neighbors
|
||||||
- port: eth0
|
|
||||||
host: netdev
|
|
||||||
authorize: yes
|
authorize: yes
|
||||||
provider: "{{ cli }}"
|
register: show_lldp_neighbors_result
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
- block:
|
||||||
that:
|
- name: Check neighbors intent arguments
|
||||||
- "result.failed == false"
|
ios_interface:
|
||||||
|
name: Gi0/0
|
||||||
|
neighbors:
|
||||||
|
- port: eth0
|
||||||
|
host: netdev
|
||||||
|
authorize: yes
|
||||||
|
provider: "{{ cli }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
- name: Check neighbors intent arguments (failed condition)
|
- assert:
|
||||||
ios_interface:
|
that:
|
||||||
name: Gi0/0
|
- "result.failed == false"
|
||||||
neighbors:
|
|
||||||
- port: dummy_port
|
|
||||||
host: dummy_host
|
|
||||||
authorize: yes
|
|
||||||
provider: "{{ cli }}"
|
|
||||||
ignore_errors: yes
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
- name: Check neighbors intent arguments (failed condition)
|
||||||
that:
|
ios_interface:
|
||||||
- "result.failed == true"
|
name: Gi0/0
|
||||||
- "'host dummy_host' in result.failed_conditions"
|
neighbors:
|
||||||
- "'port dummy_port' in result.failed_conditions"
|
- port: dummy_port
|
||||||
|
host: dummy_host
|
||||||
|
authorize: yes
|
||||||
|
provider: "{{ cli }}"
|
||||||
|
ignore_errors: yes
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- 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)
|
- name: Aggregate config + intent (pass)
|
||||||
ios_interface:
|
ios_interface:
|
||||||
aggregate:
|
aggregate:
|
||||||
- name: GigabitEthernet0/2
|
- name: GigabitEthernet0/2
|
||||||
enabled: True
|
enabled: True
|
||||||
state: up
|
state: up
|
||||||
authorize: yes
|
authorize: yes
|
||||||
provider: "{{ cli }}"
|
provider: "{{ cli }}"
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
@ -107,38 +116,40 @@
|
||||||
that:
|
that:
|
||||||
- "result.failed == false"
|
- "result.failed == false"
|
||||||
|
|
||||||
- name: Aggregate neighbors intent (pass)
|
- block:
|
||||||
ios_interface:
|
- name: Aggregate neighbors intent (pass)
|
||||||
aggregate:
|
ios_interface:
|
||||||
- name: Gi0/0
|
aggregate:
|
||||||
neighbors:
|
- name: Gi0/0
|
||||||
- port: eth0
|
neighbors:
|
||||||
host: netdev
|
- port: eth0
|
||||||
authorize: yes
|
host: netdev
|
||||||
provider: "{{ cli }}"
|
authorize: yes
|
||||||
ignore_errors: yes
|
provider: "{{ cli }}"
|
||||||
register: result
|
ignore_errors: yes
|
||||||
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result.failed == false"
|
- "result.failed == false"
|
||||||
|
|
||||||
- name: Aggregate neighbors intent (fail)
|
- name: Aggregate neighbors intent (fail)
|
||||||
ios_interface:
|
ios_interface:
|
||||||
aggregate:
|
aggregate:
|
||||||
- name: Gi0/0
|
- name: Gi0/0
|
||||||
neighbors:
|
neighbors:
|
||||||
- port: eth0
|
- port: eth0
|
||||||
host: netdev
|
host: netdev
|
||||||
- port: dummy_port
|
- port: dummy_port
|
||||||
host: dummy_host
|
host: dummy_host
|
||||||
authorize: yes
|
authorize: yes
|
||||||
provider: "{{ cli }}"
|
provider: "{{ cli }}"
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result.failed == true"
|
- "result.failed == true"
|
||||||
- "'host dummy_host' in result.failed_conditions"
|
- "'host dummy_host' in result.failed_conditions"
|
||||||
- "'port dummy_port' 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