1589a3e7c3
- Resolve coverity RESOURCE_LEAK, REVERSE_INULL and UNREACHABLE defects - Tools: crm_simulate - Support to grant/revoke/standby/activate tickets from the new ticket state section (bnc#752241) - Tools: Add crm_ticket to be profiled by valgrind - Tools: crm_ticket - Display the tickets that are referenced in rsc_ticket constraints but have never been granted yet (bnc#752241) - Tools: crm_mon - Support to display tickets (bnc#752242) - PE: Move the ticket state section to "/cib/status/tickets/ticket_state" (bnc#752241) - PE: Support to make tickets standby for relinquishing tickets gracefully (bnc#752241) - Tools: Implement a new crm_ticket (bnc#752241) - Tools: Update CLI regression tests for the new crm_ticket - Tools: Add CLI regression tests for ticket standby state - PE: Update regression tests for the new ticket state section - PE: Support to make tickets standby for relinquishing tickets gracefully (regression tests) - Tools: crm_ticket - Granting/revoking tickets need user to confirm unless "--force" option is used (bnc#752269) - Tools: Implement the support of granting/revoking tickets for crm_simulate (bnc#752241) OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=34
239 lines
8.9 KiB
Diff
239 lines
8.9 KiB
Diff
commit 0f60f521e85fac6f185f6f5fb71163f7a3772e2b
|
|
Author: Gao,Yan <ygao@suse.com>
|
|
Date: Sat Mar 24 09:40:00 2012 +0800
|
|
|
|
Low: Tools: Add CLI regression tests for ticket standby state
|
|
|
|
diff --git a/tools/regression.exp b/tools/regression.exp
|
|
index af3fed9..342a8fa 100755
|
|
--- a/tools/regression.exp
|
|
+++ b/tools/regression.exp
|
|
@@ -842,7 +842,7 @@ false
|
|
</node_state>
|
|
</status>
|
|
</cib>
|
|
-* Passed: crm_ticket - Default granted-ticket value
|
|
+* Passed: crm_ticket - Default ticket granted state
|
|
<cib epoch="18" num_updates="2" admin_epoch="0" validate-with="pacemaker-1.2" >
|
|
<configuration>
|
|
<crm_config>
|
|
@@ -881,7 +881,7 @@ false
|
|
</tickets>
|
|
</status>
|
|
</cib>
|
|
-* Passed: crm_ticket - Set granted-ticket value
|
|
+* Passed: crm_ticket - Set ticket granted state
|
|
false
|
|
<cib epoch="18" num_updates="2" admin_epoch="0" validate-with="pacemaker-1.2" >
|
|
<configuration>
|
|
@@ -921,7 +921,7 @@ false
|
|
</tickets>
|
|
</status>
|
|
</cib>
|
|
-* Passed: crm_ticket - Query granted-ticket value
|
|
+* Passed: crm_ticket - Query ticket granted state
|
|
Deleted ticketA state attribute: name=granted
|
|
<cib epoch="18" num_updates="3" admin_epoch="0" validate-with="pacemaker-1.2" >
|
|
<configuration>
|
|
@@ -961,4 +961,162 @@ Deleted ticketA state attribute: name=granted
|
|
</tickets>
|
|
</status>
|
|
</cib>
|
|
-* Passed: crm_ticket - Delete granted-ticket value
|
|
+* Passed: crm_ticket - Delete ticket granted state
|
|
+<cib epoch="18" num_updates="4" admin_epoch="0" validate-with="pacemaker-1.2" >
|
|
+ <configuration>
|
|
+ <crm_config>
|
|
+ <cluster_property_set id="cib-bootstrap-options"/>
|
|
+ <cluster_property_set id="duplicate">
|
|
+ <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
|
|
+ </cluster_property_set>
|
|
+ </crm_config>
|
|
+ <nodes>
|
|
+ <node id="clusterNode-UUID" uname="clusterNode-UNAME" type="member">
|
|
+ <instance_attributes id="nodes-clusterNode-UUID">
|
|
+ <nvpair id="nodes-clusterNode-UUID-ram" name="ram" value="1024M"/>
|
|
+ </instance_attributes>
|
|
+ </node>
|
|
+ </nodes>
|
|
+ <resources>
|
|
+ <primitive id="dummy" class="ocf" provider="pacemaker" type="Dummy">
|
|
+ <meta_attributes id="dummy-meta_attributes"/>
|
|
+ <instance_attributes id="dummy-instance_attributes">
|
|
+ <nvpair id="dummy-instance_attributes-delay" name="delay" value="10s"/>
|
|
+ </instance_attributes>
|
|
+ </primitive>
|
|
+ </resources>
|
|
+ <constraints/>
|
|
+ </configuration>
|
|
+ <status>
|
|
+ <node_state id="clusterNode-UUID" uname="clusterNode-UNAME">
|
|
+ <transient_attributes id="clusterNode-UUID">
|
|
+ <instance_attributes id="status-clusterNode-UUID">
|
|
+ <nvpair id="status-clusterNode-UUID-fail-count-dummy" name="fail-count-dummy" value="10"/>
|
|
+ </instance_attributes>
|
|
+ </transient_attributes>
|
|
+ </node_state>
|
|
+ <tickets>
|
|
+ <ticket_state id="ticketA" standby="true"/>
|
|
+ </tickets>
|
|
+ </status>
|
|
+</cib>
|
|
+* Passed: crm_ticket - Make a ticket standby
|
|
+true
|
|
+<cib epoch="18" num_updates="4" admin_epoch="0" validate-with="pacemaker-1.2" >
|
|
+ <configuration>
|
|
+ <crm_config>
|
|
+ <cluster_property_set id="cib-bootstrap-options"/>
|
|
+ <cluster_property_set id="duplicate">
|
|
+ <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
|
|
+ </cluster_property_set>
|
|
+ </crm_config>
|
|
+ <nodes>
|
|
+ <node id="clusterNode-UUID" uname="clusterNode-UNAME" type="member">
|
|
+ <instance_attributes id="nodes-clusterNode-UUID">
|
|
+ <nvpair id="nodes-clusterNode-UUID-ram" name="ram" value="1024M"/>
|
|
+ </instance_attributes>
|
|
+ </node>
|
|
+ </nodes>
|
|
+ <resources>
|
|
+ <primitive id="dummy" class="ocf" provider="pacemaker" type="Dummy">
|
|
+ <meta_attributes id="dummy-meta_attributes"/>
|
|
+ <instance_attributes id="dummy-instance_attributes">
|
|
+ <nvpair id="dummy-instance_attributes-delay" name="delay" value="10s"/>
|
|
+ </instance_attributes>
|
|
+ </primitive>
|
|
+ </resources>
|
|
+ <constraints/>
|
|
+ </configuration>
|
|
+ <status>
|
|
+ <node_state id="clusterNode-UUID" uname="clusterNode-UNAME">
|
|
+ <transient_attributes id="clusterNode-UUID">
|
|
+ <instance_attributes id="status-clusterNode-UUID">
|
|
+ <nvpair id="status-clusterNode-UUID-fail-count-dummy" name="fail-count-dummy" value="10"/>
|
|
+ </instance_attributes>
|
|
+ </transient_attributes>
|
|
+ </node_state>
|
|
+ <tickets>
|
|
+ <ticket_state id="ticketA" standby="true"/>
|
|
+ </tickets>
|
|
+ </status>
|
|
+</cib>
|
|
+* Passed: crm_ticket - Query ticket standby state
|
|
+<cib epoch="18" num_updates="5" admin_epoch="0" validate-with="pacemaker-1.2" >
|
|
+ <configuration>
|
|
+ <crm_config>
|
|
+ <cluster_property_set id="cib-bootstrap-options"/>
|
|
+ <cluster_property_set id="duplicate">
|
|
+ <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
|
|
+ </cluster_property_set>
|
|
+ </crm_config>
|
|
+ <nodes>
|
|
+ <node id="clusterNode-UUID" uname="clusterNode-UNAME" type="member">
|
|
+ <instance_attributes id="nodes-clusterNode-UUID">
|
|
+ <nvpair id="nodes-clusterNode-UUID-ram" name="ram" value="1024M"/>
|
|
+ </instance_attributes>
|
|
+ </node>
|
|
+ </nodes>
|
|
+ <resources>
|
|
+ <primitive id="dummy" class="ocf" provider="pacemaker" type="Dummy">
|
|
+ <meta_attributes id="dummy-meta_attributes"/>
|
|
+ <instance_attributes id="dummy-instance_attributes">
|
|
+ <nvpair id="dummy-instance_attributes-delay" name="delay" value="10s"/>
|
|
+ </instance_attributes>
|
|
+ </primitive>
|
|
+ </resources>
|
|
+ <constraints/>
|
|
+ </configuration>
|
|
+ <status>
|
|
+ <node_state id="clusterNode-UUID" uname="clusterNode-UNAME">
|
|
+ <transient_attributes id="clusterNode-UUID">
|
|
+ <instance_attributes id="status-clusterNode-UUID">
|
|
+ <nvpair id="status-clusterNode-UUID-fail-count-dummy" name="fail-count-dummy" value="10"/>
|
|
+ </instance_attributes>
|
|
+ </transient_attributes>
|
|
+ </node_state>
|
|
+ <tickets>
|
|
+ <ticket_state id="ticketA" standby="false"/>
|
|
+ </tickets>
|
|
+ </status>
|
|
+</cib>
|
|
+* Passed: crm_ticket - Activate a ticket
|
|
+Deleted ticketA state attribute: name=standby
|
|
+<cib epoch="18" num_updates="6" admin_epoch="0" validate-with="pacemaker-1.2" >
|
|
+ <configuration>
|
|
+ <crm_config>
|
|
+ <cluster_property_set id="cib-bootstrap-options"/>
|
|
+ <cluster_property_set id="duplicate">
|
|
+ <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
|
|
+ </cluster_property_set>
|
|
+ </crm_config>
|
|
+ <nodes>
|
|
+ <node id="clusterNode-UUID" uname="clusterNode-UNAME" type="member">
|
|
+ <instance_attributes id="nodes-clusterNode-UUID">
|
|
+ <nvpair id="nodes-clusterNode-UUID-ram" name="ram" value="1024M"/>
|
|
+ </instance_attributes>
|
|
+ </node>
|
|
+ </nodes>
|
|
+ <resources>
|
|
+ <primitive id="dummy" class="ocf" provider="pacemaker" type="Dummy">
|
|
+ <meta_attributes id="dummy-meta_attributes"/>
|
|
+ <instance_attributes id="dummy-instance_attributes">
|
|
+ <nvpair id="dummy-instance_attributes-delay" name="delay" value="10s"/>
|
|
+ </instance_attributes>
|
|
+ </primitive>
|
|
+ </resources>
|
|
+ <constraints/>
|
|
+ </configuration>
|
|
+ <status>
|
|
+ <node_state id="clusterNode-UUID" uname="clusterNode-UNAME">
|
|
+ <transient_attributes id="clusterNode-UUID">
|
|
+ <instance_attributes id="status-clusterNode-UUID">
|
|
+ <nvpair id="status-clusterNode-UUID-fail-count-dummy" name="fail-count-dummy" value="10"/>
|
|
+ </instance_attributes>
|
|
+ </transient_attributes>
|
|
+ </node_state>
|
|
+ <tickets>
|
|
+ <ticket_state id="ticketA"/>
|
|
+ </tickets>
|
|
+ </status>
|
|
+</cib>
|
|
+* Passed: crm_ticket - Delete ticket standby state
|
|
diff --git a/tools/regression.sh b/tools/regression.sh
|
|
index e8844ec..e7ef151 100755
|
|
--- a/tools/regression.sh
|
|
+++ b/tools/regression.sh
|
|
@@ -171,16 +171,28 @@ function test_tools() {
|
|
assert $? 0 crm_resource "Un-migrate a resource"
|
|
|
|
crm_ticket -t ticketA -G granted -d false
|
|
- assert $? 0 crm_ticket "Default ticket state attribute"
|
|
+ assert $? 0 crm_ticket "Default ticket granted state"
|
|
|
|
crm_ticket -t ticketA -r --force
|
|
- assert $? 0 crm_ticket "Set ticket state attribute"
|
|
+ assert $? 0 crm_ticket "Set ticket granted state"
|
|
|
|
crm_ticket -t ticketA -G granted
|
|
- assert $? 0 crm_ticket "Query ticket state attribute"
|
|
+ assert $? 0 crm_ticket "Query ticket granted state"
|
|
|
|
crm_ticket -t ticketA -D granted --force
|
|
- assert $? 0 crm_ticket "Delete ticket state attribute"
|
|
+ assert $? 0 crm_ticket "Delete ticket granted state"
|
|
+
|
|
+ crm_ticket -t ticketA -s
|
|
+ assert $? 0 crm_ticket "Make a ticket standby"
|
|
+
|
|
+ crm_ticket -t ticketA -G standby
|
|
+ assert $? 0 crm_ticket "Query ticket standby state"
|
|
+
|
|
+ crm_ticket -t ticketA -a
|
|
+ assert $? 0 crm_ticket "Activate a ticket"
|
|
+
|
|
+ crm_ticket -t ticketA -D standby
|
|
+ assert $? 0 crm_ticket "Delete ticket standby state"
|
|
}
|
|
|
|
test_tools 2>&1 | sed s/cib-last-written.*\>/\>/ > $test_home/regression.out
|