From e64661a0a650f48939d700e065e238524042d05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= Date: Sun, 20 Nov 2016 05:44:47 +0100 Subject: [PATCH 1/2] Low: rng: Create resources-2.7.rng to update template class validation Breaks the class/provider attribute definitions for primitive and template out into a new define, which will help prevent one or the other getting out of sync. Also fixes the template class list being outdated. --- xml/resources-2.7.rng | 218 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 xml/resources-2.7.rng diff --git a/xml/resources-2.7.rng b/xml/resources-2.7.rng new file mode 100644 index 0000000..355382b --- /dev/null +++ b/xml/resources-2.7.rng @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Stopped + Started + Slave + Master + + + + + + + nothing + quorum + fencing + unfencing + + + + + + + ignore + block + stop + restart + standby + fence + restart-container + + + + + + + + + + + + + + ocf + + + + + lsb + heartbeat + stonith + upstart + service + systemd + nagios + + + + + -- 1.8.3.1 From 1ec756ce373e1ec36a6de7c2c2a9a2d599cbbe98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= Date: Wed, 23 Nov 2016 19:46:34 +0100 Subject: [PATCH 2/2] Test: tools: make validity tests better adapting to new schemas We only want to suppress boring repeated parts from the diff when new schema emerges, but still want to be alerted about the new lines arising from the presence of such new schema -- that's a feedback loop that it is indeed being taken into account (and updating the regression tests to reconcile this minimalistic diff is a bearable duty at that opportunity). In one go, also reflect latest addition (as of previous commit) to the line of schemas -- pacemaker-2.7. --- tools/regression.sh | 3 +- tools/regression.validity.exp | 84 +++++++++++++++++++++++++------------------ 2 files changed, 51 insertions(+), 36 deletions(-) diff --git a/tools/regression.sh b/tools/regression.sh index f8def43..47bff43 100755 --- a/tools/regression.sh +++ b/tools/regression.sh @@ -754,7 +754,8 @@ for t in $tests; do -e 's/.*error: unpack_resources:/error: unpack_resources:/g'\ -e 's/ last-rc-change=\"[0-9]*\"//'\ -e 's|^/tmp/[0-9][0-9]*\.||'\ - -e 's/^Entity: line [0-9][0-9]*: //' $test_home/regression.$t.out + -e 's/^Entity: line [0-9][0-9]*: //'\ + -e 's/\(validation ([0-9][0-9]* of \)[0-9][0-9]*\().*\)/\1X\2/' $test_home/regression.$t.out if [ $do_save = 1 ]; then cp $test_home/regression.$t.out $test_home/regression.$t.exp diff --git a/tools/regression.validity.exp b/tools/regression.validity.exp index 39dbf92..827b660 100644 --- a/tools/regression.validity.exp +++ b/tools/regression.validity.exp @@ -22,43 +22,47 @@ Call failed: Update does not conform to the configured schema =#=#=#= End test: Try to make resulting CIB invalid (enum violation) - Update does not conform to the configured schema (203) =#=#=#= * Passed: cibadmin - Try to make resulting CIB invalid (enum violation) =#=#=#= Begin test: Run crm_simulate with invalid CIB (enum violation) =#=#=#= -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.2' validation (4 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.2' validation (4 of X) element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order ( schemas.c:760 ) trace: update_validation: pacemaker-1.2 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.3' validation (5 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.3' validation (5 of X) element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order ( schemas.c:760 ) trace: update_validation: pacemaker-1.3 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.0' validation (6 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.0' validation (6 of X) element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order ( schemas.c:760 ) trace: update_validation: pacemaker-2.0 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.1' validation (7 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.1' validation (7 of X) element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order ( schemas.c:760 ) trace: update_validation: pacemaker-2.1 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.2' validation (8 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.2' validation (8 of X) element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order ( schemas.c:760 ) trace: update_validation: pacemaker-2.2 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.3' validation (9 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.3' validation (9 of X) element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order ( schemas.c:760 ) trace: update_validation: pacemaker-2.3 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.4' validation (10 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.4' validation (10 of X) element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order ( schemas.c:760 ) trace: update_validation: pacemaker-2.4 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.5' validation (11 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.5' validation (11 of X) element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order ( schemas.c:760 ) trace: update_validation: pacemaker-2.5 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.6' validation (12 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.6' validation (12 of X) element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order ( schemas.c:760 ) trace: update_validation: pacemaker-2.6 validation failed -Your current configuration pacemaker-1.2 could not validate with any schema in range [pacemaker-1.2, pacemaker-2.6], cannot upgrade to pacemaker-2.0. +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.7' validation (13 of X) +element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order +element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order +( schemas.c:760 ) trace: update_validation: pacemaker-2.7 validation failed +Your current configuration pacemaker-1.2 could not validate with any schema in range [pacemaker-1.2, pacemaker-2.7], cannot upgrade to pacemaker-2.0. =#=#=#= End test: Run crm_simulate with invalid CIB (enum violation) - Required key not available (126) =#=#=#= * Passed: crm_simulate - Run crm_simulate with invalid CIB (enum violation) =#=#=#= Begin test: Try to make resulting CIB invalid (unrecognized validate-with) =#=#=#= @@ -82,54 +86,57 @@ Call failed: Update does not conform to the configured schema * Passed: cibadmin - Try to make resulting CIB invalid (unrecognized validate-with) =#=#=#= Begin test: Run crm_simulate with invalid CIB (unrecognized validate-with) =#=#=#= ( schemas.c:736 ) debug: update_validation: Unknown validation type -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-0.6' validation (0 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-0.6' validation (0 of X) element rsc_order: validity error : Element rsc_order does not carry attribute to element rsc_order: validity error : Element rsc_order does not carry attribute from element rsc_order: validity error : No declaration for attribute first of element rsc_order element rsc_order: validity error : No declaration for attribute first-action of element rsc_order element rsc_order: validity error : No declaration for attribute then of element rsc_order ( schemas.c:760 ) trace: update_validation: pacemaker-0.6 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'transitional-0.6' validation (1 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'transitional-0.6' validation (1 of X) element rsc_order: validity error : Element rsc_order does not carry attribute to element rsc_order: validity error : Element rsc_order does not carry attribute from element rsc_order: validity error : No declaration for attribute first of element rsc_order element rsc_order: validity error : No declaration for attribute first-action of element rsc_order element rsc_order: validity error : No declaration for attribute then of element rsc_order ( schemas.c:760 ) trace: update_validation: transitional-0.6 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-0.7' validation (2 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-0.7' validation (2 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-0.7 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.0' validation (3 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.0' validation (3 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-1.0 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.2' validation (4 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.2' validation (4 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-1.2 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.3' validation (5 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.3' validation (5 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-1.3 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.0' validation (6 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.0' validation (6 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-2.0 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.1' validation (7 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.1' validation (7 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-2.1 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.2' validation (8 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.2' validation (8 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-2.2 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.3' validation (9 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.3' validation (9 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-2.3 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.4' validation (10 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.4' validation (10 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-2.4 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.5' validation (11 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.5' validation (11 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-2.5 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.6' validation (12 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.6' validation (12 of X) element cib: Relax-NG validity error : Invalid attribute validate-with for element cib ( schemas.c:760 ) trace: update_validation: pacemaker-2.6 validation failed -Your current configuration pacemaker-9999.0 could not validate with any schema in range [unknown, pacemaker-2.6], cannot upgrade to pacemaker-2.0. +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.7' validation (13 of X) +element cib: Relax-NG validity error : Invalid attribute validate-with for element cib +( schemas.c:760 ) trace: update_validation: pacemaker-2.7 validation failed +Your current configuration pacemaker-9999.0 could not validate with any schema in range [unknown, pacemaker-2.7], cannot upgrade to pacemaker-2.0. =#=#=#= End test: Run crm_simulate with invalid CIB (unrecognized validate-with) - Required key not available (126) =#=#=#= * Passed: crm_simulate - Run crm_simulate with invalid CIB (unrecognized validate-with) =#=#=#= Begin test: Try to make resulting CIB invalid, but possibly recoverable (valid with X.Y+1) =#=#=#= @@ -152,33 +159,36 @@ Call failed: Update does not conform to the configured schema =#=#=#= End test: Try to make resulting CIB invalid, but possibly recoverable (valid with X.Y+1) - Update does not conform to the configured schema (203) =#=#=#= * Passed: cibadmin - Try to make resulting CIB invalid, but possibly recoverable (valid with X.Y+1) =#=#=#= Begin test: Run crm_simulate with invalid, but possibly recoverable CIB (valid with X.Y+1) =#=#=#= -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.2' validation (4 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.2' validation (4 of X) element tags: Relax-NG validity error : Element configuration has extra content: tags ( schemas.c:760 ) trace: update_validation: pacemaker-1.2 validation failed -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.3' validation (5 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-1.3' validation (5 of X) ( schemas.c:804 ) debug: update_validation: Upgrading pacemaker-1.3-style configuration to pacemaker-2.0 with upgrade-1.3.xsl ( schemas.c:816 ) info: update_validation: Transformation upgrade-1.3.xsl successful -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.0' validation (6 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.0' validation (6 of X) ( schemas.c:797 ) debug: update_validation: pacemaker-2.0-style configuration is also valid for pacemaker-2.1 -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.1' validation (7 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.1' validation (7 of X) ( schemas.c:771 ) debug: update_validation: Configuration valid for schema: pacemaker-2.1 ( schemas.c:797 ) debug: update_validation: pacemaker-2.1-style configuration is also valid for pacemaker-2.2 -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.2' validation (8 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.2' validation (8 of X) ( schemas.c:771 ) debug: update_validation: Configuration valid for schema: pacemaker-2.2 ( schemas.c:797 ) debug: update_validation: pacemaker-2.2-style configuration is also valid for pacemaker-2.3 -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.3' validation (9 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.3' validation (9 of X) ( schemas.c:771 ) debug: update_validation: Configuration valid for schema: pacemaker-2.3 ( schemas.c:797 ) debug: update_validation: pacemaker-2.3-style configuration is also valid for pacemaker-2.4 -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.4' validation (10 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.4' validation (10 of X) ( schemas.c:771 ) debug: update_validation: Configuration valid for schema: pacemaker-2.4 ( schemas.c:797 ) debug: update_validation: pacemaker-2.4-style configuration is also valid for pacemaker-2.5 -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.5' validation (11 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.5' validation (11 of X) ( schemas.c:771 ) debug: update_validation: Configuration valid for schema: pacemaker-2.5 ( schemas.c:797 ) debug: update_validation: pacemaker-2.5-style configuration is also valid for pacemaker-2.6 -( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.6' validation (12 of 12) +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.6' validation (12 of X) ( schemas.c:771 ) debug: update_validation: Configuration valid for schema: pacemaker-2.6 -( schemas.c:787 ) trace: update_validation: Stopping at pacemaker-2.6 -( schemas.c:843 ) info: update_validation: Transformed the configuration from pacemaker-1.2 to pacemaker-2.6 +( schemas.c:797 ) debug: update_validation: pacemaker-2.6-style configuration is also valid for pacemaker-2.7 +( schemas.c:751 ) debug: update_validation: Testing 'pacemaker-2.7' validation (13 of X) +( schemas.c:771 ) debug: update_validation: Configuration valid for schema: pacemaker-2.7 +( schemas.c:787 ) trace: update_validation: Stopping at pacemaker-2.7 +( schemas.c:843 ) info: update_validation: Transformed the configuration from pacemaker-1.2 to pacemaker-2.7 error: unpack_resources: Resource start-up disabled since no STONITH resources have been defined error: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option error: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity @@ -302,6 +312,8 @@ element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order +element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order +element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order =#=#=#= Current cib after: Make resulting CIB invalid, and without validate-with attribute =#=#=#= @@ -357,6 +369,8 @@ bad-1.2.xml:10: element rsc_order: Relax-NG validity error : Invalid attribute f bad-1.2.xml:10: element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order bad-1.2.xml:10: element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order bad-1.2.xml:10: element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order +bad-1.2.xml:10: element rsc_order: Relax-NG validity error : Invalid attribute first-action for element rsc_order +bad-1.2.xml:10: element rsc_order: Relax-NG validity error : Element constraints has extra content: rsc_order error: unpack_resources: Resource start-up disabled since no STONITH resources have been defined error: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option error: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity -- 1.8.3.1