[PATCH v2 07/11] tests: qemuxml2argv s390x cpu model

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Test cases for qemu s390x cpu model argument generation.

Signed-off-by: Jason J. Herne <jjherne@xxxxxxxxxxxxxxxxxx>
---
 .../qemuxml2argv-cpu-s390-zEC12.args                | 19 +++++++++++++++++++
 .../qemuxml2argv-cpu-s390-zEC12.xml                 | 21 +++++++++++++++++++++
 tests/qemuxml2argvtest.c                            | 12 ++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.args
new file mode 100644
index 0000000..4c95d6a
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.args
@@ -0,0 +1,19 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-kvm \
+-name guest1 \
+-S \
+-M s390-ccw-virtio \
+-cpu zEC12 \
+-m 214 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/lib/domain--1-guest1/monitor.sock,server,nowait \
+-no-acpi \
+-boot c
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.xml
new file mode 100644
index 0000000..de55f22
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.xml
@@ -0,0 +1,21 @@
+<domain type='kvm'>
+  <name>guest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <cpu mode='custom' match='exact'>
+    <model fallback='forbid'>zEC12</model>
+  </cpu>
+  <devices>
+      <emulator>/usr/bin/qemu-kvm</emulator>
+      <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 81c62ac..bd2cdcb 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -300,6 +300,9 @@ testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy)
     const char *ppc64Models[] = {
         "POWER8", "POWER7",
     };
+    const char *s390xModels[] = {
+        "z990", "zEC12", "z13",
+    };
 
     if (ARCH_IS_X86(arch)) {
         if (virQEMUCapsAddCPUDefinitions(caps, VIR_DOMAIN_VIRT_KVM, x86Models,
@@ -337,6 +340,11 @@ testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy)
                                          ARRAY_CARDINALITY(ppc64Models),
                                          VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0)
             return -1;
+    } else if (ARCH_IS_S390(arch)) {
+        if (virQEMUCapsAddCPUDefinitions(caps, VIR_DOMAIN_VIRT_KVM, s390xModels,
+                                         ARRAY_CARDINALITY(s390xModels),
+                                         VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0)
+            return -1;
     }
 
     return 0;
@@ -1512,6 +1520,10 @@ mymain(void)
     DO_TEST_FAILURE("cpu-host-passthrough", NONE);
     DO_TEST_FAILURE("cpu-qemu-host-passthrough", QEMU_CAPS_KVM);
 
+    qemuTestSetHostArch(driver.caps, VIR_ARCH_S390X);
+    DO_TEST("cpu-s390-zEC12", QEMU_CAPS_KVM, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+    qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE);
+
     qemuTestSetHostCPU(driver.caps, cpuHaswell);
     DO_TEST("cpu-Haswell", QEMU_CAPS_KVM);
     DO_TEST("cpu-Haswell2", QEMU_CAPS_KVM);
-- 
2.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux