Re: [PATCH] nodeinfo: test more details

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

 



On 15.05.2012 01:14, Eric Blake wrote:
> Make it obvious why we need Osier's patch to fix NUMA parsing
> of an AMD machine with two cores sharing a socket id.
> 
> * tests/nodeinfotest.c (linuxTestCompareFiles): Enhance the test.
> * tests/nodeinfodata/linux-nodeinfo-sysfs-test-*-output.txt: Update.
> ---
> 
> As promised here:
> https://www.redhat.com/archives/libvir-list/2012-May/msg00759.html
> (Hmm, I still need to add results from a machine with an offline cpu)
> 
> I can push this either before or after Osier's patch here:
> https://www.redhat.com/archives/libvir-list/2012-May/msg00736.html
> 
> whoever pushes second needs a minor rebase; should be obvious
> what the changes will be, since 48 online out of 24 max is clearly
> wrong...
> 
>  .../linux-nodeinfo-sysfs-test-1-cpu-ppc-output.txt |    2 +-
>  .../linux-nodeinfo-sysfs-test-1-cpu-x86-output.txt |    2 +-
>  .../linux-nodeinfo-sysfs-test-2-cpu-x86-output.txt |    2 +-
>  .../linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt |    2 +-
>  tests/nodeinfotest.c                               |    9 ++++++---
>  5 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-ppc-output.txt b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-ppc-output.txt
> index 433a81f..80df832 100644
> --- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-ppc-output.txt
> +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-ppc-output.txt
> @@ -1 +1 @@
> -CPUs: 2, MHz: 8, Nodes: 1, Cores: 2
> +CPUs: 2/2, MHz: 8, Nodes: 1, Sockets: 1, Cores: 2, Threads: 1
> diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-x86-output.txt b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-x86-output.txt
> index 09e2946..4c86824 100644
> --- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-x86-output.txt
> +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-1-cpu-x86-output.txt
> @@ -1 +1 @@
> -CPUs: 2, MHz: 2800, Nodes: 1, Cores: 2
> +CPUs: 2/2, MHz: 2800, Nodes: 1, Sockets: 1, Cores: 2, Threads: 1
> diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-2-cpu-x86-output.txt b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-2-cpu-x86-output.txt
> index 73300a4..33bfbf3 100644
> --- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-2-cpu-x86-output.txt
> +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-2-cpu-x86-output.txt
> @@ -1 +1 @@
> -CPUs: 2, MHz: 800, Nodes: 1, Cores: 2
> +CPUs: 2/2, MHz: 800, Nodes: 1, Sockets: 1, Cores: 2, Threads: 1
> diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt
> index e3c046b..ed5d6bd 100644
> --- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt
> +++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt
> @@ -1 +1 @@
> -CPUs: 48, MHz: 2100, Nodes: 1, Cores: 6
> +CPUs: 48/24, MHz: 2100, Nodes: 1, Sockets: 4, Cores: 6, Threads: 1
> diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c
> index 2b4c3a0..a2b89dd 100644
> --- a/tests/nodeinfotest.c
> +++ b/tests/nodeinfotest.c
> @@ -60,9 +60,12 @@ linuxTestCompareFiles(const char *cpuinfofile,
>      }
>      VIR_FORCE_FCLOSE(cpuinfo);
> 
> -    if (virAsprintf(&actualData, "CPUs: %u, MHz: %u, Nodes: %u, Cores: %u\n",
> -                    nodeinfo.cpus, nodeinfo.mhz, nodeinfo.nodes,
> -                    nodeinfo.cores) < 0)
> +    if (virAsprintf(&actualData,
> +                    "CPUs: %u/%u, MHz: %u, Nodes: %u, Sockets: %u, "
> +                    "Cores: %u, Threads: %u\n",
> +                    nodeinfo.cpus, VIR_NODEINFO_MAXCPUS(nodeinfo),
> +                    nodeinfo.mhz, nodeinfo.nodes, nodeinfo.sockets,
> +                    nodeinfo.cores, nodeinfo.threads) < 0)
>          goto fail;
> 
>      if (STRNEQ(actualData, expectData)) {

ACK

Michal

--
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]