Blob Blame History Raw
From 48246b5916745a56cb0ceb7b4e148b9e587708fe Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Wed, 23 Dec 2015 14:36:51 -0600
Subject: [PATCH 103/105] Test: cts: simulate pacemaker_remote failure with
 kill

Previously, failure was simulated by stopping pacemaker_remote, but
that will eventually cause a graceful stop rather than a failure,
so first kill the process.

rebased commit to 1.1.14-rc5
---
 cts/CTStests.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/cts/CTStests.py b/cts/CTStests.py
index e6f3abe..fb1c5f2 100644
--- a/cts/CTStests.py
+++ b/cts/CTStests.py
@@ -2764,6 +2764,14 @@ class RemoteDriver(CTSTest):
                 self.pcmk_started = 1
                 break
 
+    def kill_pcmk_remote(self, node):
+        """ Simulate a Pacemaker Remote daemon failure. """
+
+        # We kill the process to prevent a graceful stop,
+        # then stop it to prevent the OS from restarting it.
+        self.rsh(node, "killall -9 pacemaker_remoted")
+        self.stop_pcmk_remote(node)
+
     def start_metal(self, node):
         pcmk_started = 0
 
@@ -2855,7 +2863,7 @@ class RemoteDriver(CTSTest):
 
         # force stop the pcmk remote daemon. this will result in fencing
         self.debug("Force stopped active remote node")
-        self.stop_pcmk_remote(node)
+        self.kill_pcmk_remote(node)
 
         self.debug("Waiting for remote node to be fenced.")
         self.set_timer("remoteMetalFence")
-- 
1.8.3.1