[Zodb-checkins] CVS: ZODB3/ZEO/tests - ConnectionTests.py:1.22.2.1 testAuth.py:1.1.2.6 testConnection.py:1.10.14.1 testMonitor.py:1.3.12.1 testZEO.py:1.66.2.1 zeoserver.py:1.13.10.1

Jeremy Hylton jeremy at zope.com
Thu May 29 13:27:55 EDT 2003


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

Modified Files:
      Tag: ZODB3-auth-branch
	ConnectionTests.py testAuth.py testConnection.py 
	testMonitor.py testZEO.py zeoserver.py 
Log Message:
Merge trunk to auth branch.

Need to move the _handle_extensions() call in notifyConnected() to
work with authentication.


=== ZODB3/ZEO/tests/ConnectionTests.py 1.22 => 1.22.2.1 ===
--- ZODB3/ZEO/tests/ConnectionTests.py:1.22	Tue Apr 22 14:00:16 2003
+++ ZODB3/ZEO/tests/ConnectionTests.py	Thu May 29 12:27:54 2003
@@ -205,7 +205,6 @@
                 self._dostore()
                 break
             except ClientDisconnected:
-                self._storage.sync()
                 time.sleep(0.5)
 
     def checkReadOnlyClient(self):
@@ -392,7 +391,6 @@
                          "Error after server restart; retrying.",
                          error=sys.exc_info())
                 get_transaction().abort()
-                self._storage.sync()
             # 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
@@ -645,7 +643,6 @@
                 # quickly and the test fails because it doesn't wait
                 # long enough for the client.
                 time.sleep(0.1)
-                self._storage.sync()
         else:
             self.fail("Couldn't store after starting a read-write server")
 


=== ZODB3/ZEO/tests/testAuth.py 1.1.2.5 => 1.1.2.6 ===
--- ZODB3/ZEO/tests/testAuth.py:1.1.2.5	Wed May 28 14:37:31 2003
+++ ZODB3/ZEO/tests/testAuth.py	Thu May 29 12:27:54 2003
@@ -53,9 +53,11 @@
                                         auth_protocol=self.protocol,
                                         auth_filename=self.database)
             LoopCallback.loop()
+            sys.exit(0)
 
     def tearDown(self):
         os.kill(self.pid, 9)
+        os.waitpid(self.pid, 0)
         os.remove(self.database)
         os.remove(SOCKET)
         removefs("auth-test.fs")
@@ -66,20 +68,23 @@
         time.sleep(self.wait)
         cs = ClientStorage(SOCKET, wait=0, username='foo', password='bar',
                            realm=self.realm)
-        time.sleep(self.wait)
+        try:
+            time.sleep(self.wait)
 
-        if cs is None:
-            raise AssertionError, \
-                  "authentication for %s failed" % self.protocol
-        
-        if cs._connection == None:
-            raise AssertionError, \
-                  "authentication for %s failed" % self.protocol
-        
-        cs._connection.poll()
-        if not cs.is_connected():
-             raise AssertionError, \
-                  "authentication for %s failed" % self.protocol
+            if cs is None:
+                raise AssertionError, \
+                      "authentication for %s failed" % self.protocol
+
+            if cs._connection == None:
+                raise AssertionError, \
+                      "authentication for %s failed" % self.protocol
+
+            cs._connection.poll()
+            if not cs.is_connected():
+                 raise AssertionError, \
+                      "authentication for %s failed" % self.protocol
+        finally:
+            cs.close()
     
     def testNOK(self):
         time.sleep(self.wait)


=== ZODB3/ZEO/tests/testConnection.py 1.10 => 1.10.14.1 ===
--- ZODB3/ZEO/tests/testConnection.py:1.10	Mon Jan 13 19:09:56 2003
+++ ZODB3/ZEO/tests/testConnection.py	Thu May 29 12:27:54 2003
@@ -26,32 +26,25 @@
 class FileStorageConfig:
     def getConfig(self, path, create, read_only):
         return """\
-        <Storage>
-            type FileStorage
-            file_name %s
-            create %s
-            read_only %s
-        </Storage>""" % (path,
-                         create and 'yes' or 'no',
-                         read_only and 'yes' or 'no')
+        <filestorage>
+        path %s
+        create %s
+        read-only %s
+        </filestorage>""" % (path,
+                             create and 'yes' or 'no',
+                             read_only and 'yes' or 'no')
 
 class BerkeleyStorageConfig:
     def getConfig(self, path, create, read_only):
         return """\
-        <Storage>
-            type BDBFullStorage
-            name %s
-            read_only %s
-        </Storage>""" % (path, read_only)
+        <fullstorage>
+        name %s
+        read-only %s
+        </fullstorage>""" % (path, read_only and "yes" or "no")
 
 class MappingStorageConfig:
     def getConfig(self, path, create, read_only):
-        return """\
-        <Storage>
-            type MappingStorage
-            name %s
-        </Storage>""" % path
-
+        return """<mappingstorage/>"""
 
 
 class FileStorageConnectionTests(


=== ZODB3/ZEO/tests/testMonitor.py 1.3 => 1.3.12.1 ===
--- ZODB3/ZEO/tests/testMonitor.py:1.3	Wed Jan 15 16:23:17 2003
+++ ZODB3/ZEO/tests/testMonitor.py	Thu May 29 12:27:54 2003
@@ -72,11 +72,7 @@
         return d
         
     def getConfig(self, path, create, read_only):
-        return """\
-        <Storage>
-            type MappingStorage
-        </Storage>
-        """
+        return """<mappingstorage/>"""
 
     def testMonitor(self):
         # just open a client to know that the server is up and running


=== ZODB3/ZEO/tests/testZEO.py 1.66 => 1.66.2.1 ===
--- ZODB3/ZEO/tests/testZEO.py:1.66	Tue Apr 22 15:14:39 2003
+++ ZODB3/ZEO/tests/testZEO.py	Thu May 29 12:27:54 2003
@@ -150,20 +150,11 @@
     def getConfig(self):
         filename = self.__fs_base = tempfile.mktemp()
         return """\
-        <Storage>
-            type FileStorage
-            file_name %s
-            create yes
-        </Storage>
+        <filestorage>
+        path %s
+        </filestorage>
         """ % filename
 
-    def checkPackVersionsInPast(self):
-        # FileStorage can't cope with backpointers to objects
-        # created in versions.  Should fix if we can figure out actually how
-        # to fix it.
-        pass
-
-
 class BDBTests(FileStorageTests):
     """ZEO backed by a Berkeley full storage."""
     level = 2
@@ -171,23 +162,16 @@
     def getConfig(self):
         self._envdir = tempfile.mktemp()
         return """\
-        <Storage>
-            type BDBFullStorage
-            name %s
-        </Storage>
+        <fullstorage>
+        name %s
+        </fullstorage>
         """ % self._envdir
 
 class MappingStorageTests(FileStorageTests):
     """ZEO backed by a Mapping storage."""
 
     def getConfig(self):
-        self._envdir = tempfile.mktemp()
-        return """\
-        <Storage>
-            type MappingStorage
-            name %s
-        </Storage>
-        """ % self._envdir
+        return """<mappingstorage/>"""
 
     # Tests which MappingStorage can't possibly pass, because it doesn't
     # support versions or undo.
@@ -220,6 +204,7 @@
     def checkPackEmptyStorage(self): pass
     def checkPackAllRevisions(self): pass
     def checkPackVersionsInPast(self): pass
+    def checkPackVersionReachable(self): pass
     def checkNotUndoable(self): pass
     def checkNewSerialOnCommitVersionToVersion(self): pass
     def checkModifyAfterAbortVersion(self): pass


=== ZODB3/ZEO/tests/zeoserver.py 1.13 => 1.13.10.1 ===
--- ZODB3/ZEO/tests/zeoserver.py:1.13	Fri Feb 28 18:41:25 2003
+++ ZODB3/ZEO/tests/zeoserver.py	Thu May 29 12:27:54 2003
@@ -26,15 +26,8 @@
 
 import ZConfig.Context
 import zLOG
-from ZODB import StorageConfig
 import ZEO.StorageServer
-
-
-def load_storage(fp):
-    context = ZConfig.Context.Context()
-    rootconf = context.loadFile(fp)
-    storageconf = rootconf.getSection('Storage')
-    return StorageConfig.createStorage(storageconf)
+from ZODB.config import storageFromURL
 
 
 def cleanup(storage):
@@ -166,9 +159,7 @@
             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')
-    storage = load_storage(fp)
-    fp.close()
+    storage = storageFromURL(configfile)
     os.remove(configfile)
     # The rest of the args are hostname, portnum
     zeo_port = int(args[0])




More information about the Zodb-checkins mailing list