qemuxml2xmltest: Introduce tpm-emulator-spapr test

We already have the input xml because of xml2arg test. However,
the corresponding xml2xml test case is missing. Make the expected
XML a symlink to the input XML and clean the latter up a bit.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2022-01-04 08:38:37 +01:00
parent 1ce27fa776
commit d00e6dfe6b
3 changed files with 43 additions and 31 deletions

View File

@ -12,49 +12,59 @@
<features> <features>
<acpi/> <acpi/>
</features> </features>
<cpu mode='custom' match='exact' check='none'>
<model fallback='forbid'>POWER9</model>
</cpu>
<clock offset='utc'/> <clock offset='utc'/>
<on_poweroff>destroy</on_poweroff> <on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot> <on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash> <on_crash>destroy</on_crash>
<devices> <devices>
<emulator>/usr/bin/qemu-system-ppc64</emulator> <emulator>/usr/bin/qemu-system-ppc64</emulator>
<console type='pty'> <disk type='file' device='disk'>
<address type="spapr-vio"/> <driver name='qemu' type='raw'/>
</console> <source file='/tmp/scsidisk.img'/>
<target dev='sda' bus='scsi'/>
<!-- Two serials, first is the console --> <address type='drive' controller='1' bus='0' target='0' unit='0'/>
<serial type="pty">
<address type="spapr-vio"/>
</serial>
<serial type="pty">
<address type="spapr-vio"/>
</serial>
<!-- One disk -->
<disk type="file" device="disk">
<driver name="qemu" type="raw"/>
<source file="/tmp/scsidisk.img"/>
<target dev="sda" bus="scsi"/>
<address type="drive" controller="1"/>
</disk> </disk>
<controller type='scsi' index='0' model='ibmvscsi'>
<!-- Two SCSI controllers --> <address type='spapr-vio' reg='0x00002000'/>
<controller type="scsi" index="1">
<address type="spapr-vio"/>
</controller> </controller>
<controller type="scsi" index="0"> <controller type='scsi' index='1' model='ibmvscsi'>
<address type="spapr-vio"/> <address type='spapr-vio' reg='0x00003000'/>
</controller> </controller>
<controller type='usb' index='0' model='pci-ohci'>
<nvram> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
<address type='spapr-vio' reg='0x4000'/> </controller>
</nvram> <controller type='pci' index='0' model='pci-root'>
<model name='spapr-pci-host-bridge'/>
<!-- TPM emulator --> <target index='0'/>
</controller>
<serial type='pty'>
<target type='spapr-vio-serial' port='0'>
<model name='spapr-vty'/>
</target>
<address type='spapr-vio' reg='0x30000000'/>
</serial>
<serial type='pty'>
<target type='spapr-vio-serial' port='1'>
<model name='spapr-vty'/>
</target>
<address type='spapr-vio' reg='0x30001000'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
<address type='spapr-vio' reg='0x30000000'/>
</console>
<tpm model='tpm-spapr'> <tpm model='tpm-spapr'>
<backend type='emulator' version='2.0'/> <backend type='emulator' version='2.0'/>
<address type='spapr-vio' reg='0x00005000'/>
</tpm> </tpm>
<audio id='1' type='none'/>
<memballoon model='none'/> <memballoon model='none'/>
<nvram>
<address type='spapr-vio' reg='0x00004000'/>
</nvram>
<panic model='pseries'/>
</devices> </devices>
</domain> </domain>

View File

@ -0,0 +1 @@
../qemuxml2argvdata/tpm-emulator-spapr.xml

View File

@ -759,6 +759,7 @@ mymain(void)
DO_TEST_CAPS_LATEST("tpm-passthrough"); DO_TEST_CAPS_LATEST("tpm-passthrough");
DO_TEST_CAPS_LATEST("tpm-passthrough-crb"); DO_TEST_CAPS_LATEST("tpm-passthrough-crb");
DO_TEST_CAPS_LATEST("tpm-emulator"); DO_TEST_CAPS_LATEST("tpm-emulator");
DO_TEST_CAPS_ARCH_LATEST("tpm-emulator-spapr", "ppc64");
DO_TEST_CAPS_LATEST("tpm-emulator-tpm2"); DO_TEST_CAPS_LATEST("tpm-emulator-tpm2");
DO_TEST_CAPS_LATEST("tpm-emulator-tpm2-enc"); DO_TEST_CAPS_LATEST("tpm-emulator-tpm2-enc");
DO_TEST_CAPS_LATEST("tpm-emulator-tpm2-pstate"); DO_TEST_CAPS_LATEST("tpm-emulator-tpm2-pstate");