[PATCH 37/51] qemuxml2argvtest: Consolidate and modernize CPU topology testing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 ....args => cpu-topology1.x86_64-latest.args} |  2 +-
 tests/qemuxml2argvdata/cpu-topology1.xml      |  4 +-
 ....args => cpu-topology2.x86_64-latest.args} |  2 +-
 tests/qemuxml2argvdata/cpu-topology2.xml      |  5 +--
 ....args => cpu-topology3.x86_64-latest.args} |  0
 tests/qemuxml2argvdata/cpu-topology3.xml      |  2 +-
 ....args => cpu-topology4.x86_64-latest.args} |  6 +--
 tests/qemuxml2argvdata/cpu-topology4.xml      | 21 ++++++++++
 tests/qemuxml2argvdata/smp-dies.xml           | 33 ----------------
 tests/qemuxml2argvdata/smp.args               | 35 -----------------
 tests/qemuxml2argvdata/smp.xml                | 33 ----------------
 tests/qemuxml2argvtest.c                      | 11 +++---
 .../qemuxml2xmloutdata/smp.x86_64-latest.xml  | 39 -------------------
 tests/qemuxml2xmltest.c                       |  1 -
 14 files changed, 35 insertions(+), 159 deletions(-)
 rename tests/qemuxml2argvdata/{cpu-topology3.args => cpu-topology1.x86_64-latest.args} (96%)
 rename tests/qemuxml2argvdata/{cpu-topology2.args => cpu-topology2.x86_64-latest.args} (98%)
 rename tests/qemuxml2argvdata/{cpu-topology1.args => cpu-topology3.x86_64-latest.args} (100%)
 rename tests/qemuxml2argvdata/{smp-dies.args => cpu-topology4.x86_64-latest.args} (74%)
 create mode 100644 tests/qemuxml2argvdata/cpu-topology4.xml
 delete mode 100644 tests/qemuxml2argvdata/smp-dies.xml
 delete mode 100644 tests/qemuxml2argvdata/smp.args
 delete mode 100644 tests/qemuxml2argvdata/smp.xml
 delete mode 100644 tests/qemuxml2xmloutdata/smp.x86_64-latest.xml

diff --git a/tests/qemuxml2argvdata/cpu-topology3.args b/tests/qemuxml2argvdata/cpu-topology1.x86_64-latest.args
similarity index 96%
rename from tests/qemuxml2argvdata/cpu-topology3.args
rename to tests/qemuxml2argvdata/cpu-topology1.x86_64-latest.args
index c11b4cd307..009c08d71a 100644
--- a/tests/qemuxml2argvdata/cpu-topology3.args
+++ b/tests/qemuxml2argvdata/cpu-topology1.x86_64-latest.args
@@ -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 \
diff --git a/tests/qemuxml2argvdata/cpu-topology1.xml b/tests/qemuxml2argvdata/cpu-topology1.xml
index af82a1c51a..5cf49987e1 100644
--- a/tests/qemuxml2argvdata/cpu-topology1.xml
+++ b/tests/qemuxml2argvdata/cpu-topology1.xml
@@ -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>
diff --git a/tests/qemuxml2argvdata/cpu-topology2.args b/tests/qemuxml2argvdata/cpu-topology2.x86_64-latest.args
similarity index 98%
rename from tests/qemuxml2argvdata/cpu-topology2.args
rename to tests/qemuxml2argvdata/cpu-topology2.x86_64-latest.args
index 4639d34c56..7ba175fa80 100644
--- a/tests/qemuxml2argvdata/cpu-topology2.args
+++ b/tests/qemuxml2argvdata/cpu-topology2.x86_64-latest.args
@@ -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 \
diff --git a/tests/qemuxml2argvdata/cpu-topology2.xml b/tests/qemuxml2argvdata/cpu-topology2.xml
index 1b113b8b13..dd125ec4e2 100644
--- a/tests/qemuxml2argvdata/cpu-topology2.xml
+++ b/tests/qemuxml2argvdata/cpu-topology2.xml
@@ -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>
diff --git a/tests/qemuxml2argvdata/cpu-topology1.args b/tests/qemuxml2argvdata/cpu-topology3.x86_64-latest.args
similarity index 100%
rename from tests/qemuxml2argvdata/cpu-topology1.args
rename to tests/qemuxml2argvdata/cpu-topology3.x86_64-latest.args
diff --git a/tests/qemuxml2argvdata/cpu-topology3.xml b/tests/qemuxml2argvdata/cpu-topology3.xml
index af82a1c51a..f8175fcd81 100644
--- a/tests/qemuxml2argvdata/cpu-topology3.xml
+++ b/tests/qemuxml2argvdata/cpu-topology3.xml
@@ -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>
diff --git a/tests/qemuxml2argvdata/smp-dies.args b/tests/qemuxml2argvdata/cpu-topology4.x86_64-latest.args
similarity index 74%
rename from tests/qemuxml2argvdata/smp-dies.args
rename to tests/qemuxml2argvdata/cpu-topology4.x86_64-latest.args
index a4d5fc3372..d0e31ba2b5 100644
--- a/tests/qemuxml2argvdata/smp-dies.args
+++ b/tests/qemuxml2argvdata/cpu-topology4.x86_64-latest.args
@@ -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
index 0000000000..a60b5865fa
--- /dev/null
+++ b/tests/qemuxml2argvdata/cpu-topology4.xml
@@ -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
index a29786c0c4..0000000000
--- a/tests/qemuxml2argvdata/smp-dies.xml
+++ /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
index 352b1d3d6e..0000000000
--- a/tests/qemuxml2argvdata/smp.args
+++ /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
index 274aa37f1a..0000000000
--- a/tests/qemuxml2argvdata/smp.xml
+++ /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>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index ec06a734a1..d218b17d57 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -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
index a7f324afba..0000000000
--- a/tests/qemuxml2xmloutdata/smp.x86_64-latest.xml
+++ /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>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 3b8eab6346..72f976358f 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -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");
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux