[libvirt] [PATCH v3] libxl: Add a test suite for libxl_domain_config generator

Jim Fehlig jfehlig at suse.com
Fri Aug 4 16:31:57 UTC 2017


On 08/03/2017 06:29 AM, Joao Martins wrote:
> On Tue, Aug 01, 2017 at 03:17:51PM +0200, Marek Marczykowski-Górecki wrote:
>> From: Jim Fehlig <jfehlig at suse.com>
>>
>> The libxl library allows a libxl_domain_config object to be serialized
>> from/to a JSON string. Use this to allow testing of the XML to
>> libxl_domain_config conversion process. Test XML is converted to
>> libxl_domain_config, which is then serialized to json. A json template
>> corresponding to the test XML is converted to a libxl_domain_config
>> object using libxl_domain_config_from_json(), and then serialized
>> back to json using libxl_domain_config_to_json(). The two json
>> docs are then compared.
>>
>> Using libxl to convert the json template to a libxl_domain_config
>> object and then back to json provides a simple way to account for
>> any changes or additions to the json representation across Xen
>> releases.
>>
>> Signed-off-by: Jim Fehlig <jfehlig at suse.com>
>> [update to v3.5.0-rc1, improve error reporting, use /bin/true emulator]
>> Signed-off-by: Marek Marczykowski-Górecki <marmarek at invisiblethingslab.com>
> 
> I've been looking at this series for the past days, and taking into
> account the comments that Jim mentioned yesterday are ammended, and this
> looks good to me:
> 
> Reviewed-by: Joao Martins <joao.m.martins at oracle.com>

Thanks, I've pushed it now.

> It adds a really nice piece of testing infra for libxl_domain_configs.
> Maybe in the future more tests could be added in (in addition to the
> CPUID one that Marek has planned).

Agreed. Testing of the libxl_domain_config generation code was long overdue.

Regards,
Jim




More information about the libvir-list mailing list