From dbe473ec05fd4adf6f6181e091943d6d2ecc5649 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Thu, 6 Mar 2025 19:36:20 +0100
Subject: [PATCH 1/2] Fix: libpe_status: consider parents of an unmanaged
 resource active on the node

... even if the node is offline.

Previously, parents of an unmanaged resource were not added to the node
if the node was offline. So that for instance a resource group in
`maintenance` mode as a whole would not be displayed by
crm_mon/crm_simulate at all.
---
 lib/pengine/native.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/pengine/native.c b/lib/pengine/native.c
index bf166fac5c0..a17831d3283 100644
--- a/lib/pengine/native.c
+++ b/lib/pengine/native.c
@@ -120,7 +120,7 @@
         pe_rsc_info(rsc, "resource %s isn't managed", rsc->id);
         resource_location(rsc, node, INFINITY, "not_managed_default", data_set);
 
-        while(p && node->details->online) {
+        while(p) {
             /* add without the additional location constraint */
             p->running_on = g_list_append(p->running_on, node);
             p = p->parent;

From cf06bc2f67cbe3e606a3b42bee608b265fff27f7 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Thu, 6 Mar 2025 19:51:54 +0100
Subject: [PATCH 2/2] Test: cts-scheduler: update tests for considering parents
 of an unmanaged resource active on the node

... even if the node is offline.
---
 cts/scheduler/summary/stop-failure-no-fencing.summary | 6 ++++++
 cts/scheduler/summary/stop-failure-no-quorum.summary  | 5 ++++-
 cts/scheduler/summary/unmanaged-promoted.summary      | 6 ------
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/cts/scheduler/summary/stop-failure-no-fencing.summary b/cts/scheduler/summary/stop-failure-no-fencing.summary
index bb164fd5be4..f373981cae5 100644
--- a/cts/scheduler/summary/stop-failure-no-fencing.summary
+++ b/cts/scheduler/summary/stop-failure-no-fencing.summary
@@ -9,6 +9,9 @@ Current cluster status:
   * Full List of Resources:
     * Clone Set: dlm-clone [dlm]:
       * Stopped: [ pcmk-1 pcmk-2 pcmk-3 pcmk-4 ]
+    * Clone Set: clvm-clone [clvm]:
+      * clvm	(lsb:clvmd):	 FAILED pcmk-3 (UNCLEAN, blocked)
+      * Stopped: [ pcmk-1 pcmk-2 pcmk-4 ]
     * ClusterIP	(ocf:heartbeat:IPaddr2):	 Stopped
 
 Transition Summary:
@@ -24,4 +27,7 @@ Revised Cluster Status:
   * Full List of Resources:
     * Clone Set: dlm-clone [dlm]:
       * Stopped: [ pcmk-1 pcmk-2 pcmk-3 pcmk-4 ]
+    * Clone Set: clvm-clone [clvm]:
+      * clvm	(lsb:clvmd):	 FAILED pcmk-3 (UNCLEAN, blocked)
+      * Stopped: [ pcmk-1 pcmk-2 pcmk-4 ]
     * ClusterIP	(ocf:heartbeat:IPaddr2):	 Stopped
diff --git a/cts/scheduler/summary/stop-failure-no-quorum.summary b/cts/scheduler/summary/stop-failure-no-quorum.summary
index e76827ddfc2..7cc473e00b9 100644
--- a/cts/scheduler/summary/stop-failure-no-quorum.summary
+++ b/cts/scheduler/summary/stop-failure-no-quorum.summary
@@ -13,7 +13,7 @@ Current cluster status:
     * Clone Set: clvm-clone [clvm]:
       * clvm	(lsb:clvmd):	 FAILED pcmk-2
       * clvm	(lsb:clvmd):	 FAILED pcmk-3 (UNCLEAN, blocked)
-      * Stopped: [ pcmk-1 pcmk-3 pcmk-4 ]
+      * Stopped: [ pcmk-1 pcmk-4 ]
     * ClusterIP	(ocf:heartbeat:IPaddr2):	 Stopped
     * Fencing	(stonith:fence_xvm):	 Stopped
 
@@ -41,5 +41,8 @@ Revised Cluster Status:
   * Full List of Resources:
     * Clone Set: dlm-clone [dlm]:
       * Stopped: [ pcmk-1 pcmk-2 pcmk-3 pcmk-4 ]
+    * Clone Set: clvm-clone [clvm]:
+      * clvm	(lsb:clvmd):	 FAILED pcmk-3 (UNCLEAN, blocked)
+      * Stopped: [ pcmk-1 pcmk-2 pcmk-4 ]
     * ClusterIP	(ocf:heartbeat:IPaddr2):	 Stopped
     * Fencing	(stonith:fence_xvm):	 Stopped
diff --git a/cts/scheduler/summary/unmanaged-promoted.summary b/cts/scheduler/summary/unmanaged-promoted.summary
index a617e07342c..69392398494 100644
--- a/cts/scheduler/summary/unmanaged-promoted.summary
+++ b/cts/scheduler/summary/unmanaged-promoted.summary
@@ -9,7 +9,6 @@ Current cluster status:
       * FencingChild	(stonith:fence_xvm):	 Started pcmk-4 (unmanaged)
       * FencingChild	(stonith:fence_xvm):	 Started pcmk-2 (unmanaged)
       * FencingChild	(stonith:fence_xvm):	 Started pcmk-1 (unmanaged)
-      * Stopped: [ pcmk-3 pcmk-4 ]
     * Resource Group: group-1 (unmanaged):
       * r192.168.122.126	(ocf:heartbeat:IPaddr):	 Started pcmk-2 (unmanaged)
       * r192.168.122.127	(ocf:heartbeat:IPaddr):	 Started pcmk-2 (unmanaged)
@@ -25,13 +24,11 @@ Current cluster status:
       * ping-1	(ocf:pacemaker:ping):	 Started pcmk-4 (unmanaged)
       * ping-1	(ocf:pacemaker:ping):	 Started pcmk-2 (unmanaged)
       * ping-1	(ocf:pacemaker:ping):	 Started pcmk-1 (unmanaged)
-      * Stopped: [ pcmk-3 pcmk-4 ]
     * Clone Set: master-1 [stateful-1] (promotable, unmanaged):
       * stateful-1	(ocf:pacemaker:Stateful):	 Unpromoted pcmk-3 (unmanaged)
       * stateful-1	(ocf:pacemaker:Stateful):	 Unpromoted pcmk-4 (unmanaged)
       * stateful-1	(ocf:pacemaker:Stateful):	 Promoted pcmk-2 (unmanaged)
       * stateful-1	(ocf:pacemaker:Stateful):	 Unpromoted pcmk-1 (unmanaged)
-      * Stopped: [ pcmk-3 pcmk-4 ]
 
 Transition Summary:
 
@@ -50,7 +47,6 @@ Revised Cluster Status:
       * FencingChild	(stonith:fence_xvm):	 Started pcmk-4 (unmanaged)
       * FencingChild	(stonith:fence_xvm):	 Started pcmk-2 (unmanaged)
       * FencingChild	(stonith:fence_xvm):	 Started pcmk-1 (unmanaged)
-      * Stopped: [ pcmk-3 pcmk-4 ]
     * Resource Group: group-1 (unmanaged):
       * r192.168.122.126	(ocf:heartbeat:IPaddr):	 Started pcmk-2 (unmanaged)
       * r192.168.122.127	(ocf:heartbeat:IPaddr):	 Started pcmk-2 (unmanaged)
@@ -66,10 +62,8 @@ Revised Cluster Status:
       * ping-1	(ocf:pacemaker:ping):	 Started pcmk-4 (unmanaged)
       * ping-1	(ocf:pacemaker:ping):	 Started pcmk-2 (unmanaged)
       * ping-1	(ocf:pacemaker:ping):	 Started pcmk-1 (unmanaged)
-      * Stopped: [ pcmk-3 pcmk-4 ]
     * Clone Set: master-1 [stateful-1] (promotable, unmanaged):
       * stateful-1	(ocf:pacemaker:Stateful):	 Unpromoted pcmk-3 (unmanaged)
       * stateful-1	(ocf:pacemaker:Stateful):	 Unpromoted pcmk-4 (unmanaged)
       * stateful-1	(ocf:pacemaker:Stateful):	 Promoted pcmk-2 (unmanaged)
       * stateful-1	(ocf:pacemaker:Stateful):	 Unpromoted pcmk-1 (unmanaged)
-      * Stopped: [ pcmk-3 pcmk-4 ]
