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

Re: [libvirt] [PATCH v3 19/26] tests: Add tests for pSeries guests with multiple PHBs



On Fri, 2017-06-23 at 23:03 +0800, Andrea Bolognani wrote:
> Signed-off-by: Andrea Bolognani <abologna redhat com>
> ---
>  .../qemuxml2argv-pseries-phb-default-missing.args  | 22 +++++++++++++++
>  .../qemuxml2argv-pseries-phb-default-missing.xml   | 16 +++++++++++
>  .../qemuxml2argv-pseries-phb-simple.args           | 22 +++++++++++++++
>  .../qemuxml2argv-pseries-phb-simple.xml            | 17 +++++++++++
>  tests/qemuxml2argvtest.c                           |  8 ++++++
>  .../qemuxml2xmlout-pseries-phb-default-missing.xml | 33 ++++++++++++++++++++++
>  .../qemuxml2xmlout-pseries-phb-simple.xml          | 33 ++++++++++++++++++++++
>  tests/qemuxml2xmltest.c                            |  7 +++++
>  8 files changed, 158 insertions(+)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default-missing.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default-missing.xml
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.xml
>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-default-missing.xml
>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-simple.xml

The attached patch should be squashed in to make sure the new
test implemented in [1] works correctly. In order for the test
case to work, [2] will need to be merged first - I plan to
squeeze it in between patches 07 and 08 before pushing.

Does that sound reasonable?


[1] https://www.redhat.com/archives/libvir-list/2017-July/msg00069.html
[2] https://www.redhat.com/archives/libvir-list/2017-July/msg00070.html
-- 
Andrea Bolognani / Red Hat / Virtualization
From 466421b399cc205f35848b5ec30a0061cd9100bb Mon Sep 17 00:00:00 2001
From: Andrea Bolognani <abologna redhat com>
Date: Tue, 4 Jul 2017 12:20:21 +0200
Subject: [PATCH v3 19.5/26] tests: Only the default PHB can have targetIndex=0

Signed-off-by: Andrea Bolognani <abologna redhat com>
---
 ...qemuxml2argv-pseries-phb-wrong-target-index.xml | 22 ++++++++++++++++++++++
 tests/qemuxml2argvtest.c                           |  3 +++
 tests/qemuxml2xmltest.c                            |  3 +++
 3 files changed, 28 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-wrong-target-index.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-wrong-target-index.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-wrong-target-index.xml
new file mode 100644
index 0000000..48e3b1f
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-wrong-target-index.xml
@@ -0,0 +1,22 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+  </os>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <!-- The default PHB (controller index 0) must have target index 0 -->
+    <controller type='pci' index='0' model='pci-root'>
+      <target index='1'/>
+    </controller>
+    <!-- Other PHBs can't have target index 0 -->
+    <controller type='pci' index='1' model='pci-root'>
+      <target index='0'/>
+    </controller>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index ff68884..02e3235 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1716,6 +1716,9 @@ mymain(void)
     DO_TEST("pseries-phb-default-missing",
             QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CHARDEV,
             QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE);
+    DO_TEST_PARSE_ERROR("pseries-phb-wrong-target-index",
+                        QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CHARDEV,
+                        QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE);
 
     DO_TEST("disk-ide-drive-split",
             QEMU_CAPS_NODEFCONFIG,
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index e8d08b4..2da1b70 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -712,6 +712,9 @@ mymain(void)
     DO_TEST("pseries-phb-default-missing",
             QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CHARDEV,
             QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE);
+    DO_TEST_PARSE_ERROR("pseries-phb-wrong-target-index",
+                        QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CHARDEV,
+                        QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE);
 
     DO_TEST("balloon-device-auto", NONE);
     DO_TEST("balloon-device-period", NONE);
-- 
2.7.5


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