nxos: merge nxapi/cli tests - vrf_interface, vrrp, vtp_domain, vtp_password, vtp_version, vtep (#28242)

* refactor nxos_vrf_interface

* refactor nxos_vrrp

* refactor nxos_vtp_domain

* refactor nxos_vtp_password

* refactor nxos_vtp_version

* refactor nxos_vxlan_vtep
This commit is contained in:
David Newswanger 2017-08-17 04:44:10 -04:00 committed by Trishna Guha
parent 9556e945eb
commit e7a78f4328
24 changed files with 202 additions and 152 deletions

View file

@ -1,15 +1,25 @@
--- ---
- name: collect all cli test cases - name: collect common cli test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: cli_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ cli_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ cli }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,9 +1,19 @@
--- ---
- name: collect all nxapi test cases - name: collect common nxapi test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: nxapi_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ nxapi_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
@ -16,7 +26,7 @@
provider: "{{ cli }}" provider: "{{ cli }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,4 +0,0 @@
---
- set_fact: connection="{{ cli }}"
- import_tasks: targets/nxos_vrf_interface/tests/common/sanity.yaml

View file

@ -1,4 +0,0 @@
---
- set_fact: connection="{{ nxapi }}"
- import_tasks: targets/nxos_vrf_interface/tests/common/sanity.yaml

View file

@ -1,15 +1,25 @@
--- ---
- name: collect all cli test cases - name: collect common cli test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: cli_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ cli_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ cli }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,9 +1,19 @@
--- ---
- name: collect all nxapi test cases - name: collect common nxapi test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: nxapi_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ nxapi_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
@ -16,7 +26,7 @@
provider: "{{ cli }}" provider: "{{ cli }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,15 +1,25 @@
--- ---
- name: collect all cli test cases - name: collect common cli test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: cli_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ cli_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ cli }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,9 +1,19 @@
--- ---
- name: collect all nxapi test cases - name: collect common nxapi test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: nxapi_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ nxapi_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
@ -16,7 +26,7 @@
provider: "{{ cli }}" provider: "{{ cli }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,23 +0,0 @@
---
- debug: msg="START TRANSPORT:CLI nxos_vtp_domain sanity test"
- block:
- name: enable feature vtp
nxos_feature:
feature: vtp
state: enabled
provider: "{{ cli }}"
- name: configure vtp domain
nxos_vtp_domain:
domain: ntc
provider: "{{ cli }}"
always:
- name: disable feature vtp
nxos_feature:
feature: vtp
state: disabled
provider: "{{ cli }}"
- debug: msg="END TRANSPORT:CLI nxos_vtp_domain sanity test"

View file

@ -0,0 +1,23 @@
---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_vtp_domain sanity test"
- block:
- name: enable feature vtp
nxos_feature:
feature: vtp
state: enabled
provider: "{{ connection }}"
- name: configure vtp domain
nxos_vtp_domain:
domain: ntc
provider: "{{ connection }}"
always:
- name: disable feature vtp
nxos_feature:
feature: vtp
state: disabled
provider: "{{ connection }}"
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_vtp_domain sanity test"

View file

@ -1,23 +0,0 @@
---
- debug: msg="START TRANSPORT:NXAPI nxos_vtp_domain sanity test"
- block:
- name: enable feature vtp
nxos_feature:
feature: vtp
state: enabled
provider: "{{ nxapi }}"
- name: configure vtp domain
nxos_vtp_domain:
domain: ntc
provider: "{{ nxapi }}"
always:
- name: disable feature vtp
nxos_feature:
feature: vtp
state: disabled
provider: "{{ nxapi }}"
- debug: msg="END TRANSPORT:NXAPI nxos_vtp_domain sanity test"

View file

@ -1,15 +1,25 @@
--- ---
- name: collect all cli test cases - name: collect common cli test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: cli_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ cli_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ cli }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,9 +1,19 @@
--- ---
- name: collect all nxapi test cases - name: collect common nxapi test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: nxapi_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ nxapi_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
@ -16,7 +26,7 @@
provider: "{{ cli }}" provider: "{{ cli }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,4 +0,0 @@
---
- set_fact: connection="{{ cli }}"
- import_tasks: targets/nxos_vtp_password/tests/common/sanity.yaml

View file

@ -1,4 +0,0 @@
---
- set_fact: connection="{{ nxapi }}"
- import_tasks: targets/nxos_vtp_password/tests/common/sanity.yaml

View file

@ -1,15 +1,25 @@
--- ---
- name: collect all cli test cases - name: collect common cli test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: cli_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ cli_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ cli }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,9 +1,19 @@
--- ---
- name: collect all nxapi test cases - name: collect common nxapi test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: nxapi_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ nxapi_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
@ -16,7 +26,7 @@
provider: "{{ cli }}" provider: "{{ cli }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,23 +0,0 @@
---
- debug: msg="START TRANSPORT:CLI nxos_vtp_version sanity test"
- block:
- name: enable feature vtp
nxos_feature:
feature: vtp
state: enabled
provider: "{{ cli }}"
- name: configure vtp version
nxos_vtp_version:
version: 2
provider: "{{ cli }}"
always:
- name: disable feature vtp
nxos_feature:
feature: vtp
state: disabled
provider: "{{ cli }}"
- debug: msg="END TRANSPORT:CLI nxos_vtp_version sanity test"

View file

@ -0,0 +1,23 @@
---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_vtp_version sanity test"
- block:
- name: enable feature vtp
nxos_feature:
feature: vtp
state: enabled
provider: "{{ connection }}"
- name: configure vtp version
nxos_vtp_version:
version: 2
provider: "{{ connection }}"
always:
- name: disable feature vtp
nxos_feature:
feature: vtp
state: disabled
provider: "{{ connection }}"
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_vtp_version sanity test"

View file

@ -1,23 +0,0 @@
---
- debug: msg="START TRANSPORT:NXAPI nxos_vtp_version sanity test"
- block:
- name: enable feature vtp
nxos_feature:
feature: vtp
state: enabled
provider: "{{ nxapi }}"
- name: configure vtp version
nxos_vtp_version:
version: 2
provider: "{{ nxapi }}"
always:
- name: disable feature vtp
nxos_feature:
feature: vtp
state: disabled
provider: "{{ nxapi }}"
- debug: msg="END TRANSPORT:NXAPI nxos_vtp_version sanity test"

View file

@ -1,15 +1,25 @@
--- ---
- name: collect all cli test cases - name: collect common cli test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: cli_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ cli_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ cli }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,9 +1,19 @@
--- ---
- name: collect all nxapi test cases - name: collect common nxapi test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases register: nxapi_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ nxapi_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
@ -16,7 +26,7 @@
provider: "{{ cli }}" provider: "{{ cli }}"
- name: run test case - name: run test case
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,4 +0,0 @@
---
- set_fact: connection="{{ cli }}"
- import_tasks: targets/nxos_vxlan_vtep/tests/common/sanity.yaml

View file

@ -1,4 +0,0 @@
---
- set_fact: connection="{{ nxapi }}"
- import_tasks: targets/nxos_vxlan_vtep/tests/common/sanity.yaml