File bug-977800_pacemaker-pengine-anti-colocation-slave-test.patch of Package pacemaker.3577
commit 39586d81d3ca92784bf8d7557bd610534223b496
Author: Gao,Yan <ygao@suse.com>
Date: Tue May 3 15:55:06 2016 +0200
Test: pengine: Organize order of actions for slave resources in anti-colocations
diff --git a/pengine/regression.sh b/pengine/regression.sh
index bda2f74..8a2864c 100755
--- a/pengine/regression.sh
+++ b/pengine/regression.sh
@@ -180,6 +180,7 @@ do_test colo_master_w_native "cl#5070 - Verify promotion order is affected when
do_test colo_slave_w_native "cl#5070 - Verify promotion order is affected when colocating slave to native rsc."
do_test anti-colocation-order "cl#5187 - Prevent resources in an anti-colocation from even temporarily running on a same node"
do_test anti-colocation-master "Organize order of actions for master resources in anti-colocations"
+do_test anti-colocation-slave "Organize order of actions for slave resources in anti-colocations"
do_test enforce-colo1 "Always enforce B with A INFINITY."
do_test complex_enforce_colo "Always enforce B with A INFINITY. (make sure heat-engine stops)"
diff --git a/pengine/test10/anti-colocation-slave.dot b/pengine/test10/anti-colocation-slave.dot
new file mode 100644
index 0000000..da2a38d
--- /dev/null
+++ b/pengine/test10/anti-colocation-slave.dot
@@ -0,0 +1,21 @@
+digraph "g" {
+"all_stopped" [ style=bold color="green" fontcolor="orange"]
+"dummy1_start_0 sle12sp2-2" [ style=bold color="green" fontcolor="black"]
+"dummy1_stop_0 sle12sp2-1" -> "all_stopped" [ style = bold]
+"dummy1_stop_0 sle12sp2-1" -> "dummy1_start_0 sle12sp2-2" [ style = bold]
+"dummy1_stop_0 sle12sp2-1" -> "ms1_demote_0" [ style = bold]
+"dummy1_stop_0 sle12sp2-1" [ style=bold color="green" fontcolor="black"]
+"ms1_demote_0" -> "ms1_demoted_0" [ style = bold]
+"ms1_demote_0" -> "state1_demote_0 sle12sp2-1" [ style = bold]
+"ms1_demote_0" [ style=bold color="green" fontcolor="orange"]
+"ms1_demoted_0" -> "ms1_promote_0" [ style = bold]
+"ms1_demoted_0" [ style=bold color="green" fontcolor="orange"]
+"ms1_promote_0" -> "state1_promote_0 sle12sp2-2" [ style = bold]
+"ms1_promote_0" [ style=bold color="green" fontcolor="orange"]
+"ms1_promoted_0" -> "dummy1_start_0 sle12sp2-2" [ style = bold]
+"ms1_promoted_0" [ style=bold color="green" fontcolor="orange"]
+"state1_demote_0 sle12sp2-1" -> "ms1_demoted_0" [ style = bold]
+"state1_demote_0 sle12sp2-1" [ style=bold color="green" fontcolor="black"]
+"state1_promote_0 sle12sp2-2" -> "ms1_promoted_0" [ style = bold]
+"state1_promote_0 sle12sp2-2" [ style=bold color="green" fontcolor="black"]
+}
diff --git a/pengine/test10/anti-colocation-slave.exp b/pengine/test10/anti-colocation-slave.exp
new file mode 100644
index 0000000..afb8983
--- /dev/null
+++ b/pengine/test10/anti-colocation-slave.exp
@@ -0,0 +1,116 @@
+<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="5" operation="demote" operation_key="state1_demote_0" internal_operation_key="state1:0_demote_0" on_node="sle12sp2-1" on_node_uuid="1084783155">
+ <primitive id="state1" long-id="state1:0" class="ocf" provider="pacemaker" type="Stateful"/>
+ <attributes CRM_meta_clone="0" CRM_meta_clone_max="2" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_master_max="1" CRM_meta_master_node_max="1" CRM_meta_notify="false" CRM_meta_timeout="20000" />
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <pseudo_event id="16" operation="demote" operation_key="ms1_demote_0"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="1">
+ <action_set>
+ <rsc_op id="9" operation="promote" operation_key="state1_promote_0" internal_operation_key="state1:1_promote_0" on_node="sle12sp2-2" on_node_uuid="1084783156">
+ <primitive id="state1" long-id="state1:1" class="ocf" provider="pacemaker" type="Stateful"/>
+ <attributes CRM_meta_clone="1" CRM_meta_clone_max="2" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_master_max="1" CRM_meta_master_node_max="1" CRM_meta_notify="false" CRM_meta_timeout="20000" />
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <pseudo_event id="14" operation="promote" operation_key="ms1_promote_0"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="2" priority="1000000">
+ <action_set>
+ <pseudo_event id="17" operation="demoted" operation_key="ms1_demoted_0">
+ <attributes CRM_meta_clone_max="2" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_master_max="1" CRM_meta_master_node_max="1" CRM_meta_notify="false" CRM_meta_timeout="20000" />
+ </pseudo_event>
+ </action_set>
+ <inputs>
+ <trigger>
+ <rsc_op id="5" operation="demote" operation_key="state1_demote_0" internal_operation_key="state1:0_demote_0" on_node="sle12sp2-1" on_node_uuid="1084783155"/>
+ </trigger>
+ <trigger>
+ <pseudo_event id="16" operation="demote" operation_key="ms1_demote_0"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="3">
+ <action_set>
+ <pseudo_event id="16" operation="demote" operation_key="ms1_demote_0">
+ <attributes CRM_meta_clone_max="2" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_master_max="1" CRM_meta_master_node_max="1" CRM_meta_notify="false" CRM_meta_timeout="20000" />
+ </pseudo_event>
+ </action_set>
+ <inputs>
+ <trigger>
+ <rsc_op id="18" operation="stop" operation_key="dummy1_stop_0" on_node="sle12sp2-1" on_node_uuid="1084783155"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="4" priority="1000000">
+ <action_set>
+ <pseudo_event id="15" operation="promoted" operation_key="ms1_promoted_0">
+ <attributes CRM_meta_clone_max="2" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_master_max="1" CRM_meta_master_node_max="1" CRM_meta_notify="false" CRM_meta_timeout="20000" />
+ </pseudo_event>
+ </action_set>
+ <inputs>
+ <trigger>
+ <rsc_op id="9" operation="promote" operation_key="state1_promote_0" internal_operation_key="state1:1_promote_0" on_node="sle12sp2-2" on_node_uuid="1084783156"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="5">
+ <action_set>
+ <pseudo_event id="14" operation="promote" operation_key="ms1_promote_0">
+ <attributes CRM_meta_clone_max="2" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_master_max="1" CRM_meta_master_node_max="1" CRM_meta_notify="false" CRM_meta_timeout="20000" />
+ </pseudo_event>
+ </action_set>
+ <inputs>
+ <trigger>
+ <pseudo_event id="17" operation="demoted" operation_key="ms1_demoted_0"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="6">
+ <action_set>
+ <rsc_op id="19" operation="start" operation_key="dummy1_start_0" on_node="sle12sp2-2" on_node_uuid="1084783156">
+ <primitive id="dummy1" class="ocf" provider="pacemaker" type="Dummy"/>
+ <attributes CRM_meta_timeout="20000" />
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <pseudo_event id="15" operation="promoted" operation_key="ms1_promoted_0"/>
+ </trigger>
+ <trigger>
+ <rsc_op id="18" operation="stop" operation_key="dummy1_stop_0" on_node="sle12sp2-1" on_node_uuid="1084783155"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="7">
+ <action_set>
+ <rsc_op id="18" operation="stop" operation_key="dummy1_stop_0" on_node="sle12sp2-1" on_node_uuid="1084783155">
+ <primitive id="dummy1" class="ocf" provider="pacemaker" type="Dummy"/>
+ <attributes CRM_meta_timeout="20000" />
+ </rsc_op>
+ </action_set>
+ <inputs/>
+ </synapse>
+ <synapse id="8">
+ <action_set>
+ <pseudo_event id="1" operation="all_stopped" operation_key="all_stopped">
+ <attributes />
+ </pseudo_event>
+ </action_set>
+ <inputs>
+ <trigger>
+ <rsc_op id="18" operation="stop" operation_key="dummy1_stop_0" on_node="sle12sp2-1" on_node_uuid="1084783155"/>
+ </trigger>
+ </inputs>
+ </synapse>
+</transition_graph>
diff --git a/pengine/test10/anti-colocation-slave.scores b/pengine/test10/anti-colocation-slave.scores
new file mode 100644
index 0000000..b9d278e
--- /dev/null
+++ b/pengine/test10/anti-colocation-slave.scores
@@ -0,0 +1,17 @@
+Allocation scores:
+clone_color: ms1 allocation score on sle12sp2-1: 0
+clone_color: ms1 allocation score on sle12sp2-2: 0
+clone_color: state1:0 allocation score on sle12sp2-1: 11
+clone_color: state1:0 allocation score on sle12sp2-2: 0
+clone_color: state1:1 allocation score on sle12sp2-1: 0
+clone_color: state1:1 allocation score on sle12sp2-2: 6
+native_color: dummy1 allocation score on sle12sp2-1: -INFINITY
+native_color: dummy1 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
+native_color: state1:0 allocation score on sle12sp2-1: 11
+native_color: state1:0 allocation score on sle12sp2-2: -INFINITY
+native_color: state1:1 allocation score on sle12sp2-1: 0
+native_color: state1:1 allocation score on sle12sp2-2: 6
+state1:0 promotion score on sle12sp2-1: -INFINITY
+state1:1 promotion score on sle12sp2-2: 5
diff --git a/pengine/test10/anti-colocation-slave.summary b/pengine/test10/anti-colocation-slave.summary
new file mode 100644
index 0000000..9179e9f
--- /dev/null
+++ b/pengine/test10/anti-colocation-slave.summary
@@ -0,0 +1,35 @@
+
+Current cluster status:
+Online: [ sle12sp2-1 sle12sp2-2 ]
+
+ st_sbd (stonith:external/sbd): Started sle12sp2-1
+ Master/Slave Set: ms1 [state1]
+ Masters: [ sle12sp2-1 ]
+ Slaves: [ sle12sp2-2 ]
+ dummy1 (ocf::pacemaker:Dummy): Started sle12sp2-1
+
+Transition Summary:
+ * Demote state1:0 (Master -> Slave sle12sp2-1)
+ * Promote state1:1 (Slave -> Master sle12sp2-2)
+ * Move dummy1 (Started sle12sp2-1 -> sle12sp2-2)
+
+Executing cluster transition:
+ * Resource action: dummy1 stop on sle12sp2-1
+ * Pseudo action: all_stopped
+ * Pseudo action: ms1_demote_0
+ * Resource action: state1 demote on sle12sp2-1
+ * Pseudo action: ms1_demoted_0
+ * Pseudo action: ms1_promote_0
+ * Resource action: state1 promote on sle12sp2-2
+ * Pseudo action: ms1_promoted_0
+ * Resource action: dummy1 start on sle12sp2-2
+
+Revised cluster status:
+Online: [ sle12sp2-1 sle12sp2-2 ]
+
+ st_sbd (stonith:external/sbd): Started sle12sp2-1
+ Master/Slave Set: ms1 [state1]
+ Masters: [ sle12sp2-2 ]
+ Slaves: [ sle12sp2-1 ]
+ dummy1 (ocf::pacemaker:Dummy): Started sle12sp2-2
+
diff --git a/pengine/test10/anti-colocation-slave.xml b/pengine/test10/anti-colocation-slave.xml
new file mode 100644
index 0000000..9f94396
--- /dev/null
+++ b/pengine/test10/anti-colocation-slave.xml
@@ -0,0 +1,74 @@
+<cib crm_feature_set="3.0.8" validate-with="pacemaker-1.2" epoch="268" num_updates="28" admin_epoch="0" cib-last-written="Tue May 3 14:44:13 2016" update-origin="sle12sp2-1" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="1084783155">
+ <configuration>
+ <crm_config>
+ <cluster_property_set id="cib-bootstrap-options">
+ <nvpair name="dc-version" value="1.1.14-24.1-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="1462277437" 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"/>
+ <master id="ms1">
+ <meta_attributes id="ms1-meta_attributes">
+ <nvpair name="interleave" value="true" id="ms1-meta_attributes-interleave"/>
+ </meta_attributes>
+ <primitive id="state1" class="ocf" provider="pacemaker" type="Stateful"/>
+ </master>
+ <primitive id="dummy1" class="ocf" provider="pacemaker" type="Dummy"/>
+ </resources>
+ <constraints>
+ <rsc_colocation id="dummy1-nerver-with-ms1-slave" score="-INFINITY" rsc="dummy1" rsc-role="Started" with-rsc="ms1" with-rsc-role="Slave"/>
+ <rsc_location id="ms1-master-location" rsc="ms1" role="Master" score="-INFINITY" node="sle12sp2-1"/>
+ </constraints>
+ <rsc_defaults/>
+ </configuration>
+ <status>
+ <node_state id="1084783155" uname="sle12sp2-1" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
+ <transient_attributes id="1084783155">
+ <instance_attributes id="status-1084783155">
+ <nvpair id="status-1084783155-shutdown" name="shutdown" value="0"/>
+ <nvpair id="status-1084783155-master-state1" name="master-state1" value="10"/>
+ </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_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="5:1:0:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" transition-magic="0:0;5:1:0:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" on_node="sle12sp2-1" call-id="15" rc-code="0" op-status="0" interval="0" last-run="1462279528" last-rc-change="1462279528" exec-time="1570" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+ </lrm_resource>
+ <lrm_resource id="state1" type="Stateful" class="ocf" provider="pacemaker">
+ <lrm_rsc_op id="state1_last_0" operation_key="state1_promote_0" operation="promote" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="6:2:0:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" transition-magic="0:0;6:2:0:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" on_node="sle12sp2-1" call-id="18" rc-code="0" op-status="0" interval="0" last-run="1462279530" last-rc-change="1462279530" exec-time="133" 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_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="17:2:0:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" transition-magic="0:0;17:2:0:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" on_node="sle12sp2-1" call-id="17" rc-code="0" op-status="0" interval="0" last-run="1462279530" last-rc-change="1462279530" exec-time="34" 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="1084783156" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" uname="sle12sp2-2" join="member" expected="member">
+ <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_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="2:1:7:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" transition-magic="0:7;2:1:7:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" on_node="sle12sp2-2" call-id="5" rc-code="7" op-status="0" interval="0" last-run="1462279528" last-rc-change="1462279528" exec-time="6" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+ </lrm_resource>
+ <lrm_resource id="state1" type="Stateful" class="ocf" provider="pacemaker">
+ <lrm_rsc_op id="state1_last_0" operation_key="state1_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="6:1:0:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" transition-magic="0:0;6:1:0:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" on_node="sle12sp2-2" call-id="15" rc-code="0" op-status="0" interval="0" last-run="1462279528" last-rc-change="1462279528" exec-time="229" queue-time="23" 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:1:7:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" transition-magic="0:7;4:1:7:00d6d2ca-bca3-4332-925c-fd1b0fba7a59" on_node="sle12sp2-2" call-id="14" rc-code="7" op-status="0" interval="0" last-run="1462279528" last-rc-change="1462279528" exec-time="67" queue-time="12" 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>
+ <transient_attributes id="1084783156">
+ <instance_attributes id="status-1084783156">
+ <nvpair id="status-1084783156-shutdown" name="shutdown" value="0"/>
+ <nvpair id="status-1084783156-master-state1" name="master-state1" value="5"/>
+ </instance_attributes>
+ </transient_attributes>
+ </node_state>
+ </status>
+</cib>