From 44d32a0ac7eed91b99b0fc875495c7f09ecfa7d2 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 23 Jan 2020 10:26:12 +0100 Subject: [PATCH] tests: qemuxml2argv: Modernize tpm-passthrough tests 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 Reviewed-by: Michal Privoznik --- ...=> tpm-passthrough-crb.x86_64-latest.args} | 19 ++++++++++------- ...rgs => tpm-passthrough.x86_64-latest.args} | 21 ++++++++++++------- tests/qemuxml2argvdata/tpm-passthrough.xml | 2 +- tests/qemuxml2argvtest.c | 6 ++---- .../tpm-passthrough.x86_64-latest.xml | 2 +- 5 files changed, 29 insertions(+), 21 deletions(-) rename tests/qemuxml2argvdata/{tpm-passthrough-crb.args => tpm-passthrough-crb.x86_64-latest.args} (61%) rename tests/qemuxml2argvdata/{tpm-passthrough.args => tpm-passthrough.x86_64-latest.args} (56%) diff --git a/tests/qemuxml2argvdata/tpm-passthrough-crb.args b/tests/qemuxml2argvdata/tpm-passthrough-crb.x86_64-latest.args similarity index 61% rename from tests/qemuxml2argvdata/tpm-passthrough-crb.args rename to tests/qemuxml2argvdata/tpm-passthrough-crb.x86_64-latest.args index 1a2531d5b8..5508e4defb 100644 --- a/tests/qemuxml2argvdata/tpm-passthrough-crb.args +++ b/tests/qemuxml2argvdata/tpm-passthrough-crb.x86_64-latest.args @@ -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 diff --git a/tests/qemuxml2argvdata/tpm-passthrough.args b/tests/qemuxml2argvdata/tpm-passthrough.x86_64-latest.args similarity index 56% rename from tests/qemuxml2argvdata/tpm-passthrough.args rename to tests/qemuxml2argvdata/tpm-passthrough.x86_64-latest.args index 644363b352..60edf86dbd 100644 --- a/tests/qemuxml2argvdata/tpm-passthrough.args +++ b/tests/qemuxml2argvdata/tpm-passthrough.x86_64-latest.args @@ -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 diff --git a/tests/qemuxml2argvdata/tpm-passthrough.xml b/tests/qemuxml2argvdata/tpm-passthrough.xml index 4198f30340..036091d44f 100644 --- a/tests/qemuxml2argvdata/tpm-passthrough.xml +++ b/tests/qemuxml2argvdata/tpm-passthrough.xml @@ -5,7 +5,7 @@ 512288 1 - hvm + hvm diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 10b8f1806e..eb6a637c7a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -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"); diff --git a/tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml b/tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml index 669992bcf6..030ab3e605 100644 --- a/tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml @@ -5,7 +5,7 @@ 512288 1 - hvm + hvm