Commit 011b1d5c authored by Grégory Wisniewski's avatar Grégory Wisniewski

Minor fixed in functionnal tests:

- Clear the databases before the cluster is created (and storages started) to
avoid the latter load a false configuration.
- Ensure replication is done before drop a node in storage tests.
- Admin node take the first allocated port for consistency.


git-svn-id: https://svn.erp5.org/repos/neo/trunk@1300 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 9e863896
......@@ -156,7 +156,8 @@ class NEOCluster(object):
partitions=1, replicas=0, port_base=10000,
db_user='neo', db_password='neo',
db_super_user='root', db_super_password=None,
cleanup_on_delete=False, temp_dir=None):
cleanup_on_delete=False, temp_dir=None,
clear_databases=True):
self.cleanup_on_delete = cleanup_on_delete
self.uuid_set = set()
self.db_super_user = db_super_user
......@@ -164,17 +165,19 @@ class NEOCluster(object):
self.db_user = db_user
self.db_password = db_password
self.db_list = db_list
if clear_databases:
self.setupDB()
self.process_dict = {}
self.last_port = port_base
if temp_dir is None:
temp_dir = tempfile.mkdtemp(prefix='neo_')
print 'Using temp directory %r.' % (temp_dir, )
self.temp_dir = temp_dir
admin_port = self.__allocatePort()
self.cluster_name = 'neo_%s' % (random.randint(0, 100), )
master_node_list = [self.__allocatePort() for i in xrange(master_node_count)]
self.master_nodes = '/'.join('127.0.0.1:%s' % (x, ) for x in master_node_list)
# create admin node
admin_port = self.__allocatePort()
self.__newProcess(NEO_ADMIN, {
'--cluster': self.cluster_name,
'--name': 'admin',
......
......@@ -400,6 +400,7 @@ class StorageTests(NEOFunctionalTest):
master_node_count=1, partitions=10)
self.__expectRunning(started[0])
self.__expectRunning(started[1])
self.neo.expectOudatedCells(number=0)
# drop one
self.neo.neoctl.dropNode(started[0].getUUID())
......
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