diff --git a/cts/cli/constraints.xml b/cts/cli/constraints.xml new file mode 100644 index 0000000..1a27aa7 --- /dev/null +++ b/cts/cli/constraints.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cts/cli/regression.tools.exp b/cts/cli/regression.tools.exp index 221730d..565cacc 100644 --- a/cts/cli/regression.tools.exp +++ b/cts/cli/regression.tools.exp @@ -3470,3 +3470,785 @@ Removing constraint: cli-prefer-dummy =#=#=#= End test: Create an XML patchset - Error occurred (1) =#=#=#= * Passed: crm_diff - Create an XML patchset +=#=#=#= Begin test: Check locations and constraints for prim1 =#=#=#= +prim1: + * Locations: +=#=#=#= End test: Check locations and constraints for prim1 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim1 +=#=#=#= Begin test: Recursively check locations and constraints for prim1 =#=#=#= +prim1: + * Locations: +=#=#=#= End test: Recursively check locations and constraints for prim1 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim1 +=#=#=#= Begin test: Check locations and constraints for prim1 in XML =#=#=#= + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim1 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim1 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim1 in XML =#=#=#= + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim1 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim1 in XML +=#=#=#= Begin test: Check locations and constraints for prim2 =#=#=#= +prim2: + * Locations: + * Node cluster01 (score=INFINITY, id=prim2-on-cluster1) +Colocations: + * prim3 (score=INFINITY, id=colocation-prim2-prim3-INFINITY + * Locations: +=#=#=#= End test: Check locations and constraints for prim2 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim2 +=#=#=#= Begin test: Recursively check locations and constraints for prim2 =#=#=#= +prim2: + * Locations: + * Node cluster01 (score=INFINITY, id=prim2-on-cluster1) +Colocations: + * prim3 (score=INFINITY, id=colocation-prim2-prim3-INFINITY + * Locations: +=#=#=#= End test: Recursively check locations and constraints for prim2 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim2 +=#=#=#= Begin test: Check locations and constraints for prim2 in XML =#=#=#= + + + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim2 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim2 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim2 in XML =#=#=#= + + + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim2 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim2 in XML +=#=#=#= Begin test: Check locations and constraints for prim3 =#=#=#= +Colocations: + * prim2 (score=INFINITY, id=colocation-prim2-prim3-INFINITY + * Locations: + * Node cluster01 (score=INFINITY, id=prim2-on-cluster1) +prim3: + * Locations: +Colocations: + * prim4 (score=INFINITY, id=colocation-prim3-prim4-INFINITY + * Locations: + * Node cluster02 (score=INFINITY, id=prim4-on-cluster2) +=#=#=#= End test: Check locations and constraints for prim3 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim3 +=#=#=#= Begin test: Recursively check locations and constraints for prim3 =#=#=#= +Colocations: + * prim2 (score=INFINITY, id=colocation-prim2-prim3-INFINITY + * Locations: + * Node cluster01 (score=INFINITY, id=prim2-on-cluster1) +prim3: + * Locations: +Colocations: + * prim4 (score=INFINITY, id=colocation-prim3-prim4-INFINITY + * Locations: + * Node cluster02 (score=INFINITY, id=prim4-on-cluster2) +=#=#=#= End test: Recursively check locations and constraints for prim3 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim3 +=#=#=#= Begin test: Check locations and constraints for prim3 in XML =#=#=#= + + + + + + + + + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim3 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim3 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim3 in XML =#=#=#= + + + + + + + + + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim3 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim3 in XML +=#=#=#= Begin test: Check locations and constraints for prim4 =#=#=#= +Colocations: + * prim10 (score=INFINITY, id=colocation-prim10-prim4-INFINITY + * Locations: + * prim3 (score=INFINITY, id=colocation-prim3-prim4-INFINITY + * Locations: +prim4: + * Locations: + * Node cluster02 (score=INFINITY, id=prim4-on-cluster2) +Colocations: + * prim5 (score=INFINITY, id=colocation-prim4-prim5-INFINITY + * Locations: +=#=#=#= End test: Check locations and constraints for prim4 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim4 +=#=#=#= Begin test: Recursively check locations and constraints for prim4 =#=#=#= +Colocations: + * prim10 (score=INFINITY, id=colocation-prim10-prim4-INFINITY + * Locations: + * prim3 (score=INFINITY, id=colocation-prim3-prim4-INFINITY + * Locations: +prim4: + * Locations: + * Node cluster02 (score=INFINITY, id=prim4-on-cluster2) +Colocations: + * prim5 (score=INFINITY, id=colocation-prim4-prim5-INFINITY + * Locations: +=#=#=#= End test: Recursively check locations and constraints for prim4 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim4 +=#=#=#= Begin test: Check locations and constraints for prim4 in XML =#=#=#= + + + + + + + + + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim4 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim4 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim4 in XML =#=#=#= + + + + + + + + + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim4 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim4 in XML +=#=#=#= Begin test: Check locations and constraints for prim5 =#=#=#= +Colocations: + * prim4 (score=INFINITY, id=colocation-prim4-prim5-INFINITY + * Locations: + * Node cluster02 (score=INFINITY, id=prim4-on-cluster2) +prim5: + * Locations: +=#=#=#= End test: Check locations and constraints for prim5 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim5 +=#=#=#= Begin test: Recursively check locations and constraints for prim5 =#=#=#= +Colocations: + * prim4 (score=INFINITY, id=colocation-prim4-prim5-INFINITY + * Locations: + * Node cluster02 (score=INFINITY, id=prim4-on-cluster2) +prim5: + * Locations: +=#=#=#= End test: Recursively check locations and constraints for prim5 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim5 +=#=#=#= Begin test: Check locations and constraints for prim5 in XML =#=#=#= + + + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim5 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim5 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim5 in XML =#=#=#= + + + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim5 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim5 in XML +=#=#=#= Begin test: Check locations and constraints for prim6 =#=#=#= +prim6: + * Locations: + * Node cluster02 (score=-INFINITY, id=prim6-not-on-cluster2) +=#=#=#= End test: Check locations and constraints for prim6 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim6 +=#=#=#= Begin test: Recursively check locations and constraints for prim6 =#=#=#= +prim6: + * Locations: + * Node cluster02 (score=-INFINITY, id=prim6-not-on-cluster2) +=#=#=#= End test: Recursively check locations and constraints for prim6 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim6 +=#=#=#= Begin test: Check locations and constraints for prim6 in XML =#=#=#= + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim6 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim6 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim6 in XML =#=#=#= + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim6 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim6 in XML +=#=#=#= Begin test: Check locations and constraints for prim7 =#=#=#= +prim7: + * Locations: +Colocations: + * group (score=INFINITY, id=colocation-prim7-group-INFINITY + * Locations: +=#=#=#= End test: Check locations and constraints for prim7 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim7 +=#=#=#= Begin test: Recursively check locations and constraints for prim7 =#=#=#= +prim7: + * Locations: +Colocations: + * group (score=INFINITY, id=colocation-prim7-group-INFINITY + * Locations: +=#=#=#= End test: Recursively check locations and constraints for prim7 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim7 +=#=#=#= Begin test: Check locations and constraints for prim7 in XML =#=#=#= + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim7 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim7 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim7 in XML =#=#=#= + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim7 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim7 in XML +=#=#=#= Begin test: Check locations and constraints for prim8 =#=#=#= +prim8: + * Locations: +Colocations: + * gr2 (score=INFINITY, id=colocation-prim8-gr2-INFINITY + * Locations: +=#=#=#= End test: Check locations and constraints for prim8 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim8 +=#=#=#= Begin test: Recursively check locations and constraints for prim8 =#=#=#= +prim8: + * Locations: +Colocations: + * gr2 (score=INFINITY, id=colocation-prim8-gr2-INFINITY + * Locations: +=#=#=#= End test: Recursively check locations and constraints for prim8 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim8 +=#=#=#= Begin test: Check locations and constraints for prim8 in XML =#=#=#= + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim8 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim8 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim8 in XML =#=#=#= + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim8 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim8 in XML +=#=#=#= Begin test: Check locations and constraints for prim9 =#=#=#= +prim9: + * Locations: +Colocations: + * clone (score=INFINITY, id=colocation-prim9-clone-INFINITY + * Locations: +=#=#=#= End test: Check locations and constraints for prim9 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim9 +=#=#=#= Begin test: Recursively check locations and constraints for prim9 =#=#=#= +prim9: + * Locations: +Colocations: + * clone (score=INFINITY, id=colocation-prim9-clone-INFINITY + * Locations: +=#=#=#= End test: Recursively check locations and constraints for prim9 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim9 +=#=#=#= Begin test: Check locations and constraints for prim9 in XML =#=#=#= + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim9 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim9 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim9 in XML =#=#=#= + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim9 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim9 in XML +=#=#=#= Begin test: Check locations and constraints for prim10 =#=#=#= +prim10: + * Locations: +Colocations: + * prim4 (score=INFINITY, id=colocation-prim10-prim4-INFINITY + * Locations: + * Node cluster02 (score=INFINITY, id=prim4-on-cluster2) +=#=#=#= End test: Check locations and constraints for prim10 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim10 +=#=#=#= Begin test: Recursively check locations and constraints for prim10 =#=#=#= +prim10: + * Locations: +Colocations: + * prim4 (score=INFINITY, id=colocation-prim10-prim4-INFINITY + * Locations: + * Node cluster02 (score=INFINITY, id=prim4-on-cluster2) +=#=#=#= End test: Recursively check locations and constraints for prim10 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim10 +=#=#=#= Begin test: Check locations and constraints for prim10 in XML =#=#=#= + + + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim10 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim10 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim10 in XML =#=#=#= + + + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim10 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim10 in XML +=#=#=#= Begin test: Check locations and constraints for prim11 =#=#=#= +Colocations: + * prim13 (score=INFINITY, id=colocation-prim13-prim11-INFINITY + * Locations: +prim11: + * Locations: +Colocations: + * prim12 (score=INFINITY, id=colocation-prim11-prim12-INFINITY + * Locations: +=#=#=#= End test: Check locations and constraints for prim11 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim11 +=#=#=#= Begin test: Recursively check locations and constraints for prim11 =#=#=#= +Colocations: + * prim13 (score=INFINITY, id=colocation-prim13-prim11-INFINITY + * Locations: +prim11: + * Locations: +Colocations: + * prim12 (score=INFINITY, id=colocation-prim11-prim12-INFINITY + * Locations: +=#=#=#= End test: Recursively check locations and constraints for prim11 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim11 +=#=#=#= Begin test: Check locations and constraints for prim11 in XML =#=#=#= + + + + + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim11 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim11 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim11 in XML =#=#=#= + + + + + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim11 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim11 in XML +=#=#=#= Begin test: Check locations and constraints for prim12 =#=#=#= +Colocations: + * prim11 (score=INFINITY, id=colocation-prim11-prim12-INFINITY + * Locations: +prim12: + * Locations: +Colocations: + * prim13 (score=INFINITY, id=colocation-prim12-prim13-INFINITY + * Locations: +=#=#=#= End test: Check locations and constraints for prim12 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim12 +=#=#=#= Begin test: Recursively check locations and constraints for prim12 =#=#=#= +Colocations: + * prim11 (score=INFINITY, id=colocation-prim11-prim12-INFINITY + * Locations: +prim12: + * Locations: +Colocations: + * prim13 (score=INFINITY, id=colocation-prim12-prim13-INFINITY + * Locations: +=#=#=#= End test: Recursively check locations and constraints for prim12 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim12 +=#=#=#= Begin test: Check locations and constraints for prim12 in XML =#=#=#= + + + + + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim12 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim12 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim12 in XML =#=#=#= + + + + + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim12 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim12 in XML +=#=#=#= Begin test: Check locations and constraints for prim13 =#=#=#= +Colocations: + * prim12 (score=INFINITY, id=colocation-prim12-prim13-INFINITY + * Locations: +prim13: + * Locations: +Colocations: + * prim11 (score=INFINITY, id=colocation-prim13-prim11-INFINITY + * Locations: +=#=#=#= End test: Check locations and constraints for prim13 - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim13 +=#=#=#= Begin test: Recursively check locations and constraints for prim13 =#=#=#= +Colocations: + * prim12 (score=INFINITY, id=colocation-prim12-prim13-INFINITY + * Locations: +prim13: + * Locations: +Colocations: + * prim11 (score=INFINITY, id=colocation-prim13-prim11-INFINITY + * Locations: +=#=#=#= End test: Recursively check locations and constraints for prim13 - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim13 +=#=#=#= Begin test: Check locations and constraints for prim13 in XML =#=#=#= + + + + + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for prim13 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for prim13 in XML +=#=#=#= Begin test: Recursively check locations and constraints for prim13 in XML =#=#=#= + + + + + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for prim13 in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for prim13 in XML +=#=#=#= Begin test: Check locations and constraints for group =#=#=#= +Colocations: + * prim7 (score=INFINITY, id=colocation-prim7-group-INFINITY + * Locations: +group: + * Locations: +=#=#=#= End test: Check locations and constraints for group - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for group +=#=#=#= Begin test: Recursively check locations and constraints for group =#=#=#= +Colocations: + * prim7 (score=INFINITY, id=colocation-prim7-group-INFINITY + * Locations: +group: + * Locations: +=#=#=#= End test: Recursively check locations and constraints for group - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for group +=#=#=#= Begin test: Check locations and constraints for group in XML =#=#=#= + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for group in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for group in XML +=#=#=#= Begin test: Recursively check locations and constraints for group in XML =#=#=#= + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for group in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for group in XML +=#=#=#= Begin test: Check locations and constraints for clone =#=#=#= +Colocations: + * prim9 (score=INFINITY, id=colocation-prim9-clone-INFINITY + * Locations: +clone: + * Locations: +=#=#=#= End test: Check locations and constraints for clone - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for clone +=#=#=#= Begin test: Recursively check locations and constraints for clone =#=#=#= +Colocations: + * prim9 (score=INFINITY, id=colocation-prim9-clone-INFINITY + * Locations: +clone: + * Locations: +=#=#=#= End test: Recursively check locations and constraints for clone - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for clone +=#=#=#= Begin test: Check locations and constraints for clone in XML =#=#=#= + + + + + + + + + + + + +=#=#=#= End test: Check locations and constraints for clone in XML - OK (0) =#=#=#= +* Passed: crm_resource - Check locations and constraints for clone in XML +=#=#=#= Begin test: Recursively check locations and constraints for clone in XML =#=#=#= + + + + + + + + + + + + +=#=#=#= End test: Recursively check locations and constraints for clone in XML - OK (0) =#=#=#= +* Passed: crm_resource - Recursively check locations and constraints for clone in XML diff --git a/cts/cts-cli.in b/cts/cts-cli.in index 14b4ce9..dfdd3de 100755 --- a/cts/cts-cli.in +++ b/cts/cts-cli.in @@ -768,6 +768,29 @@ function test_tools() { desc="Create an XML patchset" cmd="crm_diff -o $test_home/cli/crm_diff_old.xml -n $test_home/cli/crm_diff_new.xml" test_assert $CRM_EX_ERROR 0 + + export CIB_file="$test_home/cli/constraints.xml" + + for rsc in prim1 prim2 prim3 prim4 prim5 prim6 prim7 prim8 prim9 \ + prim10 prim11 prim12 prim13 group clone; do + desc="Check locations and constraints for $rsc" + cmd="crm_resource -a -r $rsc" + test_assert $CRM_EX_OK 0 + + desc="Recursively check locations and constraints for $rsc" + cmd="crm_resource -A -r $rsc" + test_assert $CRM_EX_OK 0 + + desc="Check locations and constraints for $rsc in XML" + cmd="crm_resource -a -r $rsc --output-as=xml" + test_assert $CRM_EX_OK 0 + + desc="Recursively check locations and constraints for $rsc in XML" + cmd="crm_resource -A -r $rsc --output-as=xml" + test_assert $CRM_EX_OK 0 + done + + unset CIB_file } INVALID_PERIODS=( @@ -1604,7 +1627,7 @@ for t in $tests; do -e 's/last_change time=\".*\"/last_change time=\"\"/' \ -e 's/ api-version=\".*\" / api-version=\"X\" /' \ -e 's/ version=\".*\" / version=\"\" /' \ - -e 's/request=\".*crm_mon/request=\"crm_mon/' \ + -e 's/request=\".*\(crm_[a-zA-Z0-9]*\)/request=\"\1/' \ -e 's/crm_feature_set="[^"]*" //'\ -e 's/validate-with="[^"]*" //'\ -e 's/Created new pacemaker-.* configuration/Created new pacemaker configuration/'\