kubevirt_vm: Run integration test in random namespace

Run the integration tests for kubevirt_vm in a random namespace
and cleanup after the tests finish.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
Felix Matouschek
2024-08-15 13:31:48 +02:00
parent 00690ebc4c
commit 71ea312cfc
7 changed files with 46 additions and 10 deletions

View File

@@ -0,0 +1,42 @@
---
- name: Create VM
connection: local
gather_facts: false
hosts: localhost
tasks:
- name: Create a VM
kubevirt.core.kubevirt_vm:
name: testvm
namespace: {{ NAMESPACE }}
labels:
app: test
instancetype:
name: u1.small
preference:
name: centos.stream9
spec:
domain:
devices:
interfaces:
- name: default
masquerade: {}
- name: bridge-network
bridge: {}
networks:
- name: default
pod: {}
- name: bridge-network
multus:
networkName: {{ SECONDARY_NETWORK }}
volumes:
- containerDisk:
image: quay.io/containerdisks/centos-stream:9
name: containerdisk
- cloudInitNoCloud:
userData: |-
#cloud-config
ssh_authorized_keys:
- {{ '{{' }} lookup('file', 'testkey.pub') {{ '}}' }}
name: cloudinitdisk
wait: true
wait_timeout: 600