[libvirt] [PATCHv2 5/6] tests: add testcase for s390 query-cpus-fast

John Ferlan jferlan at redhat.com
Fri Mar 23 16:08:52 UTC 2018



On 03/05/2018 06:44 AM, Viktor Mihajlovski wrote:
> The s390 testcase verifies that the s390-specific cpu-state
> field is correctly mapped to the halted property.
> 
> Since a few of the x86 and ppc testcases return "halted": "true"
> it was necessary to update the respective .data files.
> 
> Signed-off-by: Viktor Mihajlovski <mihajlov at linux.vnet.ibm.com>
> Reviewed-by: Boris Fiuczynski <fiuczy at linux.vnet.ibm.com>
> ---
>  .../qemumonitorjson-cpuinfo-ppc64-hotplug-4.data    |  8 ++++++++
>  .../qemumonitorjson-cpuinfo-s390-fast-cpus.json     | 21 +++++++++++++++++++++
>  .../qemumonitorjson-cpuinfo-s390-fast-hotplug.json  | 21 +++++++++++++++++++++
>  .../qemumonitorjson-cpuinfo-s390-fast.data          | 19 +++++++++++++++++++
>  ...qemumonitorjson-cpuinfo-x86-basic-pluggable.data |  5 +++++
>  .../qemumonitorjson-cpuinfo-x86-node-full.data      |  2 ++
>  tests/qemumonitorjsontest.c                         |  5 +++++
>  7 files changed, 81 insertions(+)
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-cpus.json
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-hotplug.json
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast.data
> 

I think you could "split" this out print the halted earlier (perhaps
before any of these patches) just to prove/disprove what (if anything)
changes when the -fast command is added.

Then the s390 specific change gets included with patch 4 (or merged with
patch 2 depending on how things go).

John

> diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4.data
> index 7c90889..5f6b865 100644
> --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4.data
> +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-ppc64-hotplug-4.data
> @@ -52,41 +52,49 @@
>      alias='vcpu0'
>      qom_path='/machine/peripheral/vcpu0'
>      topology: core='8' vcpus='8'
> +    halted
>  [vcpu libvirt-id='9']
>      online=yes
>      hotpluggable=yes
>      thread-id='23171'
>      query-cpus-id='17'
> +    halted
>  [vcpu libvirt-id='10']
>      online=yes
>      hotpluggable=yes
>      thread-id='23172'
>      query-cpus-id='18'
> +    halted
>  [vcpu libvirt-id='11']
>      online=yes
>      hotpluggable=yes
>      thread-id='23173'
>      query-cpus-id='19'
> +    halted
>  [vcpu libvirt-id='12']
>      online=yes
>      hotpluggable=yes
>      thread-id='23174'
>      query-cpus-id='20'
> +    halted
>  [vcpu libvirt-id='13']
>      online=yes
>      hotpluggable=yes
>      thread-id='23175'
>      query-cpus-id='21'
> +    halted
>  [vcpu libvirt-id='14']
>      online=yes
>      hotpluggable=yes
>      thread-id='23176'
>      query-cpus-id='22'
> +    halted
>  [vcpu libvirt-id='15']
>      online=yes
>      hotpluggable=yes
>      thread-id='23177'
>      query-cpus-id='23'
> +    halted
>  [vcpu libvirt-id='16']
>      online=yes
>      hotpluggable=yes
> diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-cpus.json
> new file mode 100644
> index 0000000..4082e0e
> --- /dev/null
> +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-cpus.json
> @@ -0,0 +1,21 @@
> +{
> +  "return": [
> +    {
> +      "arch": "s390",
> +      "cpu-index": 0,
> +      "props": {"core-id": 0},
> +      "qom-path": "/machine/unattached/device[0]",
> +      "thread-id": 89504,
> +      "cpu-state": "operating"
> +    },
> +    {
> +      "arch": "s390",
> +      "cpu-index": 1,
> +      "props": {"core-id": 1},
> +      "qom-path": "/machine/unattached/device[1]",
> +      "thread-id": 89505,
> +      "cpu-state": "stopped"
> +    }
> +  ],
> +  "id": "libvirt-42"
> +}
> diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-hotplug.json
> new file mode 100644
> index 0000000..8016b5b
> --- /dev/null
> +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-hotplug.json
> @@ -0,0 +1,21 @@
> +{
> +  "return": [
> +    {
> +      "props": {
> +        "core-id": 1
> +      },
> +      "vcpus-count": 1,
> +      "qom-path": "/machine/unattached/device[1]",
> +      "type": "host-s390x-cpu"
> +    },
> +    {
> +      "props": {
> +        "core-id": 0
> +      },
> +      "vcpus-count": 1,
> +      "qom-path": "/machine/unattached/device[0]",
> +      "type": "host-s390x-cpu"
> +    }
> +  ],
> +  "id": "libvirt-41"
> +}
> diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast.data
> new file mode 100644
> index 0000000..9fc7041
> --- /dev/null
> +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast.data
> @@ -0,0 +1,19 @@
> +[vcpu libvirt-id='0']
> +    online=yes
> +    hotpluggable=no
> +    thread-id='89504'
> +    enable-id='1'
> +    query-cpus-id='0'
> +    type='host-s390x-cpu'
> +    qom_path='/machine/unattached/device[0]'
> +    topology: core='0' vcpus='1'
> +[vcpu libvirt-id='1']
> +    online=yes
> +    hotpluggable=no
> +    thread-id='89505'
> +    enable-id='2'
> +    query-cpus-id='1'
> +    type='host-s390x-cpu'
> +    qom_path='/machine/unattached/device[1]'
> +    topology: core='1' vcpus='1'
> +    halted
> diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data
> index 93cefb9..9a1788d 100644
> --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data
> +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data
> @@ -7,6 +7,7 @@
>      type='qemu64-x86_64-cpu'
>      qom_path='/machine/unattached/device[0]'
>      topology: socket='0' core='0' thread='0' vcpus='1'
> +    halted
>  [vcpu libvirt-id='1']
>      online=yes
>      hotpluggable=no
> @@ -16,6 +17,7 @@
>      type='qemu64-x86_64-cpu'
>      qom_path='/machine/unattached/device[2]'
>      topology: socket='0' core='0' thread='1' vcpus='1'
> +    halted
>  [vcpu libvirt-id='2']
>      online=yes
>      hotpluggable=no
> @@ -25,6 +27,7 @@
>      type='qemu64-x86_64-cpu'
>      qom_path='/machine/unattached/device[3]'
>      topology: socket='0' core='1' thread='0' vcpus='1'
> +    halted
>  [vcpu libvirt-id='3']
>      online=yes
>      hotpluggable=no
> @@ -34,6 +37,7 @@
>      type='qemu64-x86_64-cpu'
>      qom_path='/machine/unattached/device[4]'
>      topology: socket='0' core='1' thread='1' vcpus='1'
> +    halted
>  [vcpu libvirt-id='4']
>      online=yes
>      hotpluggable=no
> @@ -43,6 +47,7 @@
>      type='qemu64-x86_64-cpu'
>      qom_path='/machine/unattached/device[5]'
>      topology: socket='1' core='0' thread='0' vcpus='1'
> +    halted
>  [vcpu libvirt-id='5']
>      online=no
>      hotpluggable=yes
> diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full.data
> index 070ea08..0f7dbf1 100644
> --- a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full.data
> +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full.data
> @@ -7,6 +7,7 @@
>      type='Broadwell-x86_64-cpu'
>      qom_path='/machine/unattached/device[0]'
>      topology: socket='0' core='0' thread='0' node='0' vcpus='1'
> +    halted
>  [vcpu libvirt-id='1']
>      online=yes
>      hotpluggable=no
> @@ -16,6 +17,7 @@
>      type='Broadwell-x86_64-cpu'
>      qom_path='/machine/unattached/device[2]'
>      topology: socket='0' core='0' thread='1' node='1' vcpus='1'
> +    halted
>  [vcpu libvirt-id='2']
>      online=no
>      hotpluggable=yes
> diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
> index a932e39..c642166 100644
> --- a/tests/qemumonitorjsontest.c
> +++ b/tests/qemumonitorjsontest.c
> @@ -2712,6 +2712,9 @@ testQemuMonitorCPUInfoFormat(qemuMonitorCPUInfoPtr vcpus,
>              virBufferAddLit(&buf, "\n");
>          }
>  
> +        if (vcpu->halted)
> +            virBufferAddLit(&buf, "halted\n");
> +
>          virBufferAdjustIndent(&buf, -4);
>      }
>  
> @@ -3029,6 +3032,8 @@ mymain(void)
>      DO_TEST_CPU_INFO("ppc64-hotplug-4", 24);
>      DO_TEST_CPU_INFO("ppc64-no-threads", 16);
>  
> +    DO_TEST_CPU_INFO_FAST("s390-fast", 2);
> +
>  #define DO_TEST_BLOCK_NODE_DETECT(testname) \
>      do { \
>          if (virTestRun("node-name-detect(" testname ")", \
> 




More information about the libvir-list mailing list