[Debian-ha-commits] [pacemaker] 04/05: Medium: CTS: Fix the startup patterns

Christoph Berg myon at debian.org
Mon Jan 4 22:02:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

myon pushed a commit to tag Pacemaker-0.6.1
in repository pacemaker.

commit 4c1c1d9ffcf12cddc05ba01421ad585dcfd608fc
Author: Andrew Beekhof <andrew at beekhof.net>
Date:   Mon Feb 11 14:51:14 2008 +0100

    Medium: CTS: Fix the startup patterns
    
    Mercurial revision: 497f3a59ca92246ca9d10f7668ce8029421a69fa
---
 cts/CM_LinuxHAv2.py.in | 15 +++++++++------
 cts/CM_fs.py.in        |  4 ++--
 cts/CM_hb.py.in        |  4 ++--
 cts/CTS.py.in          |  9 +++++----
 cts/CTStests.py.in     | 24 ++++++++++++++----------
 5 files changed, 32 insertions(+), 24 deletions(-)

diff --git a/cts/CM_LinuxHAv2.py.in b/cts/CM_LinuxHAv2.py.in
index f2febda..d29e2b7 100755
--- a/cts/CM_LinuxHAv2.py.in
+++ b/cts/CM_LinuxHAv2.py.in
@@ -91,9 +91,9 @@ class LinuxHAv2(HeartbeatCM):
             "Pat:DC_IDLE"      : "crmd.*State transition.*-> S_IDLE",
             
             # This wont work if we have multiple partitions
-            # Use: "Pat:They_started" : "%s crmd:.*State transition.*-> S_NOT_DC",
-            "Pat:They_started" : "Updating node state to member for %s",
-            "Pat:We_started"   : "%s crmd:.* State transition.*-> S_IDLE",
+            "Pat:Local_started" : "%s crmd:.*The local CRM is operational",
+            "Pat:Slave_started" : "%s crmd:.*State transition.*-> S_NOT_DC",
+            "Pat:Master_started"   : "%s crmd:.* State transition.*-> S_IDLE",
             "Pat:We_stopped"   : "heartbeat.*%s.*Heartbeat shutdown complete",
             "Pat:Logd_stopped" : "%s logd:.*Exiting write process",
             "Pat:They_stopped" : "%s crmd:.*LOST:.* %s ",
@@ -152,7 +152,7 @@ class LinuxHAv2(HeartbeatCM):
                 "ERROR: Message hist queue is filling up",
                 "stonithd: .*CRIT: external_hostlist: 'vmware gethosts' returned an empty hostlist",
                 "stonithd: .*ERROR: Could not list nodes for stonith RA external/vmware.",
-
+                "pengine: Preventing .* from re-starting",
                 ]
         return []
 
@@ -204,7 +204,7 @@ class LinuxHAv2(HeartbeatCM):
 
         watchpats = [ ]
         watchpats.append("Current ping state: (S_IDLE|S_NOT_DC)")
-        watchpats.append(self["Pat:They_started"]%node)
+        watchpats.append(self["Pat:Slave_started"]%node)
         idle_watch = CTS.LogWatcher(self["LogFileName"], watchpats)
         idle_watch.setwatch()
 
@@ -264,6 +264,7 @@ class LinuxHAv2(HeartbeatCM):
         watchpats = [ ]
         watchpats.append("Current ping state: S_IDLE")
         watchpats.append(self["Pat:DC_IDLE"])
+        self.debug("Waiting for cluster stability...") 
 
         if timeout == None:
             timeout = self["DeadTime"]
@@ -536,7 +537,9 @@ class LinuxHAv2(HeartbeatCM):
 #                    "Scheduling Node .* for STONITH",
 #                    "Executing .* fencing operation",
 #                    "tengine_stonith_callback: .*result=0",
-                    "State transition S_.* -> S_INTEGRATION.*input=I_NODE_JOIN",
+                    "A new node joined the cluster",
+#                    "Processing I_NODE_JOIN:.* cause=C_HA_MESSAGE",
+#                    "State transition S_.* -> S_INTEGRATION.*input=I_NODE_JOIN",
                     "State transition S_STARTING -> S_PENDING",
                     ], [], common_ignore, self.fastfail, self)
 
diff --git a/cts/CM_fs.py.in b/cts/CM_fs.py.in
index 328863a..26dc83d 100644
--- a/cts/CM_fs.py.in
+++ b/cts/CM_fs.py.in
@@ -54,8 +54,8 @@ class FailSafeCM(ClusterManager):
             "TestConfigDir"    : None, # Fix me!
             "LogFileName"      : None, # Fix me!
 
-            "Pat:We_started"   : None, # Fix me!
-            "Pat:They_started" : None, # Fix me!
+            "Pat:Master_started"   : None, # Fix me!
+            "Pat:Slave_started" : None, # Fix me!
             "Pat:We_stopped"   : None, # Fix me!
             "Pat:They_stopped" : None, # Fix me!
 
diff --git a/cts/CM_hb.py.in b/cts/CM_hb.py.in
index 2a4929f..5fc8d6e 100755
--- a/cts/CM_hb.py.in
+++ b/cts/CM_hb.py.in
@@ -71,8 +71,8 @@ class HeartbeatCM(ClusterManager):
             "LogFileName"    : Environment["LogFileName"],
 
             # Patterns to look for in the log files for various occasions...
-            "Pat:We_started"       : " (%s) .* Initial resource acquisition complete",
-            "Pat:They_started"     : " (%s) .* Initial resource acquisition complete",
+            "Pat:Master_started"       : " (%s) .* Initial resource acquisition complete",
+            "Pat:Slave_started"     : " (%s) .* Initial resource acquisition complete",
             "Pat:We_stopped"       : "%s heartbeat.*Heartbeat shutdown complete",
             "Pat:Logd_stopped"     : "%s logd:.*Exiting write process",
             "Pat:They_stopped"     : "%s heartbeat.*node (%s).*: is dead",
diff --git a/cts/CTS.py.in b/cts/CTS.py.in
index 85197b6..b132627 100755
--- a/cts/CTS.py.in
+++ b/cts/CTS.py.in
@@ -451,8 +451,8 @@ class ClusterManager(UserDict):
             "TestConfigDir"  : None,
             "LogFileName"    : None,
 
-            "Pat:We_started"   : None,
-            "Pat:They_started" : None,
+            "Pat:Master_started"   : None,
+            "Pat:Slave_started" : None,
             "Pat:We_stopped"   : None,
             "Pat:They_stopped" : None,
 
@@ -525,10 +525,11 @@ class ClusterManager(UserDict):
 
         patterns = []
         # Technically we should always be able to notice ourselves starting
+        patterns.append(self["Pat:Local_started"] % node)
         if self.upcount() == 0:
-            patterns.append(self["Pat:We_started"] % node)
+            patterns.append(self["Pat:Master_started"] % node)
         else:
-            patterns.append(self["Pat:They_started"] % node)
+            patterns.append(self["Pat:Slave_started"] % node)
 
         watch = LogWatcher(
             self["LogFileName"], patterns, timeout=self["StartTime"]+10)
diff --git a/cts/CTStests.py.in b/cts/CTStests.py.in
index 4dddfc0..c79801d 100644
--- a/cts/CTStests.py.in
+++ b/cts/CTStests.py.in
@@ -321,8 +321,6 @@ class StopTest(CTSTest):
     def __init__(self, cm):
         CTSTest.__init__(self, cm)
         self.name="Stop"
-        self.uspat   = self.CM["Pat:We_stopped"]
-        self.thempat = self.CM["Pat:They_stopped"]
 
     def __call__(self, node):
         '''Perform the 'stop' test. '''
@@ -396,8 +394,6 @@ class StartTest(CTSTest):
         CTSTest.__init__(self,cm)
         self.name="start"
         self.debug = debug
-        self.uspat   = self.CM["Pat:We_started"]
-        self.thempat = self.CM["Pat:They_started"]
 
     def __call__(self, node):
         '''Perform the 'start' test. '''
@@ -510,8 +506,8 @@ class StonithTest(CTSTest):
         self.name="Stonith"
         self.theystopped  = self.CM["Pat:They_dead"]
         self.allstopped   = self.CM["Pat:All_stopped"]
-        self.usstart      = self.CM["Pat:We_started"]
-        self.themstart    = self.CM["Pat:They_started"]
+        self.usstart      = self.CM["Pat:Master_started"]
+        self.themstart    = self.CM["Pat:Slave_started"]
         self.timeout      = timeout
         self.ssherror     = False
     
@@ -1601,7 +1597,7 @@ class Split_brainTest(CTSTest):
         watchpartitionpats = [ ]
         partitionpat = self.CM["Pat:Return_partition"]
         watchstartpats = [ ]
-        startpat = self.CM["Pat:We_started"]
+        startpat = self.CM["Pat:Master_started"]
 
         for member in self.CM.Env["nodes"]:
             thispat = (partitionpat % member)
@@ -1783,7 +1779,8 @@ class ComponentFail(CTSTest):
           for other in self.CM.Env["nodes"]:
               if other != node:
                   self.patterns.append(self.CM["Pat:They_stopped"] %(other, node))
-          self.patterns.append(self.CM["Pat:They_started"] % node)
+          self.patterns.append(self.CM["Pat:Slave_started"] % node)
+          self.patterns.append(self.CM["Pat:Local_started"] % node)
 
         # In an ideal world, this next stuff should be in the "chosen" object as a member function
         if chosen.dc_only:
@@ -2205,7 +2202,8 @@ class NearQuorumPointTest(CTSTest):
                 
         for node in startset:
             if self.CM.ShouldBeStatus[node] == self.CM["down"]:
-                watchpats.append(self.CM["Pat:They_started"] % node)
+                #watchpats.append(self.CM["Pat:Slave_started"] % node)
+                watchpats.append(self.CM["Pat:Local_started"] % node)
                 
         if len(watchpats) == 0:
             return self.skipped()
@@ -2434,13 +2432,19 @@ class SimulStartLite(CTSTest):
         #        We ignore the "node" parameter...
         watchpats = [ ]
 
+        uppat = self.CM["Pat:Slave_started"]
+        if self.CM.upcount() == 0:
+            uppat = self.CM["Pat:Local_started"]
+
         for node in self.CM.Env["nodes"]:
             if self.CM.ShouldBeStatus[node] == self.CM["down"]:
                 self.incr("WasStopped")
-                watchpats.append(self.CM["Pat:They_started"] % node)
+                watchpats.append(uppat % node)
         
         if len(watchpats) == 0:
             return self.skipped()
+
+        watchpats.append(self.CM["Pat:DC_IDLE"])
         
         #        Start all the nodes - at about the same time...
         watch = CTS.LogWatcher(self.CM["LogFileName"], watchpats

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/pacemaker.git



More information about the Debian-HA-Commits mailing list