]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2argvtest: Consolidate and modernize CPU topology testing
authorPeter Krempa <pkrempa@redhat.com>
Fri, 1 Sep 2023 12:41:42 +0000 (14:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 6 Sep 2023 12:09:45 +0000 (14:09 +0200)
Move the 'smp-dies' test case into 'cpu-topology4' and remove
unnecessary cruft.

Remove cpu definition from 'cpu-topology2' as it's not relevant to the
test case.

Remove 'smp' case as it's covered by the rest.

Use real capabilities for all of them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
14 files changed:
tests/qemuxml2argvdata/cpu-topology1.x86_64-latest.args [moved from tests/qemuxml2argvdata/cpu-topology3.args with 96% similarity]
tests/qemuxml2argvdata/cpu-topology1.xml
tests/qemuxml2argvdata/cpu-topology2.x86_64-latest.args [moved from tests/qemuxml2argvdata/cpu-topology2.args with 98% similarity]
tests/qemuxml2argvdata/cpu-topology2.xml
tests/qemuxml2argvdata/cpu-topology3.x86_64-latest.args [moved from tests/qemuxml2argvdata/cpu-topology1.args with 100% similarity]
tests/qemuxml2argvdata/cpu-topology3.xml
tests/qemuxml2argvdata/cpu-topology4.x86_64-latest.args [moved from tests/qemuxml2argvdata/smp-dies.args with 74% similarity]
tests/qemuxml2argvdata/cpu-topology4.xml [new file with mode: 0644]
tests/qemuxml2argvdata/smp-dies.xml [deleted file]
tests/qemuxml2argvdata/smp.args [deleted file]
tests/qemuxml2argvdata/smp.xml [deleted file]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/smp.x86_64-latest.xml [deleted file]
tests/qemuxml2xmltest.c

similarity index 96%
rename from tests/qemuxml2argvdata/cpu-topology3.args
rename to tests/qemuxml2argvdata/cpu-topology1.x86_64-latest.args
index c11b4cd307f1069edff1d068bc39f134b81ff641..009c08d71afc53da7d48a58040c7bd1edc4de79d 100644 (file)
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -m size=219136k \
 -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
--smp 6,sockets=3,dies=1,cores=2,threads=1 \
+-smp 1,maxcpus=6,sockets=3,dies=1,cores=2,threads=1 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
 -display none \
 -no-user-config \
index af82a1c51a11e7a7f1df3396bd9de03938155d65..5cf49987e1f8f26536d48f81b95ff12ef821c73e 100644 (file)
@@ -3,7 +3,7 @@
   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
   <memory unit='KiB'>219100</memory>
   <currentMemory unit='KiB'>219100</currentMemory>
-  <vcpu placement='static'>6</vcpu>
+  <vcpu placement='static' current='1'>6</vcpu>
   <os>
     <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='network'/>
@@ -16,6 +16,6 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-      <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
   </devices>
 </domain>
similarity index 98%
rename from tests/qemuxml2argvdata/cpu-topology2.args
rename to tests/qemuxml2argvdata/cpu-topology2.x86_64-latest.args
index 4639d34c562c95b0ea6da1dffa4e72fbd2282f15..7ba175fa80184104aa32204dc9a3be013f441f81 100644 (file)
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
 -machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
 -accel tcg \
--cpu core2duo \
+-cpu qemu64 \
 -m size=219136k \
 -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
index 1b113b8b1303754cde77688ca81df915a9297815..dd125ec4e2fe3456d8a2d477e5bc58cb5dede547 100644 (file)
@@ -8,8 +8,7 @@
     <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='network'/>
   </os>
-  <cpu match='exact'>
-    <model>core2duo</model>
+  <cpu>
     <topology sockets="1" dies="1" cores="2" threads="3"/>
   </cpu>
   <clock offset='utc'/>
@@ -17,6 +16,6 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-      <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
   </devices>
 </domain>
index af82a1c51a11e7a7f1df3396bd9de03938155d65..f8175fcd8199460cc1fac3388b319734434b44c8 100644 (file)
@@ -16,6 +16,6 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-      <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
   </devices>
 </domain>
similarity index 74%
rename from tests/qemuxml2argvdata/smp-dies.args
rename to tests/qemuxml2argvdata/cpu-topology4.x86_64-latest.args
index a4d5fc3372e1f501d27bf0bd2c0652749ec9fca9..d0e31ba2b583aa7da46ab96064b421572af6514f 100644 (file)
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -m size=219136k \
 -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
--smp 1,maxcpus=4,sockets=2,dies=2,cores=1,threads=1 \
+-smp 1,maxcpus=6,sockets=1,dies=3,cores=2,threads=1 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
 -display none \
 -no-user-config \
@@ -27,9 +27,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -boot strict=on \
 -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
--blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
--device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
+-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2argvdata/cpu-topology4.xml b/tests/qemuxml2argvdata/cpu-topology4.xml
new file mode 100644 (file)
index 0000000..a60b586
--- /dev/null
@@ -0,0 +1,21 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static' current='1'>6</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <cpu>
+    <topology sockets='1' dies='3' cores='2' threads='1'/>
+  </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>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/smp-dies.xml b/tests/qemuxml2argvdata/smp-dies.xml
deleted file mode 100644 (file)
index a29786c..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219136</memory>
-  <currentMemory unit='KiB'>219136</currentMemory>
-  <vcpu placement='static' current='1'>4</vcpu>
-  <os>
-    <type arch='x86_64' machine='pc'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <cpu>
-    <topology sockets='2' dies='2' cores='1' threads='1'/>
-  </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='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0'/>
-    <controller type='ide' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <memballoon model='none'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/smp.args b/tests/qemuxml2argvdata/smp.args
deleted file mode 100644 (file)
index 352b1d3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-/usr/bin/qemu-system-x86_64 \
--name guest=QEMUGuest1,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
--accel tcg \
--cpu qemu64 \
--m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
--overcommit mem-lock=off \
--smp 1,maxcpus=2,sockets=2,dies=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--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 \
--device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
--blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
--device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \
--audiodev '{"id":"audio1","driver":"none"}' \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxml2argvdata/smp.xml b/tests/qemuxml2argvdata/smp.xml
deleted file mode 100644 (file)
index 274aa37..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219136</memory>
-  <currentMemory unit='KiB'>219136</currentMemory>
-  <vcpu placement='static' current='1'>2</vcpu>
-  <os>
-    <type arch='x86_64' machine='pc'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <cpu>
-    <topology sockets='2' dies='1' cores='1' threads='1'/>
-  </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='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0'/>
-    <controller type='ide' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <memballoon model='none'/>
-  </devices>
-</domain>
index ec06a734a1b945c4a2ce7546f371ef7030767ec6..d218b17d57b9264ea984290f15f4a02abe9ffab4 100644 (file)
@@ -1723,9 +1723,6 @@ mymain(void)
     DO_TEST_NOCAPS("qemu-ns-no-env");
     DO_TEST_NOCAPS("qemu-ns-alt");
 
-    DO_TEST_NOCAPS("smp");
-    DO_TEST("smp-dies", QEMU_CAPS_SMP_DIES);
-
     DO_TEST_CAPS_LATEST("iothreads-ids");
     DO_TEST_CAPS_LATEST("iothreads-ids-partial");
     DO_TEST_CAPS_LATEST("iothreads-ids-pool-sizes");
@@ -1735,9 +1732,11 @@ mymain(void)
     DO_TEST_CAPS_LATEST("iothreads-virtio-scsi-pci");
     DO_TEST_CAPS_ARCH_LATEST("iothreads-virtio-scsi-ccw", "s390x");
 
-    DO_TEST_NOCAPS("cpu-topology1");
-    DO_TEST_NOCAPS("cpu-topology2");
-    DO_TEST_NOCAPS("cpu-topology3");
+    DO_TEST_CAPS_LATEST("cpu-topology1");
+    DO_TEST_CAPS_LATEST("cpu-topology2");
+    DO_TEST_CAPS_LATEST("cpu-topology3");
+    DO_TEST_CAPS_LATEST("cpu-topology4");
+
     DO_TEST("cpu-minimum1", QEMU_CAPS_KVM);
     DO_TEST("cpu-minimum2", QEMU_CAPS_KVM);
     DO_TEST("cpu-exact1", QEMU_CAPS_KVM);
diff --git a/tests/qemuxml2xmloutdata/smp.x86_64-latest.xml b/tests/qemuxml2xmloutdata/smp.x86_64-latest.xml
deleted file mode 100644 (file)
index a7f324a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219136</memory>
-  <currentMemory unit='KiB'>219136</currentMemory>
-  <vcpu placement='static' current='1'>2</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>
-    <topology sockets='2' dies='1' cores='1' threads='1'/>
-  </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='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0' model='piix3-uhci'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
-    </controller>
-    <controller type='ide' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
-    </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='none'/>
-  </devices>
-</domain>
index 3b8eab63461a61fcb98681ee99e86d8a6693559e..72f976358ff6b6a07edac6c95efade4cd1a3e73b 100644 (file)
@@ -466,7 +466,6 @@ mymain(void)
     DO_TEST_CAPS_LATEST("cputune-cpuset-big-id");
     DO_TEST_CAPS_LATEST("numavcpus-topology-mismatch");
 
-    DO_TEST_CAPS_LATEST("smp");
     DO_TEST_CAPS_LATEST("iothreads-ids");
     DO_TEST_CAPS_LATEST("iothreads-ids-pool-sizes");
     DO_TEST_CAPS_LATEST("iothreads-ids-partial");