]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuxml2xmltest: Modernize all test cases using QEMU_CAPS_QCOW2_LUKS
authorPeter Krempa <pkrempa@redhat.com>
Fri, 15 Jul 2022 14:35:27 +0000 (16:35 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 11 Aug 2022 12:38:31 +0000 (14:38 +0200)
Modernize 'disk-nvme', 'encrypted-disk-usage', 'encrypted-disk', and
'user-aliases' cases to use DO_TEST_CAPS_LATEST.

This will remove all uses of QEMU_CAPS_QCOW2_LUKS from the test suite.

Since the output files are done via symlinks to input files, the input
files need to be modernized with few auto-added XML bits.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
12 files changed:
tests/qemuxml2argvdata/disk-nvme.xml
tests/qemuxml2argvdata/encrypted-disk-usage.xml
tests/qemuxml2argvdata/user-aliases.xml
tests/qemuxml2xmloutdata/disk-nvme.x86_64-latest.xml [new symlink]
tests/qemuxml2xmloutdata/disk-nvme.xml [deleted symlink]
tests/qemuxml2xmloutdata/encrypted-disk-usage.x86_64-latest.xml [new symlink]
tests/qemuxml2xmloutdata/encrypted-disk-usage.xml [deleted symlink]
tests/qemuxml2xmloutdata/encrypted-disk.x86_64-latest.xml [new file with mode: 0644]
tests/qemuxml2xmloutdata/encrypted-disk.xml [deleted file]
tests/qemuxml2xmloutdata/user-aliases.x86_64-latest.xml [new symlink]
tests/qemuxml2xmloutdata/user-aliases.xml [deleted symlink]
tests/qemuxml2xmltest.c

index 226ea3d68630b132bc62ab7b695d44a3a3713f71..5e521ad6d3457067cfbfd7adbc8fcef2c2f8c695 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>
@@ -49,7 +52,7 @@
       <target dev='vdd' bus='virtio'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
     </disk>
-    <controller type='usb' index='0'>
+    <controller type='usb' index='0' model='piix3-uhci'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
index 43afacf220a8113ed174ed4a28d4d40fcb5662e4..7c5781b96fde00f74e87a84173f1fb603b8c2420 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>
@@ -23,7 +26,7 @@
       </encryption>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
     </disk>
-    <controller type='usb' index='0'>
+    <controller type='usb' index='0' model='piix3-uhci'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
index b688b84b565e1c8fb280d96ead52ea27c75c159a..9998c1e08f0f8d93783494297cde13b4c1e06c75 100644 (file)
@@ -19,7 +19,8 @@
     <apic/>
     <pae/>
   </features>
-  <cpu>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
     <numa>
       <cell id='0' cpus='0' memory='1048576' unit='KiB'/>
       <cell id='1' cpus='1' memory='1048576' unit='KiB'/>
@@ -70,7 +71,7 @@
       <alias name='ua-WhatAnAwesomeCDROM'/>
       <address type='drive' controller='0' bus='1' target='0' unit='0'/>
     </disk>
-    <controller type='usb' index='0'>
+    <controller type='usb' index='0' model='piix3-uhci'>
       <alias name='ua-SomeWeirdController'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
diff --git a/tests/qemuxml2xmloutdata/disk-nvme.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-nvme.x86_64-latest.xml
new file mode 120000 (symlink)
index 0000000..ea9eb26
--- /dev/null
@@ -0,0 +1 @@
+../qemuxml2argvdata/disk-nvme.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/disk-nvme.xml b/tests/qemuxml2xmloutdata/disk-nvme.xml
deleted file mode 120000 (symlink)
index ea9eb26..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../qemuxml2argvdata/disk-nvme.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/encrypted-disk-usage.x86_64-latest.xml b/tests/qemuxml2xmloutdata/encrypted-disk-usage.x86_64-latest.xml
new file mode 120000 (symlink)
index 0000000..a1a4f84
--- /dev/null
@@ -0,0 +1 @@
+../qemuxml2argvdata/encrypted-disk-usage.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/encrypted-disk-usage.xml b/tests/qemuxml2xmloutdata/encrypted-disk-usage.xml
deleted file mode 120000 (symlink)
index a1a4f84..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../qemuxml2argvdata/encrypted-disk-usage.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/encrypted-disk.x86_64-latest.xml b/tests/qemuxml2xmloutdata/encrypted-disk.x86_64-latest.xml
new file mode 100644 (file)
index 0000000..abf0bf5
--- /dev/null
@@ -0,0 +1,40 @@
+<domain type='qemu'>
+  <name>encryptdisk</name>
+  <uuid>496898a6-e6ff-f7c8-5dc2-3cf410945ee9</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <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>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2'/>
+      <source file='/storage/guest_disks/encryptdisk'/>
+      <target dev='vda' bus='virtio'/>
+      <encryption format='luks' engine='qemu'>
+        <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
+      </encryption>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+    </disk>
+    <controller type='usb' index='0' model='piix3-uhci'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <audio id='1' type='none'/>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+    </memballoon>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/encrypted-disk.xml b/tests/qemuxml2xmloutdata/encrypted-disk.xml
deleted file mode 100644 (file)
index b840f35..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<domain type='qemu'>
-  <name>encryptdisk</name>
-  <uuid>496898a6-e6ff-f7c8-5dc2-3cf410945ee9</uuid>
-  <memory unit='KiB'>1048576</memory>
-  <currentMemory unit='KiB'>524288</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>
-    <disk type='file' device='disk'>
-      <driver name='qemu' type='qcow2'/>
-      <source file='/storage/guest_disks/encryptdisk'/>
-      <target dev='vda' bus='virtio'/>
-      <encryption format='luks' engine='qemu'>
-        <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
-      </encryption>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
-    </disk>
-    <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
-    </controller>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <audio id='1' type='none'/>
-    <memballoon model='virtio'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
-    </memballoon>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2xmloutdata/user-aliases.x86_64-latest.xml b/tests/qemuxml2xmloutdata/user-aliases.x86_64-latest.xml
new file mode 120000 (symlink)
index 0000000..b5a27f0
--- /dev/null
@@ -0,0 +1 @@
+../qemuxml2argvdata/user-aliases.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/user-aliases.xml b/tests/qemuxml2xmloutdata/user-aliases.xml
deleted file mode 120000 (symlink)
index b5a27f0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../qemuxml2argvdata/user-aliases.xml
\ No newline at end of file
index 8299c724c1264005b8ceabba03270f0328d9cb2d..32e331ca5d7d1b49a391ee107325e9da0d10fc6d 100644 (file)
@@ -349,7 +349,7 @@ mymain(void)
     DO_TEST_NOCAPS("disk-network-tlsx509-nbd");
     DO_TEST_CAPS_LATEST("disk-network-tlsx509-nbd-hostname");
     DO_TEST_NOCAPS("disk-network-tlsx509-vxhs");
-    DO_TEST("disk-nvme", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_QCOW2_LUKS);
+    DO_TEST_CAPS_LATEST("disk-nvme");
     DO_TEST_CAPS_LATEST("disk-vhostuser");
     DO_TEST_CAPS_LATEST("disk-scsi");
     DO_TEST("disk-virtio-scsi-reservations",
@@ -570,8 +570,8 @@ mymain(void)
     DO_TEST_CAPS_LATEST("disk-slices");
     DO_TEST_CAPS_LATEST("disk-rotation");
 
-    DO_TEST("encrypted-disk", QEMU_CAPS_QCOW2_LUKS);
-    DO_TEST("encrypted-disk-usage", QEMU_CAPS_QCOW2_LUKS);
+    DO_TEST_CAPS_LATEST("encrypted-disk");
+    DO_TEST_CAPS_LATEST("encrypted-disk-usage");
     DO_TEST_CAPS_LATEST("luks-disks");
     DO_TEST_CAPS_LATEST("luks-disks-source");
     DO_TEST_CAPS_LATEST("luks-disks-source-qcow2");
@@ -1297,14 +1297,7 @@ mymain(void)
     DO_TEST_CAPS_ARCH_LATEST("pseries-cpu-compat", "ppc64");
     DO_TEST_CAPS_ARCH_LATEST("pseries-cpu-exact", "ppc64");
 
-    DO_TEST("user-aliases",
-            QEMU_CAPS_DEVICE_CIRRUS_VGA,
-            QEMU_CAPS_QCOW2_LUKS,
-            QEMU_CAPS_OBJECT_MEMORY_FILE,
-            QEMU_CAPS_PIIX_DISABLE_S3,
-            QEMU_CAPS_PIIX_DISABLE_S4,
-            QEMU_CAPS_VNC,
-            QEMU_CAPS_CCID_EMULATED);
+    DO_TEST_CAPS_LATEST("user-aliases");
     DO_TEST("input-virtio-ccw",
             QEMU_CAPS_CCW,
             QEMU_CAPS_VIRTIO_KEYBOARD,