Commit cca7e029 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Add isAlive() and expectAlive() to functional test framework.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1740 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent a139a328
......@@ -135,6 +135,9 @@ class NEOProcess:
self.uuid = uuid
self.arg_dict['--uuid'] = dump(uuid)
def isAlive(self):
return os.path.exists('/proc/%d' % self.pid)
class NEOCluster(object):
......@@ -465,6 +468,12 @@ class NEOCluster(object):
def expectClusterRunning(self, timeout=0, delay=1):
self.expectClusterState(ClusterStates.RUNNING)
def expectAlive(self, process, timeout=0, delay=1):
def callback(last_try):
current_try = process.isAlive()
return current_try, current_try
self.expectCondition(callback, timeout, delay)
def __del__(self):
if self.cleanup_on_delete:
os.removedirs(self.temp_dir)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment