Skip to content

Commit

Permalink
Fix first integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mariolenz committed May 6, 2024
1 parent 54c346a commit 58ed77b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions plugins/modules/guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,9 @@ def main():
mutually_exclusive=[
['cluster', 'esxi_hostname'],
],
required_one_of=[
['cluster', 'esxi_hostname'],
],
)
result = {'failed': False, 'changed': False}
pyv = PyVmomiHelper(module)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
name: test_vm1
guest_id: centos64Guest
datacenter: "{{ dc1 }}"
esxi_hostname: '{{ esxi1 }}'
hardware:
num_cpus: 1
boot_firmware: "bios"
Expand Down Expand Up @@ -48,6 +49,7 @@
name: test_vm2
guest_id: centos64Guest
datacenter: "{{ dc1 }}"
esxi_hostname: '{{ esxi1 }}'
hardware:
num_cpus: 1
boot_firmware: "efi"
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/targets/guest/tasks/create_d1_c1_f0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
name: test_vm1
guest_id: centos64Guest
datacenter: "{{ dc1 }}"
esxi_hostname: '{{ esxi1 }}'
hardware:
num_cpus: 1
num_cpu_cores_per_socket: 1
Expand Down Expand Up @@ -59,6 +60,7 @@
name: test_vm1
guest_id: centos64Guest
datacenter: "{{ dc1 }}"
esxi_hostname: '{{ esxi1 }}'
hardware:
num_cpus: 2
memory_mb: 128
Expand Down Expand Up @@ -93,6 +95,7 @@
password: "{{ vcenter_password }}"
name: test_vm1
datacenter: "{{ dc1 }}"
esxi_hostname: '{{ esxi1 }}'
state: absent
folder: '{{ f0 }}'
register: delete_d1_c1_f0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
name: invalid_vm
guest_id: "invalid_guest_id"
datacenter: "{{ dc1 }}"
esxi_hostname: '{{ esxi1 }}'
hardware:
num_cpus: 1
memory_mb: 128
Expand All @@ -21,7 +22,7 @@

- debug: var=invalid_guest_0001_d1_c1_f0

- name: assert that changes were made
- name: assert that no changes were made
assert:
that:
- "not (invalid_guest_0001_d1_c1_f0 is changed)"
Expand Down

0 comments on commit 58ed77b

Please sign in to comment.