File bsc#1196340-0009-Test-scheduler-do-not-enforce-resource-stop-if-any-n.patch of Package pacemaker.27558

From 1f85ebab544feba406e16a5d02a757031c70a37b Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Tue, 10 May 2022 13:05:54 +0200
Subject: [PATCH 9/9] Test: scheduler: do not enforce resource stop if any new
 probe/monitor indicates the resource was not running on the target of a
 failed migrate_to

---
 cts/cts-scheduler.in                          |  1 +
 .../probe-target-of-failed-migrate_to-2.dot   |  2 +
 .../probe-target-of-failed-migrate_to-2.exp   |  1 +
 ...probe-target-of-failed-migrate_to-2.scores |  5 ++
 ...robe-target-of-failed-migrate_to-2.summary | 19 +++++++
 .../probe-target-of-failed-migrate_to-2.xml   | 55 +++++++++++++++++++
 6 files changed, 83 insertions(+)
 create mode 100644 cts/scheduler/probe-target-of-failed-migrate_to-2.dot
 create mode 100644 cts/scheduler/probe-target-of-failed-migrate_to-2.exp
 create mode 100644 cts/scheduler/probe-target-of-failed-migrate_to-2.scores
 create mode 100644 cts/scheduler/probe-target-of-failed-migrate_to-2.summary
 create mode 100644 cts/scheduler/probe-target-of-failed-migrate_to-2.xml

Index: pacemaker-2.0.1+20190417.13d370ca9/cts/cts-scheduler.in
===================================================================
--- pacemaker-2.0.1+20190417.13d370ca9.orig/cts/cts-scheduler.in
+++ pacemaker-2.0.1+20190417.13d370ca9/cts/cts-scheduler.in
@@ -698,6 +698,7 @@ do_test 11-a-then-bm-b-move-a-clone-star
 do_test a-promote-then-b-migrate "A promote then B start. migrate B"
 do_test a-demote-then-b-migrate "A demote then B stop. migrate B"
 do_test probe-target-of-failed-migrate_to-1 "Failed migrate_to, target rejoins"
+do_test probe-target-of-failed-migrate_to-2 "Failed migrate_to, target rejoined and probed"
 
 if [ $DO_VERSIONED_TESTS -eq 1 ]; then
     do_test migrate-versioned "Disable migration for versioned resources"
Index: pacemaker-2.0.1+20190417.13d370ca9/cts/scheduler/probe-target-of-failed-migrate_to-2.dot
===================================================================
--- /dev/null
+++ pacemaker-2.0.1+20190417.13d370ca9/cts/scheduler/probe-target-of-failed-migrate_to-2.dot
@@ -0,0 +1,2 @@
+ digraph "g" {
+}
Index: pacemaker-2.0.1+20190417.13d370ca9/cts/scheduler/probe-target-of-failed-migrate_to-2.exp
===================================================================
--- /dev/null
+++ pacemaker-2.0.1+20190417.13d370ca9/cts/scheduler/probe-target-of-failed-migrate_to-2.exp
@@ -0,0 +1 @@
+<transition_graph cluster-delay="60s" stonith-timeout="60s" failed-stop-offset="INFINITY" failed-start-offset="INFINITY"  transition_id="0"/>
Index: pacemaker-2.0.1+20190417.13d370ca9/cts/scheduler/probe-target-of-failed-migrate_to-2.scores
===================================================================
--- /dev/null
+++ pacemaker-2.0.1+20190417.13d370ca9/cts/scheduler/probe-target-of-failed-migrate_to-2.scores
@@ -0,0 +1,5 @@
+Allocation scores:
+native_color: dummy1 allocation score on node1: INFINITY
+native_color: dummy1 allocation score on node2: 0
+native_color: st-sbd allocation score on node1: 0
+native_color: st-sbd allocation score on node2: 0
Index: pacemaker-2.0.1+20190417.13d370ca9/cts/scheduler/probe-target-of-failed-migrate_to-2.summary
===================================================================
--- /dev/null
+++ pacemaker-2.0.1+20190417.13d370ca9/cts/scheduler/probe-target-of-failed-migrate_to-2.summary
@@ -0,0 +1,17 @@
+
+Current cluster status:
+Online: [ node1 node2 ]
+
+ st-sbd	(stonith:external/sbd):	 Started node1
+ dummy1	(ocf::pacemaker:Dummy):	 Started node1
+
+Transition Summary:
+
+Executing cluster transition:
+
+Revised cluster status:
+Online: [ node1 node2 ]
+
+ st-sbd	(stonith:external/sbd):	 Started node1
+ dummy1	(ocf::pacemaker:Dummy):	 Started node1
+
Index: pacemaker-2.0.1+20190417.13d370ca9/cts/scheduler/probe-target-of-failed-migrate_to-2.xml
===================================================================
--- /dev/null
+++ pacemaker-2.0.1+20190417.13d370ca9/cts/scheduler/probe-target-of-failed-migrate_to-2.xml
@@ -0,0 +1,55 @@
+<cib crm_feature_set="3.0.10" validate-with="pacemaker-2.7" epoch="54" num_updates="11" admin_epoch="0" cib-last-written="Mon May  9 12:26:45 2022" update-origin="node1" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="1">
+  <configuration>
+    <crm_config>
+      <cluster_property_set id="cib-bootstrap-options">
+        <nvpair name="have-watchdog" value="true" id="cib-bootstrap-options-have-watchdog"/>
+        <nvpair name="dc-version" value="2.1.2+20220509.89fa32d09-150300.1378.1-2.1.2+20220509.89fa32d09" id="cib-bootstrap-options-dc-version"/>
+        <nvpair name="cluster-infrastructure" value="corosync" id="cib-bootstrap-options-cluster-infrastructure"/>
+        <nvpair id="cib-bootstrap-options-last-lrm-refresh" name="last-lrm-refresh" value="1648809766"/>
+      </cluster_property_set>
+    </crm_config>
+    <nodes>
+      <node id="1" uname="node1"/>
+      <node id="2" uname="node2"/>
+    </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 name="allow-migrate" value="true" id="dummy1-meta_attributes-allow-migrate"/>
+        </meta_attributes>
+      </primitive>
+    </resources>
+    <constraints>
+      <rsc_location id="cli-prefer-dummy1" rsc="dummy1" role="Started" score="INFINITY" node="node1"/>
+    </constraints>
+    <rsc_defaults/>
+  </configuration>
+  <status>
+    <node_state id="1" uname="node1" in_ccm="true" crmd="online" crm-debug-origin="do_state_transition" join="member" expected="member">
+      <lrm id="1">
+        <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.15.0" transition-key="3:1:0:dbc3dbdf-240c-4c26-8cfc-0d86416529e6" transition-magic="0:0;3:1:0:dbc3dbdf-240c-4c26-8cfc-0d86416529e6" exit-reason="" on_node="node1" call-id="10" rc-code="0" op-status="0" interval="0" last-rc-change="1652091783" exec-time="1344" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+          <lrm_resource id="dummy1" type="Dummy" class="ocf" provider="pacemaker">
+            <lrm_rsc_op id="dummy1_last_failure_0" operation_key="dummy1_migrate_to_0" operation="migrate_to" crm-debug-origin="build_active_RAs" crm_feature_set="3.15.0" transition-key="5:2:0:dbc3dbdf-240c-4c26-8cfc-0d86416529e6" transition-magic="0:1;5:2:0:dbc3dbdf-240c-4c26-8cfc-0d86416529e6" exit-reason="" on_node="node1" call-id="12" rc-code="1" op-status="0" interval="0" last-rc-change="1652091880" exec-time="142" queue-time="0" migrate_source="node1" migrate_target="node2" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+            <lrm_rsc_op id="dummy1_last_0" operation_key="dummy1_start_0" operation="start" crm-debug-origin="build_active_RAs" crm_feature_set="3.15.0" transition-key="5:4:0:dbc3dbdf-240c-4c26-8cfc-0d86416529e6" transition-magic="0:0;5:4:0:dbc3dbdf-240c-4c26-8cfc-0d86416529e6" exit-reason="" on_node="node1" call-id="14" rc-code="0" op-status="0" interval="0" last-rc-change="1652091894" exec-time="61" queue-time="0" migrate_source="node1" migrate_target="node2" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+    </node_state>
+    <node_state id="2" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" uname="node2" join="member" expected="member">
+      <lrm id="2">
+        <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.15.0" transition-key="1:6:7:dbc3dbdf-240c-4c26-8cfc-0d86416529e6" transition-magic="0:7;1:6:7:dbc3dbdf-240c-4c26-8cfc-0d86416529e6" exit-reason="" on_node="node2" call-id="5" rc-code="7" op-status="0" interval="0" last-rc-change="1652092136" exec-time="4" 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_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.15.0" transition-key="2:6:7:dbc3dbdf-240c-4c26-8cfc-0d86416529e6" transition-magic="0:7;2:6:7:dbc3dbdf-240c-4c26-8cfc-0d86416529e6" exit-reason="" on_node="node2" call-id="9" rc-code="7" op-status="0" interval="0" last-rc-change="1652092136" exec-time="25" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+          </lrm_resource>
+        </lrm_resources>
+      </lrm>
+    </node_state>
+  </status>
+</cib>
openSUSE Build Service is sponsored by