ansible/test/integration/targets/vmware_guest/tasks/main.yml
Gonéri Le Bouder 6bb21c3db0 vmware: test-refactoring
- In order to keep the integration with `ansible-test`, we prefer to avoid any
  interaction with the Ansible inventory file.
- split up the prepare_vmware_tests/defaults/main.yml in two
  configuration files: one for vcsim and one for a real environment
- remove all the access to hostvars
- directly interact with the ESXi to mount/umount the datastore
  https://github.com/ansible/ansible/pull/56516
- record the virtual machine folder in the environment configuration
- vmware_guest_move: Use https://github.com/ansible/ansible/pull/55237
2019-05-23 17:40:19 -04:00

116 lines
3.3 KiB
YAML

# Test code for the vmware_guest module.
# Copyright: (c) 2017, James Tanner <tanner.jc@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- import_role:
name: prepare_vmware_tests
vars:
setup_datacenter: true
setup_attach_host: true
setup_datastore: true
setup_virtualmachines: true
setup_resource_pool: true
- block:
- include: poweroff_d1_c1_f0.yml
- include: poweroff_d1_c1_f1.yml
- include: check_mode.yml
- include: clone_d1_c1_f0.yml
- include: create_d1_c1_f0.yml
- include: cdrom_d1_c1_f0.yml
- include: create_rp_d1_c1_f0.yml
- include: create_guest_invalid_d1_c1_f0.yml
- include: mac_address_d1_c1_f0.yml
- include: disk_type_d1_c1_f0.yml
- include: create_nw_d1_c1_f0.yml
- include: delete_vm.yml
- include: non_existent_vm_ops.yml
always:
- name: Remove VM
vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
cluster: "{{ ccr1 }}"
name: '{{ item }}'
force: yes
state: absent
with_items:
- CDROM-Test
- CDROM-Test-38679
- newvm_2
- newvm_3
- newvmnw_4
- DC0_H0_VM12
- import_role:
name: prepare_vmware_tests
vars:
setup_attach_host: true
setup_datastore: true
setup_virtualmachines: true
- block:
- include: network_negative_test.yml
# VCSIM does not return list of portgroups for dvswitch so commenting following TC
#- include: network_with_portgroup.yml
# Currently, VCSIM doesn't support DVPG (as portkeys are not available) so commenting this test
# - include: network_with_dvpg.yml
#- include: template_d1_c1_f0.yml
- include: vapp_d1_c1_f0.yml
- include: disk_size_d1_c1_f0.yml
- include: network_with_device.yml
- include: disk_mode_d1_c1_f0.yml
- include: linked_clone_d1_c1_f0.yml
always:
- name: Remove VM
vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
cluster: "{{ ccr1 }}"
name: '{{ item }}'
force: yes
state: absent
with_items:
- disk_mode_d1_c1_f0
- network_with_device
- new_vm_no_nw_type
- vApp-Test
- import_role:
name: prepare_vmware_tests
vars:
setup_attach_host: true
setup_datastore: true
setup_virtualmachines: true
- block:
- include: boot_firmware_d1_c1_f0.yml
- include: clone_with_convert.yml
- include: clone_customize_guest_test.yml
always:
- name: Remove VM
vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
cluster: "{{ ccr1 }}"
name: '{{ item }}'
force: yes
state: absent
with_items:
- newvm_DC0_H0_VM0
- newvm_DC0_H0_VM1
- newvm_efi_DC0_H0_VM0
- newvm_efi_DC0_H0_VM1
- thin_DC0_H0_VM0
- thin_DC0_H0_VM1
- thick_DC0_H0_VM0
- thick_DC0_H0_VM1
- eagerzeroedthick_DC0_H0_VM0
- eagerzeroedthick_DC0_H0_VM1
- net_customize_DC0_H0_VM0
- net_customize_DC0_H0_VM1