Commit 11d55e48 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Allow start a storage node without an UUID in functional test framework.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1668 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 600b81fb
...@@ -60,15 +60,19 @@ class NEOProcess: ...@@ -60,15 +60,19 @@ class NEOProcess:
def __init__(self, command, uuid, arg_dict): def __init__(self, command, uuid, arg_dict):
self.command = command self.command = command
self.arg_dict = arg_dict self.arg_dict = arg_dict
self.with_uuid = True
self.setUUID(uuid) self.setUUID(uuid)
def start(self): def start(self, with_uuid=True):
# Prevent starting when already forked and wait wasn't called. # Prevent starting when already forked and wait wasn't called.
if self.pid != 0: if self.pid != 0:
raise AlreadyRunning, 'Already running with PID %r' % (self.pid, ) raise AlreadyRunning, 'Already running with PID %r' % (self.pid, )
command = self.command command = self.command
args = [] args = []
self.with_uuid = with_uuid
for arg, param in self.arg_dict.iteritems(): for arg, param in self.arg_dict.iteritems():
if with_uuid is False and arg == '--uuid':
continue
args.append(arg) args.append(arg)
if param is not None: if param is not None:
args.append(str(param)) args.append(str(param))
...@@ -121,6 +125,7 @@ class NEOProcess: ...@@ -121,6 +125,7 @@ class NEOProcess:
self.wait() self.wait()
def getUUID(self): def getUUID(self):
assert self.with_uuid, 'UUID disabled on this process'
return self.uuid return self.uuid
def setUUID(self, uuid): def setUUID(self, uuid):
......
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