commit 1f2e34921c4d387a1d7bbbccf7cec67e82673f75
Author: Gao,Yan <ygao@suse.com>
Date:   Thu Apr 28 17:36:51 2016 +0200

    Test: pengine: Respect asymmetrical ordering when trying to move resources

diff --git a/pengine/regression.sh b/pengine/regression.sh
index e5a8135..108190c 100755
--- a/pengine/regression.sh
+++ b/pengine/regression.sh
@@ -530,6 +530,7 @@ do_test bug-5069-op-enabled  "Test on-fail=ignore with failure when monitor is e
 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 asymmetrical-order-move "Respect asymmetrical ordering when trying to move resources"
 
 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/asymmetrical-order-move.dot b/pengine/test10/asymmetrical-order-move.dot
new file mode 100644
index 0000000..f36234b
--- /dev/null
+++ b/pengine/test10/asymmetrical-order-move.dot
@@ -0,0 +1,7 @@
+digraph "g" {
+"all_stopped" [ style=bold color="green" fontcolor="orange"]
+"dummy2_start_0 sle12sp2-2" [ style=dashed color="red" fontcolor="black"]
+"dummy2_stop_0 sle12sp2-1" -> "all_stopped" [ style = bold]
+"dummy2_stop_0 sle12sp2-1" -> "dummy2_start_0 sle12sp2-2" [ style = dashed]
+"dummy2_stop_0 sle12sp2-1" [ style=bold color="green" fontcolor="black"]
+}
diff --git a/pengine/test10/asymmetrical-order-move.exp b/pengine/test10/asymmetrical-order-move.exp
new file mode 100644
index 0000000..458094f
--- /dev/null
+++ b/pengine/test10/asymmetrical-order-move.exp
@@ -0,0 +1,23 @@
+<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="4" operation="stop" operation_key="dummy2_stop_0" on_node="sle12sp2-1" on_node_uuid="1084783155">
+        <primitive id="dummy2" class="ocf" provider="pacemaker" type="Dummy"/>
+        <attributes CRM_meta_timeout="20000" />
+      </rsc_op>
+    </action_set>
+    <inputs/>
+  </synapse>
+  <synapse id="1">
+    <action_set>
+      <pseudo_event id="1" operation="all_stopped" operation_key="all_stopped">
+        <attributes />
+      </pseudo_event>
+    </action_set>
+    <inputs>
+      <trigger>
+        <rsc_op id="4" operation="stop" operation_key="dummy2_stop_0" on_node="sle12sp2-1" on_node_uuid="1084783155"/>
+      </trigger>
+    </inputs>
+  </synapse>
+</transition_graph>
diff --git a/pengine/test10/asymmetrical-order-move.scores b/pengine/test10/asymmetrical-order-move.scores
new file mode 100644
index 0000000..23f717b
--- /dev/null
+++ b/pengine/test10/asymmetrical-order-move.scores
@@ -0,0 +1,8 @@
+Allocation scores:
+Using the original execution date of: 2016-04-28 11:50:29Z
+native_color: dummy1 allocation score on sle12sp2-1: -INFINITY
+native_color: dummy1 allocation score on sle12sp2-2: -INFINITY
+native_color: dummy2 allocation score on sle12sp2-1: -INFINITY
+native_color: dummy2 allocation score on sle12sp2-2: 0
+native_color: st_sbd allocation score on sle12sp2-1: 0
+native_color: st_sbd allocation score on sle12sp2-2: 0
diff --git a/pengine/test10/asymmetrical-order-move.summary b/pengine/test10/asymmetrical-order-move.summary
new file mode 100644
index 0000000..a9c1d8f
--- /dev/null
+++ b/pengine/test10/asymmetrical-order-move.summary
@@ -0,0 +1,25 @@
+Using the original execution date of: 2016-04-28 11:50:29Z
+1 of 3 resources DISABLED and 0 BLOCKED from being started due to failures
+
+Current cluster status:
+Online: [ sle12sp2-1 sle12sp2-2 ]
+
+ st_sbd	(stonith:external/sbd):	Started sle12sp2-2 
+ dummy1	(ocf::pacemaker:Dummy):	Stopped ( disabled ) 
+ dummy2	(ocf::pacemaker:Dummy):	Started sle12sp2-1 
+
+Transition Summary:
+ * Stop    dummy2	(Started sle12sp2-1)
+
+Executing cluster transition:
+ * Resource action: dummy2          stop on sle12sp2-1
+ * Pseudo action:   all_stopped
+Using the original execution date of: 2016-04-28 11:50:29Z
+
+Revised cluster status:
+Online: [ sle12sp2-1 sle12sp2-2 ]
+
+ st_sbd	(stonith:external/sbd):	Started sle12sp2-2 
+ dummy1	(ocf::pacemaker:Dummy):	Stopped ( disabled ) 
+ dummy2	(ocf::pacemaker:Dummy):	Stopped 
+
diff --git a/pengine/test10/asymmetrical-order-move.xml b/pengine/test10/asymmetrical-order-move.xml
new file mode 100644
index 0000000..3be653a
--- /dev/null
+++ b/pengine/test10/asymmetrical-order-move.xml
@@ -0,0 +1,71 @@
+<cib crm_feature_set="3.0.8" validate-with="pacemaker-1.2" epoch="224" num_updates="0" admin_epoch="0" cib-last-written="Thu Apr 28 13:50:29 2016" update-origin="sle12sp2-1" update-client="crm_resource" update-user="root" have-quorum="1" dc-uuid="1084783156" execution-date="1461844229">
+  <configuration>
+    <crm_config>
+      <cluster_property_set id="cib-bootstrap-options">
+        <nvpair name="dc-version" value="1.1.14-18.4-5a6cdd1" id="cib-bootstrap-options-dc-version"/>
+        <nvpair name="cluster-infrastructure" value="corosync" id="cib-bootstrap-options-cluster-infrastructure"/>
+        <nvpair name="last-lrm-refresh" value="1460540775" id="cib-bootstrap-options-last-lrm-refresh"/>
+      </cluster_property_set>
+    </crm_config>
+    <nodes>
+      <node id="1084783155" uname="sle12sp2-1"/>
+      <node id="1084783156" uname="sle12sp2-2"/>
+    </nodes>
+    <resources>
+      <primitive id="st_sbd" class="stonith" type="external/sbd"/>
+      <primitive id="dummy1" class="ocf" provider="pacemaker" type="Dummy">
+        <meta_attributes id="dummy1-meta_attributes">
+          <nvpair id="dummy1-meta_attributes-target-role" name="target-role" value="Stopped"/>
+        </meta_attributes>
+      </primitive>
+      <primitive id="dummy2" class="ocf" provider="pacemaker" type="Dummy"/>
+    </resources>
+    <constraints>
+      <rsc_order id="o_d1_d2" kind="Mandatory" symmetrical="false" first="dummy1" then="dummy2"/>
+      <rsc_location id="cli-ban-dummy2-on-sle12sp2-1" rsc="dummy2" role="Started" node="sle12sp2-1" score="-INFINITY"/>
+    </constraints>
+    <rsc_defaults/>
+  </configuration>
+  <status>
+    <node_state id="1084783156" uname="sle12sp2-2" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
+      <transient_attributes id="1084783156">
+        <instance_attributes id="status-1084783156">
+          <nvpair id="status-1084783156-shutdown" name="shutdown" value="0"/>
+        </instance_attributes>
+      </transient_attributes>
+      <lrm id="1084783156">
+        <lrm_resources>
+          <lrm_resource id="st_sbd" type="external/sbd" class="stonith">
+            <lrm_rsc_op id="st_sbd_last_0" operation_key="st_sbd_start_0" operation="start" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="3:7:0:227c6da2-2be2-434b-933b-d715c60f45cd" transition-magic="0:0;3:7:0:227c6da2-2be2-434b-933b-d715c60f45cd" on_node="sle12sp2-2" call-id="18" rc-code="0" op-status="0" interval="0" last-run="1461774608" last-rc-change="1461774608" exec-time="1394" queue-time="1" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+          <lrm_resource id="dummy1" type="Dummy" class="ocf" provider="pacemaker">
+            <lrm_rsc_op id="dummy1_last_0" operation_key="dummy1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="4:88:7:227c6da2-2be2-434b-933b-d715c60f45cd" transition-magic="0:7;4:88:7:227c6da2-2be2-434b-933b-d715c60f45cd" on_node="sle12sp2-2" call-id="22" rc-code="7" op-status="0" interval="0" last-run="1461844132" last-rc-change="1461844132" exec-time="60" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart=" state  passwd  op_sleep " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params=" passwd " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+          <lrm_resource id="dummy2" type="Dummy" class="ocf" provider="pacemaker">
+            <lrm_rsc_op id="dummy2_last_0" operation_key="dummy2_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="5:88:7:227c6da2-2be2-434b-933b-d715c60f45cd" transition-magic="0:7;5:88:7:227c6da2-2be2-434b-933b-d715c60f45cd" on_node="sle12sp2-2" call-id="26" rc-code="7" op-status="0" interval="0" last-run="1461844132" last-rc-change="1461844132" exec-time="84" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart=" state  passwd  op_sleep " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params=" passwd " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+    </node_state>
+    <node_state id="1084783155" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" uname="sle12sp2-1" join="member" expected="member">
+      <transient_attributes id="1084783155">
+        <instance_attributes id="status-1084783155">
+          <nvpair id="status-1084783155-shutdown" name="shutdown" value="0"/>
+        </instance_attributes>
+      </transient_attributes>
+      <lrm id="1084783155">
+        <lrm_resources>
+          <lrm_resource id="st_sbd" type="external/sbd" class="stonith">
+            <lrm_rsc_op id="st_sbd_last_0" operation_key="st_sbd_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="2:10:7:227c6da2-2be2-434b-933b-d715c60f45cd" transition-magic="0:7;2:10:7:227c6da2-2be2-434b-933b-d715c60f45cd" on_node="sle12sp2-1" call-id="5" rc-code="7" op-status="0" interval="0" last-run="1461774707" last-rc-change="1461774707" exec-time="5" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+          <lrm_resource id="dummy1" type="Dummy" class="ocf" provider="pacemaker">
+            <lrm_rsc_op id="dummy1_last_0" operation_key="dummy1_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="24:89:0:227c6da2-2be2-434b-933b-d715c60f45cd" transition-magic="0:0;24:89:0:227c6da2-2be2-434b-933b-d715c60f45cd" on_node="sle12sp2-1" call-id="28" rc-code="0" op-status="0" interval="0" last-run="1461844199" last-rc-change="1461844199" exec-time="43" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart=" state  passwd  op_sleep " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params=" passwd " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+          <lrm_resource id="dummy2" type="Dummy" class="ocf" provider="pacemaker">
+            <lrm_rsc_op id="dummy2_last_0" operation_key="dummy2_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="29:88:0:227c6da2-2be2-434b-933b-d715c60f45cd" transition-magic="0:0;29:88:0:227c6da2-2be2-434b-933b-d715c60f45cd" on_node="sle12sp2-1" call-id="27" rc-code="0" op-status="0" interval="0" last-run="1461844133" last-rc-change="1461844133" exec-time="29" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart=" state  passwd  op_sleep " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params=" passwd " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+    </node_state>
+  </status>
+</cib>
