SVN: ZODB/trunk/src/ZEO/tests/ Provided more control over the way test servers are run to make

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <[email protected]>
Log message for revision 111595:
  Provided more control over the way test servers are run to make
  debugging easier.
  

Changed:
  U   ZODB/trunk/src/ZEO/tests/forker.py
  U   ZODB/trunk/src/ZEO/tests/zeoserver.py

-=-
Modified: ZODB/trunk/src/ZEO/tests/forker.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/forker.py	2010-04-29 21:27:57 UTC (rev 111594)
+++ ZODB/trunk/src/ZEO/tests/forker.py	2010-04-29 21:27:59 UTC (rev 111595)
@@ -42,6 +42,7 @@
         self.authentication_protocol = None
         self.authentication_database = None
         self.authentication_realm = None
+        self.loglevel = 'INFO'
 
     def dump(self, f):
         print >> f, "<zeo>"
@@ -66,12 +67,12 @@
 
         print >> f, """
         <eventlog>
-          level INFO
+          level %s
           <logfile>
              path server-%s.log
           </logfile>
         </eventlog>
-        """ % self.address[1]
+        """ % (self.loglevel, self.address[1])
 
     def __str__(self):
         f = StringIO.StringIO()
@@ -90,7 +91,7 @@
 
 def start_zeo_server(storage_conf=None, zeo_conf=None, port=None, keep=False,
                      path='Data.fs', protocol=None, blob_dir=None,
-                     suicide=True):
+                     suicide=True, debug=False):
     """Start a ZEO server in a separate process.
 
     Takes two positional arguments a string containing the storage conf
@@ -133,6 +134,8 @@
     args = [qa(sys.executable), qa(script), '-C', qa(tmpfile)]
     if keep:
         args.append("-k")
+    if debug:
+        args.append("-d")
     if not suicide:
         args.append("-S")
     if protocol:
@@ -288,7 +291,8 @@
     servers = {}
 
     def start_server(storage_conf=None, zeo_conf=None, port=None, keep=False,
-                     addr=None, path='Data.fs', protocol=None, blob_dir=None):
+                     addr=None, path='Data.fs', protocol=None, blob_dir=None,
+                     suicide=True, debug=False):
         """Start a ZEO server.
 
         Return the server and admin addresses.
@@ -301,7 +305,8 @@
         elif addr is not None:
             raise TypeError("Can't specify port and addr")
         addr, adminaddr, pid, config_path = start_zeo_server(
-            storage_conf, zeo_conf, port, keep, path, protocol, blob_dir)
+            storage_conf, zeo_conf, port, keep, path, protocol, blob_dir,
+            suicide, debug)
         os.remove(config_path)
         servers[adminaddr] = pid
         return addr, adminaddr

Modified: ZODB/trunk/src/ZEO/tests/zeoserver.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/zeoserver.py	2010-04-29 21:27:57 UTC (rev 111594)
+++ ZODB/trunk/src/ZEO/tests/zeoserver.py	2010-04-29 21:27:59 UTC (rev 111595)
@@ -153,10 +153,12 @@
     configfile = None
     suicide = True
     # Parse the arguments and let getopt.error percolate
-    opts, args = getopt.getopt(sys.argv[1:], 'kSC:v:')
+    opts, args = getopt.getopt(sys.argv[1:], 'dkSC:v:')
     for opt, arg in opts:
         if opt == '-k':
             keep = 1
+        if opt == '-d':
+            ZEO.zrpc.connection.debug_zrpc = True
         elif opt == '-C':
             configfile = arg
         elif opt == '-S':
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.