tests: Cleanup after inventory test

Cleanup the created the created VMs after the inventory integration
tests collected the inventory test results to not leave running VMs
behind after the test finished.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
Felix Matouschek
2024-03-18 17:00:53 +01:00
parent bbe86b89ba
commit eb2291692d
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
---
- name: Create VMs
connection: local
gather_facts: false
hosts: localhost
tasks:
- name: Create a VM
kubevirt.core.kubevirt_vm:
state: absent
name: testvm1
namespace: default
wait: true
- name: Create another VM
kubevirt.core.kubevirt_vm:
state: absent
name: testvm2
namespace: default
wait: true

View File

@@ -13,4 +13,6 @@ ansible-inventory -i test.kubevirt.yml -y --list --output all.yml "$@"
ansible-inventory -i test.label.kubevirt.yml -y --list --output label.yml "$@"
ansible-inventory -i test.net.kubevirt.yml -y --list --output net.yml "$@"
ansible-playbook cleanup.yml "$@"
ansible-playbook verify.yml "$@"