commit 285f72c3bf16733fe0090d7cc87f238cae2de5a1
Author: Gao,Yan <ygao@suse.com>
Date:   Sat May 24 20:43:44 2014 +0800

    Test: pengine: Block restart of resources if any dependent resource in a group is unmanaged

diff --git a/pengine/regression.sh b/pengine/regression.sh
index 5dd76eb..ca8038f 100755
--- a/pengine/regression.sh
+++ b/pengine/regression.sh
@@ -408,6 +408,7 @@ do_test unmanaged-stop-1 "cl#5155 - Block the stop of resources if any depending
 do_test unmanaged-stop-2 "cl#5155 - Block the stop of resources if the first resource in a mandatory stop order is unmanaged "
 do_test unmanaged-stop-3 "cl#5155 - Block the stop of resources if any depending resource in a group is unmanaged "
 do_test unmanaged-stop-4 "cl#5155 - Block the stop of resources if any depending resource in the middle of a group is unmanaged "
+do_test unmanaged-block-restart "Block restart of resources if any dependent resource in a group is unmanaged"
 
 echo ""
 do_test interleave-0 "Interleave (reference)"
diff --git a/pengine/test10/unmanaged-block-restart.dot b/pengine/test10/unmanaged-block-restart.dot
new file mode 100644
index 0000000..44e075f
--- /dev/null
+++ b/pengine/test10/unmanaged-block-restart.dot
@@ -0,0 +1,39 @@
+digraph "g" {
+"all_stopped" [ style=dashed color="red" fontcolor="orange"]
+"group1_running_0" [ style=dashed color="red" fontcolor="orange"]
+"group1_start_0" -> "group1_running_0" [ style = dashed]
+"group1_start_0" -> "rsc1_start_0 yingying.site" [ style = bold]
+"group1_start_0" -> "rsc2_start_0 yingying.site" [ style = dashed]
+"group1_start_0" -> "rsc3_start_0 yingying.site" [ style = dashed]
+"group1_start_0" [ style=bold color="green" fontcolor="orange"]
+"group1_stop_0" -> "group1_stopped_0" [ style = dashed]
+"group1_stop_0" -> "rsc2_stop_0 yingying.site" [ style = dashed]
+"group1_stop_0" -> "rsc3_stop_0 yingying.site" [ style = dashed]
+"group1_stop_0" [ style=bold color="green" fontcolor="orange"]
+"group1_stopped_0" -> "group1_start_0" [ style = dashed]
+"group1_stopped_0" [ style=dashed color="red" fontcolor="orange"]
+"probe_complete yingying.site" [ style=bold color="green" fontcolor="black"]
+"rsc1_monitor_10000 yingying.site" [ style=bold color="green" fontcolor="black"]
+"rsc1_start_0 yingying.site" -> "group1_running_0" [ style = dashed]
+"rsc1_start_0 yingying.site" -> "rsc1_monitor_10000 yingying.site" [ style = bold]
+"rsc1_start_0 yingying.site" -> "rsc2_start_0 yingying.site" [ style = dashed]
+"rsc1_start_0 yingying.site" [ style=bold color="green" fontcolor="black"]
+"rsc2_monitor_10000 yingying.site" [ style=dashed color="red" fontcolor="black"]
+"rsc2_start_0 yingying.site" -> "group1_running_0" [ style = dashed]
+"rsc2_start_0 yingying.site" -> "rsc2_monitor_10000 yingying.site" [ style = dashed]
+"rsc2_start_0 yingying.site" -> "rsc3_start_0 yingying.site" [ style = dashed]
+"rsc2_start_0 yingying.site" [ style=dashed color="red" fontcolor="black"]
+"rsc2_stop_0 yingying.site" -> "all_stopped" [ style = dashed]
+"rsc2_stop_0 yingying.site" -> "group1_stopped_0" [ style = dashed]
+"rsc2_stop_0 yingying.site" -> "rsc2_start_0 yingying.site" [ style = dashed]
+"rsc2_stop_0 yingying.site" [ style=dashed color="red" fontcolor="black"]
+"rsc3_monitor_10000 yingying.site" [ style=dashed color="red" fontcolor="black"]
+"rsc3_start_0 yingying.site" -> "group1_running_0" [ style = dashed]
+"rsc3_start_0 yingying.site" -> "rsc3_monitor_10000 yingying.site" [ style = dashed]
+"rsc3_start_0 yingying.site" [ style=dashed color="red" fontcolor="black"]
+"rsc3_stop_0 yingying.site" -> "all_stopped" [ style = dashed]
+"rsc3_stop_0 yingying.site" -> "group1_stopped_0" [ style = dashed]
+"rsc3_stop_0 yingying.site" -> "rsc2_stop_0 yingying.site" [ style = dashed]
+"rsc3_stop_0 yingying.site" -> "rsc3_start_0 yingying.site" [ style = dashed]
+"rsc3_stop_0 yingying.site" [ style=dashed color="red" fontcolor="black"]
+}
diff --git a/pengine/test10/unmanaged-block-restart.exp b/pengine/test10/unmanaged-block-restart.exp
new file mode 100644
index 0000000..7639eb2
--- /dev/null
+++ b/pengine/test10/unmanaged-block-restart.exp
@@ -0,0 +1,52 @@
+<transition_graph cluster-delay="60s" stonith-timeout="60s" failed-stop-offset="INFINITY" failed-start-offset="INFINITY"  transition_id="0">
+  <synapse id="0">
+    <action_set>
+      <pseudo_event id="15" operation="stop" operation_key="group1_stop_0">
+        <attributes CRM_meta_timeout="20000" />
+      </pseudo_event>
+    </action_set>
+    <inputs/>
+  </synapse>
+  <synapse id="1">
+    <action_set>
+      <pseudo_event id="13" operation="start" operation_key="group1_start_0">
+        <attributes CRM_meta_timeout="20000" />
+      </pseudo_event>
+    </action_set>
+    <inputs/>
+  </synapse>
+  <synapse id="2">
+    <action_set>
+      <rsc_op id="7" operation="monitor" operation_key="rsc1_monitor_10000" on_node="yingying.site" on_node_uuid="yingying.site">
+        <primitive id="rsc1" class="ocf" provider="pacemaker" type="Dummy"/>
+        <attributes CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_timeout="20000" />
+      </rsc_op>
+    </action_set>
+    <inputs>
+      <trigger>
+        <rsc_op id="6" operation="start" operation_key="rsc1_start_0" on_node="yingying.site" on_node_uuid="yingying.site"/>
+      </trigger>
+    </inputs>
+  </synapse>
+  <synapse id="3">
+    <action_set>
+      <rsc_op id="6" operation="start" operation_key="rsc1_start_0" on_node="yingying.site" on_node_uuid="yingying.site">
+        <primitive id="rsc1" class="ocf" provider="pacemaker" type="Dummy"/>
+        <attributes CRM_meta_timeout="20000" />
+      </rsc_op>
+    </action_set>
+    <inputs>
+      <trigger>
+        <pseudo_event id="13" operation="start" operation_key="group1_start_0"/>
+      </trigger>
+    </inputs>
+  </synapse>
+  <synapse id="4" priority="1000000">
+    <action_set>
+      <rsc_op id="5" operation="probe_complete" operation_key="probe_complete" on_node="yingying.site" on_node_uuid="yingying.site">
+        <attributes CRM_meta_op_no_wait="true" />
+      </rsc_op>
+    </action_set>
+    <inputs/>
+  </synapse>
+</transition_graph>
diff --git a/pengine/test10/unmanaged-block-restart.scores b/pengine/test10/unmanaged-block-restart.scores
new file mode 100644
index 0000000..340433e
--- /dev/null
+++ b/pengine/test10/unmanaged-block-restart.scores
@@ -0,0 +1,10 @@
+Allocation scores:
+group_color: group1 allocation score on yingying.site: 0
+group_color: rsc1 allocation score on yingying.site: 0
+group_color: rsc2 allocation score on yingying.site: 0
+group_color: rsc3 allocation score on yingying.site: 0
+group_color: rsc4 allocation score on yingying.site: -INFINITY
+native_color: rsc1 allocation score on yingying.site: 0
+native_color: rsc2 allocation score on yingying.site: 0
+native_color: rsc3 allocation score on yingying.site: 0
+native_color: rsc4 allocation score on yingying.site: -INFINITY
diff --git a/pengine/test10/unmanaged-block-restart.summary b/pengine/test10/unmanaged-block-restart.summary
new file mode 100644
index 0000000..c4ef724
--- /dev/null
+++ b/pengine/test10/unmanaged-block-restart.summary
@@ -0,0 +1,30 @@
+
+Current cluster status:
+Online: [ yingying.site ]
+
+ Resource Group: group1
+     rsc1	(ocf::pacemaker:Dummy):	Stopped 
+     rsc2	(ocf::pacemaker:Dummy):	Started yingying.site 
+     rsc3	(ocf::pacemaker:Dummy):	Started yingying.site 
+     rsc4	(ocf::pacemaker:Dummy):	FAILED yingying.site (unmanaged) 
+
+Transition Summary:
+ * Start   rsc1	(yingying.site)
+ * Stop    rsc2	(Started yingying.site)
+ * Stop    rsc3	(Started yingying.site)
+
+Executing cluster transition:
+ * Pseudo action:   group1_stop_0
+ * Pseudo action:   group1_start_0
+ * Resource action: rsc1            start on yingying.site
+ * Resource action: rsc1            monitor=10000 on yingying.site
+
+Revised cluster status:
+Online: [ yingying.site ]
+
+ Resource Group: group1
+     rsc1	(ocf::pacemaker:Dummy):	Started yingying.site 
+     rsc2	(ocf::pacemaker:Dummy):	Started yingying.site 
+     rsc3	(ocf::pacemaker:Dummy):	Started yingying.site 
+     rsc4	(ocf::pacemaker:Dummy):	FAILED yingying.site (unmanaged) 
+
diff --git a/pengine/test10/unmanaged-block-restart.xml b/pengine/test10/unmanaged-block-restart.xml
new file mode 100644
index 0000000..52ed7bf
--- /dev/null
+++ b/pengine/test10/unmanaged-block-restart.xml
@@ -0,0 +1,70 @@
+<cib epoch="141" num_updates="16" admin_epoch="0" validate-with="pacemaker-1.2" cib-last-written="Fri May 23 13:12:16 2014" update-origin="yingying.site" update-client="cibadmin" update-user="root" crm_feature_set="3.0.7" have-quorum="0" dc-uuid="yingying.site">
+  <configuration>
+    <crm_config>
+      <cluster_property_set id="cib-bootstrap-options">
+        <nvpair id="cib-bootstrap-options-expected-quorum-votes" name="expected-quorum-votes" value="2"/>
+        <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="yingying.site" uname="yingying.site"/>
+    </nodes>
+    <resources>
+      <group id="group1">
+        <primitive id="rsc1" class="ocf" provider="pacemaker" type="Dummy">
+          <operations>
+            <op id="rsc1-monitor-1" interval="10" name="monitor"/>
+          </operations>
+        </primitive>
+        <primitive id="rsc2" class="ocf" provider="pacemaker" type="Dummy">
+          <operations>
+            <op id="rsc2-monitor-10" interval="10" name="monitor"/>
+          </operations>
+        </primitive>
+        <primitive id="rsc3" class="ocf" provider="pacemaker" type="Dummy">
+          <meta_attributes id="rsc3-meta_attributes"/>
+          <operations>
+            <op id="rsc3-monitor-10" interval="10" name="monitor"/>
+          </operations>
+        </primitive>
+        <primitive id="rsc4" class="ocf" provider="pacemaker" type="Dummy">
+          <operations>
+            <op id="rsc4-monitor-10" interval="10" name="monitor"/>
+          </operations>
+        </primitive>
+      </group>
+    </resources>
+    <constraints/>
+  </configuration>
+  <status>
+    <node_state id="yingying.site" uname="yingying.site" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
+      <lrm id="yingying.site">
+        <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.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="7" op-status="0" interval="0" last-run="1400821388" last-rc-change="1400821388" 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="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="1400821388" last-rc-change="1400821388" 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="1400821388" 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_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="1400821388" last-rc-change="1400821388" 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="1400821388" 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.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="1400821388" last-rc-change="1400821388" 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="1" op-status="0" interval="10000" last-rc-change="1400821388" exec-time="0" queue-time="0" op-digest="4811cef7f7f94e3a35a70be7916cb2fd"/>
+            <lrm_rsc_op id="rsc4_last_failure_0" operation_key="rsc4_stop_0" operation="stop" 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="0" last-run="1400821937" last-rc-change="1400821937" exec-time="0" queue-time="0"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+      <transient_attributes id="yingying.site">
+        <instance_attributes id="yingying.site">
+          <nvpair id="fail-count-rsc4-yingying.site" name="fail-count-rsc4" value="1"/>
+          <nvpair id="last-failure-rsc4-yingying.site" name="last-failure-rsc4" value="1400821937"/>
+        </instance_attributes>
+      </transient_attributes>
+    </node_state>
+  </status>
+</cib>
