Add integration tests and fix nxos providers (#26913)

* fix issues with python3.x

* Add integration testa and fix for nxos_evpn_vni

* add nxos_evpn_vni to nxos.yaml

* fix get_vtp_config()

* add new integration tests

* fix rollback

* add integration test files
This commit is contained in:
saichint 2017-07-27 06:32:35 -07:00 committed by Nathaniel Case
commit 9b9a8749da
66 changed files with 1158 additions and 80 deletions

View file

@ -0,0 +1,2 @@
---
testcase: "*"

View file

@ -0,0 +1,2 @@
dependencies:
- prepare_nxos_tests

View file

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

View file

@ -0,0 +1,3 @@
---
- { include: cli.yaml, tags: ['cli'] }
- { include: nxapi.yaml, tags: ['nxapi'] }

View file

@ -0,0 +1,28 @@
---
- name: collect all nxapi test cases
find:
paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: enable nxapi
nxos_config:
lines:
- feature nxapi
- nxapi http port 80
provider: "{{ cli }}"
- name: run test case
include: "{{ test_case_to_run }}"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
- name: disable nxapi
nxos_config:
lines:
- no feature nxapi
provider: "{{ cli }}"

View file

@ -0,0 +1,29 @@
---
- debug: msg="START TRANSPORT:CLI nxos_rollback sanity test"
- name: delete existing checkpoint file
nxos_config: &delete
commands:
- terminal dont-ask
- delete backup.cfg
match: none
provider: "{{ cli }}"
ignore_errors: yes
- name: Create checkpoint file
nxos_rollback:
checkpoint_file: backup.cfg
timeout: 300
provider: "{{ cli }}"
- name: rollback to the previously created checkpoint file
nxos_rollback:
rollback_to: backup.cfg
timeout: 300
provider: "{{ cli }}"
- name: cleanup checkpoint file
nxos_config: *delete
ignore_errors: yes
- debug: msg="END TRANSPORT:CLI nxos_rollback sanity test"

View file

@ -0,0 +1,29 @@
---
- debug: msg="START TRANSPORT:NXAPI nxos_rollback sanity test"
- name: delete existing checkpoint file
nxos_config: &delete
commands:
- terminal dont-ask
- delete backup.cfg
match: none
provider: "{{ nxapi }}"
ignore_errors: yes
- name: Create checkpoint file
nxos_rollback:
checkpoint_file: backup.cfg
timeout: 300
provider: "{{ nxapi }}"
- name: rollback to the previously created checkpoint file
nxos_rollback:
rollback_to: backup.cfg
timeout: 300
provider: "{{ nxapi }}"
- name: cleanup checkpoint file
nxos_config: *delete
ignore_errors: yes
- debug: msg="END TRANSPORT:NXAPI nxos_rollback sanity test"