File bsc#1206263-0003-Test-cts-scheduler-update-test-for-preventing-a-left.patch of Package pacemaker.29727

From 0da1d22a27a640b9b16ef5c62c0286485d9f142e Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Mon, 5 Dec 2022 15:03:18 +0100
Subject: [PATCH 3/6] Test: cts-scheduler: update test for preventing a
 leftover pending monitor from causing unexpected stop of other instances

---
 .../dot/leftover-pending-monitor.dot          | 39 +++-----------
 .../exp/leftover-pending-monitor.exp          | 54 +++++--------------
 .../summary/leftover-pending-monitor.summary  | 17 +++---
 3 files changed, 28 insertions(+), 82 deletions(-)

diff --git a/cts/scheduler/dot/leftover-pending-monitor.dot b/cts/scheduler/dot/leftover-pending-monitor.dot
index ca0ae3fc3..0f76394e6 100644
--- a/cts/scheduler/dot/leftover-pending-monitor.dot
+++ b/cts/scheduler/dot/leftover-pending-monitor.dot
@@ -1,36 +1,13 @@
  digraph "g" {
-"promotable-1_demote_0" -> "promotable-1_demoted_0" [ style = bold]
-"promotable-1_demote_0" -> "stateful-1_demote_0 node-3" [ style = bold]
-"promotable-1_demote_0" [ style=bold color="green" fontcolor="orange"]
-"promotable-1_demoted_0" -> "promotable-1_start_0" [ style = dashed]
-"promotable-1_demoted_0" -> "promotable-1_stop_0" [ style = bold]
-"promotable-1_demoted_0" [ style=bold color="green" fontcolor="orange"]
-"promotable-1_running_0" [ style=dashed color="red" fontcolor="orange"]
-"promotable-1_start_0" -> "promotable-1_running_0" [ style = dashed]
-"promotable-1_start_0" -> "stateful-1:2_start_0 node-1" [ style = dashed]
-"promotable-1_start_0" -> "stateful-1_start_0 node-3" [ style = dashed]
-"promotable-1_start_0" [ style=dashed color="red" fontcolor="orange"]
-"promotable-1_stop_0" -> "promotable-1_stopped_0" [ style = bold]
-"promotable-1_stop_0" -> "stateful-1_stop_0 node-3" [ style = bold]
-"promotable-1_stop_0" [ style=bold color="green" fontcolor="orange"]
-"promotable-1_stopped_0" -> "promotable-1_start_0" [ style = dashed]
-"promotable-1_stopped_0" [ style=bold color="green" fontcolor="orange"]
+"promotable-1_running_0" [ style=bold color="green" fontcolor="orange"]
+"promotable-1_start_0" -> "promotable-1_running_0" [ style = bold]
+"promotable-1_start_0" -> "stateful-1:2_start_0 node-1" [ style = bold]
+"promotable-1_start_0" [ style=bold color="green" fontcolor="orange"]
 "st-sbd_monitor_0 node-2" [ style=dashed color="red" fontcolor="black"]
-"stateful-1:2_monitor_5000 node-1" [ style=dashed color="red" fontcolor="black"]
-"stateful-1:2_start_0 node-1" -> "promotable-1_running_0" [ style = dashed]
-"stateful-1:2_start_0 node-1" -> "stateful-1:2_monitor_5000 node-1" [ style = dashed]
-"stateful-1:2_start_0 node-1" [ style=dashed color="red" fontcolor="black"]
-"stateful-1_demote_0 node-3" -> "promotable-1_demoted_0" [ style = bold]
-"stateful-1_demote_0 node-3" -> "stateful-1_stop_0 node-3" [ style = bold]
-"stateful-1_demote_0 node-3" [ style=bold color="green" fontcolor="black"]
+"stateful-1:2_monitor_5000 node-1" [ style=bold color="green" fontcolor="black"]
+"stateful-1:2_start_0 node-1" -> "promotable-1_running_0" [ style = bold]
+"stateful-1:2_start_0 node-1" -> "stateful-1:2_monitor_5000 node-1" [ style = bold]
+"stateful-1:2_start_0 node-1" [ style=bold color="green" fontcolor="black"]
 "stateful-1_monitor_0 node-2" -> "promotable-1_start_0" [ style = dashed]
-"stateful-1_monitor_0 node-2" -> "promotable-1_stopped_0" [ style = dashed]
 "stateful-1_monitor_0 node-2" [ style=dashed color="red" fontcolor="black"]
-"stateful-1_monitor_10000 node-3" [ style=dashed color="red" fontcolor="black"]
-"stateful-1_start_0 node-3" -> "promotable-1_running_0" [ style = dashed]
-"stateful-1_start_0 node-3" -> "stateful-1_monitor_10000 node-3" [ style = dashed]
-"stateful-1_start_0 node-3" [ style=dashed color="red" fontcolor="black"]
-"stateful-1_stop_0 node-3" -> "promotable-1_stopped_0" [ style = bold]
-"stateful-1_stop_0 node-3" -> "stateful-1_start_0 node-3" [ style = dashed]
-"stateful-1_stop_0 node-3" [ style=bold color="green" fontcolor="black"]
 }
diff --git a/cts/scheduler/exp/leftover-pending-monitor.exp b/cts/scheduler/exp/leftover-pending-monitor.exp
index 3914bc349..9508f16db 100644
--- a/cts/scheduler/exp/leftover-pending-monitor.exp
+++ b/cts/scheduler/exp/leftover-pending-monitor.exp
@@ -1,81 +1,51 @@
 <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="8" operation="stop" operation_key="stateful-1_stop_0" internal_operation_key="stateful-1:1_stop_0" on_node="node-3" on_node_uuid="3">
-        <primitive id="stateful-1" long-id="stateful-1:1" class="ocf" provider="pacemaker" type="Stateful"/>
-        <attributes CRM_meta_clone="1" CRM_meta_clone_max="3" 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_on_node="node-3" CRM_meta_on_node_uuid="3" CRM_meta_promoted_max="1" CRM_meta_promoted_node_max="1" CRM_meta_timeout="20000" />
+      <rsc_op id="11" operation="monitor" operation_key="stateful-1:2_monitor_5000" on_node="node-1" on_node_uuid="1">
+        <primitive id="stateful-1" long-id="stateful-1:2" class="ocf" provider="pacemaker" type="Stateful"/>
+        <attributes CRM_meta_clone="2" CRM_meta_clone_max="3" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_interval="5000" CRM_meta_master_max="1" CRM_meta_master_node_max="1" CRM_meta_name="monitor" CRM_meta_notify="false" CRM_meta_on_node="node-1" CRM_meta_on_node_uuid="1" CRM_meta_promoted_max="1" CRM_meta_promoted_node_max="1" CRM_meta_timeout="20000" />
       </rsc_op>
     </action_set>
     <inputs>
       <trigger>
-        <rsc_op id="7" operation="demote" operation_key="stateful-1_demote_0" internal_operation_key="stateful-1:1_demote_0" on_node="node-3" on_node_uuid="3"/>
-      </trigger>
-      <trigger>
-        <pseudo_event id="14" operation="stop" operation_key="promotable-1_stop_0"/>
+        <rsc_op id="10" operation="start" operation_key="stateful-1:2_start_0" on_node="node-1" on_node_uuid="1"/>
       </trigger>
     </inputs>
   </synapse>
   <synapse id="1">
     <action_set>
-      <rsc_op id="7" operation="demote" operation_key="stateful-1_demote_0" internal_operation_key="stateful-1:1_demote_0" on_node="node-3" on_node_uuid="3">
-        <primitive id="stateful-1" long-id="stateful-1:1" class="ocf" provider="pacemaker" type="Stateful"/>
-        <attributes CRM_meta_clone="1" CRM_meta_clone_max="3" 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_on_node="node-3" CRM_meta_on_node_uuid="3" CRM_meta_promoted_max="1" CRM_meta_promoted_node_max="1" CRM_meta_timeout="20000" />
+      <rsc_op id="10" operation="start" operation_key="stateful-1:2_start_0" on_node="node-1" on_node_uuid="1">
+        <primitive id="stateful-1" long-id="stateful-1:2" class="ocf" provider="pacemaker" type="Stateful"/>
+        <attributes CRM_meta_clone="2" CRM_meta_clone_max="3" 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_on_node="node-1" CRM_meta_on_node_uuid="1" CRM_meta_promoted_max="1" CRM_meta_promoted_node_max="1" CRM_meta_timeout="20000" />
       </rsc_op>
     </action_set>
     <inputs>
       <trigger>
-        <pseudo_event id="18" operation="demote" operation_key="promotable-1_demote_0"/>
+        <pseudo_event id="12" operation="start" operation_key="promotable-1_start_0"/>
       </trigger>
     </inputs>
   </synapse>
   <synapse id="2" priority="1000000">
     <action_set>
-      <pseudo_event id="19" operation="demoted" operation_key="promotable-1_demoted_0">
+      <pseudo_event id="13" operation="running" operation_key="promotable-1_running_0">
         <attributes CRM_meta_clone_max="3" 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_promoted_max="1" CRM_meta_promoted_node_max="1" CRM_meta_timeout="20000" />
       </pseudo_event>
     </action_set>
     <inputs>
       <trigger>
-        <rsc_op id="7" operation="demote" operation_key="stateful-1_demote_0" internal_operation_key="stateful-1:1_demote_0" on_node="node-3" on_node_uuid="3"/>
+        <rsc_op id="10" operation="start" operation_key="stateful-1:2_start_0" on_node="node-1" on_node_uuid="1"/>
       </trigger>
       <trigger>
-        <pseudo_event id="18" operation="demote" operation_key="promotable-1_demote_0"/>
+        <pseudo_event id="12" operation="start" operation_key="promotable-1_start_0"/>
       </trigger>
     </inputs>
   </synapse>
   <synapse id="3">
     <action_set>
-      <pseudo_event id="18" operation="demote" operation_key="promotable-1_demote_0">
+      <pseudo_event id="12" operation="start" operation_key="promotable-1_start_0">
         <attributes CRM_meta_clone_max="3" 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_promoted_max="1" CRM_meta_promoted_node_max="1" CRM_meta_timeout="20000" />
       </pseudo_event>
     </action_set>
     <inputs/>
   </synapse>
-  <synapse id="4" priority="1000000">
-    <action_set>
-      <pseudo_event id="15" operation="stopped" operation_key="promotable-1_stopped_0">
-        <attributes CRM_meta_clone_max="3" 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_promoted_max="1" CRM_meta_promoted_node_max="1" CRM_meta_timeout="20000" />
-      </pseudo_event>
-    </action_set>
-    <inputs>
-      <trigger>
-        <rsc_op id="8" operation="stop" operation_key="stateful-1_stop_0" internal_operation_key="stateful-1:1_stop_0" on_node="node-3" on_node_uuid="3"/>
-      </trigger>
-      <trigger>
-        <pseudo_event id="14" operation="stop" operation_key="promotable-1_stop_0"/>
-      </trigger>
-    </inputs>
-  </synapse>
-  <synapse id="5">
-    <action_set>
-      <pseudo_event id="14" operation="stop" operation_key="promotable-1_stop_0">
-        <attributes CRM_meta_clone_max="3" 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_promoted_max="1" CRM_meta_promoted_node_max="1" CRM_meta_timeout="20000" />
-      </pseudo_event>
-    </action_set>
-    <inputs>
-      <trigger>
-        <pseudo_event id="19" operation="demoted" operation_key="promotable-1_demoted_0"/>
-      </trigger>
-    </inputs>
-  </synapse>
 </transition_graph>
diff --git a/cts/scheduler/summary/leftover-pending-monitor.summary b/cts/scheduler/summary/leftover-pending-monitor.summary
index 82e850f66..ee31231c2 100644
--- a/cts/scheduler/summary/leftover-pending-monitor.summary
+++ b/cts/scheduler/summary/leftover-pending-monitor.summary
@@ -12,16 +12,13 @@ Current cluster status:
       * Stopped: [ node-1 node-2 ]
 
 Transition Summary:
-  * Stop       stateful-1:1     ( Promoted node-3 )  due to unrunnable stateful-1:0 monitor
-  * Start      stateful-1:2     (          node-1 )  due to unrunnable stateful-1:0 monitor (blocked)
+  * Start      stateful-1:2     ( node-1 )
 
 Executing Cluster Transition:
-  * Pseudo action:   promotable-1_demote_0
-  * Resource action: stateful-1      demote on node-3
-  * Pseudo action:   promotable-1_demoted_0
-  * Pseudo action:   promotable-1_stop_0
-  * Resource action: stateful-1      stop on node-3
-  * Pseudo action:   promotable-1_stopped_0
+  * Pseudo action:   promotable-1_start_0
+  * Resource action: stateful-1      start on node-1
+  * Pseudo action:   promotable-1_running_0
+  * Resource action: stateful-1      monitor=5000 on node-1
 Using the original execution date of: 2022-12-02 17:04:52Z
 
 Revised Cluster Status:
@@ -32,4 +29,6 @@ Revised Cluster Status:
   * Full List of Resources:
     * st-sbd	(stonith:external/sbd):	 Started node-1
     * Clone Set: promotable-1 [stateful-1] (promotable):
-      * Stopped: [ node-1 node-2 node-3 ]
+      * Promoted: [ node-3 ]
+      * Unpromoted: [ node-1 ]
+      * Stopped: [ node-2 ]
-- 
2.35.3

openSUSE Build Service is sponsored by