mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add FindByUUID testcase for vmware_guest_facts (#27022)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
0b1cca56f7
commit
cf34cefbdc
2 changed files with 23 additions and 1 deletions
|
@ -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…
Reference in a new issue