[Zope-Checkins] CVS: ZODB3/ZEO/tests - ConnectionTests.py:1.14 forker.py:1.32 zeoserver.py:1.11

Jeremy Hylton jeremy@zope.com
Thu, 9 Jan 2003 18:57:23 -0500


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv14767/ZEO/tests

Modified Files:
	ConnectionTests.py forker.py zeoserver.py 
Log Message:
Add option to enable monitor server.


=== ZODB3/ZEO/tests/ConnectionTests.py 1.13 => 1.14 ===
--- ZODB3/ZEO/tests/ConnectionTests.py:1.13	Tue Jan  7 17:12:58 2003
+++ ZODB3/ZEO/tests/ConnectionTests.py	Thu Jan  9 18:57:21 2003
@@ -61,6 +61,7 @@
     keep = 0
     invq = None
     timeout = None
+    monitor = 0
 
     def setUp(self):
         """Test setup for connection tests.
@@ -132,7 +133,8 @@
         path = "%s.%d" % (self.file, index)
         conf = self.getConfig(path, create, read_only)
         zeoport, adminaddr, pid = forker.start_zeo_server(
-            conf, addr, ro_svr, self.keep, self.invq, self.timeout)
+            conf, addr, ro_svr,
+            self.monitor, self.keep, self.invq, self.timeout)
         self._pids.append(pid)
         self._servers.append(adminaddr)
 


=== ZODB3/ZEO/tests/forker.py 1.31 => 1.32 ===
--- ZODB3/ZEO/tests/forker.py:1.31	Tue Jan  7 17:12:58 2003
+++ ZODB3/ZEO/tests/forker.py	Thu Jan  9 18:57:21 2003
@@ -51,7 +51,7 @@
     raise RuntimeError, "Can't find port"
 
 
-def start_zeo_server(conf, addr=None, ro_svr=0, keep=0, invq=None,
+def start_zeo_server(conf, addr=None, ro_svr=0, monitor=0, keep=0, invq=None,
                      timeout=None):
     """Start a ZEO server in a separate process.
 
@@ -82,6 +82,9 @@
         args += ['-Q', str(invq)]
     if timeout:
         args += ['-T', str(timeout)]
+    if monitor:
+        # XXX Is it safe to reuse the port?
+        args += ['-m', '42000']
     args.append(str(port))
     d = os.environ.copy()
     d['PYTHONPATH'] = os.pathsep.join(sys.path)


=== ZODB3/ZEO/tests/zeoserver.py 1.10 => 1.11 ===
--- ZODB3/ZEO/tests/zeoserver.py:1.10	Thu Jan  9 13:19:35 2003
+++ ZODB3/ZEO/tests/zeoserver.py	Thu Jan  9 18:57:21 2003
@@ -135,8 +135,9 @@
     configfile = None
     invalidation_queue_size = 100
     transaction_timeout = None
+    monitor_address = None
     # Parse the arguments and let getopt.error percolate
-    opts, args = getopt.getopt(sys.argv[1:], 'rkC:Q:T:')
+    opts, args = getopt.getopt(sys.argv[1:], 'rkC:Q:T:m:')
     for opt, arg in opts:
         if opt == '-r':
             ro_svr = 1
@@ -148,6 +149,8 @@
             invalidation_queue_size = int(arg)
         elif opt == '-T':
             transaction_timeout = int(arg)
+        elif opt == "-m":
+            monitor_address = '', int(arg)
     # Open the config file and let ZConfig parse the data there.  Then remove
     # the config file, otherwise we'll leave turds.
     fp = open(configfile, 'r')
@@ -163,7 +166,8 @@
     serv = ZEO.StorageServer.StorageServer(
         addr, {'1': storage}, ro_svr,
         invalidation_queue_size=invalidation_queue_size,
-        transaction_timeout=transaction_timeout)
+        transaction_timeout=transaction_timeout,
+        monitor_address=monitor_address)
     try:
         log(label, 'creating the test server, ro: %s, keep: %s', ro_svr, keep)
         t = ZEOTestServer(test_addr, serv, keep)