[PATCH 1/4] qemuxml2xmltest: Introduce tpm-emulator-spapr test

Michal Privoznik mprivozn at redhat.com
Tue Jan 4 08:14:27 UTC 2022


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 at redhat.com>
---
 tests/qemuxml2argvdata/tpm-emulator-spapr.xml | 74 +++++++++++--------
 .../tpm-emulator-spapr.ppc64-latest.xml       |  1 +
 tests/qemuxml2xmltest.c                       |  1 +
 3 files changed, 44 insertions(+), 32 deletions(-)
 create mode 120000 tests/qemuxml2xmloutdata/tpm-emulator-spapr.ppc64-latest.xml

diff --git a/tests/qemuxml2argvdata/tpm-emulator-spapr.xml b/tests/qemuxml2argvdata/tpm-emulator-spapr.xml
index f9cda19727..1b4b825e2c 100644
--- a/tests/qemuxml2argvdata/tpm-emulator-spapr.xml
+++ b/tests/qemuxml2argvdata/tpm-emulator-spapr.xml
@@ -12,49 +12,59 @@
   <features>
     <acpi/>
   </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>POWER9</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-ppc64</emulator>
+    <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' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='scsi' index='0' model='ibmvscsi'>
+      <address type='spapr-vio' reg='0x00002000'/>
+    </controller>
+    <controller type='scsi' index='1' model='ibmvscsi'>
+      <address type='spapr-vio' reg='0x00003000'/>
+    </controller>
+    <controller type='usb' index='0' model='pci-ohci'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'>
+      <model name='spapr-pci-host-bridge'/>
+      <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'>
-      <address type="spapr-vio"/>
+      <target type='serial' port='0'/>
+      <address type='spapr-vio' reg='0x30000000'/>
     </console>
-
-    <!-- Two serials, first is the console -->
-    <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>
-
-    <!-- Two SCSI controllers -->
-    <controller type="scsi" index="1">
-      <address type="spapr-vio"/>
-    </controller>
-    <controller type="scsi" index="0">
-      <address type="spapr-vio"/>
-    </controller>
-
-    <nvram>
-      <address type='spapr-vio' reg='0x4000'/>
-    </nvram>
-
-    <!-- TPM emulator -->
     <tpm model='tpm-spapr'>
       <backend type='emulator' version='2.0'/>
+      <address type='spapr-vio' reg='0x00005000'/>
     </tpm>
-
+    <audio id='1' type='none'/>
     <memballoon model='none'/>
+    <nvram>
+      <address type='spapr-vio' reg='0x00004000'/>
+    </nvram>
+    <panic model='pseries'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/tpm-emulator-spapr.ppc64-latest.xml b/tests/qemuxml2xmloutdata/tpm-emulator-spapr.ppc64-latest.xml
new file mode 120000
index 0000000000..d69355b81e
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/tpm-emulator-spapr.ppc64-latest.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/tpm-emulator-spapr.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 45e76bf9cc..c11d415e98 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -759,6 +759,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST("tpm-passthrough");
     DO_TEST_CAPS_LATEST("tpm-passthrough-crb");
     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-enc");
     DO_TEST_CAPS_LATEST("tpm-emulator-tpm2-pstate");
-- 
2.34.1




More information about the libvir-list mailing list