Skip to content

update tests to use 2.19 #610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/sanity-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
- stable-2.16
- stable-2.17
- stable-2.18
- stable-2.19
- devel
# - milestone
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions changelogs/fragments/609-test-with-219.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
trivial:
- run integration tests with ansible-core 2.19.0b5
(https://github.com/ansible-collections/vmware.vmware_rest/issues/593)
2 changes: 1 addition & 1 deletion tests/integration/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible-core
ansible-core==2.19.0b5

# required for vmware.vmware
requests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
register: ovf_item
- assert:
that:
- ovf_item is changed
- ovf_item is ansible.builtin.changed

- name: _Export again the VM as an OVF on the library
vmware.vmware_rest.vcenter_ovf_libraryitem:
Expand All @@ -130,8 +130,8 @@
register: _result
- assert:
that:
- not(_result is changed)
- _result.id
- not(_result is ansible.builtin.changed)
- _result.id is defined and _result.id != ''

- name: Get the list of items of the NFS library
vmware.vmware.content_library_item_info:
Expand Down Expand Up @@ -354,6 +354,7 @@
vmware.vmware_rest.content_subscribedlibrary:
library_id: "{{ sub_lib.id }}"
state: absent
when: sub_lib.id is defined

- name: Delete test VM
vmware.vmware_rest.vcenter_vm:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
- name: Verify VM template added to the library
ansible.builtin.assert:
that:
- nfs_lib_item is changed
- nfs_lib_item is ansible.builtin.changed

- name: _Create the same template again
vmware.vmware_rest.vcenter_vmtemplate_libraryitems:
Expand All @@ -83,7 +83,7 @@
- name: Verify no VM template added to the library
ansible.builtin.assert:
that:
- not (_result is changed)
- not (_result is ansible.builtin.changed)

- name: Get the list of items of the NFS library
vmware.vmware.content_library_item_info:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
- name: Verify an instant clone of VM is created
ansible.builtin.assert:
that:
- vm_instant_clone is changed
- vm_instant_clone is ansible.builtin.changed
- vm_instant_clone.value.name == vm2_name

- name: Create a clone of VM
Expand All @@ -71,7 +71,7 @@
- name: Verify a clone of VM is created
ansible.builtin.assert:
that:
- clone_vm is changed
- clone_vm is ansible.builtin.changed
- clone_vm.value.name == vm3_name

always:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
- name: Verify changed true
ansible.builtin.assert:
that:
- vm_dir_info.changed
- vm_dir_info is ansible.builtin.changed

- name: Create directory with name duplication in /tmp
vmware.vmware_rest.vcenter_vm_guest_filesystem_directories:
Expand All @@ -72,7 +72,7 @@
- name: Verify no changes
ansible.builtin.assert:
that:
- not vm_dir_info.changed
- vm_dir_info is not ansible.builtin.changed
- vm_dir_info.value.error_type == "ALREADY_EXISTS"

- name: Move directory in /tmp
Expand All @@ -96,7 +96,7 @@
- name: Verify changed true
ansible.builtin.assert:
that:
- vm_dir_info.changed
- vm_dir_info is ansible.builtin.changed

- name: Create a directory in /tmp
vmware.vmware_rest.vcenter_vm_guest_filesystem_directories:
Expand All @@ -117,7 +117,7 @@
- name: Verify changed true
ansible.builtin.assert:
that:
- vm_dir_info.changed
- vm_dir_info is ansible.builtin.changed

- name: Create a temporary directory in /tmp
vmware.vmware_rest.vcenter_vm_guest_filesystem_directories:
Expand All @@ -139,8 +139,8 @@
- name: Verify changed true
ansible.builtin.assert:
that:
- vm_dir_info_temp.changed
- vm_dir_info_temp.value
- vm_dir_info_temp is ansible.builtin.changed
- vm_dir_info_temp.value is defined and vm_dir_info_temp.value != ''

- name: Delete directories in /tmp
vmware.vmware_rest.vcenter_vm_guest_filesystem_directories:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- name: Verify VM creation
ansible.builtin.assert:
that:
- test_vm is changed
- test_vm is ansible.builtin.changed
- test_vm.value.identity.name == test_vm_name

- name: _Create a VM (again)
Expand All @@ -43,7 +43,7 @@
- name: Verify no VM created second time
ansible.builtin.assert:
that:
- not(result is changed)
- not(result is ansible.builtin.changed)

- name: Search VM with an invalid filter
vmware.vmware_rest.vcenter_vm_info:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
vmware.vmware_rest.vcenter_vm_hardware:
upgrade_policy: AFTER_CLEAN_SHUTDOWN
upgrade_version: VMX_21
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
register: _result

- name: Print debug info
Expand All @@ -13,13 +13,13 @@
- name: Verify VM hardware version was chenged
ansible.builtin.assert:
that:
- _result is changed
- _result is ansible.builtin.changed

- name: _Upgrade the VM hardware version (again)
vmware.vmware_rest.vcenter_vm_hardware:
upgrade_policy: AFTER_CLEAN_SHUTDOWN
upgrade_version: VMX_21
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
register: _result

- name: Print debug info
Expand All @@ -29,6 +29,6 @@
- name: Verify VM hardware version
ansible.builtin.assert:
that:
- not(_result is changed)
- not(_result is ansible.builtin.changed)
- _result.value.upgrade_status == "PENDING"
- _result.value.upgrade_version == "VMX_21"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Create a SATA adapter at PCI slot 34
vmware.vmware_rest.vcenter_vm_hardware_adapter_sata:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
pci_slot_number: 34
register: _sata_adapter_result_1

Expand All @@ -12,27 +12,27 @@
- name: Verify SATA adapter creation
ansible.builtin.assert:
that:
- _sata_adapter_result_1 is changed
- _sata_adapter_result_1 is ansible.builtin.changed
- _sata_adapter_result_1.value.pci_slot_number == 34
- '"SATA" in _sata_adapter_result_1.value.label'

- name: _Create a SATA adapter at PCI slot 34 (again)
vmware.vmware_rest.vcenter_vm_hardware_adapter_sata:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
pci_slot_number: 34
register: _sata_adapter_result_2

- name: Ensure the second call was idempotent
ansible.builtin.assert:
that:
- _sata_adapter_result_2 is not changed
- _sata_adapter_result_2 is not ansible.builtin.changed
- _sata_adapter_result_1.value.pci_slot_number == _sata_adapter_result_2.value.pci_slot_number
- _sata_adapter_result_1.id == _sata_adapter_result_2.id

- name: Get information about a specific controller
vmware.vmware_rest.vcenter_vm_hardware_adapter_sata_info:
vm: '{{ test_vm_id }}'
adapter: '{{ _sata_adapter_result_1.id }}'
vm: "{{ test_vm_id }}"
adapter: "{{ _sata_adapter_result_1.id }}"
register: adapter_sata_info

- name: Print debug info
Expand All @@ -46,7 +46,7 @@

- name: List the controller
vmware.vmware_rest.vcenter_vm_hardware_adapter_sata_info:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
register: adapters_info

- name: Verify SATA adapter is in a list of controllers
Expand All @@ -56,43 +56,43 @@

- name: List the SCSI adapter of a given VM
vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi_info:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
register: _result

- name: Verify list the SCSI adapter of a given VM found
ansible.builtin.assert:
that:
- _result is not failed
- _result is not failed

- name: Create a SCSI adapter at PCI slot 35
vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
pci_slot_number: 35
register: _scsi_adapter_result_1

- name: _Create a SCSI adapter at PCI slot 35 (again)
vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
pci_slot_number: 35
register: _scsi_adapter_result_2

- name: Ensure the second call was idempotent
ansible.builtin.assert:
that:
- _scsi_adapter_result_2 is not changed
- _scsi_adapter_result_2 is not ansible.builtin.changed
- _scsi_adapter_result_1.value.pci_slot_number == _scsi_adapter_result_2.value.pci_slot_number
- _scsi_adapter_result_1.id == _scsi_adapter_result_2.id

- name: Drop the SCSI controller
vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
pci_slot_number: 35
state: absent
register: _result

- name: Get list of SCSI adapters
vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi_info:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
register: _result

- name: Verify SCSI adapter droped
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- name: Retrieve the boot information from the VM
vmware.vmware_rest.vcenter_vm_hardware_boot_info:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
register: hardware_boot_info

- name: Print debug info
Expand All @@ -9,7 +9,7 @@

- name: Change a VM boot parameters
vmware.vmware_rest.vcenter_vm_hardware_boot:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
type: EFI
efi_legacy_boot: true
register: _result
Expand All @@ -21,11 +21,11 @@
- name: Verify boot device parameters were applied
ansible.builtin.assert:
that:
- _result is changed
- _result is ansible.builtin.changed

- name: _Change a VM boot parameters (again)
vmware.vmware_rest.vcenter_vm_hardware_boot:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
efi_legacy_boot: true
type: EFI
register: _result
Expand All @@ -37,11 +37,11 @@
- name: Verify boot device parameters weren't applied
ansible.builtin.assert:
that:
- not(_result is changed)
- not(_result is ansible.builtin.changed)

- name: Get information about the boot device
vmware.vmware_rest.vcenter_vm_hardware_boot_device_info:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
register: _result

- name: Print debug info
Expand All @@ -50,7 +50,7 @@

- name: Restore a VM boot parameters
vmware.vmware_rest.vcenter_vm_hardware_boot:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
type: EFI
efi_legacy_boot: false
register: _result
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Attach an ISO image to a guest VM
vmware.vmware_rest.vcenter_vm_hardware_cdrom:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
type: SATA
sata:
bus: 0
Expand All @@ -19,13 +19,13 @@
- name: Verify ISO image attached
ansible.builtin.assert:
that:
- _cdrom_info is changed
- _cdrom_info is ansible.builtin.changed
- _cdrom_info.value.backing.iso_file == "{{ rhel_9_3_iso_path }}"
- _cdrom_info.value.type == "SATA"

- name: Attach an ISO image to a guest VM (again)
vmware.vmware_rest.vcenter_vm_hardware_cdrom:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
type: SATA
sata:
bus: 0
Expand All @@ -38,11 +38,11 @@

- name: Ensure idempotency
ansible.builtin.assert:
that: _result is not changed
that: _result is not ansible.builtin.changed

- name: List the cdrom devices on the guest
vmware.vmware_rest.vcenter_vm_hardware_cdrom_info:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
register: _cdrom_list

- name: Print debug info
Expand All @@ -56,7 +56,7 @@

- name: Set a boot device
vmware.vmware_rest.vcenter_vm_hardware_boot_device:
vm: '{{ test_vm_id }}'
vm: "{{ test_vm_id }}"
devices:
- type: "CDROM"
register: _result
Expand All @@ -68,4 +68,4 @@
- name: Verify boot device was set
ansible.builtin.assert:
that:
- _result is changed
- _result is ansible.builtin.changed
Loading