mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 23:51:23 -07:00
Port eos tests to network_cli (#33586)
* Add eos and fix tests to run multiple connections * Update tests to report connection * Add missing START messages * Fix unspecified connection * Python 3 updates Exceptions don't have `.message` in Python 3 * Override `become` when using `connection=local` * Slight restructuring to make eapi easier later on * Move eapi toggle to prepare_eos * Pull out connection on eapi tasks
This commit is contained in:
parent
f64b276f6a
commit
513c75079e
70 changed files with 393 additions and 249 deletions
|
@ -4,12 +4,19 @@
|
|||
paths: "{{ role_path }}/tests/cli"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
register: test_cases
|
||||
delegate_to: localhost
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test case
|
||||
include: "{{ test_case_to_run }}"
|
||||
- name: run test cases (connection=network_cli)
|
||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
||||
|
||||
- name: run test case (connection=local)
|
||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
||||
with_first_found: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
state: absent
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: setup - remove vrf
|
||||
eos_vrf:
|
||||
|
@ -13,6 +14,7 @@
|
|||
state: absent
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: setup - remove vrf
|
||||
eos_vrf:
|
||||
|
@ -20,6 +22,7 @@
|
|||
state: absent
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: Create vrf
|
||||
eos_vrf:
|
||||
|
@ -28,6 +31,7 @@
|
|||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -45,6 +49,7 @@
|
|||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -61,6 +66,7 @@
|
|||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -78,6 +84,7 @@
|
|||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -96,6 +103,7 @@
|
|||
interfaces:
|
||||
- Ethernet2
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -115,6 +123,7 @@
|
|||
interfaces:
|
||||
- Ethernet2
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -132,6 +141,7 @@
|
|||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -152,6 +162,7 @@
|
|||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -170,6 +181,7 @@
|
|||
purge: yes
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -191,6 +203,7 @@
|
|||
state: absent
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: Delete VRFs again (idempotent)
|
||||
eos_vrf:
|
||||
|
@ -198,6 +211,7 @@
|
|||
state: absent
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: Delete aggregate of VRFs
|
||||
eos_vrf:
|
||||
|
@ -209,6 +223,7 @@
|
|||
state: absent
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: Delete VRFs again (idempotent)
|
||||
eos_vrf:
|
||||
|
@ -220,6 +235,7 @@
|
|||
state: absent
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
# FIXME add in tests for everything defined in docs
|
||||
# FIXME Test state:absent + test:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue