diff options
author | David Newswanger <gamma.dave@gmail.com> | 2017-08-17 10:17:14 +0200 |
---|---|---|
committer | Trishna Guha <trishnaguha17@gmail.com> | 2017-08-17 10:17:14 +0200 |
commit | ffe51bed96a356db1357097561272ab2708652e2 (patch) | |
tree | 3738a8d822334185affb9e92c983c95a04ce605d /test/integration/targets/nxos_evpn_vni | |
parent | WIP Implement declarative intent arguments on eos_vlan (#28270) (diff) | |
download | ansible-ffe51bed96a356db1357097561272ab2708652e2.tar.xz ansible-ffe51bed96a356db1357097561272ab2708652e2.zip |
nxos: merge nxapi/cli tests - evpn_global, evpn_vni, facts, feature (#28237)
* refactor nxos_evpn_global
* refactor nxos_evpn_vni
* refactor nxos_facts
* refactor nxos_feature
Diffstat (limited to 'test/integration/targets/nxos_evpn_vni')
-rw-r--r-- | test/integration/targets/nxos_evpn_vni/tasks/cli.yaml | 16 | ||||
-rw-r--r-- | test/integration/targets/nxos_evpn_vni/tasks/nxapi.yaml | 16 | ||||
-rw-r--r-- | test/integration/targets/nxos_evpn_vni/tests/common/sanity.yaml (renamed from test/integration/targets/nxos_evpn_vni/tests/cli/sanity.yaml) | 22 | ||||
-rw-r--r-- | test/integration/targets/nxos_evpn_vni/tests/nxapi/sanity.yaml | 74 |
4 files changed, 37 insertions, 91 deletions
diff --git a/test/integration/targets/nxos_evpn_vni/tasks/cli.yaml b/test/integration/targets/nxos_evpn_vni/tasks/cli.yaml index d675462dd0..0ab3f8f908 100644 --- a/test/integration/targets/nxos_evpn_vni/tasks/cli.yaml +++ b/test/integration/targets/nxos_evpn_vni/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_evpn_vni/tasks/nxapi.yaml b/test/integration/targets/nxos_evpn_vni/tasks/nxapi.yaml index ea525379f7..e071f293a2 100644 --- a/test/integration/targets/nxos_evpn_vni/tasks/nxapi.yaml +++ b/test/integration/targets/nxos_evpn_vni/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_evpn_vni/tests/cli/sanity.yaml b/test/integration/targets/nxos_evpn_vni/tests/common/sanity.yaml index d2b963cb5b..c37adfaf19 100644 --- a/test/integration/targets/nxos_evpn_vni/tests/cli/sanity.yaml +++ b/test/integration/targets/nxos_evpn_vni/tests/common/sanity.yaml @@ -1,24 +1,24 @@ --- -- debug: msg="START TRANSPORT:CLI nxos_evpn_vni sanity test" +- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_evpn_vni sanity test" - name: "Setup" nxos_config: &remove_evpn lines: no nv overlay evpn - provider: "{{ cli }}" + provider: "{{ connection }}" match: none ignore_errors: yes - block: - name: "Enable feature BGP" - nxos_feature: + nxos_feature: feature: bgp state: enabled - provider: "{{ cli }}" + provider: "{{ connection }}" - name: "Enable nv overlay evpn" - nxos_config: + nxos_config: lines: nv overlay evpn - provider: "{{ cli }}" + provider: "{{ connection }}" match: none - name: "Configure nxos_evpn_vni" @@ -29,7 +29,7 @@ - "5000:10" - "4100:100" route_target_export: auto - provider: "{{ cli }}" + provider: "{{ connection }}" register: result - assert: &true @@ -48,7 +48,7 @@ nxos_evpn_vni: &rvni vni: 6000 state: absent - provider: "{{ cli }}" + provider: "{{ connection }}" register: result - assert: *true @@ -65,10 +65,10 @@ ignore_errors: yes - name: "Disable feature bgp" - nxos_feature: + nxos_feature: feature: bgp state: disabled - provider: "{{ cli }}" + provider: "{{ connection }}" ignore_errors: yes -- debug: msg="END TRANSPORT:CLI nxos_evpn_vni sanity test" +- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_evpn_vni sanity test" diff --git a/test/integration/targets/nxos_evpn_vni/tests/nxapi/sanity.yaml b/test/integration/targets/nxos_evpn_vni/tests/nxapi/sanity.yaml deleted file mode 100644 index 83123c493a..0000000000 --- a/test/integration/targets/nxos_evpn_vni/tests/nxapi/sanity.yaml +++ /dev/null @@ -1,74 +0,0 @@ ---- -- debug: msg="START TRANSPORT:NXAPI nxos_evpn_vni sanity test" - -- name: "Setup" - nxos_config: &remove_evpn - lines: no nv overlay evpn - provider: "{{ nxapi }}" - match: none - ignore_errors: yes - -- block: - - name: "Enable feature BGP" - nxos_feature: - feature: bgp - state: enabled - provider: "{{ nxapi }}" - - - name: "Enable nv overlay evpn" - nxos_config: - lines: nv overlay evpn - provider: "{{ nxapi }}" - match: none - - - name: "Configure nxos_evpn_vni" - nxos_evpn_vni: &evpn_vni - vni: 6000 - route_distinguisher: "60:10" - route_target_import: - - "5000:10" - - "4100:100" - route_target_export: auto - provider: "{{ nxapi }}" - register: result - - - assert: &true - that: - - "result.changed == true" - - - name: "Check Idempotence" - nxos_evpn_vni: *evpn_vni - register: result - - - assert: &false - that: - - "result.changed == false" - - - name: "remove nxos_evpn_vni" - nxos_evpn_vni: &rvni - vni: 6000 - state: absent - provider: "{{ nxapi }}" - register: result - - - assert: *true - - - name: "Check Idempotence" - nxos_evpn_vni: *rvni - register: result - - - assert: *false - - always: - - name: "Remove nv overlay evpn" - nxos_config: *remove_evpn - ignore_errors: yes - - - name: "Disable feature bgp" - nxos_feature: - feature: bgp - state: disabled - provider: "{{ nxapi }}" - ignore_errors: yes - -- debug: msg="END TRANSPORT:NXAPI nxos_evpn_vni sanity test" |