-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e10a923
commit 2229682
Showing
29 changed files
with
4,692 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,074 changes: 1,074 additions & 0 deletions
1,074
tests/integration/targets/dcnm_interface/tests/dcnm/dcnm_intf_sanity.yml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
183 changes: 183 additions & 0 deletions
183
tests/integration/targets/dcnm_inventory/tests/dcnm/sanity.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
############################################## | ||
## SETUP ## | ||
############################################## | ||
|
||
- set_fact: | ||
rest_path: "/rest/control/fabrics/{{ ansible_it_fabric }}" | ||
when: controller_version == "11" | ||
tags: sanity | ||
|
||
- set_fact: | ||
rest_path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/control/fabrics/{{ ansible_it_fabric }}" | ||
when: controller_version >= "12" | ||
tags: sanity | ||
|
||
- name: SANITY- MERGED - Verify if fabric is deployed. | ||
cisco.dcnm.dcnm_rest: | ||
method: GET | ||
path: "{{ rest_path }}" | ||
register: result | ||
tags: sanity | ||
|
||
- assert: | ||
that: | ||
- 'result.response.DATA != None' | ||
tags: sanity | ||
|
||
- name: SANITY- DELETED - setup - Clean up existing devices | ||
cisco.dcnm.dcnm_inventory: | ||
fabric: "{{ ansible_it_fabric }}" | ||
state: deleted | ||
register: result | ||
tags: sanity | ||
|
||
############################################## | ||
## MERGED ## | ||
############################################## | ||
|
||
- name: SANITY- MERGED - Merge a Switch using GreenField Deployment | ||
cisco.dcnm.dcnm_inventory: &conf | ||
fabric: "{{ ansible_it_fabric }}" | ||
state: merged | ||
config: | ||
- seed_ip: "{{ ansible_switch1 }}" | ||
auth_proto: MD5 # choose from [MD5, SHA, MD5_DES, MD5_AES, SHA_DES, SHA_AES] | ||
user_name: "{{ switch_username }}" | ||
password: "{{ switch_password }}" | ||
max_hops: 0 | ||
role: leaf # default is Leaf - choose from [Leaf, Spine, Border, Border Spine, Border Gateway, Border Gateway Spine | ||
# Super Spine, Border Super Spine, Border Gateway Super Spine] | ||
preserve_config: False # boolean, default is true | ||
register: result | ||
tags: sanity | ||
|
||
- assert: | ||
that: | ||
- 'result.changed == true' | ||
tags: sanity | ||
|
||
- assert: | ||
that: | ||
- 'item["RETURN_CODE"] == 200' | ||
loop: '{{ result.response }}' | ||
tags: sanity | ||
|
||
- name: SANITY- MERGED - conf1 - GF - Idempotence | ||
cisco.dcnm.dcnm_inventory: *conf | ||
register: result | ||
tags: sanity | ||
|
||
- assert: | ||
that: | ||
- 'result.changed == false' | ||
- 'result.response == "The switch provided is already part of the fabric and cannot be created again"' | ||
tags: sanity | ||
|
||
############################################# | ||
# QUERY ## | ||
############################################# | ||
|
||
- name: SANITY- QUERY - Query a Switch - Hostname and Role must match | ||
cisco.dcnm.dcnm_inventory: | ||
fabric: "{{ ansible_it_fabric }}" | ||
state: query | ||
config: | ||
- seed_ip: "{{ ansible_switch1 }}" | ||
role: leaf # default is Leaf - choose from [Leaf, Spine, Border, Border Spine, Border Gateway, Border Gateway Spine | ||
# Super Spine, Border Super Spine, Border Gateway Super Spine] | ||
register: result | ||
tags: sanity | ||
|
||
- assert: | ||
that: | ||
- 'result.response[0].ipAddress == "{{ ansible_switch1 }}"' | ||
- 'result.response[0].switchRole == "leaf"' | ||
tags: sanity | ||
|
||
|
||
|
||
############################################## | ||
## OVERRIDDEN ## | ||
############################################## | ||
|
||
- name: SANITY- OVERRIDDEN - Update a New Switch using GreenField Deployment - Delete and Create - default role | ||
cisco.dcnm.dcnm_inventory: &conf_over | ||
fabric: "{{ ansible_it_fabric }}" | ||
state: overridden | ||
config: | ||
- seed_ip: "{{ ansible_switch2 }}" | ||
auth_proto: MD5 # choose from [MD5, SHA, MD5_DES, MD5_AES, SHA_DES, SHA_AES] | ||
user_name: "{{ switch_username }}" | ||
password: "{{ switch_password }}" | ||
max_hops: 0 | ||
preserve_config: False # boolean, default is true | ||
register: result | ||
tags: sanity | ||
|
||
- assert: | ||
that: | ||
- 'result.changed == true' | ||
tags: sanity | ||
|
||
- assert: | ||
that: | ||
- 'item["RETURN_CODE"] == 200' | ||
loop: '{{ result.response }}' | ||
tags: sanity | ||
|
||
- name: SANITY- OVERRIDDEN - conf1 - OV - Idempotence | ||
cisco.dcnm.dcnm_inventory: *conf_over | ||
register: result | ||
tags: sanity | ||
|
||
- assert: | ||
that: | ||
- 'result.changed == false' | ||
- 'result.response == "The switch provided is already part of the fabric and there is no more device to delete in the fabric"' | ||
tags: sanity | ||
|
||
############################################## | ||
## CLEAN-UP ## | ||
############################################## | ||
|
||
- name: SANITY- DELETED - setup - Clean up existing devices | ||
cisco.dcnm.dcnm_inventory: &clean | ||
fabric: "{{ ansible_it_fabric }}" | ||
state: deleted | ||
config: | ||
- seed_ip: "{{ ansible_switch2 }}" | ||
auth_proto: MD5 # choose from [MD5, SHA, MD5_DES, MD5_AES, SHA_DES, SHA_AES] | ||
user_name: "{{ switch_username }}" | ||
password: "{{ switch_password }}" | ||
max_hops: 0 | ||
preserve_config: False # boolean, default is true | ||
register: result | ||
tags: sanity | ||
|
||
- name: SANITY- DELETED - conf1 - OV - Idempotence | ||
cisco.dcnm.dcnm_inventory: *clean | ||
register: result | ||
tags: sanity | ||
|
||
############################################## | ||
## RESET FABRIC ## | ||
############################################## | ||
|
||
- name: SANITY- RESET - setup switches in fabric | ||
cisco.dcnm.dcnm_inventory: | ||
fabric: "{{ ansible_it_fabric }}" | ||
config: | ||
- seed_ip: "{{ ansible_switch1 }}" | ||
auth_proto: MD5 # choose from [MD5, SHA, MD5_DES, MD5_AES, SHA_DES, SHA_AES] | ||
user_name: "{{ switch_username }}" | ||
password: "{{ switch_password }}" | ||
max_hops: 0 | ||
preserve_config: False # boolean, default is true | ||
- seed_ip: "{{ ansible_switch2 }}" | ||
auth_proto: MD5 # choose from [MD5, SHA, MD5_DES, MD5_AES, SHA_DES, SHA_AES] | ||
user_name: "{{ switch_username }}" | ||
password: "{{ switch_password }}" | ||
max_hops: 0 | ||
preserve_config: False # boolean, default is true | ||
register: result | ||
tags: sanity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.