forked from redhat-cop/cloud.vmware_ops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request redhat-cop#82 from anna-savina/cleanup
Improve vmware_ops integration tests cleanup implementation
- Loading branch information
Showing
25 changed files
with
156 additions
and
91 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
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
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
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
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
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
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
105 changes: 53 additions & 52 deletions
105
tests/integration/targets/vmware_ops_manage_folder_test/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 |
---|---|---|
@@ -1,69 +1,70 @@ | ||
--- | ||
- name: Import common vars for tests on vCenter Environment | ||
ansible.builtin.include_vars: | ||
file: ../group_vars.yml | ||
when: not run_on_simulator | ||
- name: Run Manage folder tests | ||
block: | ||
- name: Import common vars for tests on vCenter Environment | ||
ansible.builtin.include_vars: | ||
file: ../group_vars.yml | ||
when: not run_on_simulator | ||
|
||
- name: Create Folder Tree | ||
loop: "{{ folder_types }}" | ||
ansible.builtin.include_role: | ||
name: cloud.vmware_ops.manage_folder | ||
vars: | ||
manage_folder_state: present | ||
manage_folder_folder_name: production/foo/web | ||
manage_folder_folder_type: "{{ item }}" | ||
- name: Create Folder Tree | ||
loop: "{{ folder_types }}" | ||
ansible.builtin.include_role: | ||
name: cloud.vmware_ops.manage_folder | ||
vars: | ||
manage_folder_state: present | ||
manage_folder_folder_name: "{{ folder_name_pattern }}/foo/web" | ||
manage_folder_folder_type: "{{ item }}" | ||
|
||
- name: Create Folder Without Managing Full Tree | ||
loop: "{{ folder_types }}" | ||
ansible.builtin.include_role: | ||
name: cloud.vmware_ops.manage_folder | ||
vars: | ||
manage_folder_state: present | ||
manage_folder_folder_name: db | ||
manage_folder_parent_folder: production/foo | ||
manage_folder_folder_type: "{{ item }}" | ||
- name: Create Folder Without Managing Full Tree | ||
loop: "{{ folder_types }}" | ||
ansible.builtin.include_role: | ||
name: cloud.vmware_ops.manage_folder | ||
vars: | ||
manage_folder_state: present | ||
manage_folder_folder_name: db | ||
manage_folder_parent_folder: "{{ folder_name_pattern }}/foo" | ||
manage_folder_folder_type: "{{ item }}" | ||
|
||
- name: Create A Folder With A Slash In It | ||
loop: "{{ folder_types }}" | ||
ansible.builtin.include_role: | ||
name: cloud.vmware_ops.manage_folder | ||
vars: | ||
manage_folder_state: present | ||
manage_folder_folder_name: security/syseng | ||
manage_folder_parent_folder: production/foo | ||
manage_folder_parse_name_as_path: false | ||
manage_folder_folder_type: "{{ item }}" | ||
- name: Create A Folder With A Slash In It | ||
loop: "{{ folder_types }}" | ||
ansible.builtin.include_role: | ||
name: cloud.vmware_ops.manage_folder | ||
vars: | ||
manage_folder_state: present | ||
manage_folder_folder_name: security/syseng | ||
manage_folder_parent_folder: "{{ folder_name_pattern }}/foo" | ||
manage_folder_parse_name_as_path: false | ||
manage_folder_folder_type: "{{ item }}" | ||
|
||
- name: Get Folder Info | ||
community.vmware.vmware_folder_info: | ||
hostname: "{{ manage_folder_hostname }}" | ||
username: "{{ manage_folder_username }}" | ||
password: "{{ manage_folder_password }}" | ||
datacenter: "{{ manage_folder_datacenter_name }}" | ||
port: "{{ manage_folder_port }}" | ||
validate_certs: false | ||
delegate_to: localhost | ||
register: _folder_info | ||
- name: Get Folder Info | ||
community.vmware.vmware_folder_info: | ||
hostname: "{{ manage_folder_hostname }}" | ||
username: "{{ manage_folder_username }}" | ||
password: "{{ manage_folder_password }}" | ||
datacenter: "{{ manage_folder_datacenter_name }}" | ||
port: "{{ manage_folder_port }}" | ||
validate_certs: false | ||
delegate_to: localhost | ||
register: _folder_info | ||
|
||
- name: Check Folders Were Created | ||
ansible.builtin.assert: | ||
that: | ||
- _folder_info.folder_info.hostFolders.subfolders.production.subfolders.foo.subfolders['web'] is defined | ||
- _folder_info.folder_info.hostFolders.subfolders.production.subfolders.foo.subfolders['db'] is defined | ||
- _folder_info.folder_info.hostFolders.subfolders.production.subfolders.foo.subfolders['security%2fsyseng'] is defined | ||
fail_msg: Folder structure does not match expected result. | ||
- name: Check Folders Were Created | ||
ansible.builtin.assert: | ||
that: | ||
- _folder_info.folder_info.hostFolders.subfolders[folder_name_pattern].subfolders.foo.subfolders['web'] is defined | ||
- _folder_info.folder_info.hostFolders.subfolders[folder_name_pattern].subfolders.foo.subfolders['db'] is defined | ||
- _folder_info.folder_info.hostFolders.subfolders[folder_name_pattern].subfolders.foo.subfolders['security%2fsyseng'] is defined | ||
fail_msg: Folder structure does not match expected result. | ||
|
||
- name: Run Post Test Operations | ||
block: | ||
always: | ||
- name: Start Cleanup | ||
ansible.builtin.debug: | ||
msg: "Running cleanup..." | ||
always: | ||
|
||
- name: Delete The Whole Tree | ||
loop: "{{ folder_types }}" | ||
ansible.builtin.include_role: | ||
name: cloud.vmware_ops.manage_folder | ||
vars: | ||
manage_folder_state: absent | ||
manage_folder_folder_name: production | ||
manage_folder_folder_name: "{{ folder_name_pattern }}" | ||
manage_folder_folder_type: "{{ item }}" |
1 change: 1 addition & 0 deletions
1
tests/integration/targets/vmware_ops_manage_folder_test/vars.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
1 change: 1 addition & 0 deletions
1
tests/integration/targets/vmware_ops_manage_folder_test/vars/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
5 changes: 4 additions & 1 deletion
5
tests/integration/targets/vmware_ops_provision_virtual_esxi_test/runme.sh
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
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
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.