From e7a78f4328af8c9d51c069bbac3487c745775f2f Mon Sep 17 00:00:00 2001 From: David Newswanger <gamma.dave@gmail.com> Date: Thu, 17 Aug 2017 04:44:10 -0400 Subject: [PATCH] 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 --- .../targets/nxos_vrf_interface/tasks/cli.yaml | 16 ++++++++++--- .../nxos_vrf_interface/tasks/nxapi.yaml | 16 ++++++++++--- .../nxos_vrf_interface/tests/cli/sanity.yaml | 4 ---- .../tests/nxapi/sanity.yaml | 4 ---- .../targets/nxos_vrrp/tasks/cli.yaml | 16 ++++++++++--- .../targets/nxos_vrrp/tasks/nxapi.yaml | 16 ++++++++++--- .../targets/nxos_vtp_domain/tasks/cli.yaml | 16 ++++++++++--- .../targets/nxos_vtp_domain/tasks/nxapi.yaml | 16 ++++++++++--- .../nxos_vtp_domain/tests/cli/sanity.yaml | 23 ------------------- .../nxos_vtp_domain/tests/common/sanity.yaml | 23 +++++++++++++++++++ .../nxos_vtp_domain/tests/nxapi/sanity.yaml | 23 ------------------- .../targets/nxos_vtp_password/tasks/cli.yaml | 16 ++++++++++--- .../nxos_vtp_password/tasks/nxapi.yaml | 16 ++++++++++--- .../nxos_vtp_password/tests/cli/sanity.yaml | 4 ---- .../nxos_vtp_password/tests/nxapi/sanity.yaml | 4 ---- .../targets/nxos_vtp_version/tasks/cli.yaml | 16 ++++++++++--- .../targets/nxos_vtp_version/tasks/nxapi.yaml | 16 ++++++++++--- .../nxos_vtp_version/tests/cli/sanity.yaml | 23 ------------------- .../nxos_vtp_version/tests/common/sanity.yaml | 23 +++++++++++++++++++ .../nxos_vtp_version/tests/nxapi/sanity.yaml | 23 ------------------- .../targets/nxos_vxlan_vtep/tasks/cli.yaml | 16 ++++++++++--- .../targets/nxos_vxlan_vtep/tasks/nxapi.yaml | 16 ++++++++++--- .../nxos_vxlan_vtep/tests/cli/sanity.yaml | 4 ---- .../nxos_vxlan_vtep/tests/nxapi/sanity.yaml | 4 ---- 24 files changed, 202 insertions(+), 152 deletions(-) delete mode 100644 test/integration/targets/nxos_vrf_interface/tests/cli/sanity.yaml delete mode 100644 test/integration/targets/nxos_vrf_interface/tests/nxapi/sanity.yaml delete mode 100644 test/integration/targets/nxos_vtp_domain/tests/cli/sanity.yaml create mode 100644 test/integration/targets/nxos_vtp_domain/tests/common/sanity.yaml delete mode 100644 test/integration/targets/nxos_vtp_domain/tests/nxapi/sanity.yaml delete mode 100644 test/integration/targets/nxos_vtp_password/tests/cli/sanity.yaml delete mode 100644 test/integration/targets/nxos_vtp_password/tests/nxapi/sanity.yaml delete mode 100644 test/integration/targets/nxos_vtp_version/tests/cli/sanity.yaml create mode 100644 test/integration/targets/nxos_vtp_version/tests/common/sanity.yaml delete mode 100644 test/integration/targets/nxos_vtp_version/tests/nxapi/sanity.yaml delete mode 100644 test/integration/targets/nxos_vxlan_vtep/tests/cli/sanity.yaml delete mode 100644 test/integration/targets/nxos_vxlan_vtep/tests/nxapi/sanity.yaml diff --git a/test/integration/targets/nxos_vrf_interface/tasks/cli.yaml b/test/integration/targets/nxos_vrf_interface/tasks/cli.yaml index d675462dd02..0ab3f8f9086 100644 --- a/test/integration/targets/nxos_vrf_interface/tasks/cli.yaml +++ b/test/integration/targets/nxos_vrf_interface/tasks/cli.yaml @@ -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: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" - register: test_cases + register: cli_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ cli_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ cli }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vrf_interface/tasks/nxapi.yaml b/test/integration/targets/nxos_vrf_interface/tasks/nxapi.yaml index ea525379f7f..e071f293a2b 100644 --- a/test/integration/targets/nxos_vrf_interface/tasks/nxapi.yaml +++ b/test/integration/targets/nxos_vrf_interface/tasks/nxapi.yaml @@ -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: paths: "{{ role_path }}/tests/nxapi" patterns: "{{ testcase }}.yaml" - register: test_cases + register: nxapi_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ nxapi_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" @@ -16,7 +26,7 @@ provider: "{{ cli }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ nxapi }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vrf_interface/tests/cli/sanity.yaml b/test/integration/targets/nxos_vrf_interface/tests/cli/sanity.yaml deleted file mode 100644 index 5cdeee4a98f..00000000000 --- a/test/integration/targets/nxos_vrf_interface/tests/cli/sanity.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- set_fact: connection="{{ cli }}" - -- import_tasks: targets/nxos_vrf_interface/tests/common/sanity.yaml diff --git a/test/integration/targets/nxos_vrf_interface/tests/nxapi/sanity.yaml b/test/integration/targets/nxos_vrf_interface/tests/nxapi/sanity.yaml deleted file mode 100644 index d239bab0f8f..00000000000 --- a/test/integration/targets/nxos_vrf_interface/tests/nxapi/sanity.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- set_fact: connection="{{ nxapi }}" - -- import_tasks: targets/nxos_vrf_interface/tests/common/sanity.yaml diff --git a/test/integration/targets/nxos_vrrp/tasks/cli.yaml b/test/integration/targets/nxos_vrrp/tasks/cli.yaml index d675462dd02..0ab3f8f9086 100644 --- a/test/integration/targets/nxos_vrrp/tasks/cli.yaml +++ b/test/integration/targets/nxos_vrrp/tasks/cli.yaml @@ -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: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" - register: test_cases + register: cli_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ cli_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ cli }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vrrp/tasks/nxapi.yaml b/test/integration/targets/nxos_vrrp/tasks/nxapi.yaml index ea525379f7f..e071f293a2b 100644 --- a/test/integration/targets/nxos_vrrp/tasks/nxapi.yaml +++ b/test/integration/targets/nxos_vrrp/tasks/nxapi.yaml @@ -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: paths: "{{ role_path }}/tests/nxapi" patterns: "{{ testcase }}.yaml" - register: test_cases + register: nxapi_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ nxapi_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" @@ -16,7 +26,7 @@ provider: "{{ cli }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ nxapi }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vtp_domain/tasks/cli.yaml b/test/integration/targets/nxos_vtp_domain/tasks/cli.yaml index d675462dd02..0ab3f8f9086 100644 --- a/test/integration/targets/nxos_vtp_domain/tasks/cli.yaml +++ b/test/integration/targets/nxos_vtp_domain/tasks/cli.yaml @@ -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: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" - register: test_cases + register: cli_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ cli_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ cli }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vtp_domain/tasks/nxapi.yaml b/test/integration/targets/nxos_vtp_domain/tasks/nxapi.yaml index ea525379f7f..e071f293a2b 100644 --- a/test/integration/targets/nxos_vtp_domain/tasks/nxapi.yaml +++ b/test/integration/targets/nxos_vtp_domain/tasks/nxapi.yaml @@ -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: paths: "{{ role_path }}/tests/nxapi" patterns: "{{ testcase }}.yaml" - register: test_cases + register: nxapi_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ nxapi_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" @@ -16,7 +26,7 @@ provider: "{{ cli }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ nxapi }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vtp_domain/tests/cli/sanity.yaml b/test/integration/targets/nxos_vtp_domain/tests/cli/sanity.yaml deleted file mode 100644 index 5454ddebad5..00000000000 --- a/test/integration/targets/nxos_vtp_domain/tests/cli/sanity.yaml +++ /dev/null @@ -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" diff --git a/test/integration/targets/nxos_vtp_domain/tests/common/sanity.yaml b/test/integration/targets/nxos_vtp_domain/tests/common/sanity.yaml new file mode 100644 index 00000000000..e8b42925cbb --- /dev/null +++ b/test/integration/targets/nxos_vtp_domain/tests/common/sanity.yaml @@ -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" diff --git a/test/integration/targets/nxos_vtp_domain/tests/nxapi/sanity.yaml b/test/integration/targets/nxos_vtp_domain/tests/nxapi/sanity.yaml deleted file mode 100644 index 377fae6976a..00000000000 --- a/test/integration/targets/nxos_vtp_domain/tests/nxapi/sanity.yaml +++ /dev/null @@ -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" diff --git a/test/integration/targets/nxos_vtp_password/tasks/cli.yaml b/test/integration/targets/nxos_vtp_password/tasks/cli.yaml index d675462dd02..0ab3f8f9086 100644 --- a/test/integration/targets/nxos_vtp_password/tasks/cli.yaml +++ b/test/integration/targets/nxos_vtp_password/tasks/cli.yaml @@ -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: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" - register: test_cases + register: cli_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ cli_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ cli }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vtp_password/tasks/nxapi.yaml b/test/integration/targets/nxos_vtp_password/tasks/nxapi.yaml index ea525379f7f..e071f293a2b 100644 --- a/test/integration/targets/nxos_vtp_password/tasks/nxapi.yaml +++ b/test/integration/targets/nxos_vtp_password/tasks/nxapi.yaml @@ -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: paths: "{{ role_path }}/tests/nxapi" patterns: "{{ testcase }}.yaml" - register: test_cases + register: nxapi_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ nxapi_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" @@ -16,7 +26,7 @@ provider: "{{ cli }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ nxapi }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vtp_password/tests/cli/sanity.yaml b/test/integration/targets/nxos_vtp_password/tests/cli/sanity.yaml deleted file mode 100644 index 3e930f98dd7..00000000000 --- a/test/integration/targets/nxos_vtp_password/tests/cli/sanity.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- set_fact: connection="{{ cli }}" - -- import_tasks: targets/nxos_vtp_password/tests/common/sanity.yaml diff --git a/test/integration/targets/nxos_vtp_password/tests/nxapi/sanity.yaml b/test/integration/targets/nxos_vtp_password/tests/nxapi/sanity.yaml deleted file mode 100644 index 326d4cafcea..00000000000 --- a/test/integration/targets/nxos_vtp_password/tests/nxapi/sanity.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- set_fact: connection="{{ nxapi }}" - -- import_tasks: targets/nxos_vtp_password/tests/common/sanity.yaml diff --git a/test/integration/targets/nxos_vtp_version/tasks/cli.yaml b/test/integration/targets/nxos_vtp_version/tasks/cli.yaml index d675462dd02..0ab3f8f9086 100644 --- a/test/integration/targets/nxos_vtp_version/tasks/cli.yaml +++ b/test/integration/targets/nxos_vtp_version/tasks/cli.yaml @@ -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: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" - register: test_cases + register: cli_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ cli_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ cli }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vtp_version/tasks/nxapi.yaml b/test/integration/targets/nxos_vtp_version/tasks/nxapi.yaml index ea525379f7f..e071f293a2b 100644 --- a/test/integration/targets/nxos_vtp_version/tasks/nxapi.yaml +++ b/test/integration/targets/nxos_vtp_version/tasks/nxapi.yaml @@ -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: paths: "{{ role_path }}/tests/nxapi" patterns: "{{ testcase }}.yaml" - register: test_cases + register: nxapi_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ nxapi_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" @@ -16,7 +26,7 @@ provider: "{{ cli }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ nxapi }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vtp_version/tests/cli/sanity.yaml b/test/integration/targets/nxos_vtp_version/tests/cli/sanity.yaml deleted file mode 100644 index 6655cacc000..00000000000 --- a/test/integration/targets/nxos_vtp_version/tests/cli/sanity.yaml +++ /dev/null @@ -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" diff --git a/test/integration/targets/nxos_vtp_version/tests/common/sanity.yaml b/test/integration/targets/nxos_vtp_version/tests/common/sanity.yaml new file mode 100644 index 00000000000..8fbe61226d8 --- /dev/null +++ b/test/integration/targets/nxos_vtp_version/tests/common/sanity.yaml @@ -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" diff --git a/test/integration/targets/nxos_vtp_version/tests/nxapi/sanity.yaml b/test/integration/targets/nxos_vtp_version/tests/nxapi/sanity.yaml deleted file mode 100644 index 475f6eab20d..00000000000 --- a/test/integration/targets/nxos_vtp_version/tests/nxapi/sanity.yaml +++ /dev/null @@ -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" diff --git a/test/integration/targets/nxos_vxlan_vtep/tasks/cli.yaml b/test/integration/targets/nxos_vxlan_vtep/tasks/cli.yaml index d675462dd02..0ab3f8f9086 100644 --- a/test/integration/targets/nxos_vxlan_vtep/tasks/cli.yaml +++ b/test/integration/targets/nxos_vxlan_vtep/tasks/cli.yaml @@ -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: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" - register: test_cases + register: cli_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ cli_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ cli }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vxlan_vtep/tasks/nxapi.yaml b/test/integration/targets/nxos_vxlan_vtep/tasks/nxapi.yaml index ea525379f7f..e071f293a2b 100644 --- a/test/integration/targets/nxos_vxlan_vtep/tasks/nxapi.yaml +++ b/test/integration/targets/nxos_vxlan_vtep/tasks/nxapi.yaml @@ -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: paths: "{{ role_path }}/tests/nxapi" patterns: "{{ testcase }}.yaml" - register: test_cases + register: nxapi_cases + +- set_fact: + test_cases: + files: "{{ test_cases.files }} + {{ nxapi_cases.files }}" - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" @@ -16,7 +26,7 @@ provider: "{{ cli }}" - name: run test case - include: "{{ test_case_to_run }}" + include: "{{ test_case_to_run }} connection={{ nxapi }}" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_vxlan_vtep/tests/cli/sanity.yaml b/test/integration/targets/nxos_vxlan_vtep/tests/cli/sanity.yaml deleted file mode 100644 index e15740a6082..00000000000 --- a/test/integration/targets/nxos_vxlan_vtep/tests/cli/sanity.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- set_fact: connection="{{ cli }}" - -- import_tasks: targets/nxos_vxlan_vtep/tests/common/sanity.yaml diff --git a/test/integration/targets/nxos_vxlan_vtep/tests/nxapi/sanity.yaml b/test/integration/targets/nxos_vxlan_vtep/tests/nxapi/sanity.yaml deleted file mode 100644 index ad578b6f320..00000000000 --- a/test/integration/targets/nxos_vxlan_vtep/tests/nxapi/sanity.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- set_fact: connection="{{ nxapi }}" - -- import_tasks: targets/nxos_vxlan_vtep/tests/common/sanity.yaml