mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-03-26 19:03:16 +00:00
test(inventory): Add integration test for stopped VMs
Add an integration test that ensures that the inventory supports looking up stopped VMs. Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
@@ -17,3 +17,10 @@
|
||||
name: testvm2
|
||||
namespace: default
|
||||
wait: true
|
||||
|
||||
- name: Delete the stopped VM
|
||||
kubevirt.core.kubevirt_vm:
|
||||
state: absent
|
||||
name: testvm-stopped
|
||||
namespace: default
|
||||
wait: true
|
||||
|
||||
@@ -52,3 +52,13 @@
|
||||
name: containerdisk
|
||||
wait: true
|
||||
wait_timeout: 600
|
||||
|
||||
- name: Create a stopped VM
|
||||
kubevirt.core.kubevirt_vm:
|
||||
state: present
|
||||
name: testvm-stopped
|
||||
namespace: default
|
||||
running: false
|
||||
spec:
|
||||
domain:
|
||||
devices: {}
|
||||
|
||||
@@ -16,11 +16,12 @@
|
||||
ansible.builtin.include_vars:
|
||||
file: all.yml
|
||||
name: inv_all
|
||||
- name: Assert two instances with different labels
|
||||
- name: Assert all expected hosts were discovered
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- inv_all['all']['children']['label_app_test']['hosts'] | length == 1
|
||||
- inv_all['all']['children']['label_foo_bar']['hosts'] | length == 1
|
||||
- "'default-testvm-stopped' in inv_all['all']['children']['test']['children']['namespace_default']['hosts']"
|
||||
- name: Read filtered inventory
|
||||
ansible.builtin.include_vars:
|
||||
file: label.yml
|
||||
|
||||
Reference in New Issue
Block a user