Add FindByUUID testcase for vmware_guest_facts (#27022)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/27040/head
Abhijeet Kasurde 7 years ago committed by jctanner
parent 0b1cca56f7
commit cf34cefbdc

@ -173,7 +173,6 @@ def main():
folder=dict(required=False, type='str', default='/vm'),
datacenter=dict(required=True, type='str'),
),
required_together=[('name', 'folder')],
required_one_of=[['name', 'uuid']],
)

@ -80,3 +80,26 @@
that:
- "guest_facts_0001['instance']['hw_name'] == vm1 | basename"
- "guest_facts_0001['instance']['hw_product_uuid'] is defined"
- set_fact: vm1_uuid="{{ guest_facts_0001['instance']['hw_product_uuid'] }}"
- debug: var=vm1_uuid
# Testcase 0002: Get details about virtual machines using UUID
- name: get list of facts about virtual machines using UUID
vmware_guest_facts:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
uuid: "{{ vm1_uuid }}"
register: guest_facts_0002
- debug: msg="{{ guest_facts_0002 }}"
- assert:
that:
- "guest_facts_0002['instance']['hw_name'] == vm1 | basename"
- "guest_facts_0002['instance']['hw_product_uuid'] is defined"
- "guest_facts_0002['instance']['hw_product_uuid'] == vm1_uuid"

Loading…
Cancel
Save