render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 577c3bb46c94384f4d5a5c8ae390cf52e2eae838 Mon Sep 17 00:00:00 2001
Message-Id: <577c3bb46c94384f4d5a5c8ae390cf52e2eae838@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 24 Aug 2016 16:11:29 -0400
Subject: [PATCH] tests: cpu-hotplug: Add data for ppc64 without threads
 enabled

https://bugzilla.redhat.com/show_bug.cgi?id=1097930
https://bugzilla.redhat.com/show_bug.cgi?id=1224341

The reported data is unusual so add it to the test suite.

(cherry picked from commit 04fce1d496a76fd8c422b4ee7021eba3f248a246)
---
 ...umonitorjson-cpuinfo-ppc64-no-threads-cpus.json |  77 +++++++++++++
 ...nitorjson-cpuinfo-ppc64-no-threads-hotplug.json | 125 +++++++++++++++++++++
 .../qemumonitorjson-cpuinfo-ppc64-no-threads.data  |  72 ++++++++++++
 tests/qemumonitorjsontest.c                        |   1 +
 4 files changed, 275 insertions(+)
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-hotplug.json
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads.data

diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json
new file mode 100644
index 0000000..31a3905
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-cpus.json
@@ -0,0 +1,77 @@
+{
+  "return": [
+    {
+      "arch": "ppc",
+      "current": true,
+      "CPU": 0,
+      "nip": -4611686018426772876,
+      "qom_path": "/machine/unattached/device[1]/thread[0]",
+      "halted": false,
+      "thread_id": 35232
+    },
+    {
+      "arch": "ppc",
+      "current": false,
+      "CPU": 1,
+      "nip": -4611686018426772876,
+      "qom_path": "/machine/unattached/device[2]/thread[0]",
+      "halted": false,
+      "thread_id": 35233
+    },
+    {
+      "arch": "ppc",
+      "current": false,
+      "CPU": 2,
+      "nip": -4611686018426772876,
+      "qom_path": "/machine/unattached/device[3]/thread[0]",
+      "halted": false,
+      "thread_id": 35234
+    },
+    {
+      "arch": "ppc",
+      "current": false,
+      "CPU": 3,
+      "nip": -4611686018426772876,
+      "qom_path": "/machine/unattached/device[4]/thread[0]",
+      "halted": false,
+      "thread_id": 35235
+    },
+    {
+      "arch": "ppc",
+      "current": false,
+      "CPU": 4,
+      "nip": -4611686018426772876,
+      "qom_path": "/machine/unattached/device[5]/thread[0]",
+      "halted": false,
+      "thread_id": 35236
+    },
+    {
+      "arch": "ppc",
+      "current": false,
+      "CPU": 5,
+      "nip": -4611686018426772876,
+      "qom_path": "/machine/unattached/device[6]/thread[0]",
+      "halted": false,
+      "thread_id": 35237
+    },
+    {
+      "arch": "ppc",
+      "current": false,
+      "CPU": 6,
+      "nip": -4611686018426772876,
+      "qom_path": "/machine/unattached/device[7]/thread[0]",
+      "halted": false,
+      "thread_id": 35238
+    },
+    {
+      "arch": "ppc",
+      "current": false,
+      "CPU": 7,
+      "nip": -4611686018426772876,
+      "qom_path": "/machine/unattached/device[8]/thread[0]",
+      "halted": false,
+      "thread_id": 35239
+    }
+  ],
+  "id": "libvirt-11"
+}
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-hotplug.json
new file mode 100644
index 0000000..30785a9
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads-hotplug.json
@@ -0,0 +1,125 @@
+{
+  "return": [
+    {
+      "props": {
+        "core-id": 120
+      },
+      "vcpus-count": 1,
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 112
+      },
+      "vcpus-count": 1,
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 104
+      },
+      "vcpus-count": 1,
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 96
+      },
+      "vcpus-count": 1,
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 88
+      },
+      "vcpus-count": 1,
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 80
+      },
+      "vcpus-count": 1,
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 72
+      },
+      "vcpus-count": 1,
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 64
+      },
+      "vcpus-count": 1,
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 56
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[8]",
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 48
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[7]",
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 40
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[6]",
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 32
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[5]",
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 24
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[4]",
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 16
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[3]",
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 8
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[2]",
+      "type": "host-spapr-cpu-core"
+    },
+    {
+      "props": {
+        "core-id": 0
+      },
+      "vcpus-count": 1,
+      "qom-path": "/machine/unattached/device[1]",
+      "type": "host-spapr-cpu-core"
+    }
+  ],
+  "id": "libvirt-12"
+}
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads.data
new file mode 100644
index 0000000..d7ab77b
--- /dev/null
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-no-threads.data
@@ -0,0 +1,72 @@
+[vcpu libvirt-id='0']
+    thread-id='35232'
+    qemu-id='1'
+    type='host-spapr-cpu-core'
+    qom_path='/machine/unattached/device[1]'
+    topology: core='0' vcpus='1'
+[vcpu libvirt-id='1']
+    thread-id='35233'
+    qemu-id='2'
+    type='host-spapr-cpu-core'
+    qom_path='/machine/unattached/device[2]'
+    topology: core='8' vcpus='1'
+[vcpu libvirt-id='2']
+    thread-id='35234'
+    qemu-id='3'
+    type='host-spapr-cpu-core'
+    qom_path='/machine/unattached/device[3]'
+    topology: core='16' vcpus='1'
+[vcpu libvirt-id='3']
+    thread-id='35235'
+    qemu-id='4'
+    type='host-spapr-cpu-core'
+    qom_path='/machine/unattached/device[4]'
+    topology: core='24' vcpus='1'
+[vcpu libvirt-id='4']
+    thread-id='35236'
+    qemu-id='5'
+    type='host-spapr-cpu-core'
+    qom_path='/machine/unattached/device[5]'
+    topology: core='32' vcpus='1'
+[vcpu libvirt-id='5']
+    thread-id='35237'
+    qemu-id='6'
+    type='host-spapr-cpu-core'
+    qom_path='/machine/unattached/device[6]'
+    topology: core='40' vcpus='1'
+[vcpu libvirt-id='6']
+    thread-id='35238'
+    qemu-id='7'
+    type='host-spapr-cpu-core'
+    qom_path='/machine/unattached/device[7]'
+    topology: core='48' vcpus='1'
+[vcpu libvirt-id='7']
+    thread-id='35239'
+    qemu-id='8'
+    type='host-spapr-cpu-core'
+    qom_path='/machine/unattached/device[8]'
+    topology: core='56' vcpus='1'
+[vcpu libvirt-id='8']
+    type='host-spapr-cpu-core'
+    topology: core='64' vcpus='1'
+[vcpu libvirt-id='9']
+    type='host-spapr-cpu-core'
+    topology: core='72' vcpus='1'
+[vcpu libvirt-id='10']
+    type='host-spapr-cpu-core'
+    topology: core='80' vcpus='1'
+[vcpu libvirt-id='11']
+    type='host-spapr-cpu-core'
+    topology: core='88' vcpus='1'
+[vcpu libvirt-id='12']
+    type='host-spapr-cpu-core'
+    topology: core='96' vcpus='1'
+[vcpu libvirt-id='13']
+    type='host-spapr-cpu-core'
+    topology: core='104' vcpus='1'
+[vcpu libvirt-id='14']
+    type='host-spapr-cpu-core'
+    topology: core='112' vcpus='1'
+[vcpu libvirt-id='15']
+    type='host-spapr-cpu-core'
+    topology: core='120' vcpus='1'
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index ddcbd78..0410630 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -2591,6 +2591,7 @@ mymain(void)
     DO_TEST_CPU_INFO("ppc64-hotplug-1", 24);
     DO_TEST_CPU_INFO("ppc64-hotplug-2", 24);
     DO_TEST_CPU_INFO("ppc64-hotplug-4", 24);
+    DO_TEST_CPU_INFO("ppc64-no-threads", 16);
 
     qemuTestDriverFree(&driver);
 
-- 
2.10.0