From 1d0c3c3a6274654259775d9e7cfb899b56ea9d6d Mon Sep 17 00:00:00 2001 From: Huaqiang Date: Thu, 14 Nov 2019 01:08:21 +0800 Subject: [PATCH] cachetune schema: a looser check for the order of and element MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally, inside , it requires the element to be in the position before , and following configuration is not permitted by schema, but it is better to let it be valid. ^ |__ Not permitted originally because it is in the place before element. ... And, let schema do more strict check by identifying following configuration to be invalid, due to should contain at least one or element. ^ |__ a SHOULD contain at least one or ... Reviewed-by: Daniel P. Berrangé Signed-off-by: Huaqiang --- docs/schemas/domaincommon.rng | 68 +++++++++++------------ tests/genericxml2xmlindata/cachetune.xml | 1 + tests/genericxml2xmloutdata/cachetune.xml | 34 ++++++++++++ tests/genericxml2xmltest.c | 2 +- 4 files changed, 70 insertions(+), 35 deletions(-) create mode 100644 tests/genericxml2xmloutdata/cachetune.xml diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 1e9a9f295b..ec540f8c27 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -980,41 +980,41 @@ - - - - - - - - - - - both - code - data - - - - - - - - + + + + + - - - - - - - - - - - - - + + + + + + both + code + data + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/genericxml2xmlindata/cachetune.xml b/tests/genericxml2xmlindata/cachetune.xml index 8f9d19b4de..40259cf2ee 100644 --- a/tests/genericxml2xmlindata/cachetune.xml +++ b/tests/genericxml2xmlindata/cachetune.xml @@ -6,6 +6,7 @@ 4 + diff --git a/tests/genericxml2xmloutdata/cachetune.xml b/tests/genericxml2xmloutdata/cachetune.xml new file mode 100644 index 0000000000..f05cab70ff --- /dev/null +++ b/tests/genericxml2xmloutdata/cachetune.xml @@ -0,0 +1,34 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 4 + + + + + + + + + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + + + + + + + + diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index 1376221ef8..e5d2bca947 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -161,9 +161,9 @@ mymain(void) DO_TEST_FULL("chardev-reconnect-invalid-mode", 0, false, TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); - DO_TEST("cachetune"); DO_TEST("cachetune-small"); DO_TEST("cachetune-cdp"); + DO_TEST_DIFFERENT("cachetune"); DO_TEST_DIFFERENT("cachetune-extra-tunes"); DO_TEST_FULL("cachetune-colliding-allocs", false, true, TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE);