ansible/test/integration/targets/vmware_guest_screenshot/tasks/main.yml
Diane Wang 39fbdc22ff VMware: Add new module vmware_guest_screenshot (#57449)
Signed-off-by: Tomorrow9 <tommorrow7@gmail.com>
Co-Authored-By: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-01 15:58:05 +05:30

41 lines
1.3 KiB
YAML

# Test code for the vmware_guest_screenshot module
# Copyright: (c) 2019, Diane Wang (Tomorrow9) <dianew@vmware.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- when: vcsim is not defined
block:
- import_role:
name: prepare_vmware_tests
vars:
setup_attach_host: true
setup_datastore: true
setup_virtualmachines: true
- name: take screenshot of virtual machine's console
vmware_guest_screenshot:
validate_certs: False
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
name: "{{ infra.vm_list[0] }}"
register: take_screenshot
- debug: var=take_screenshot
- name: assert the screenshot captured
assert:
that:
- "take_screenshot.changed == true"
- name: take screenshot of virtual machine's console and download to local
vmware_guest_screenshot:
validate_certs: False
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
name: "{{ infra.vm_list[0] }}"
local_path: "/tmp/screenshot_test.png"
register: take_screenshot
- debug: var=take_screenshot
- name: assert the screenshot captured
assert:
that:
- "take_screenshot.changed == true"