From cc1a3bed69f362a10a005a04531c60c9e20d7915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Wisniewski?= <gregory@nexedi.com> Date: Fri, 5 Mar 2010 21:24:21 +0000 Subject: [PATCH] Add (but disable) storage recovery tests. git-svn-id: https://svn.erp5.org/repos/neo/trunk@1905 71dcc9de-d417-0410-9af5-da40c76e7ee4 --- neo/tests/zodb/testRecovery.py | 53 ++++++++++++++++++++++++++++++++++ tools/runner | 1 + 2 files changed, 54 insertions(+) create mode 100644 neo/tests/zodb/testRecovery.py diff --git a/neo/tests/zodb/testRecovery.py b/neo/tests/zodb/testRecovery.py new file mode 100644 index 00000000..162dedb1 --- /dev/null +++ b/neo/tests/zodb/testRecovery.py @@ -0,0 +1,53 @@ +# +# Copyright (C) 2009-2010 Nexedi SA +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +import os +import unittest +import ZODB + +from ZODB.tests.RecoveryStorage import RecoveryStorage +from ZODB.tests.StorageTestBase import StorageTestBase + +from neo.tests.functional import NEOCluster +from neo.tests.zodb import ZODBTestCase + +class RecoveryTests(ZODBTestCase, StorageTestBase, RecoveryStorage): + + def setUp(self): + super(RecoveryTests, self).setUp() + dst_temp_dir = self.getTempDirectory() + '-dst' + if not os.path.exists(dst_temp_dir): + os.makedirs(dst_temp_dir) + self.neo_dst = NEOCluster(['test_neo1-dst'], + partitions=1, replicas=0, port_base=10000, + master_node_count=1, temp_dir=dst_temp_dir) + self.neo_dst.stop() + self.neo_dst.setupDB() + self.neo_dst.start() + self._dst = self.neo.getZODBStorage() + self._dst_db = ZODB.DB(self._dst) + + def tearDown(self): + super(RecoveryTests, self).tearDown() + self._dst_db.close() + self._dst.cleanup() + self.neo_dst.stop() + +if __name__ == "__main__": + suite = unittest.makeSuite(RecoveryTests, 'check') + unittest.main(defaultTest='suite') + diff --git a/tools/runner b/tools/runner index 08af691f..e3a4e9e4 100755 --- a/tools/runner +++ b/tools/runner @@ -80,6 +80,7 @@ ZODB_TEST_MODULES = [ ('neo.tests.zodb.testPersistent', 'check'), ('neo.tests.zodb.testReadOnly', 'check'), ('neo.tests.zodb.testRevision', 'check'), + #('neo.tests.zodb.testRecovery', 'check'), ('neo.tests.zodb.testSynchronization', 'check'), # ('neo.tests.zodb.testVersion', 'check'), ('neo.tests.zodb.testUndo', 'check'), -- 2.30.9