Skip to content

Testing libvirt XML -> libxl_domain_config conversion

Daniel P. Berrange xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 9 repliesIn review
  2. v15 patches 13 repliesSuperseded

Changes in v2 from the cover letter

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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4util: Introduce virJSONStringCompare for JSON doc comparisonssrc/libvirt_private.syms src/util/virjson.c src/util/virjson.h+208 -01 reply
2/4util: Allow port allocator to skip bind() checksrc/libxl/libxl_driver.c src/qemu/qemu_driver.c src/util/virportallocator.c +2 more+26 -111 reply
3/4tests: Add more test suite mock helperstests/virfirewalltest.c tests/virmock.h tests/virsystemdtest.c+45 -171 reply
4/4libxl: Add a test suite for libxl option generatorconfigure.ac tests/Makefile.am tests/libxlxml2jsondata/minimal.json +3 more+507 -16 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] Testing libvirt XML -> libxl_domain_config conversion

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
Signature · 1 line
1.9.3