[libvirt] [PATCH] cputest: Skip tests requiring JSON_MODELS if QEMU is disabled

Pavel Hrdina phrdina at redhat.com
Thu Nov 2 09:38:52 UTC 2017


On Wed, Nov 01, 2017 at 06:57:42PM +0100, Jiri Denemark wrote:
> Some tests require JSON_MODELS to be parsed into qemuCaps and applied
> when computing CPU models and such test cannot succeed if QEMU driver is
> disabled. Let's mark the tests with JSON_MODELS_REQUIRED and skip the
> appropriate parts if building without QEMU.
> 
> On the other hand, CPU tests with JSON_MODELS should succeed even if
> model definitions from QEMU are not parsed and applied. Let's explicitly
> test this by repeating the tests without JSON_MODELS set.
> 
> This fixes the build with QEMU driver disabled, e.g., on some
> architectures on RHEL/CentOS.
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
>  tests/cputest.c | 70 ++++++++++++++++++++++++++++++++++++++++-----------------
>  1 file changed, 49 insertions(+), 21 deletions(-)
>
> diff --git a/tests/cputest.c b/tests/cputest.c
> index 5d1fe7d99..8e94c2152 100644
> --- a/tests/cputest.c
> +++ b/tests/cputest.c
> @@ -464,6 +464,7 @@ typedef enum {
>      JSON_NONE,
>      JSON_HOST,
>      JSON_MODELS,
> +    JSON_MODELS_REQUIRED,
>  } cpuTestCPUIDJson;

After discussion on IRC please describe when JSON_MODELS_REQUIRED should
be used, preferably in the code, commit message is good as well but if
the code gets moved, it's easier to have it in the code.

Since this fixes only tests I would say SFF.

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20171102/55d5de81/attachment-0001.sig>


More information about the libvir-list mailing list