mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Add test case for TPM passthrough
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com> Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
This commit is contained in:
parent
291cfb83f3
commit
c772feb069
6
tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.args
Normal file
6
tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.args
Normal file
@ -0,0 +1,6 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
|
||||
/usr/bin/qemu -S -M pc-0.12 -m 2048 -smp 1 -nographic -nodefaults \
|
||||
-monitor unix:/tmp/test-monitor,server,nowait -boot c -usb \
|
||||
-tpmdev passthrough,id=tpm-tpm0,path=/dev/tpm0,cancel-path=/sys/class/misc/tpm0/device/cancel \
|
||||
-device tpm-tis,tpmdev=tpm-tpm0,id=tpm0 \
|
||||
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
29
tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.xml
Normal file
29
tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<domain type='qemu'>
|
||||
<name>TPM-VM</name>
|
||||
<uuid>11d7cd22-da89-3094-6212-079a48a309a1</uuid>
|
||||
<memory unit='KiB'>2097152</memory>
|
||||
<currentMemory unit='KiB'>512288</currentMemory>
|
||||
<vcpu placement='static'>1</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64' machine='pc-0.12'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
</features>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<controller type='usb' index='0'/>
|
||||
<tpm model='tpm-tis'>
|
||||
<backend type='passthrough'>
|
||||
<device path='/dev/tpm0'/>
|
||||
</backend>
|
||||
</tpm>
|
||||
<memballoon model='virtio'/>
|
||||
</devices>
|
||||
</domain>
|
@ -937,6 +937,9 @@ mymain(void)
|
||||
|
||||
DO_TEST("ppc-dtb", QEMU_CAPS_KVM, QEMU_CAPS_DTB);
|
||||
|
||||
DO_TEST("tpm-passthrough", QEMU_CAPS_DEVICE,
|
||||
QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_TIS);
|
||||
|
||||
virObjectUnref(driver.config);
|
||||
virObjectUnref(driver.caps);
|
||||
virObjectUnref(driver.xmlopt);
|
||||
|
@ -274,6 +274,8 @@ mymain(void)
|
||||
|
||||
DO_TEST_DIFFERENT("metadata");
|
||||
|
||||
DO_TEST("tpm-passthrough");
|
||||
|
||||
virObjectUnref(driver.caps);
|
||||
virObjectUnref(driver.xmlopt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user