[Neo-report] r2089 gregory - /trunk/neo/tests/functional/testStorage.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri May 7 16:49:54 CEST 2010
Author: gregory
Date: Fri May 7 16:49:53 2010
New Revision: 2089
Log:
Add a test for the recovery step.
Add some XXX where the cluster is stopped without wait for the storages
to process the pending requests (eg. outdate cells of a just-down node).
Modified:
trunk/neo/tests/functional/testStorage.py
Modified: trunk/neo/tests/functional/testStorage.py
==============================================================================
--- trunk/neo/tests/functional/testStorage.py [iso-8859-1] (original)
+++ trunk/neo/tests/functional/testStorage.py [iso-8859-1] Fri May 7 16:49:53 2010
@@ -485,14 +485,48 @@
self.__expectRunning(started[1])
self.neo.expectOudatedCells(number=0)
self.neo.expectClusterRunning()
+ # XXX: need to sync with storages first
+ self.neo.stop()
# restart it with one storage only
+ self.neo.start(except_storages=(started[1], ))
+ self.__expectRunning(started[0])
+ self.__expectUnknown(started[1])
+ self.neo.expectClusterRunning()
+
+ def testRecoveryWithMultiplePT(self):
+ # start a cluster with 2 storages and a replica
+ (started, stopped) = self.__setup(storage_number=2, replicas=1,
+ pending_number=0, partitions=10)
+ self.__expectRunning(started[0])
+ self.__expectRunning(started[1])
+ self.neo.expectOudatedCells(number=0)
+ self.neo.expectClusterRunning()
+
+ # drop the first then the second storage
+ started[0].stop()
+ self.__expectUnavailable(started[0])
+ self.__expectRunning(started[1])
+ self.neo.expectOudatedCells(number=10)
+ started[1].stop()
+ self.__expectUnavailable(started[0])
+ self.__expectUnavailable(started[1])
+ self.neo.expectOudatedCells(number=10)
+ self.neo.expectClusterVeryfing()
+ # XXX: need to sync with storages first
self.neo.stop()
- self.neo.start(except_storages=(started[1], ))
+
+ # restart the cluster with the first storage killed
+ self.neo.run(except_storages=[started[1]])
self.__expectRunning(started[0])
self.__expectUnknown(started[1])
- self.neo.expectClusterRunning()
-
+ self.neo.expectClusterRecovering()
+ self.neo.expectOudatedCells(number=0)
+ started[1].start()
+ self.__expectRunning(started[0])
+ self.__expectRunning(started[1])
+ self.neo.expectClusterRecovering()
+ self.neo.expectOudatedCells(number=10)
if __name__ == "__main__":
unittest.main()
More information about the Neo-report
mailing list