mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-05-13 13:02:04 +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
|
name: testvm2
|
||||||
namespace: default
|
namespace: default
|
||||||
wait: true
|
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
|
name: containerdisk
|
||||||
wait: true
|
wait: true
|
||||||
wait_timeout: 600
|
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:
|
ansible.builtin.include_vars:
|
||||||
file: all.yml
|
file: all.yml
|
||||||
name: inv_all
|
name: inv_all
|
||||||
- name: Assert two instances with different labels
|
- name: Assert all expected hosts were discovered
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- inv_all['all']['children']['label_app_test']['hosts'] | length == 1
|
- inv_all['all']['children']['label_app_test']['hosts'] | length == 1
|
||||||
- inv_all['all']['children']['label_foo_bar']['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
|
- name: Read filtered inventory
|
||||||
ansible.builtin.include_vars:
|
ansible.builtin.include_vars:
|
||||||
file: label.yml
|
file: label.yml
|
||||||
|
|||||||
Reference in New Issue
Block a user