commit 30ea303ba7078271e6d7d01dab9e408c07a78c10
Author: Gao,Yan <ygao@suse.com>
Date:   Mon Apr 14 20:48:42 2014 +0800

    Test: pengine: Ignore failure-timeout only if the failed operation has on-fail="block"

diff --git a/pengine/regression.sh b/pengine/regression.sh
index 79ee73b..8722046 100755
--- a/pengine/regression.sh
+++ b/pengine/regression.sh
@@ -486,6 +486,7 @@ do_test bug-5059 "No need to restart p_stateful1:*"
 do_test bug-5069-op-enabled  "Test on-fail=ignore with failure when monitor is enabled."
 do_test bug-5069-op-disabled "Test on-fail-ignore with failure when monitor is disabled."
 do_test obsolete-lrm-resource "cl#5115 - Do not use obsolete lrm_resource sections"
+do_test expire-non-blocked-failure "Ignore failure-timeout only if the failed operation has on-fail=block"
 
 do_test ignore_stonith_rsc_order1 "cl#5056- Ignore order constraint between stonith and non-stonith rsc."
 do_test ignore_stonith_rsc_order2 "cl#5056- Ignore order constraint with group rsc containing mixed stonith and non-stonith."
diff --git a/pengine/test10/expire-non-blocked-failure.dot b/pengine/test10/expire-non-blocked-failure.dot
new file mode 100644
index 0000000..f8ca7b9
--- /dev/null
+++ b/pengine/test10/expire-non-blocked-failure.dot
@@ -0,0 +1,5 @@
+digraph "g" {
+"probe_complete node1" [ style=bold color="green" fontcolor="black"]
+"probe_complete node2" [ style=bold color="green" fontcolor="black"]
+"rsc2_clear_failcount node1" [ style=bold color="green" fontcolor="black"]
+}
diff --git a/pengine/test10/expire-non-blocked-failure.exp b/pengine/test10/expire-non-blocked-failure.exp
new file mode 100644
index 0000000..983bfa3
--- /dev/null
+++ b/pengine/test10/expire-non-blocked-failure.exp
@@ -0,0 +1,27 @@
+<transition_graph cluster-delay="60s" stonith-timeout="60s" failed-stop-offset="INFINITY" failed-start-offset="INFINITY"  transition_id="0">
+  <synapse id="0">
+    <action_set>
+      <crm_event id="1" operation="clear_failcount" operation_key="rsc2_clear_failcount" on_node="node1" on_node_uuid="node1">
+        <primitive id="rsc2" class="ocf" provider="pacemaker" type="Dummy"/>
+        <attributes CRM_meta_op_no_wait="true" CRM_meta_timeout="20000" />
+      </crm_event>
+    </action_set>
+    <inputs/>
+  </synapse>
+  <synapse id="1" priority="1000000">
+    <action_set>
+      <rsc_op id="7" 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="2" priority="1000000">
+    <action_set>
+      <rsc_op id="6" 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/expire-non-blocked-failure.scores b/pengine/test10/expire-non-blocked-failure.scores
new file mode 100644
index 0000000..aa5880b
--- /dev/null
+++ b/pengine/test10/expire-non-blocked-failure.scores
@@ -0,0 +1,7 @@
+Allocation scores:
+native_color: rsc1 allocation score on node1: 0
+native_color: rsc1 allocation score on node2: -INFINITY
+native_color: rsc2 allocation score on node1: 0
+native_color: rsc2 allocation score on node2: 0
+native_color: rsc_stonith allocation score on node1: 0
+native_color: rsc_stonith allocation score on node2: 0
diff --git a/pengine/test10/expire-non-blocked-failure.summary b/pengine/test10/expire-non-blocked-failure.summary
new file mode 100644
index 0000000..311c007
--- /dev/null
+++ b/pengine/test10/expire-non-blocked-failure.summary
@@ -0,0 +1,20 @@
+
+Current cluster status:
+Online: [ node1 node2 ]
+
+ rsc_stonith	(stonith:null):	Started node1 
+ rsc1	(ocf::pacemaker:Dummy):	FAILED node2 (unmanaged) 
+ rsc2	(ocf::pacemaker:Dummy):	Started node1 
+
+Transition Summary:
+
+Executing cluster transition:
+ * Cluster action:  clear_failcount for rsc2 on node1
+
+Revised cluster status:
+Online: [ node1 node2 ]
+
+ rsc_stonith	(stonith:null):	Started node1 
+ rsc1	(ocf::pacemaker:Dummy):	FAILED node2 (unmanaged) 
+ rsc2	(ocf::pacemaker:Dummy):	Started node1 
+
diff --git a/pengine/test10/expire-non-blocked-failure.xml b/pengine/test10/expire-non-blocked-failure.xml
new file mode 100644
index 0000000..1132624
--- /dev/null
+++ b/pengine/test10/expire-non-blocked-failure.xml
@@ -0,0 +1,85 @@
+<cib epoch="1" num_updates="36" admin_epoch="0" validate-with="pacemaker-1.2" cib-last-written="Fri Jul 13 13:51:21 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="true"/>
+        <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>
+      <primitive class="stonith" id="rsc_stonith" type="null"/>
+      <primitive class="ocf" id="rsc1" provider="pacemaker" type="Dummy">
+        <meta_attributes id="rsc1-meta_attributes">
+          <nvpair id="rsc1-meta_attributes-failure-timeout" name="failure-timeout" value="60"/>
+        </meta_attributes>
+        <operations>
+          <op id="rsc1-monitor-10" interval="10" name="monitor"/>
+          <op id="rsc1-stop-0" interval="0" name="stop" on-fail="block"/>
+        </operations>
+      </primitive>
+      <primitive class="ocf" id="rsc2" provider="pacemaker" type="Dummy">
+        <meta_attributes id="rsc2-meta_attributes">
+          <nvpair id="rsc2-meta_attributes-failure-timeout" name="failure-timeout" value="60"/>
+        </meta_attributes>
+        <operations>
+          <op id="rsc2-monitor-10" interval="10" name="monitor"/>
+          <op id="rsc2-stop-0" interval="0" name="stop" on-fail="block"/>
+        </operations>
+      </primitive>
+    </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="rsc_stonith" class="stonith" type="null">
+            <lrm_rsc_op id="rsc_stonith_monitor_0" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.7" 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" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="rsc_stonith_start_0" operation="start" crm-debug-origin="crm_simulate" crm_feature_set="3.0.7" 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" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+          <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.9" 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="1397191766" last-rc-change="1397191766" 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_start_0" operation="start" crm-debug-origin="crm_simulate" crm_feature_set="3.0.9" transition-key="6:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:0;6:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="6" rc-code="0" op-status="0" interval="0" last-run="1397196440" last-rc-change="1397196440" 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="7:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:0;7:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="7" rc-code="0" op-status="0" interval="10000" last-rc-change="1397196440" exec-time="0" queue-time="0" op-digest="4811cef7f7f94e3a35a70be7916cb2fd"/>
+            <lrm_rsc_op id="rsc2_last_failure_0" operation_key="rsc2_monitor_10000" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.9" transition-key="4:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:1;4:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="4" rc-code="1" op-status="0" interval="10000" last-rc-change="1397196403" exec-time="0" queue-time="0"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+      <transient_attributes id="node1">
+        <instance_attributes id="node1">
+          <nvpair id="fail-count-rsc2-node1" name="fail-count-rsc2" value="1"/>
+          <nvpair id="last-failure-rsc2-node1" name="last-failure-rsc2" value="1397196403"/>
+        </instance_attributes>
+      </transient_attributes>
+    </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="rsc_stonith" class="stonith" type="null">
+            <lrm_rsc_op id="rsc_stonith_monitor_0" operation="monitor" crm-debug-origin="crm_simulate" crm_feature_set="3.0.7" 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" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+          <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.9" 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="1397191766" last-rc-change="1397191766" 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="1397191766" exec-time="0" queue-time="0" op-digest="4811cef7f7f94e3a35a70be7916cb2fd"/>
+            <lrm_rsc_op id="rsc1_last_failure_0" operation_key="rsc1_stop_0" operation="stop" crm-debug-origin="crm_simulate" crm_feature_set="3.0.9" transition-key="5:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" transition-magic="0:1;5:-1:0:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" call-id="5" rc-code="1" op-status="0" interval="0" last-rc-change="1397196015" exec-time="0" queue-time="0" last-run="1397196015" 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.9" 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="1397191766" last-rc-change="1397191766" exec-time="0" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+      <transient_attributes id="node2">
+        <instance_attributes id="node2">
+          <nvpair id="fail-count-rsc1-node2" name="fail-count-rsc1" value="2"/>
+          <nvpair id="last-failure-rsc1-node2" name="last-failure-rsc1" value="1397196015"/>
+        </instance_attributes>
+      </transient_attributes>
+    </node_state>
+  </status>
+</cib>
