[Zodb-checkins] CVS: ZEO/ZEO/tests - Cache.py:1.4.4.1.2.1 __init__.py:1.2.8.1 forker.py:1.10.4.4.2.1 multi.py:1.4.4.1.2.1 speed.py:1.5.4.1.2.1 stress.py:1.2.4.2.2.1 testTransactionBuffer.py:1.3.2.1.2.1 testZEO.py:1.16.4.4.2.1 winserver.py:1.2.6.1.2.1
Jeremy Hylton
jeremy@zope.com
Thu, 25 Apr 2002 16:19:56 -0400
Update of /cvs-repository/ZEO/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv5401/ZEO/tests
Modified Files:
Tag: ZEO2-branch
Cache.py __init__.py forker.py multi.py speed.py stress.py
testTransactionBuffer.py testZEO.py winserver.py
Log Message:
Merge the Standby-branch into the ZEO2-branch.
The Standby-branch is history.
=== ZEO/ZEO/tests/Cache.py 1.4.4.1 => 1.4.4.1.2.1 ===
+##############################################################################
#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
# This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL). A copy of the ZPL should accompany this
-# distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
-# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST
-# INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
-
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
"""Tests of the ZEO cache"""
from ZODB.Transaction import Transaction
@@ -34,16 +38,17 @@
return
# Now start an undo transaction
- self._transaction.note('undo1')
- self._storage.tpc_begin(self._transaction)
+ t = Transaction()
+ t.note('undo1')
+ self._storage.tpc_begin(t)
- oids = self._storage.transactionalUndo(tid, self._transaction)
+ oids = self._storage.transactionalUndo(tid, t)
# Make sure this doesn't load invalid data into the cache
self._storage.load(oid, '')
-
- self._storage.tpc_vote(self._transaction)
- self._storage.tpc_finish(self._transaction)
+
+ self._storage.tpc_vote(t)
+ self._storage.tpc_finish(t)
assert len(oids) == 1
assert oids[0] == oid
=== ZEO/ZEO/tests/__init__.py 1.2 => 1.2.8.1 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
=== ZEO/ZEO/tests/forker.py 1.10.4.4 => 1.10.4.4.2.1 ===
+##############################################################################
#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
# This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL). A copy of the ZPL should accompany this
-# distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
-# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST
-# INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
-
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
"""Library for forking storage server and connecting client storage"""
import asyncore
@@ -60,7 +64,7 @@
args = (sys.executable, script, str(port), storage_name) + args
d = os.environ.copy()
d['PYTHONPATH'] = os.pathsep.join(sys.path)
- pid = os.spawnve(os.P_NOWAIT, sys.executable, args, os.environ)
+ pid = os.spawnve(os.P_NOWAIT, sys.executable, args, d)
return ('localhost', port), ('localhost', port + 1), pid
else:
@@ -97,7 +101,8 @@
except os.error:
pass
- def start_zeo_server(storage, addr):
+ def start_zeo_server(storage_name, args, addr):
+ assert isinstance(args, types.TupleType)
rd, wr = os.pipe()
pid = os.fork()
if pid == 0:
@@ -110,7 +115,7 @@
globals(), locals())
p.close()
else:
- run_server(storage, addr, rd, wr)
+ run_server(addr, rd, wr, storage_name, args)
except:
print "Exception in ZEO server process"
traceback.print_exc()
@@ -119,20 +124,27 @@
os.close(rd)
return pid, ZEOClientExit(wr)
- def run_server(storage, addr, rd, wr):
+ def load_storage(name, args):
+ package = __import__("ZODB." + name)
+ mod = getattr(package, name)
+ klass = getattr(mod, name)
+ return klass(*args)
+
+ def run_server(addr, rd, wr, storage_name, args):
# in the child, run the storage server
global server
os.close(wr)
ZEOServerExit(rd)
import ZEO.StorageServer, ZEO.zrpc.server
+ storage = load_storage(storage_name, args)
server = ZEO.StorageServer.StorageServer(addr, {'1':storage})
ZEO.zrpc.server.loop()
storage.close()
if isinstance(addr, types.StringType):
os.unlink(addr)
- def start_zeo(storage, cache=None, cleanup=None, domain="AF_INET",
- storage_id="1", cache_size=20000000):
+ def start_zeo(storage_name, args, cache=None, cleanup=None,
+ domain="AF_INET", storage_id="1", cache_size=20000000):
"""Setup ZEO client-server for storage.
Returns a ClientStorage instance and a ZEOClientExit instance.
@@ -148,11 +160,10 @@
else:
raise ValueError, "bad domain: %s" % domain
- pid, exit = start_zeo_server(storage, addr)
+ pid, exit = start_zeo_server(storage_name, args, addr)
s = ZEO.ClientStorage.ClientStorage(addr, storage_id,
debug=1, client=cache,
cache_size=cache_size,
min_disconnect_poll=0.5,
wait_for_server_on_startup=1)
return s, exit, pid
-
=== ZEO/ZEO/tests/multi.py 1.4.4.1 => 1.4.4.1.2.1 ===
+##############################################################################
#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
# This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL). A copy of the ZPL should accompany this
-# distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
-# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST
-# INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
-
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
"""A multi-client test of the ZEO storage server"""
import ZODB, ZODB.DB, ZODB.FileStorage, ZODB.POSException
@@ -65,16 +69,18 @@
def start_client(addr, client_func=None):
pid = os.fork()
if pid == 0:
- import ZEO.ClientStorage
- if VERBOSE:
- print "Client process started:", os.getpid()
- cli = ZEO.ClientStorage.ClientStorage(addr, client=CLIENT_CACHE)
- if client_func is None:
- run(cli)
- else:
- client_func(cli)
- cli.close()
- os._exit(0)
+ try:
+ import ZEO.ClientStorage
+ if VERBOSE:
+ print "Client process started:", os.getpid()
+ cli = ZEO.ClientStorage.ClientStorage(addr, client=CLIENT_CACHE)
+ if client_func is None:
+ run(cli)
+ else:
+ client_func(cli)
+ cli.close()
+ finally:
+ os._exit(0)
else:
return pid
=== ZEO/ZEO/tests/speed.py 1.5.4.1 => 1.5.4.1.2.1 ===
+##############################################################################
#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
# This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL). A copy of the ZPL should accompany this
-# distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
-# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST
-# INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
-
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
usage="""Test speed of a ZODB storage
Options:
@@ -37,7 +41,7 @@
-t n Number of concurrent threads to run.
"""
-import asyncore
+import asyncore
import sys, os, getopt, string, time
##sys.path.insert(0, os.getcwd())
@@ -77,7 +81,7 @@
for r in 1, 10, 100, 1000:
t = time.time()
conflicts = 0
-
+
jar = db.open()
while 1:
try:
@@ -101,7 +105,7 @@
else:
break
jar.close()
-
+
t = time.time() - t
if detailed:
if threadno is None:
@@ -201,11 +205,11 @@
for v in l:
tot = tot + v
return tot / len(l)
-
+
##def compress(s):
## c = zlib.compressobj()
## o = c.compress(s)
-## return o + c.flush()
+## return o + c.flush()
if __name__=='__main__':
main(sys.argv[1:])
=== ZEO/ZEO/tests/stress.py 1.2.4.2 => 1.2.4.2.2.1 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
"""A ZEO client-server stress test to look for leaks.
The stress test should run in an infinite loop and should involve
@@ -90,7 +103,12 @@
pid = os.fork()
if pid != 0:
return pid
-
+ try:
+ _start_child(zaddr)
+ finally:
+ os._exit(0)
+
+def _start_child(zaddr):
storage = ClientStorage(zaddr, debug=1, min_disconnect_poll=0.5,
wait_for_server_on_startup=1)
db = ZODB.DB(storage, pool_size=NUM_CONNECTIONS)
@@ -116,8 +134,6 @@
else:
c.__count += 1
work(c)
-
- os._exit(0)
if __name__ == "__main__":
main()
=== ZEO/ZEO/tests/testTransactionBuffer.py 1.3.2.1 => 1.3.2.1.2.1 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
import random
import unittest
@@ -46,7 +59,7 @@
# the tbuf add a dummy None to invalidates
x = x[:2]
self.assertEqual(x, data[i])
-
+
def checkOrderPreserved(self):
tbuf = TransactionBuffer()
self.doUpdates(tbuf)
@@ -61,4 +74,3 @@
def test_suite():
return unittest.makeSuite(TransBufTests, 'check')
-
=== ZEO/ZEO/tests/testZEO.py 1.16.4.4 => 1.16.4.4.2.1 ===
+##############################################################################
#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
# This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL). A copy of the ZPL should accompany this
-# distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
-# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST
-# INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
-
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
"""Test suite for ZEO based on ZODB.tests"""
import asyncore
@@ -53,83 +57,11 @@
def pack(self, t, f):
self.storage.pack(t, f, wait=1)
-class ZEOTestBase(StorageTestBase.StorageTestBase):
- """Version of the storage test class that supports ZEO.
-
- For ZEO, we don't always get the serialno/exception for a
- particular store as the return value from the store. But we
- will get no later than the return value from vote.
- """
-
- def _dostore(self, oid=None, revid=None, data=None, version=None,
- already_pickled=0):
- """Do a complete storage transaction.
-
- The defaults are:
- - oid=None, ask the storage for a new oid
- - revid=None, use a revid of ZERO
- - data=None, pickle up some arbitrary data (the integer 7)
- - version=None, use the empty string version
-
- Returns the object's new revision id.
- """
- if oid is None:
- oid = self._storage.new_oid()
- if revid is None:
- revid = ZERO
- if data is None:
- data = MinPO(7)
- if not already_pickled:
- data = StorageTestBase.zodb_pickle(data)
- if version is None:
- version = ''
- # Begin the transaction
- self._storage.tpc_begin(self._transaction)
- # Store an object
- r1 = self._storage.store(oid, revid, data, version,
- self._transaction)
- s1 = self._get_serial(r1)
- # Finish the transaction
- r2 = self._storage.tpc_vote(self._transaction)
- s2 = self._get_serial(r2)
- self._storage.tpc_finish(self._transaction)
- # s1, s2 can be None or dict
- assert not (s1 and s2)
- return s1 and s1[oid] or s2 and s2[oid]
-
- def _get_serial(self, r):
- """Return oid -> serialno dict from sequence of ZEO replies."""
- d = {}
- if r is None:
- return None
- if type(r) == types.StringType:
- raise RuntimeError, "unexpected ZEO response: no oid"
- else:
- for oid, serial in r:
- if isinstance(serial, Exception):
- raise serial
- d[oid] = serial
- return d
-
-# Some of the ZEO tests depend on the version of FileStorage available
-# for the tests. If we run these tests using Zope 2.3, FileStorage
-# doesn't support TransactionalUndo.
-
-if hasattr(FileStorage, 'supportsTransactionalUndo'):
- # XXX Assume that a FileStorage that supports transactional undo
- # also supports conflict resolution.
- class VersionDependentTests(
- TransactionalUndoStorage.TransactionalUndoStorage,
- TransactionalUndoVersionStorage.TransactionalUndoVersionStorage,
- ConflictResolution.ConflictResolvingStorage,
- ConflictResolution.ConflictResolvingTransUndoStorage):
- pass
-else:
- class VersionDependentTests:
- pass
-
-class GenericTests(ZEOTestBase,
- VersionDependentTests,
+class GenericTests(StorageTestBase.StorageTestBase,
+ TransactionalUndoStorage.TransactionalUndoStorage,
+ TransactionalUndoVersionStorage.TransactionalUndoVersionStorage,
+ ConflictResolution.ConflictResolvingStorage,
+ ConflictResolution.ConflictResolvingTransUndoStorage,
Cache.StorageWithCache,
Cache.TransUndoStorageWithCache,
BasicStorage.BasicStorage,
@@ -148,14 +80,10 @@
returns a specific storage, e.g. FileStorage.
"""
- __super_setUp = StorageTestBase.StorageTestBase.setUp
- __super_tearDown = StorageTestBase.StorageTestBase.tearDown
-
def setUp(self):
- self.__super_setUp()
- zLOG.LOG("testZEO", zLOG.BLATHER, "setUp() new test")
+ zLOG.LOG("testZEO", zLOG.INFO, "setUp() %s" % self.id())
self.running = 1
- client, exit, pid = forker.start_zeo(self.getStorage())
+ client, exit, pid = forker.start_zeo(*self.getStorage())
self._pids = [pid]
self._servers = [exit]
self._storage = PackWaitWrapper(client)
@@ -169,7 +97,6 @@
for pid in self._pids:
os.waitpid(pid, 0)
self.delStorage()
- self.__super_tearDown()
def checkLargeUpdate(self):
obj = MinPO("X" * (10 * 128 * 1024))
@@ -177,7 +104,7 @@
class ZEOFileStorageTests(GenericTests):
__super_setUp = GenericTests.setUp
-
+
def setUp(self):
self.__fs_base = tempfile.mktemp()
self.__super_setUp()
@@ -185,7 +112,7 @@
def open(self, read_only=0):
# XXX Needed to support ReadOnlyStorage tests. Ought to be a
# cleaner way.
-
+
# Is this the only way to get the address?
addr = self._storage._rpc_mgr.addr[0][1]
self._storage.close()
@@ -193,11 +120,12 @@
wait_for_server_on_startup=1)
def getStorage(self):
- return FileStorage(self.__fs_base, create=1)
+ self.__fs_base = tempfile.mktemp()
+ return 'FileStorage', (self.__fs_base, '1')
def delStorage(self):
# file storage appears to create four files
- for ext in '', '.index', '.lock', '.tmp':
+ for ext in '', '.index', '.lock', '.tmp', '.old':
path = self.__fs_base + ext
try:
os.remove(path)
@@ -211,11 +139,8 @@
can't be created in the parent process and passed to the child.
All the work has to be done in the server's process.
"""
- __super_setUp = StorageTestBase.StorageTestBase.setUp
- __super_tearDown = StorageTestBase.StorageTestBase.tearDown
def setUp(self):
- self.__super_setUp()
args = self.getStorageInfo()
name = args[0]
args = args[1:]
@@ -234,13 +159,12 @@
# the connection should cause the storage server to die
time.sleep(0.5)
self.delStorage()
- self.__super_tearDown()
class WindowsZEOFileStorageTests(WindowsGenericTests):
def getStorageInfo(self):
self.__fs_base = tempfile.mktemp()
- return 'FileStorage', self.__fs_base, '1'
+ return 'FileStorage', (self.__fs_base, '1') # create=1
def delStorage(self):
# file storage appears to create four files
@@ -251,13 +175,13 @@
except os.error:
pass
-class ConnectionTests(ZEOTestBase):
+class ConnectionTests(StorageTestBase.StorageTestBase):
"""Tests that explicitly manage the server process.
To test the cache or re-connection, these test cases explicit
start and stop a ZEO storage server.
"""
-
+
__super_tearDown = StorageTestBase.StorageTestBase.tearDown
ports = []
@@ -302,14 +226,14 @@
def checkMultipleServers(self):
# XXX crude test at first -- just start two servers and do a
# commit at each one.
-
+
self._newAddr()
self._storage = self.openClientStorage('test', 100000, wait=1)
self._dostore()
self.shutdownServer(index=0)
self._startServer(index=1)
-
+
# If we can still store after shutting down one of the
# servers, we must be reconnecting to the other server.
@@ -319,7 +243,7 @@
break
except Disconnected:
time.sleep(0.5)
-
+
def checkDisconnectionError(self):
# Make sure we get a Disconnected when we try to read an
@@ -352,7 +276,7 @@
# In this case, only one object fits in a cache file. When the
# cache files swap, the first object is effectively uncached.
-
+
self._storage = self.openClientStorage('test', 1000, wait=1)
oid1 = self._storage.new_oid()
obj1 = MinPO("1" * 500)
@@ -380,8 +304,12 @@
oid = self._storage.new_oid()
obj = MinPO(12)
revid1 = self._dostore(oid, data=obj)
+ zLOG.LOG("checkReconnection", zLOG.INFO,
+ "About to shutdown server")
self.shutdownServer()
self.running = 1
+ zLOG.LOG("checkReconnection", zLOG.INFO,
+ "About to restart server")
self._startServer(create=0)
oid = self._storage.new_oid()
obj = MinPO(12)
@@ -391,16 +319,19 @@
break
except (Disconnected, select.error, thread.error, socket.error), \
err:
+ zLOG.LOG("checkReconnection", zLOG.INFO,
+ "Error after server restart; retrying.",
+ error=sys.exc_info())
get_transaction().abort()
time.sleep(0.1) # XXX how long to sleep
# XXX This is a bloody pain. We're placing a heavy burden
# on users to catch a plethora of exceptions in order to
# write robust code. Need to think about implementing
# John Heintz's suggestion to make sure all exceptions
- # inherit from POSException.
+ # inherit from POSException.
+ zLOG.LOG("checkReconnection", zLOG.INFO, "finished")
class UnixConnectionTests(ConnectionTests):
- __super_setUp = StorageTestBase.StorageTestBase.setUp
def setUp(self):
"""Start a ZEO server using a Unix domain socket
@@ -415,7 +346,6 @@
self._servers = []
self._newAddr()
self._startServer()
- self.__super_setUp()
def _newAddr(self):
self.addr.append(self._getAddr())
@@ -424,9 +354,10 @@
return '', self.ports.pop()
def _startServer(self, create=1, index=0):
- fs = FileStorage("%s.%d" % (self.file, index), create=create)
+ path = "%s.%d" % (self.file, index)
addr = self.addr[index]
- pid, server = forker.start_zeo_server(fs, addr)
+ pid, server = forker.start_zeo_server('FileStorage',
+ (path, create), addr)
self._pids.append(pid)
self._servers.append(server)
@@ -450,14 +381,12 @@
pass
class WindowsConnectionTests(ConnectionTests):
- __super_setUp = StorageTestBase.StorageTestBase.setUp
# XXX these tests are now out-of-date
def setUp(self):
self.file = tempfile.mktemp()
self._startServer()
- self.__super_setUp()
def _startServer(self, create=1):
if create == 0:
@@ -490,7 +419,7 @@
def tearDown(self):
self.shutdownServer()
-
+ self._storage.close()
def get_methods(klass):
l = [klass]
@@ -538,7 +467,7 @@
if args:
print "Did not expect arguments. Got %s" % args
return 0
-
+
tests = makeTestSuite(name_of_test)
runner = unittest.TextTestRunner()
runner.run(tests)
=== ZEO/ZEO/tests/winserver.py 1.2.6.1 => 1.2.6.1.2.1 ===
+##############################################################################
#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
# This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL). A copy of the ZPL should accompany this
-# distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
-# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST
-# INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
-
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
"""Helper file used to launch ZEO server for Windows tests"""
import asyncore