]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2(argv|xml)test: Sanitize testing of default video type on x86_64
authorPeter Krempa <pkrempa@redhat.com>
Tue, 15 Aug 2023 14:46:05 +0000 (16:46 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 22 Aug 2023 12:04:41 +0000 (14:04 +0200)
Use real capabilities and remove the redundant test case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-0.err [deleted file]
tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-1.xml [deleted file]
tests/qemuxml2argvdata/default-video-type-x86_64.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/default-video-type-x86_64.xml [moved from tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-0.xml with 100% similarity]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/default-video-type-x86_64-caps-test-0.xml [deleted file]
tests/qemuxml2xmloutdata/default-video-type-x86_64.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/default-video-type-x86_64-caps-test-1.xml with 91% similarity]
tests/qemuxml2xmltest.c

diff --git a/tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-0.err b/tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-0.err
deleted file mode 100644 (file)
index 28ffb0c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-internal error: missing video model and cannot determine default
diff --git a/tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-1.xml b/tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-1.xml
deleted file mode 100644 (file)
index 2142db8..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<domain type='kvm'>
-  <name>default-video-type-x86_64-test</name>
-  <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
-  <memory unit='KiB'>1048576</memory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='x86_64' machine='pc'>hvm</type>
-  </os>
-  <devices>
-    <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <controller type='usb' index='0' model='none'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <memballoon model='none'/>
-    <graphics type='spice'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/default-video-type-x86_64.x86_64-latest.args b/tests/qemuxml2argvdata/default-video-type-x86_64.x86_64-latest.args
new file mode 100644 (file)
index 0000000..247927f
--- /dev/null
@@ -0,0 +1,32 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-default-video-type-x \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-default-video-type-x/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-default-video-type-x/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-default-video-type-x/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=default-video-type-x86_64-test,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-default-video-type-x/master-key.aes"}' \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-accel kvm \
+-cpu qemu64 \
+-m size=1048576k \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-audiodev '{"id":"audio1","driver":"spice"}' \
+-spice port=0,seamless-migration=on \
+-device '{"driver":"cirrus-vga","id":"video0","bus":"pci.0","addr":"0x2"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
index ff3a070cbb7702db9ea50c2cfaaab6b727a0f761..b868b3ac6627c269c960b4381b0bacb11ff5e4e1 100644 (file)
@@ -2062,7 +2062,7 @@ mymain(void)
     DO_TEST("video-none-device",
             QEMU_CAPS_VNC);
     DO_TEST_PARSE_ERROR_NOCAPS("video-invalid-multiple-devices");
-    DO_TEST_PARSE_ERROR_NOCAPS("default-video-type-x86_64-caps-test-0");
+    DO_TEST_CAPS_LATEST("default-video-type-x86_64");
 
     DO_TEST_CAPS_ARCH_LATEST("default-video-type-aarch64", "aarch64");
     DO_TEST_CAPS_ARCH_LATEST("default-video-type-ppc64", "ppc64");
diff --git a/tests/qemuxml2xmloutdata/default-video-type-x86_64-caps-test-0.xml b/tests/qemuxml2xmloutdata/default-video-type-x86_64-caps-test-0.xml
deleted file mode 100644 (file)
index 596364f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<domain type='kvm'>
-  <name>default-video-type-x86_64-test</name>
-  <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
-  <memory unit='KiB'>1048576</memory>
-  <currentMemory unit='KiB'>1048576</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='x86_64' machine='pc'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <controller type='usb' index='0' model='none'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <graphics type='spice'>
-      <listen type='none'/>
-    </graphics>
-    <audio id='1' type='spice'/>
-    <video>
-      <model type='vga' vram='16384' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
-    </video>
-    <memballoon model='none'/>
-  </devices>
-</domain>
similarity index 91%
rename from tests/qemuxml2xmloutdata/default-video-type-x86_64-caps-test-1.xml
rename to tests/qemuxml2xmloutdata/default-video-type-x86_64.x86_64-latest.xml
index a86f785b441371ec57f7ac515f39a754f773abe6..b9b50bae84e7a50f280a6c9b2ab1143bfc58c56a 100644 (file)
@@ -8,6 +8,9 @@
     <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
index 85851a8240165cc8c168ef6b1d5a87bdb0b6cdbb..3296f92dc8a5730e37ea09275bbbf13e1cce4d22 100644 (file)
@@ -378,12 +378,7 @@ mymain(void)
     DO_TEST_CAPS_ARCH_LATEST("default-video-type-ppc64", "ppc64");
     DO_TEST_CAPS_ARCH_LATEST("default-video-type-riscv64", "riscv64");
     DO_TEST_CAPS_ARCH_LATEST("default-video-type-s390x", "s390x");
-    DO_TEST("default-video-type-x86_64-caps-test-0",
-            QEMU_CAPS_DEVICE_VGA,
-            QEMU_CAPS_SPICE);
-    DO_TEST("default-video-type-x86_64-caps-test-1",
-            QEMU_CAPS_DEVICE_CIRRUS_VGA,
-            QEMU_CAPS_SPICE);
+    DO_TEST_CAPS_LATEST("default-video-type-x86_64");
 
     DO_TEST("graphics-sdl", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_SDL);
     DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_SDL);