summaryrefslogtreecommitdiff
path: root/test/integration/targets/nxos_vtp_domain
diff options
context:
space:
mode:
authorDavid Newswanger <gamma.dave@gmail.com>2017-08-17 04:44:10 -0400
committerTrishna Guha <trishnaguha17@gmail.com>2017-08-17 14:14:10 +0530
commite7a78f4328af8c9d51c069bbac3487c745775f2f (patch)
treef3dd426b192f6612cfffb6645a797c7394be6bd2 /test/integration/targets/nxos_vtp_domain
parent9556e945eb6ddf21be968bfaa2c1470de9b00e8f (diff)
downloadansible-e7a78f4328af8c9d51c069bbac3487c745775f2f.tar.gz
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
Diffstat (limited to 'test/integration/targets/nxos_vtp_domain')
-rw-r--r--test/integration/targets/nxos_vtp_domain/tasks/cli.yaml16
-rw-r--r--test/integration/targets/nxos_vtp_domain/tasks/nxapi.yaml16
-rw-r--r--test/integration/targets/nxos_vtp_domain/tests/cli/sanity.yaml23
-rw-r--r--test/integration/targets/nxos_vtp_domain/tests/common/sanity.yaml23
-rw-r--r--test/integration/targets/nxos_vtp_domain/tests/nxapi/sanity.yaml23
5 files changed, 49 insertions, 52 deletions
diff --git a/test/integration/targets/nxos_vtp_domain/tasks/cli.yaml b/test/integration/targets/nxos_vtp_domain/tasks/cli.yaml
index d675462dd0..0ab3f8f908 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/cli"
+ 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: 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 ea525379f7..e071f293a2 100644
--- a/test/integration/targets/nxos_vtp_domain/tasks/nxapi.yaml
+++ b/test/integration/targets/nxos_vtp_domain/tasks/nxapi.yaml
@@ -1,10 +1,20 @@
---
-- name: collect all nxapi test cases
+- name: collect common nxapi test cases
find:
- paths: "{{ role_path }}/tests/nxapi"
+ 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: 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 5454ddebad..0000000000
--- 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 0000000000..e8b42925cb
--- /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 377fae6976..0000000000
--- 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"