render / rpms / libvirt

Forked from rpms/libvirt 4 months ago
Clone
e73cc6
From: Prerna Saxena <prerna@linux.vnet.ibm.com>
e73cc6
Date: Tue, 4 Nov 2014 23:02:15 +0530
e73cc6
Subject: [PATCH] Test: Add a testcase for PowerPC compat mode cpu
e73cc6
 specification.
e73cc6
e73cc6
This introduces a testcase for PowerPC compat mode cpu specification.
e73cc6
e73cc6
Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
e73cc6
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
e73cc6
(cherry picked from commit 12c381114ce362e49cadb730b5faabbc150a8878)
e73cc6
---
e73cc6
 .../qemuxml2argv-pseries-cpu-compat.args             |  8 ++++++++
e73cc6
 .../qemuxml2argv-pseries-cpu-compat.xml              | 20 ++++++++++++++++++++
e73cc6
 tests/qemuxml2argvtest.c                             |  2 ++
e73cc6
 3 files changed, 30 insertions(+)
e73cc6
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
e73cc6
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.xml
e73cc6
e73cc6
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
e73cc6
new file mode 100644
e73cc6
index 0000000..64df406
e73cc6
--- /dev/null
e73cc6
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
e73cc6
@@ -0,0 +1,8 @@
e73cc6
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
e73cc6
+QEMU_AUDIO_DRV=none /usr/bin/qemu-system-ppc64 -S -M pseries \
e73cc6
+-cpu host,compat=power7 \
e73cc6
+-m 214 -smp 4 -nographic -nodefconfig -nodefaults \
e73cc6
+-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
e73cc6
+-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -usb \
e73cc6
+-chardev pty,id=charserial0 \
e73cc6
+-device spapr-vty,chardev=charserial0,reg=0x30000000
e73cc6
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.xml
e73cc6
new file mode 100644
e73cc6
index 0000000..e34a8ad
e73cc6
--- /dev/null
e73cc6
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.xml
e73cc6
@@ -0,0 +1,20 @@
e73cc6
+<domain type='kvm'>
e73cc6
+  <name>QEMUGuest1</name>
e73cc6
+  <memory unit='KiB'>219100</memory>
e73cc6
+  <currentMemory unit='KiB'>219100</currentMemory>
e73cc6
+  <vcpu placement='static'>4</vcpu>
e73cc6
+  <os>
e73cc6
+    <type arch='ppc64' machine='pseries'>hvm</type>
e73cc6
+  </os>
e73cc6
+  <cpu mode='host-model'>
e73cc6
+    <model>power7</model>
e73cc6
+  </cpu>
e73cc6
+  <clock offset='utc'/>
e73cc6
+  <devices>
e73cc6
+      <emulator>/usr/bin/qemu-system-ppc64</emulator>
e73cc6
+      <console type='pty'>
e73cc6
+        <address type="spapr-vio"/>
e73cc6
+      </console>
e73cc6
+      <memballoon model="none"/>
e73cc6
+  </devices>
e73cc6
+</domain>
e73cc6
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
e73cc6
index 0e9fab9..90f053e 100644
e73cc6
--- a/tests/qemuxml2argvtest.c
e73cc6
+++ b/tests/qemuxml2argvtest.c
e73cc6
@@ -1305,6 +1305,8 @@ mymain(void)
e73cc6
             QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
e73cc6
     DO_TEST("pseries-cpu-exact", QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE,
e73cc6
             QEMU_CAPS_NODEFCONFIG);
e73cc6
+    DO_TEST("pseries-cpu-compat", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST,
e73cc6
+            QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
e73cc6
     DO_TEST("disk-ide-drive-split",
e73cc6
             QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
e73cc6
             QEMU_CAPS_IDE_CD);