From a41380e5e28709803443130122da7c99e52e6a1d Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Tue, 18 Aug 2020 16:12:19 -0500
Subject: [PATCH 2/2] Test: scheduler: update migrate-fail-9 test for migration
 code change

migrate-fail-7 has a failed migrate_to and successful stop on the migration
source, with only a probe on the migration target. The cluster's response is to
start the affected resource (on the source).

migrate-fail-9 is identical, except the target has a successful stop as well.
Previously, the cluster would schedule a stop and a start (on the source).
However, there's no reason a successful stop on the target should force a
redundant stop on the source. Now, it will only schedule the start.
---
 cts/pengine/migrate-fail-9.dot     |  2 --
 cts/pengine/migrate-fail-9.exp     | 16 ++--------------
 cts/pengine/migrate-fail-9.summary |  3 +--
 3 files changed, 3 insertions(+), 18 deletions(-)

Index: pacemaker-1.1.18+20180430.b12c320f5/cts/pengine/migrate-fail-9.summary
===================================================================
--- pacemaker-1.1.18+20180430.b12c320f5.orig/cts/pengine/migrate-fail-9.summary
+++ pacemaker-1.1.18+20180430.b12c320f5/cts/pengine/migrate-fail-9.summary
@@ -7,13 +7,11 @@ Online: [ hex-13 hex-14 ]
      Started: [ hex-13 hex-14 ]
 
 Transition Summary:
- * Restart    test-vm     ( hex-13 )  
+ * Start      test-vm     ( hex-13 )  
 
 Executing cluster transition:
- * Resource action: test-vm         stop on hex-14
  * Pseudo action:   load_stopped_hex-14
  * Pseudo action:   load_stopped_hex-13
- * Pseudo action:   all_stopped
  * Resource action: test-vm         start on hex-13
 
 Revised cluster status:
Index: pacemaker-1.1.18+20180430.b12c320f5/cts/pengine/migrate-fail-9.dot
===================================================================
--- pacemaker-1.1.18+20180430.b12c320f5.orig/cts/pengine/migrate-fail-9.dot
+++ pacemaker-1.1.18+20180430.b12c320f5/cts/pengine/migrate-fail-9.dot
@@ -1,10 +1,6 @@
 digraph "g" {
-"all_stopped" [ style=bold color="green" fontcolor="orange" ]
 "load_stopped_hex-13 hex-13" -> "test-vm_start_0 hex-13" [ style = bold]
 "load_stopped_hex-13 hex-13" [ style=bold color="green" fontcolor="orange" ]
 "load_stopped_hex-14 hex-14" [ style=bold color="green" fontcolor="orange" ]
 "test-vm_start_0 hex-13" [ style=bold color="green" fontcolor="black" ]
-"test-vm_stop_0 hex-14" -> "all_stopped" [ style = bold]
-"test-vm_stop_0 hex-14" -> "test-vm_start_0 hex-13" [ style = bold]
-"test-vm_stop_0 hex-14" [ style=bold color="green" fontcolor="black" ]
 }
Index: pacemaker-1.1.18+20180430.b12c320f5/cts/pengine/migrate-fail-9.exp
===================================================================
--- pacemaker-1.1.18+20180430.b12c320f5.orig/cts/pengine/migrate-fail-9.exp
+++ pacemaker-1.1.18+20180430.b12c320f5/cts/pengine/migrate-fail-9.exp
@@ -1,7 +1,7 @@
 <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="13" operation="start" operation_key="test-vm_start_0" on_node="hex-13" on_node_uuid="hex-13">
+      <rsc_op id="12" operation="start" operation_key="test-vm_start_0" on_node="hex-13" on_node_uuid="hex-13">
         <primitive id="test-vm" class="ocf" provider="heartbeat" type="Xen"/>
         <attributes CRM_meta_on_node="hex-13" CRM_meta_on_node_uuid="hex-13" CRM_meta_record_pending="true" CRM_meta_timeout="600000"  name="test-vm" xmfile="/var/lib/xen/images/SLES_11_SP1_JeOS_Xen_Guest.x86_64-0.0.1.xenconfig"/>
       </rsc_op>
@@ -10,29 +10,17 @@
       <trigger>
         <pseudo_event id="2" operation="load_stopped_hex-13" operation_key="load_stopped_hex-13"/>
       </trigger>
-      <trigger>
-        <rsc_op id="12" operation="stop" operation_key="test-vm_stop_0" on_node="hex-14" on_node_uuid="hex-14"/>
-      </trigger>
     </inputs>
   </synapse>
   <synapse id="1">
     <action_set>
-      <rsc_op id="12" operation="stop" operation_key="test-vm_stop_0" on_node="hex-14" on_node_uuid="hex-14">
-        <primitive id="test-vm" class="ocf" provider="heartbeat" type="Xen"/>
-        <attributes CRM_meta_on_node="hex-14" CRM_meta_on_node_uuid="hex-14" CRM_meta_record_pending="true" CRM_meta_timeout="600000"  name="test-vm" xmfile="/var/lib/xen/images/SLES_11_SP1_JeOS_Xen_Guest.x86_64-0.0.1.xenconfig"/>
-      </rsc_op>
-    </action_set>
-    <inputs/>
-  </synapse>
-  <synapse id="2">
-    <action_set>
       <pseudo_event id="3" operation="load_stopped_hex-14" operation_key="load_stopped_hex-14">
         <attributes />
       </pseudo_event>
     </action_set>
     <inputs/>
   </synapse>
-  <synapse id="3">
+  <synapse id="2">
     <action_set>
       <pseudo_event id="2" operation="load_stopped_hex-13" operation_key="load_stopped_hex-13">
         <attributes />
@@ -40,17 +28,4 @@
     </action_set>
     <inputs/>
   </synapse>
-  <synapse id="4">
-    <action_set>
-      <pseudo_event id="1" operation="all_stopped" operation_key="all_stopped">
-        <attributes />
-      </pseudo_event>
-    </action_set>
-    <inputs>
-      <trigger>
-        <rsc_op id="12" operation="stop" operation_key="test-vm_stop_0" on_node="hex-14" on_node_uuid="hex-14"/>
-      </trigger>
-    </inputs>
-  </synapse>
 </transition_graph>
-
