Ejemplo n.º 1
0
    def _new_storage(self):
        port = get_port(self)
        zconf = forker.ZEOConfig(("", port))
        zport, adminaddr, pid, path = forker.start_zeo_server(self.getConfig(), zconf, port)
        self._pids.append(pid)
        self._servers.append(adminaddr)

        blob_cache_dir = tempfile.mkdtemp(dir=".")

        storage = ClientStorage(
            zport, "1", cache_size=20000000, min_disconnect_poll=0.5, wait=1, wait_timeout=60, blob_dir=blob_cache_dir
        )
        storage.registerDB(DummyDB())
        return storage
Ejemplo n.º 2
0
 def _makeBaseStorage(self):
     logger.info("setUp() %s", self.id())
     port = get_port()
     zconf = forker.ZEOConfig(('', port))
     zport, adminaddr, pid, path = forker.start_zeo_server(
         self.getConfig(), zconf, port)
     self._pids = [pid]
     self._servers = [adminaddr]
     self._conf_path = path
     _base = ClientStorage(zport,
                           '1',
                           cache_size=20000000,
                           min_disconnect_poll=0.5,
                           wait=1,
                           wait_timeout=60)
     _base.registerDB(DummyDB())
     return _base
Ejemplo n.º 3
0
 def setUp(self):
     logger.info("setUp() %s", self.id())
     port = get_port()
     zconf = forker.ZEOConfig(('', port))
     zport, adminaddr, pid, path = forker.start_zeo_server(
         self.getConfig(), zconf, port)
     self._pids = [pid]
     self._servers = [adminaddr]
     self._conf_path = path
     if not self.blob_cache_dir:
         # This is the blob cache for ClientStorage
         self.blob_cache_dir = tempfile.mkdtemp()
     self._storage = ClientStorage(zport,
                                   '1',
                                   cache_size=20000000,
                                   min_disconnect_poll=0.5,
                                   wait=1,
                                   wait_timeout=60,
                                   blob_dir=self.blob_cache_dir,
                                   shared_blob_dir=self.shared_blob_dir)
     self._storage.registerDB(DummyDB())
Ejemplo n.º 4
0
 def setUp(self):
     StorageTestBase.StorageTestBase.setUp(self)
     logger.info("setUp() %s", self.id())
     port = get_port(self)
     zconf = forker.ZEOConfig(("", port))
     zport, adminaddr, pid, path = forker.start_zeo_server(self.getConfig(), zconf, port)
     self._pids = [pid]
     self._servers = [adminaddr]
     self._conf_path = path
     if not self.blob_cache_dir:
         # This is the blob cache for ClientStorage
         self.blob_cache_dir = tempfile.mkdtemp("blob_cache", dir=os.path.abspath(os.getcwd()))
     self._storage = ClientStorage(
         zport,
         "1",
         cache_size=20000000,
         min_disconnect_poll=0.5,
         wait=1,
         wait_timeout=60,
         blob_dir=self.blob_cache_dir,
         shared_blob_dir=self.shared_blob_dir,
     )
     self._storage.registerDB(DummyDB())
Ejemplo n.º 5
0
 def set_inet_addr(self):
     self.host = socket.gethostname()
     self.port = forker.get_port()
     self.addr = self.host, self.port
Ejemplo n.º 6
0
 def _getAddr(self):
     return '127.0.0.1', forker.get_port(self)
Ejemplo n.º 7
0
 def _getAddr(self):
     return '::1', forker.get_port(self)
Ejemplo n.º 8
0
 def _getAddr(self):
     return '127.0.0.1', forker.get_port(self)
Ejemplo n.º 9
0
 def _getAddr(self):
     return '::1', forker.get_port(self)
Ejemplo n.º 10
0
 def _getAddr(self):
     return 'localhost', forker.get_port(self)
Ejemplo n.º 11
0
 def _getAddr(self):
     return 'localhost', forker.get_port(self)
Ejemplo n.º 12
0
 def set_inet_addr(self):
     self.host = socket.gethostname()
     self.port = forker.get_port()
     self.addr = self.host, self.port