Version 2 of: https://www.redhat.com/archives/libvir-list/2014-May/msg01102.html This tests the conversion of libvirt XML to libxl_domain_config objects by the libvirt libxl driver. Changed in v2: - Compare the parsed JSON object model instead of strcmp() on the string-ified JSON document - To cope with new additions between Xen 4.3 and 4.4 - Ignore case where actual JSON object has gained new keys. This copes with fact that '/c_info' gained a new key called 'pvh' in 4.4 - Ignore case where actual JSON value has changed from 'null' to a non-'null' value type. This copes with fact that the element at /b_info/device_model_version changed from 'null' to a specific value by default in 4.4. - Use libxl_domain_config_to_json instead of libxl_json.h functions, and disable test if running on Xen version which lacks this function (eg 4.2) - Isolate VNC port allocator from host TCP ports so a predictable VNC port is always in the config. Daniel P. Berrange (4): util: Introduce virJSONStringCompare for JSON doc comparisons util: Allow port allocator to skip bind() check tests: Add more test suite mock helpers libxl: Add a test suite for libxl option generator configure.ac | 2 + src/libvirt_private.syms | 1 + src/libxl/libxl_driver.c | 3 +- src/qemu/qemu_driver.c | 9 +- src/util/virjson.c | 185 ++++++++++++++++++++++++++++++++++ src/util/virjson.h | 22 +++++ src/util/virportallocator.c | 14 ++- src/util/virportallocator.h | 7 +- tests/Makefile.am | 25 ++++- tests/libxlxml2jsondata/minimal.json | 172 ++++++++++++++++++++++++++++++++ tests/libxlxml2jsondata/minimal.xml | 36 +++++++ tests/libxlxml2jsontest.c | 186 +++++++++++++++++++++++++++++++++++ tests/virfirewalltest.c | 4 +- tests/virmock.h | 54 +++++++--- tests/virmocklibxl.c | 87 ++++++++++++++++ tests/virportallocatortest.c | 4 +- tests/virsystemdtest.c | 4 +- 17 files changed, 786 insertions(+), 29 deletions(-) create mode 100644 tests/libxlxml2jsondata/minimal.json create mode 100644 tests/libxlxml2jsondata/minimal.xml create mode 100644 tests/libxlxml2jsontest.c create mode 100644 tests/virmocklibxl.c -- 1.9.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list