commit 884585015032344fa45b838693126861c6c21f9a
Author: Gao,Yan <ygao@suse.com>
Date:   Thu Feb 20 18:57:14 2014 +0800

    Test: pengine: Support per-resource maintenance mode

diff --git a/pengine/regression.sh b/pengine/regression.sh
index 59cf7c3..32035f9 100755
--- a/pengine/regression.sh
+++ b/pengine/regression.sh
@@ -531,6 +531,8 @@ do_test reprobe-target_rc "Ensure correct target_rc for reprobe of inactive reso
 do_test node-maintenance-1 "cl#5128 - Node maintenance"
 do_test node-maintenance-2 "cl#5128 - Node maintenance (coming out of maintenance mode)"
 
+do_test rsc-maintenance "Per-resource maintenance"
+
 echo ""
 do_test not-installed-agent "The resource agent is missing"
 do_test not-installed-tools "Something the resource agent needs is missing"
diff --git a/pengine/test10/rsc-maintenance.dot b/pengine/test10/rsc-maintenance.dot
new file mode 100644
index 0000000..40c699b
--- /dev/null
+++ b/pengine/test10/rsc-maintenance.dot
@@ -0,0 +1,6 @@
+digraph "g" {
+"Cancel rsc1_monitor_10000 node1" [ style=bold color="green" fontcolor="black"]
+"Cancel rsc2_monitor_10000 node1" [ style=bold color="green" fontcolor="black"]
+"probe_complete node1" [ style=bold color="green" fontcolor="black"]
+"probe_complete node2" [ style=bold color="green" fontcolor="black"]
+}
diff --git a/pengine/test10/rsc-maintenance.exp b/pengine/test10/rsc-maintenance.exp
new file mode 100644
index 0000000..7d32bff
--- /dev/null
+++ b/pengine/test10/rsc-maintenance.exp
@@ -0,0 +1,36 @@
+<transition_graph cluster-delay="60s" stonith-timeout="60s" failed-stop-offset="INFINITY" failed-start-offset="INFINITY"  transition_id="0">
+  <synapse id="0">
+    <action_set>
+      <rsc_op id="1" operation="cancel" operation_key="rsc1_monitor_10000" on_node="node1" on_node_uuid="node1">
+        <primitive id="rsc1" class="ocf" provider="pacemaker" type="Dummy"/>
+        <attributes CRM_meta_call_id="3" CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_operation="monitor" CRM_meta_timeout="20000" />
+      </rsc_op>
+    </action_set>
+    <inputs/>
+  </synapse>
+  <synapse id="1">
+    <action_set>
+      <rsc_op id="2" operation="cancel" operation_key="rsc2_monitor_10000" on_node="node1" on_node_uuid="node1">
+        <primitive id="rsc2" class="ocf" provider="pacemaker" type="Dummy"/>
+        <attributes CRM_meta_call_id="3" CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_operation="monitor" CRM_meta_timeout="20000" />
+      </rsc_op>
+    </action_set>
+    <inputs/>
+  </synapse>
+  <synapse id="2" priority="1000000">
+    <action_set>
+      <rsc_op id="8" operation="probe_complete" operation_key="probe_complete" on_node="node2" on_node_uuid="node2">
+        <attributes CRM_meta_op_no_wait="true" />
+      </rsc_op>
+    </action_set>
+    <inputs/>
+  </synapse>
+  <synapse id="3" priority="1000000">
+    <action_set>
+      <rsc_op id="7" operation="probe_complete" operation_key="probe_complete" on_node="node1" on_node_uuid="node1">
+        <attributes CRM_meta_op_no_wait="true" />
+      </rsc_op>
+    </action_set>
+    <inputs/>
+  </synapse>
+</transition_graph>
diff --git a/pengine/test10/rsc-maintenance.scores b/pengine/test10/rsc-maintenance.scores
new file mode 100644
index 0000000..69681a8
--- /dev/null
+++ b/pengine/test10/rsc-maintenance.scores
@@ -0,0 +1,21 @@
+Allocation scores:
+group_color: group1 allocation score on node1: 0
+group_color: group1 allocation score on node2: 0
+group_color: group2 allocation score on node1: 0
+group_color: group2 allocation score on node2: 0
+group_color: rsc1 allocation score on node1: INFINITY
+group_color: rsc1 allocation score on node2: 0
+group_color: rsc2 allocation score on node1: INFINITY
+group_color: rsc2 allocation score on node2: 0
+group_color: rsc3 allocation score on node1: 0
+group_color: rsc3 allocation score on node2: 0
+group_color: rsc4 allocation score on node1: 0
+group_color: rsc4 allocation score on node2: 0
+native_color: rsc1 allocation score on node1: -INFINITY
+native_color: rsc1 allocation score on node2: -INFINITY
+native_color: rsc2 allocation score on node1: -INFINITY
+native_color: rsc2 allocation score on node2: -INFINITY
+native_color: rsc3 allocation score on node1: 0
+native_color: rsc3 allocation score on node2: 0
+native_color: rsc4 allocation score on node1: -INFINITY
+native_color: rsc4 allocation score on node2: 0
diff --git a/pengine/test10/rsc-maintenance.summary b/pengine/test10/rsc-maintenance.summary
new file mode 100644
index 0000000..ea6b16f
--- /dev/null
+++ b/pengine/test10/rsc-maintenance.summary
@@ -0,0 +1,27 @@
+
+Current cluster status:
+Online: [ node1 node2 ]
+
+ Resource Group: group1
+     rsc1	(ocf::pacemaker:Dummy):	Started node1 (unmanaged) 
+     rsc2	(ocf::pacemaker:Dummy):	Started node1 (unmanaged) 
+ Resource Group: group2
+     rsc3	(ocf::pacemaker:Dummy):	Started node2 
+     rsc4	(ocf::pacemaker:Dummy):	Started node2 
+
+Transition Summary:
+
+Executing cluster transition:
+ * Resource action: rsc1            cancel=10000 on node1
+ * Resource action: rsc2            cancel=10000 on node1
+
+Revised cluster status:
+Online: [ node1 node2 ]
+
+ Resource Group: group1
+     rsc1	(ocf::pacemaker:Dummy):	Started node1 (unmanaged) 
+     rsc2	(ocf::pacemaker:Dummy):	Started node1 (unmanaged) 
+ Resource Group: group2
+     rsc3	(ocf::pacemaker:Dummy):	Started node2 
+     rsc4	(ocf::pacemaker:Dummy):	Started node2 
+
diff --git a/pengine/test10/rsc-maintenance.xml b/pengine/test10/rsc-maintenance.xml
new file mode 100644
index 0000000..cabf822
--- /dev/null
+++ b/pengine/test10/rsc-maintenance.xml
@@ -0,0 +1,87 @@
+<cib epoch="1" num_updates="36" admin_epoch="0" validate-with="pacemaker-1.1" cib-last-written="Fri Jul 13 13:51:16 2012" have-quorum="1">
+  <configuration>
+    <crm_config>
+      <cluster_property_set id="cib-bootstrap-options">
+        <nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
+        <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
+      </cluster_property_set>
+    </crm_config>
+    <nodes>
+      <node id="node1" type="normal" uname="node1"/>
+      <node id="node2" type="normal" uname="node2"/>
+    </nodes>
+    <resources>
+      <group id="group1">
+        <meta_attributes id="meta_1">
+          <nvpair id="meta_1_maintenance" name="maintenance" value="true"/>
+          <nvpair id="meta_1_target-role" name="target-role" value="Stopped"/>
+        </meta_attributes>
+        <primitive id="rsc1" class="ocf" provider="pacemaker" type="Dummy">
+          <operations>
+            <op id="rsc1-monitor-10" name="monitor" interval="10"/>
+          </operations>
+        </primitive>
+        <primitive id="rsc2" class="ocf" provider="pacemaker" type="Dummy">
+          <operations>
+            <op id="rsc2-monitor-10" name="monitor" interval="10"/>
+          </operations>
+        </primitive>
+      </group>
+      <group id="group2">
+        <primitive id="rsc3" class="ocf" provider="pacemaker" type="Dummy">
+          <operations>
+            <op id="rsc3-monitor-10" name="monitor" interval="10"/>
+          </operations>
+        </primitive>
+        <primitive id="rsc4" class="ocf" provider="pacemaker" type="Dummy">
+          <operations>
+            <op id="rsc4-monitor-10" name="monitor" interval="10"/>
+          </operations>
+        </primitive>
+      </group>
+    </resources>
+    <constraints/>
+  </configuration>
+  <status>
+    <node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <lrm id="node1">
+        <lrm_resources>
+          <lrm_resource id="rsc1" class="ocf" provider="pacemaker" type="Dummy">
+            <lrm_rsc_op id="rsc1_last_0" operation_key="rsc1_start_0" operation="start" crm-debug-origin="crm_simulate" crm_feature_set="3.0.8" transition-key="2:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:0;2:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="2" rc-code="0" op-status="0" interval="0" last-run="1387546150" last-rc-change="1387546150" exec-time="0" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="rsc1_monitor_10000" operation_key="rsc1_monitor_10000" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.9" transition-key="3:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:0;3:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="3" rc-code="0" op-status="0" interval="10000" last-rc-change="1392890744" exec-time="0" queue-time="0" op-digest="4811cef7f7f94e3a35a70be7916cb2fd"/>
+          </lrm_resource>
+          <lrm_resource id="rsc2" class="ocf" provider="pacemaker" type="Dummy">
+            <lrm_rsc_op id="rsc2_last_0" operation_key="rsc2_start_0" operation="start" crm-debug-origin="crm_simulate" crm_feature_set="3.0.8" transition-key="2:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:0;2:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="2" rc-code="0" op-status="0" interval="0" last-run="1387546150" last-rc-change="1387546150" exec-time="0" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="rsc2_monitor_10000" operation_key="rsc2_monitor_10000" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.9" transition-key="3:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:0;3:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="3" rc-code="0" op-status="0" interval="10000" last-rc-change="1392890744" exec-time="0" queue-time="0" op-digest="4811cef7f7f94e3a35a70be7916cb2fd"/>
+          </lrm_resource>
+          <lrm_resource id="rsc3" class="ocf" provider="pacemaker" type="Dummy">
+            <lrm_rsc_op id="rsc3_last_0" operation_key="rsc3_monitor_0" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.8" transition-key="1:-1:7:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:7;1:-1:7:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="1" rc-code="7" op-status="0" interval="0" last-run="1387546150" last-rc-change="1387546150" exec-time="0" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+          <lrm_resource id="rsc4" class="ocf" provider="pacemaker" type="Dummy">
+            <lrm_rsc_op id="rsc4_last_0" operation_key="rsc4_monitor_0" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.8" transition-key="1:-1:7:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:7;1:-1:7:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="1" rc-code="7" op-status="0" interval="0" last-run="1387546150" last-rc-change="1387546150" exec-time="0" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+    </node_state>
+    <node_state id="node2" uname="node2" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
+      <lrm id="node2">
+        <lrm_resources>
+          <lrm_resource id="rsc1" class="ocf" provider="pacemaker" type="Dummy">
+            <lrm_rsc_op id="rsc1_last_0" operation_key="rsc1_monitor_0" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.8" transition-key="1:-1:7:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:7;1:-1:7:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="1" rc-code="7" op-status="0" interval="0" last-run="1387546150" last-rc-change="1387546150" exec-time="0" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+          <lrm_resource id="rsc2" class="ocf" provider="pacemaker" type="Dummy">
+            <lrm_rsc_op id="rsc2_last_0" operation_key="rsc2_monitor_0" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.8" transition-key="1:-1:7:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:7;1:-1:7:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="1" rc-code="7" op-status="0" interval="0" last-run="1387546150" last-rc-change="1387546150" exec-time="0" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+          <lrm_resource id="rsc3" class="ocf" provider="pacemaker" type="Dummy">
+            <lrm_rsc_op id="rsc3_last_0" operation_key="rsc3_start_0" operation="start" crm-debug-origin="crm_simulate" crm_feature_set="3.0.8" transition-key="2:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:0;2:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="2" rc-code="0" op-status="0" interval="0" last-run="1387546150" last-rc-change="1387546150" exec-time="0" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="rsc3_monitor_10000" operation_key="rsc3_monitor_10000" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.9" transition-key="3:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:0;3:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="3" rc-code="0" op-status="0" interval="10000" last-rc-change="1392890744" exec-time="0" queue-time="0" op-digest="4811cef7f7f94e3a35a70be7916cb2fd"/>
+          </lrm_resource>
+          <lrm_resource id="rsc4" class="ocf" provider="pacemaker" type="Dummy">
+            <lrm_rsc_op id="rsc4_last_0" operation_key="rsc4_start_0" operation="start" crm-debug-origin="crm_simulate" crm_feature_set="3.0.8" transition-key="2:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:0;2:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="2" rc-code="0" op-status="0" interval="0" last-run="1387546150" last-rc-change="1387546150" exec-time="0" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="rsc4_monitor_10000" operation_key="rsc4_monitor_10000" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.9" transition-key="3:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:0;3:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="3" rc-code="0" op-status="0" interval="10000" last-rc-change="1392890744" exec-time="0" queue-time="0" op-digest="4811cef7f7f94e3a35a70be7916cb2fd"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+    </node_state>
+  </status>
+</cib>
