[CalendarServer-changes] [6611] CalendarServer/branches/users/glyph/dont-start-postgres/ calendarserver/tap

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 10 18:56:59 PST 2010


Revision: 6611
          http://trac.macosforge.org/projects/calendarserver/changeset/6611
Author:   glyph at apple.com
Date:     2010-11-10 18:56:56 -0800 (Wed, 10 Nov 2010)
Log Message:
-----------
a few test fixes.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/caldav.py
    CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/test/test_caldav.py

Modified: CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/caldav.py
===================================================================
--- CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/caldav.py	2010-11-11 02:56:44 UTC (rev 6610)
+++ CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/caldav.py	2010-11-11 02:56:56 UTC (rev 6611)
@@ -704,6 +704,14 @@
 
         config.addPostUpdateHooks((updateFactory,))
 
+        anyNamed = []
+        def httpsvc(svc):
+            # Try to name one of the services so the tests can find it.
+            if not anyNamed:
+                svc.setServiceName('HTTP')
+                anyNamed.append(True)
+            return svc
+
         if config.InheritFDs or config.InheritSSLFDs:
             # Inherit sockets to call accept() on them individually.
 
@@ -714,18 +722,18 @@
                     except SSLError, e:
                         log.error("Unable to set up SSL context factory: %s" % (e,))
                     else:
-                        MaxAcceptSSLServer(
+                        httpsvc(MaxAcceptSSLServer(
                             int(fdAsStr), httpFactory,
                             contextFactory,
                             backlog=config.ListenBacklog,
                             inherit=True
-                        ).setServiceParent(service)
+                        )).setServiceParent(service)
             for fdAsStr in config.InheritFDs:
-                MaxAcceptTCPServer(
+                httpsvc(MaxAcceptTCPServer(
                     int(fdAsStr), httpFactory,
                     backlog=config.ListenBacklog,
                     inherit=True
-                ).setServiceParent(service)
+                )).setServiceParent(service)
 
         elif config.MetaFD:
             # Inherit a single socket to receive accept()ed connections via
@@ -740,9 +748,9 @@
                 # 'SSL' tag on it, since that's the only time it's used.
                 contextFactory = None
 
-            ReportingHTTPService(
+            httpsvc(ReportingHTTPService(
                 requestFactory, int(config.MetaFD), contextFactory
-            ).setServiceParent(service)
+            )).setServiceParent(service)
 
         else: # Not inheriting, therefore we open our own:
             for bindAddress in self._allBindAddresses():
@@ -759,21 +767,21 @@
                                            % (e,))
                             self.log_error("Disabling SSL port: %s" % (port,))
                         else:
-                            httpsService = MaxAcceptSSLServer(
+                            httpsService = httpsvc(MaxAcceptSSLServer(
                                 int(port), httpFactory,
                                 contextFactory, interface=bindAddress,
                                 backlog=config.ListenBacklog,
                                 inherit=False
-                            )
+                            ))
                             httpsService.setServiceParent(service)
 
                 for port in config.BindHTTPPorts:
-                    MaxAcceptTCPServer(
+                    httpsvc(MaxAcceptTCPServer(
                         int(port), httpFactory,
                         interface=bindAddress,
                         backlog=config.ListenBacklog,
                         inherit=False
-                    ).setServiceParent(service)
+                    )).setServiceParent(service)
 
 
         # Change log level back to what it was before

Modified: CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/test/test_caldav.py
===================================================================
--- CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/test/test_caldav.py	2010-11-11 02:56:44 UTC (rev 6610)
+++ CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/test/test_caldav.py	2010-11-11 02:56:56 UTC (rev 6611)
@@ -312,7 +312,7 @@
 
         self.config.ServerRoot     = self.mktemp()
         self.config.ConfigRoot     = "config"
-        self.config.ProcessType    = "Slave"
+        self.config.ProcessType    = "Single"
         self.config.SSLPrivateKey  = pemFile
         self.config.SSLCertificate = pemFile
         self.config.EnableSSL      = True
@@ -360,7 +360,7 @@
         service = self.makeService()
 
         # FIXME: should at least use service name, not index
-        return service.services[2].args[1].protocolArgs["requestFactory"]
+        return service.getServiceNamed("HTTP").protocolArgs["requestFactory"]
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20101110/659c96ac/attachment.html>


More information about the calendarserver-changes mailing list