]> xenbits.xensource.com Git - libvirt.git/commit
tests: Add CPU detection tests
authorJiri Denemark <jdenemar@redhat.com>
Wed, 1 Jun 2016 13:57:00 +0000 (15:57 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 9 Jun 2016 07:47:56 +0000 (09:47 +0200)
commit3704b9003f9c54c2a4d14d3c7e26e6dd3c1819a2
treec0e7fb8f7f7bcccd96053bd0fa4d04992c53e9f9
parenta54234c37bf58c28e8f26939c058121701b77589
tests: Add CPU detection tests

So far we only test CPUID -> CPU def conversion on artificial CPUID data
computed from another CPU def. This patch adds the infrastructure to
test this conversion on real data gathered from a host CPU and two
helper scripts for adding new test data:

- cpu-gather.sh runs cpuid tool and qemu-system-x86_64 to get CPUID data
  from the host CPU; this is what users can be asked to run if they run
  into an issue with host CPU detection in libvirt

- cpu-parse.sh takes the data generated by cpu-gather.sh and creates
  data files for CPU detection tests

The CPUID data queried from QEMU will eventually switch to the format
used by query-host-cpu QMP command once QEMU implements it. Until then
we just spawn QEMU with -cpu host and query the guest CPU in QOM. They
should both provide the same CPUID results, but query-host-cpu does not
require any guest CPU to be created by QEMU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
tests/Makefile.am
tests/cputest.c
tests/cputestdata/cpu-gather.sh [new file with mode: 0755]
tests/cputestdata/cpu-parse.sh [new file with mode: 0755]