forked from cisco-en-programmability/dnacenter-ansible
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration test cases for ISE integration workflow manager module (#75)
- Loading branch information
Showing
7 changed files
with
384 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
tests/integration/ccc_aaa_server_management/ccc_aaa_server_management/defaults/main.yml
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,2 @@ | ||
--- | ||
testcase: "*" |
1 change: 1 addition & 0 deletions
1
tests/integration/ccc_aaa_server_management/ccc_aaa_server_management/meta/main.yml
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 @@ | ||
dependencies: [] |
34 changes: 34 additions & 0 deletions
34
tests/integration/ccc_aaa_server_management/ccc_aaa_server_management/tasks/main.yml
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,34 @@ | ||
--- | ||
- name: collect ccc test cases | ||
find: | ||
paths: "{{ role_path }}/tests" | ||
patterns: "{{ testcase }}.yml" | ||
connection: local | ||
register: ccc_cases | ||
tags: sanity | ||
|
||
- debug: | ||
msg: "CCC Cases: {{ ccc_cases }}" | ||
|
||
- set_fact: | ||
test_cases: | ||
files: "{{ ccc_cases.files }}" | ||
tags: sanity | ||
|
||
- debug: | ||
msg: "Test Cases: {{ test_cases }}" | ||
|
||
- name: set test_items | ||
set_fact: | ||
test_items: "{{ test_cases.files | map(attribute='path') | list }}" | ||
tags: sanity | ||
|
||
- debug: | ||
msg: "Test Items: {{ test_items }}" | ||
|
||
- name: run test cases (connection=httpapi) | ||
include_tasks: "{{ test_case_to_run }}" | ||
loop: "{{ test_items }}" | ||
loop_control: | ||
loop_var: test_case_to_run | ||
tags: sanity |
149 changes: 149 additions & 0 deletions
149
...integration/ccc_aaa_server_management/ccc_aaa_server_management/tests/test_aaa_server.yml
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,149 @@ | ||
--- | ||
- debug: msg="Starting AAA server management test" | ||
- debug: msg="Role Path {{ role_path }}" | ||
|
||
- block: | ||
- name: Load vars and declare dnac vars | ||
include_vars: | ||
file: "{{ role_path }}/vars/vars_aaa_server.yml" | ||
name: vars_map | ||
vars: | ||
dnac_login: &dnac_login | ||
dnac_host: "{{ dnac_host }}" | ||
dnac_username: "{{ dnac_username }}" | ||
dnac_password: "{{ dnac_password }}" | ||
dnac_verify: "{{ dnac_verify }}" | ||
dnac_port: "{{ dnac_port }}" | ||
dnac_version: "{{ dnac_version }}" | ||
dnac_debug: "{{ dnac_debug }}" | ||
dnac_log: true | ||
dnac_log_level: DEBUG | ||
config_verify: true | ||
|
||
# - debug: | ||
# msg: "{{ vars_map.create_aaa_server_details }}" | ||
|
||
# - debug: | ||
# msg: "{{ vars_map.update_aaa_server_details }}" | ||
|
||
# - debug: | ||
# msg: "{{ vars_map.delete_aaa_server_details }}" | ||
|
||
############################################# | ||
# Pre Tests Clean Up # | ||
############################################# | ||
|
||
- name: Clean up AAA server before test | ||
block: | ||
- name: Clean up AAA server before test | ||
cisco.dnac.ise_radius_integration_workflow_manager: | ||
<<: *dnac_login | ||
state: deleted | ||
config: | ||
- "{{ item }}" | ||
loop: "{{ vars_map.delete_aaa_server_details }}" | ||
|
||
- name: Pause for 5 seconds after each deletion | ||
pause: | ||
seconds: 5 | ||
|
||
############################################# | ||
# CREATE AAA SERVER # | ||
############################################# | ||
|
||
- name: Create AAA server | ||
block: | ||
- name: Create AAA server from create_aaa_server_details config | ||
cisco.dnac.ise_radius_integration_workflow_manager: | ||
<<: *dnac_login | ||
state: merged | ||
config: | ||
- "{{ item }}" | ||
register: result_create_aaa_server | ||
loop: "{{ vars_map.create_aaa_server_details }}" | ||
tags: merged | ||
|
||
- name: Pause for 5 seconds after each creation | ||
pause: | ||
seconds: 5 | ||
|
||
# - name: Debug item | ||
# debug: | ||
# var: item | ||
# loop: "{{ result_create_aaa_server.results }}" | ||
# when: result_create_aaa_server is defined | ||
|
||
- name: Assert AAA server creation | ||
assert: | ||
that: | ||
- item.changed == true | ||
- item.response[0].authenticationPolicyServer.Validation == "Success" | ||
- "'Created Successfully' in item.response[0].authenticationPolicyServer.msg['10.0.0.40']" | ||
loop: "{{ result_create_aaa_server.results }}" | ||
when: result_create_aaa_server is defined | ||
|
||
############################################# | ||
# UPDATE AAA SERVER # | ||
############################################# | ||
|
||
- name: Update AAA server | ||
block: | ||
- name: Update AAA server from update_aaa_server_details config | ||
cisco.dnac.ise_radius_integration_workflow_manager: | ||
<<: *dnac_login | ||
state: merged | ||
config: | ||
- "{{ item }}" | ||
with_list: "{{ vars_map.update_aaa_server_details }}" | ||
tags: merged | ||
register: result_update_aaa_server | ||
|
||
- name: Pause for 5 seconds after each updation | ||
pause: | ||
seconds: 5 | ||
|
||
# - name: Debug item | ||
# debug: | ||
# var: item | ||
# loop: "{{ result_update_aaa_server.results }}" | ||
# when: result_update_aaa_server is defined | ||
|
||
- name: Assert AAA server updation | ||
assert: | ||
that: | ||
- item.changed == true | ||
- item.response[0].authenticationPolicyServer.Validation == "Success" | ||
- "'Updated Successfully' in item.response[0].authenticationPolicyServer.msg['10.0.0.40']" | ||
loop: "{{ result_update_aaa_server.results }}" | ||
when: result_update_aaa_server is defined | ||
|
||
############################################# | ||
# DELETE AAA SERVER # | ||
############################################# | ||
|
||
- name: Delete AAA server | ||
block: | ||
- name: Delete AAA server from delete_aaa_server_details config | ||
cisco.dnac.ise_radius_integration_workflow_manager: | ||
<<: *dnac_login | ||
state: deleted | ||
config: | ||
- "{{ item }}" | ||
register: result_delete_aaa_server | ||
loop: "{{ vars_map.delete_aaa_server_details }}" | ||
tags: deleted | ||
|
||
# - name: Debug item | ||
# debug: | ||
# var: item | ||
# loop: "{{ result_delete_aaa_server.results }}" | ||
# when: result_delete_aaa_server is defined | ||
|
||
- name: Assert AAA server deletion | ||
assert: | ||
that: | ||
- item.changed == true | ||
- item.response[0].authenticationPolicyServer.Validation == "Success" | ||
- "'deleted successfully' in item.response[0].authenticationPolicyServer.msg['10.0.0.40']" | ||
loop: "{{ result_delete_aaa_server.results }}" | ||
when: result_delete_aaa_server is defined |
129 changes: 129 additions & 0 deletions
129
...integration/ccc_aaa_server_management/ccc_aaa_server_management/tests/test_ise_server.yml
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,129 @@ | ||
# --- | ||
# - debug: msg="Starting Cisco ISE server management test" | ||
# - debug: msg="Role Path {{ role_path }}" | ||
|
||
# - block: | ||
# - name: Load vars and declare dnac vars | ||
# include_vars: | ||
# file: "{{ role_path }}/vars/vars_ise_server.yml" | ||
# name: vars_map | ||
# vars: | ||
# dnac_login: &dnac_login | ||
# dnac_host: "{{ dnac_host }}" | ||
# dnac_username: "{{ dnac_username }}" | ||
# dnac_password: "{{ dnac_password }}" | ||
# dnac_verify: "{{ dnac_verify }}" | ||
# dnac_port: "{{ dnac_port }}" | ||
# dnac_version: "{{ dnac_version }}" | ||
# dnac_debug: "{{ dnac_debug }}" | ||
# dnac_log: true | ||
# dnac_log_level: DEBUG | ||
# config_verify: true | ||
|
||
# # - debug: | ||
# # msg: "{{ vars_map.create_ise_server_details }}" | ||
|
||
# # - debug: | ||
# # msg: "{{ vars_map.update_ise_server_details }}" | ||
|
||
# # - debug: | ||
# # msg: "{{ vars_map.delete_ise_server_details }}" | ||
|
||
# # ############################################# | ||
# # # Pre Tests Clean Up # | ||
# # ############################################# | ||
|
||
# # - name: Clean up Cisco ISE server before test | ||
# # cisco.dnac.ise_radius_integration_workflow_manager: | ||
# # <<: *dnac_login | ||
# # state: deleted | ||
# # config: | ||
# # - "{{ item }}" | ||
# # loop: "{{ vars_map.delete_ise_server_details }}" | ||
|
||
# ############################################# | ||
# # CREATE ISE SERVER # | ||
# ############################################# | ||
|
||
# - name: Create Cisco ISE server from create_ise_server_details config | ||
# cisco.dnac.ise_radius_integration_workflow_manager: | ||
# <<: *dnac_login | ||
# state: merged | ||
# config: | ||
# - "{{ item }}" | ||
# register: result_create_ise_server | ||
# loop: "{{ vars_map.create_ise_server_details }}" | ||
# tags: merged | ||
|
||
# # - name: Debug item | ||
# # debug: | ||
# # var: item | ||
# # loop: "{{ result_create_ise_server.results }}" | ||
# # when: result_create_ise_server is defined | ||
|
||
# # - name: Assert Cisco ISE server creation | ||
# # assert: | ||
# # that: | ||
# # - item.changed == true | ||
# # - item.response[0].authenticationPolicyServer.Validation == "Success" | ||
# # - "'Created Successfully' in item.response[0].authenticationPolicyServer.msg['172.23.241.229']" | ||
# # loop: "{{ result_create_ise_server.results }}" | ||
# # when: result_create_ise_server is defined | ||
|
||
# ############################################# | ||
# # UPDATE ISE SERVER # | ||
# ############################################# | ||
|
||
# - name: Update Cisco ISE server from update_ise_server_details config | ||
# cisco.dnac.ise_radius_integration_workflow_manager: | ||
# <<: *dnac_login | ||
# state: merged | ||
# config: | ||
# - "{{ item }}" | ||
# with_list: "{{ vars_map.update_ise_server_details }}" | ||
# tags: merged | ||
# register: result_update_ise_server | ||
|
||
# # - name: Debug item | ||
# # debug: | ||
# # var: item | ||
# # loop: "{{ result_update_ise_server.results }}" | ||
# # when: result_update_ise_server is defined | ||
|
||
# - name: Assert Cisco ISE server updation | ||
# assert: | ||
# that: | ||
# - item.changed == true | ||
# - item.response[0].authenticationPolicyServer.Validation == "Success" | ||
# - "'Updated Successfully' in item.response[0].authenticationPolicyServer.msg['172.23.241.229']" | ||
# loop: "{{ result_update_ise_server.results }}" | ||
# when: result_update_ise_server is defined | ||
|
||
# # ############################################# | ||
# # # DELETE ISE SERVER # | ||
# # ############################################# | ||
|
||
# # - name: Delete Cisco ISE server from delete_ise_server_details config | ||
# # cisco.dnac.ise_radius_integration_workflow_manager: | ||
# # <<: *dnac_login | ||
# # state: deleted | ||
# # config: | ||
# # - "{{ item }}" | ||
# # register: result_delete_ise_server | ||
# # loop: "{{ vars_map.delete_ise_server_details }}" | ||
# # tags: deleted | ||
|
||
# # # - name: Debug item | ||
# # # debug: | ||
# # # var: item | ||
# # # loop: "{{ result_delete_ise_server.results }}" | ||
# # # when: result_delete_ise_server is defined | ||
|
||
# # - name: Assert Cisco ISE server deletion | ||
# # assert: | ||
# # that: | ||
# # - item.changed == true | ||
# # - item.response[0].authenticationPolicyServer.Validation == "Success" | ||
# # - "'deleted successfully' in item.response[0].authenticationPolicyServer.msg['172.23.241.229']" | ||
# # loop: "{{ result_delete_ise_server.results }}" | ||
# # when: result_delete_ise_server is defined |
26 changes: 26 additions & 0 deletions
26
.../integration/ccc_aaa_server_management/ccc_aaa_server_management/vars/vars_aaa_server.yml
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,26 @@ | ||
--- | ||
create_aaa_server_details: | ||
- authentication_policy_server: | ||
- server_type: AAA | ||
server_ip_address: 10.0.0.40 | ||
shared_secret: cisco | ||
protocol: RADIUS_TACACS | ||
encryption_scheme: KEYWRAP | ||
encryption_key: 1234123412341234 | ||
message_authenticator_code_key: dnacisesolutions1234 | ||
authentication_port: 1800 | ||
accounting_port: 1700 | ||
retries: 3 | ||
timeout: 4 | ||
role: secondary | ||
|
||
update_aaa_server_details: | ||
- authentication_policy_server: | ||
- server_type: AAA | ||
server_ip_address: 10.0.0.40 | ||
retries: 2 | ||
timeout: 5 | ||
|
||
delete_aaa_server_details: | ||
- authentication_policy_server: | ||
- server_ip_address: 10.0.0.40 |
43 changes: 43 additions & 0 deletions
43
.../integration/ccc_aaa_server_management/ccc_aaa_server_management/vars/vars_ise_server.yml
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,43 @@ | ||
--- | ||
create_ise_server_details: | ||
- authentication_policy_server: | ||
- server_type: ISE | ||
server_ip_address: 10.195.243.31 | ||
shared_secret: cisco | ||
protocol: RADIUS_TACACS | ||
encryption_scheme: KEYWRAP | ||
encryption_key: dnacsolutions123 | ||
message_authenticator_code_key: dnacisesolutions1234 | ||
authentication_port: 1800 | ||
accounting_port: 1700 | ||
retries: 3 | ||
timeout: 4 | ||
role: primary | ||
pxgrid_enabled: False | ||
use_dnac_cert_for_pxgrid: False | ||
cisco_ise_dtos: | ||
- user_name: admin | ||
password: Lablab123 | ||
fqdn: IBSTE-ISE1.cisco.com | ||
ip_address: 10.195.243.31 | ||
subscriber_name: ersadmin | ||
description: CISCO ISE | ||
trusted_server: True | ||
ise_integration_wait_time: 30 | ||
|
||
update_ise_server_details: | ||
- authentication_policy_server: | ||
- server_type: ISE | ||
server_ip_address: 10.195.243.31 | ||
retries: 2 | ||
timeout: 5 | ||
pxgrid_enabled: True | ||
cisco_ise_dtos: | ||
- user_name: admin | ||
password: Lablab123 | ||
ip_address: 10.195.243.31 | ||
description: CISCO ISE | ||
|
||
delete_ise_server_details: | ||
- authentication_policy_server: | ||
- server_ip_address: 10.195.243.31 |