Files
kubevirt.core/tests/integration/targets/kubevirt_vm/verify.yml
Felix Matouschek ea8447dee8 fix(tests,kubevirt_vm): Fix assertion in verify.yml
Fix the assertion that was introduced in
2521e8ba24 by removing the superfluous 'd'
at the end of the variable names.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-05 16:17:31 +02:00

51 lines
1.2 KiB
YAML

---
- name: Verify creation with existing VM
connection: local
gather_facts: false
hosts: localhost
tasks:
- name: Create a VM
kubevirt.core.kubevirt_vm:
name: testvm
namespace: default
labels:
app: test
register: recreate
- name: Assert module reported no or expected changes
ansible.builtin.assert:
that:
- >-
not recreate.changed or
recreate.changed and
recreate.method == "update" and
recreate.diff.before.metadata.annotations.get('kubemacpool.io/transaction-timestamp') and
not recreate.diff.after.metadata.annotations
- name: Delete VM
connection: local
gather_facts: false
hosts: localhost
tasks:
- name: Delete a VM
kubevirt.core.kubevirt_vm:
name: testvm
namespace: default
state: absent
wait: true
- name: Verify VM deletion
connection: local
gather_facts: false
hosts: localhost
tasks:
- name: Delete a VM
kubevirt.core.kubevirt_vm:
name: testvm
namespace: default
state: absent
register: delete
- name: Assert module reported no changes
ansible.builtin.assert:
that:
- not delete.changed