]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Update smm=on test
authorAndrea Bolognani <abologna@redhat.com>
Fri, 13 May 2022 14:00:09 +0000 (16:00 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 16 May 2022 12:29:04 +0000 (14:29 +0200)
Use DO_TEST_CAPS_LATEST() instead of hardcoding capabilities and
add the xml2xml part, which was missing; finally, rename it to
accomodate the complementary smm=off test that we're about to
introduce.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvdata/machine-smm-on.x86_64-latest.args [moved from tests/qemuxml2argvdata/machine-smm-opt.args with 52% similarity]
tests/qemuxml2argvdata/machine-smm-on.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/machine-smm-on.x86_64-latest.xml [moved from tests/qemuxml2argvdata/machine-smm-opt.xml with 53% similarity]
tests/qemuxml2xmltest.c

similarity index 52%
rename from tests/qemuxml2argvdata/machine-smm-opt.args
rename to tests/qemuxml2argvdata/machine-smm-on.x86_64-latest.args
index 39fb44732084e5c4b7acbe57b5646995add7e2a2..6fde3755231a8f7a72941459c0dad4e0b9ebdae1 100644 (file)
@@ -6,14 +6,15 @@ LOGNAME=test \
 XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
 XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
 XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-QEMU_AUDIO_DRV=none \
 /usr/bin/qemu-system-x86_64 \
 -name guest=QEMUGuest1,debug-threads=on \
 -S \
--object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine q35,usb=off,smm=on,dump-guest-core=off \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine q35,usb=off,smm=on,dump-guest-core=off,memory-backend=pc.ram \
 -accel tcg \
+-cpu qemu64 \
 -m 214 \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
 -smp 1,sockets=1,cores=1,threads=1 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
@@ -26,11 +27,6 @@ QEMU_AUDIO_DRV=none \
 -no-shutdown \
 -no-acpi \
 -boot strict=on \
--device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
--device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
--device ioh3420,port=8,chassis=3,id=pci.3,bus=pcie.0,addr=0x1 \
--device virtio-scsi-pci,id=scsi0,bus=pci.2,addr=0x1 \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-scsi0-0-0-0 \
--device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 \
--device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x2 \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2argvdata/machine-smm-on.xml b/tests/qemuxml2argvdata/machine-smm-on.xml
new file mode 100644 (file)
index 0000000..e246083
--- /dev/null
@@ -0,0 +1,17 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='q35'>hvm</type>
+  </os>
+  <features>
+    <smm state='on'/>
+  </features>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index 829550fbfe3879c4a88729d51f9f94c62dd177ef..c0c18ef1dc4bc00242944ec0ea7330a25811ebd9 100644 (file)
@@ -1061,12 +1061,7 @@ mymain(void)
     driver.config->dumpGuestCore = true;
     DO_TEST_NOCAPS("machine-core-off");
     driver.config->dumpGuestCore = false;
-    DO_TEST("machine-smm-opt",
-            QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
-            QEMU_CAPS_DEVICE_PCI_BRIDGE,
-            QEMU_CAPS_DEVICE_IOH3420,
-            QEMU_CAPS_ICH9_AHCI,
-            QEMU_CAPS_VIRTIO_SCSI);
+    DO_TEST_CAPS_LATEST("machine-smm-on");
     DO_TEST("machine-vmport-opt",
             QEMU_CAPS_MACHINE_VMPORT_OPT);
     DO_TEST_NOCAPS("default-kvm-host-arch");
similarity index 53%
rename from tests/qemuxml2argvdata/machine-smm-opt.xml
rename to tests/qemuxml2xmloutdata/machine-smm-on.x86_64-latest.xml
index 053bb5c25f858946d9f434a6df63bc04d2bb8c03..7c7df9e06d42d727712c37940dea45a92d6d409c 100644 (file)
   <features>
     <smm state='on'/>
   </features>
+  <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='block' device='disk'>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='sda' bus='scsi'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='scsi' index='0'/>
-    <memballoon model='virtio'/>
+    <controller type='usb' index='0' model='none'/>
+    <controller type='sata' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pcie-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <audio id='1' type='none'/>
+    <memballoon model='none'/>
   </devices>
 </domain>
index 8b655874d130e985e3a3aae23051e0ff84f76d36..02d8a66f3cfe602482b166bbe71f89141e55ab10 100644 (file)
@@ -243,6 +243,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST("genid-auto");
     DO_TEST_NOCAPS("machine-core-on");
     DO_TEST_NOCAPS("machine-core-off");
+    DO_TEST_CAPS_LATEST("machine-smm-on");
     DO_TEST("machine-loadparm-multiple-disks-nets-s390", QEMU_CAPS_CCW);
     DO_TEST_NOCAPS("default-kvm-host-arch");
     DO_TEST_NOCAPS("default-qemu-host-arch");