diff --git a/python/pacemaker/_cts/tests/restartonebyone.py b/python/pacemaker/_cts/tests/restartonebyone.py index c6ddd2ffe7..30fe124388 100644 --- a/python/pacemaker/_cts/tests/restartonebyone.py +++ b/python/pacemaker/_cts/tests/restartonebyone.py @@ -1,41 +1,49 @@ -""" Test-specific classes for Pacemaker's Cluster Test Suite (CTS) -""" +""" Restart all nodes in order """ __all__ = ["RestartOnebyOne"] __copyright__ = "Copyright 2000-2023 the Pacemaker project contributors" __license__ = "GNU General Public License version 2 or later (GPLv2+) WITHOUT ANY WARRANTY" from pacemaker._cts.tests.ctstest import CTSTest from pacemaker._cts.tests.restarttest import RestartTest from pacemaker._cts.tests.simulstartlite import SimulStartLite class RestartOnebyOne(CTSTest): - '''Restart all the nodes in order''' + """ A concrete test that restarts all nodes in order """ + def __init__(self, cm): - CTSTest.__init__(self,cm) + """ Create a new RestartOnebyOne instance + + Arguments: + + cm -- A ClusterManager instance + """ + + CTSTest.__init__(self, cm) + self.name = "RestartOnebyOne" self._startall = SimulStartLite(cm) def __call__(self, dummy): - '''Perform the 'RestartOnebyOne' test. ''' - self.incr("calls") + """ Perform the test """ - # We ignore the "node" parameter... + self.incr("calls") - # Start up all the nodes... ret = self._startall(None) if not ret: return self.failure("Setup failed") did_fail = [] self.set_timer() self.restart = RestartTest(self._cm) + for node in self._env["nodes"]: if not self.restart(node): did_fail.append(node) if did_fail: return self.failure("Could not restart %d nodes: %s" % (len(did_fail), repr(did_fail))) + return self.success()