virshtest: Adapt 'virsh-start' and 'virsh-undefine' tests as 'lifecycle' case

The 'virsh-start' case simply tried to start an already running VM. This
can be easily tested together with the tests for undefining a VM.

For this test the test driver config with multiple VMs comes handy as we
need to test 3 situations when we undefine and stop the VM.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa committed 2024-04-02 14:24:30 +02:00
1 parent 6bc71ed27c
commit a068dec641
6 files changed
+130 -119

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
list --all
echo test failure when starting already running guest
start fv0
echo undefine a running domain - by domain name
dominfo fc4
undefine fc4
dominfo fc4
shutdown fc4
dominfo fc4
echo undefine a running domain - by domain id
dominfo 3
undefine 3
dominfo 3
shutdown 3
dominfo fc5
echo shutdown then undefine
shutdown fv0
undefine fv0
dominfo fv0
+106
View File
@@ -0,0 +1,106 @@
Id Name State
----------------------
1 fv0 running
2 fc4 running
3 fc5 running
test failure when starting already running guest
error: Domain is already active
undefine a running domain - by domain name
Id: 2
Name: fc4
UUID: ef861801-45b9-11cb-88e3-afbfe5370493
OS Type: linux
State: running
CPU(s): 1
Max memory: 261072 KiB
Used memory: 131072 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: testSecurity
Security DOI:
Security label: libvirt-test (enforcing)
Messages: tainted: network configuration using opaque shell scripts
Domain 'fc4' has been undefined
Id: 2
Name: fc4
UUID: ef861801-45b9-11cb-88e3-afbfe5370493
OS Type: linux
State: running
CPU(s): 1
Max memory: 261072 KiB
Used memory: 131072 KiB
Persistent: no
Autostart: disable
Managed save: no
Security model: testSecurity
Security DOI:
Security label: libvirt-test (enforcing)
Messages: tainted: network configuration using opaque shell scripts
Domain 'fc4' is being shutdown
error: failed to get domain 'fc4'
undefine a running domain - by domain id
Id: 3
Name: fc5
UUID: 08721f99-3d1d-4aec-96eb-97803297bb36
OS Type: linux
State: running
CPU(s): 4
Max memory: 2097152 KiB
Used memory: 2097152 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: testSecurity
Security DOI:
Security label: libvirt-test (enforcing)
Messages: tainted: running with undesirable elevated privileges
tainted: network configuration using opaque shell scripts
tainted: use of host cdrom passthrough
tainted: custom device tree blob used
tainted: use of deprecated configuration settings
deprecated configuration: CPU model Deprecated-Test
Domain '3' has been undefined
Id: 3
Name: fc5
UUID: 08721f99-3d1d-4aec-96eb-97803297bb36
OS Type: linux
State: running
CPU(s): 4
Max memory: 2097152 KiB
Used memory: 2097152 KiB
Persistent: no
Autostart: disable
Managed save: no
Security model: testSecurity
Security DOI:
Security label: libvirt-test (enforcing)
Messages: tainted: running with undesirable elevated privileges
tainted: network configuration using opaque shell scripts
tainted: use of host cdrom passthrough
tainted: custom device tree blob used
tainted: use of deprecated configuration settings
deprecated configuration: CPU model Deprecated-Test
Domain '3' is being shutdown
error: failed to get domain 'fc5'
shutdown then undefine
Domain 'fv0' is being shutdown
Domain 'fv0' has been undefined
error: failed to get domain 'fv0'
## Exit code: 1