mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -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
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
- no vlan 4002
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: setup - remove switchport settings on interface Ethernet1 used in test
|
||||
eos_config:
|
||||
|
@ -17,6 +18,7 @@
|
|||
parents: interface Ethernet1
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: setup - remove switchport settings on interface Ethernet2 used in test
|
||||
eos_config:
|
||||
|
@ -26,6 +28,7 @@
|
|||
parents: interface Ethernet2
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
|
||||
- name: Create vlan
|
||||
eos_vlan:
|
||||
|
@ -34,6 +37,7 @@
|
|||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -51,6 +55,7 @@
|
|||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -67,6 +72,7 @@
|
|||
state: suspend
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -85,6 +91,7 @@
|
|||
state: suspend
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -100,6 +107,7 @@
|
|||
state: active
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -119,6 +127,7 @@
|
|||
- Ethernet2
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -141,6 +150,7 @@
|
|||
- Ethernet2
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -158,6 +168,7 @@
|
|||
- Ethernet1
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -177,6 +188,7 @@
|
|||
- Ethernet1
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -194,6 +206,7 @@
|
|||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -213,6 +226,7 @@
|
|||
state: present
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -231,6 +245,7 @@
|
|||
purge: yes
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -251,6 +266,7 @@
|
|||
purge: yes
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue