Commit 01c63c90 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Add a test to check that a dropped node is weel removed from the storage nodes partition

table. This test fail for now, I'm working on a fix.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1257 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 523e0a0a
......@@ -479,6 +479,7 @@ class NEOFunctionalTest(unittest.TestCase):
temp_dir = os.environ.get('TEMP', None)
if temp_dir is None:
temp_dir = tempfile.mkdtemp(prefix='neo_')
print 'Using temp directory %r.' % (temp_dir, )
# build the full path based on test case and current test method
test_case_name = self.__class__.__name__
test_method_name = self._TestCase__testMethodName
......
......@@ -372,12 +372,39 @@ class StorageTests(NEOFunctionalTest):
self.__checkDatabase(self.neo.db_list[1])
def testStartWithManyPartitions(self):
""" Just tests that cluster can start with more than 1000 partitions.
1000, because currently there is an arbitrary packet split at
every 1000 partition when sending a partition table. """
self.__setup(storage_number=2, partitions=5000, master_node_count=1)
neoctl = self.neo.getNEOCTL()
# Just tests that cluster can start with more than 1000 partitions.
# 1000, because currently there is an arbitrary packet split at
# every 1000 partition when sending a partition table.
self.neo.expectClusterState(protocol.RUNNING_CLUSTER_STATE)
def testDropNodeThenRestartCluster(self):
""" Start a cluster with more than one storage, down one, shutdown the
cluster then restart it. The partition table recovered must not include
the dropped node """
# start with two storage / one replica
(started, stopped) = self.__setup(storage_number=2, replicas=1,
master_node_count=1)
self.__expectRunning(started[0])
self.__expectRunning(started[1])
# drop one
self.neo.neoctl.dropNode(started[0].getUUID())
self.__expectNotKnown(started[0])
self.__expectRunning(started[1])
# restart all nodes
self.neo.stop()
self.neo.start()
# the stopped node must start in pending state
self.__expectPending(started[0])
self.__expectRunning(started[1])
if __name__ == "__main__":
unittest.main()
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