]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: qemuxml2argv: Modernize tpm-passthrough tests
authorPeter Krempa <pkrempa@redhat.com>
Thu, 23 Jan 2020 09:26:12 +0000 (10:26 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 27 Jan 2020 13:55:03 +0000 (14:55 +0100)
XML->XML testing uses DO_TEST_CAPS_LATEST so use it also for the
XML->argv testing. Additionally use the same more modern machine type
in both tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemuxml2argvdata/tpm-passthrough-crb.x86_64-latest.args [moved from tests/qemuxml2argvdata/tpm-passthrough-crb.args with 61% similarity]
tests/qemuxml2argvdata/tpm-passthrough.x86_64-latest.args [moved from tests/qemuxml2argvdata/tpm-passthrough.args with 56% similarity]
tests/qemuxml2argvdata/tpm-passthrough.xml
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml

similarity index 61%
rename from tests/qemuxml2argvdata/tpm-passthrough-crb.args
rename to tests/qemuxml2argvdata/tpm-passthrough-crb.x86_64-latest.args
index 1a2531d5b8ddc80da14b36c467c76c031b1d5b18..5508e4defbf86fc3546d780cd704f3641ad24c24 100644 (file)
@@ -8,25 +8,30 @@ XDG_CACHE_HOME=/tmp/lib/domain--1-TPM-VM/.cache \
 XDG_CONFIG_HOME=/tmp/lib/domain--1-TPM-VM/.config \
 QEMU_AUDIO_DRV=none \
 /usr/bin/qemu-system-x86_64 \
--name TPM-VM \
+-name guest=TPM-VM,debug-threads=on \
 -S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-TPM-VM/master-key.aes \
 -machine pc-i440fx-2.12,accel=tcg,usb=off,dump-guest-core=off \
+-cpu qemu64 \
 -m 2048 \
--realtime mlock=off \
+-overcommit mem-lock=off \
 -smp 1,sockets=1,cores=1,threads=1 \
 -uuid 11d7cd22-da89-3094-6212-079a48a309a1 \
 -display none \
 -no-user-config \
 -nodefaults \
--chardev socket,id=charmonitor,path=/tmp/lib/domain--1-TPM-VM/monitor.sock,\
-server,nowait \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
 -mon chardev=charmonitor,id=monitor,mode=control \
 -rtc base=utc \
 -no-shutdown \
--boot menu=on \
--usb \
+-boot menu=on,strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
 -tpmdev passthrough,id=tpm-tpm0,path=/dev/fdset/0,cancel-path=/dev/fdset/1 \
 -add-fd set=0,fd=1730 \
 -add-fd set=1,fd=1731 \
 -device tpm-crb,tpmdev=tpm-tpm0,id=tpm0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
similarity index 56%
rename from tests/qemuxml2argvdata/tpm-passthrough.args
rename to tests/qemuxml2argvdata/tpm-passthrough.x86_64-latest.args
index 644363b352e31a721e75405f031f635caaf8073e..60edf86dbd0723c2b06d144fc0cc92ccb69df86b 100644 (file)
@@ -8,25 +8,30 @@ XDG_CACHE_HOME=/tmp/lib/domain--1-TPM-VM/.cache \
 XDG_CONFIG_HOME=/tmp/lib/domain--1-TPM-VM/.config \
 QEMU_AUDIO_DRV=none \
 /usr/bin/qemu-system-x86_64 \
--name TPM-VM \
+-name guest=TPM-VM,debug-threads=on \
 -S \
--machine pc-0.12,accel=tcg,usb=off,dump-guest-core=off \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-TPM-VM/master-key.aes \
+-machine pc-i440fx-2.12,accel=tcg,usb=off,dump-guest-core=off \
+-cpu qemu64 \
 -m 2048 \
--realtime mlock=off \
+-overcommit mem-lock=off \
 -smp 1,sockets=1,cores=1,threads=1 \
 -uuid 11d7cd22-da89-3094-6212-079a48a309a1 \
 -display none \
 -no-user-config \
 -nodefaults \
--chardev socket,id=charmonitor,path=/tmp/lib/domain--1-TPM-VM/monitor.sock,\
-server,nowait \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
 -mon chardev=charmonitor,id=monitor,mode=control \
 -rtc base=utc \
 -no-shutdown \
--boot menu=on \
--usb \
+-boot menu=on,strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
 -tpmdev passthrough,id=tpm-tpm0,path=/dev/fdset/0,cancel-path=/dev/fdset/1 \
 -add-fd set=0,fd=1730 \
 -add-fd set=1,fd=1731 \
 -device tpm-tis,tpmdev=tpm-tpm0,id=tpm0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
index 4198f303406e93fe6568bb6d69167a857ee156b5..036091d44fe825443e01d08e0e94cf93b1560aed 100644 (file)
@@ -5,7 +5,7 @@
   <currentMemory unit='KiB'>512288</currentMemory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='x86_64' machine='pc-0.12'>hvm</type>
+    <type arch='x86_64' machine='pc-i440fx-2.12'>hvm</type>
     <boot dev='hd'/>
     <bootmenu enable='yes'/>
   </os>
index 10b8f1806ee58f8535c9085af7be5057962d6bb7..eb6a637c7a52ccfc05df7cfd2bef53778becf7ea 100644 (file)
@@ -2177,10 +2177,8 @@ mymain(void)
     DO_TEST("ppce500-serial",
             QEMU_CAPS_KVM);
 
-    DO_TEST("tpm-passthrough",
-            QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_TIS);
-    DO_TEST("tpm-passthrough-crb",
-            QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_CRB);
+    DO_TEST_CAPS_LATEST("tpm-passthrough");
+    DO_TEST_CAPS_LATEST("tpm-passthrough-crb");
     DO_TEST_PARSE_ERROR("tpm-no-backend-invalid",
                         QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_TIS);
     DO_TEST_CAPS_LATEST("tpm-emulator");
index 669992bcf66e4171ca8ec83b45c121934df01dde..030ab3e605f9e90af0f79c941ecf01802412f9aa 100644 (file)
@@ -5,7 +5,7 @@
   <currentMemory unit='KiB'>512288</currentMemory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='x86_64' machine='pc-0.12'>hvm</type>
+    <type arch='x86_64' machine='pc-i440fx-2.12'>hvm</type>
     <boot dev='hd'/>
     <bootmenu enable='yes'/>
   </os>