Beispiel #1
0
 def run(self):
     """
     Actually starts the server
     """
     options = ZEOOptions()
     options.realize(['-f', self.fd, '-a', '%s:%d' % self.addr])
     self.server = SilentZEOServer(options)
     self.server.main()
Beispiel #2
0
class TestZEOServer:
    def __init__(self, port, file):
        self.options = ZEOOptions()
        self.options.realize(['-f', file, '-a', 'localhost:%d' % port])
        self.server = ZEOServer(self.options)

    def start(self):
        self.server.main()
Beispiel #3
0
 def run(self):
     """
     Actually starts the server
     """
     options = ZEOOptions()
     options.realize(['-f', self.fd, '-a', '%s:%d' % self.addr])
     self.server = SilentZEOServer(options)
     self.server.main()
Beispiel #4
0
 def run(self):
     """
     Actually starts the server
     """
     options = ZEOOptions()
     options.realize(["-f", self.fd, "-a", "%s:%d" % self.addr])
     self.server = SilentZEOServer(options)
     self.server.main()
Beispiel #5
0
class TestZEOServer:
    def __init__(self, port, file):
        self.options = ZEOOptions();
        self.options.realize(['-f',file,'-a','localhost:%d' % port])
        self.server = ZEOServer(self.options)

    def start(self):
        self.server.main()
Beispiel #6
0
class TestZEOServer:
    def __init__(self, port, file):
        self.options = ZEOOptions()
        self.options.realize(["-f", file, "-a", "localhost:%d" % port])
        self.server = ZEOServer(self.options)

    def start(self):
        self.server.main()
Beispiel #7
0
def main():
    global pid
    pid = os.getpid()
    label = str(pid)
    log(label, "starting")

    # We don't do much sanity checking of the arguments, since if we get it
    # wrong, it's a bug in the test suite.
    keep = 0
    configfile = None
    # Parse the arguments and let getopt.error percolate
    opts, args = getopt.getopt(sys.argv[1:], 'kC:')
    for opt, arg in opts:
        if opt == '-k':
            keep = 1
        elif opt == '-C':
            configfile = arg

    zo = ZEOOptions()
    zo.realize(["-C", configfile])
    zeo_port = int(zo.address[1])

    if zo.auth_protocol == "plaintext":
        import ZEO.tests.auth_plaintext

    # Open the config file and let ZConfig parse the data there.  Then remove
    # the config file, otherwise we'll leave turds.
    # The rest of the args are hostname, portnum
    test_port = zeo_port + 1
    test_addr = ('localhost', test_port)
    addr = ('localhost', zeo_port)
    log(label, 'creating the storage server')
    storage = zo.storages[0].open()
    mon_addr = None
    if zo.monitor_address:
        mon_addr = zo.monitor_address
    server = StorageServer(
        zo.address,
        {"1": storage},
        read_only=zo.read_only,
        invalidation_queue_size=zo.invalidation_queue_size,
        transaction_timeout=zo.transaction_timeout,
        monitor_address=mon_addr,
        auth_protocol=zo.auth_protocol,
        auth_database=zo.auth_database,
        auth_realm=zo.auth_realm)

    try:
        log(label, 'creating the test server, keep: %s', keep)
        t = ZEOTestServer(test_addr, server, keep)
    except socket.error, e:
        if e[0] <> errno.EADDRINUSE: raise
        log(label, 'addr in use, closing and exiting')
        storage.close()
        cleanup(storage)
        sys.exit(2)
Beispiel #8
0
def main():
    global pid
    pid = os.getpid()
    label = str(pid)
    log(label, "starting")

    # We don't do much sanity checking of the arguments, since if we get it
    # wrong, it's a bug in the test suite.
    keep = 0
    configfile = None
    # Parse the arguments and let getopt.error percolate
    opts, args = getopt.getopt(sys.argv[1:], 'kC:')
    for opt, arg in opts:
        if opt == '-k':
            keep = 1
        elif opt == '-C':
            configfile = arg

    zo = ZEOOptions()
    zo.realize(["-C", configfile])
    zeo_port = int(zo.address[1])

    if zo.auth_protocol == "plaintext":
        import ZEO.tests.auth_plaintext

    # Open the config file and let ZConfig parse the data there.  Then remove
    # the config file, otherwise we'll leave turds.
    # The rest of the args are hostname, portnum
    test_port = zeo_port + 1
    test_addr = ('localhost', test_port)
    addr = ('localhost', zeo_port)
    log(label, 'creating the storage server')
    storage = zo.storages[0].open()
    mon_addr = None
    if zo.monitor_address:
        mon_addr = zo.monitor_address
    server = StorageServer(zo.address, {"1": storage},
                           read_only=zo.read_only,
                           invalidation_queue_size=zo.invalidation_queue_size,
                           transaction_timeout=zo.transaction_timeout,
                           monitor_address=mon_addr,
                           auth_protocol=zo.auth_protocol,
                           auth_database=zo.auth_database,
                           auth_realm=zo.auth_realm)

    try:
        log(label, 'creating the test server, keep: %s', keep)
        t = ZEOTestServer(test_addr, server, keep)
    except socket.error, e:
        if e[0] <> errno.EADDRINUSE: raise
        log(label, 'addr in use, closing and exiting')
        storage.close()
        cleanup(storage)
        sys.exit(2)
Beispiel #9
0
    def run(cls, args=None):
        options = ZEOOptions()
        options.realize(args=args)

        for o_storage in options.storages:
            if o_storage.config.pack_gc:
                logging.warn("Packing with GC and end-to-end encryption removes all the data")
                logging.warn("Turining GC off!")
                o_storage.config.pack_gc = False

        s = cls(options)
        s.main()
    def run(cls, args=None):
        options = ZEOOptions()
        options.realize(args=args)

        for o_storage in options.storages:
            if o_storage.config.pack_gc:
                logging.warn(
                    "Packing with GC and end-to-end encryption removes all the data"
                )
                logging.warn("Turining GC off!")
                o_storage.config.pack_gc = False

        s = cls(options)
        s.main()
 def main(self):
     try:
         args = get_registry_parameters(self._svc_name_)
         self.logger.info("Starting ZEO service with args %s ..."%args)
         options = ZEOOptions()
         args = args.split()
         options.realize(args)
         self.s = ZEOServer(options)
         self.s.check_socket()
         self.s.clear_socket()
         self.s.make_pidfile()
         self.s.open_storages()
         self.s.setup_signals()
         self.s.create_server()
         self.s.server.start_thread()
         self.logger.info("Started ZEO server")
         win32event.WaitForSingleObject(self.hWaitStop, win32event.INFINITE)
     except Exception as e:
         self.logger.exception(str(e))
Beispiel #12
0
 def __init__(self, port, file):
     self.options = ZEOOptions()
     self.options.realize(['-f', file, '-a', 'localhost:%d' % port])
     self.server = ZEOServer(self.options)
Beispiel #13
0
 def run(cls, args=None):
     options = ZEOOptions()
     options.realize(args=args)
     s = cls(options)
     s.main()
Beispiel #14
0
 def __init__(self, port, file):
     self.options = ZEOOptions();
     self.options.realize(['-f',file,'-a','localhost:%d' % port])
     self.server = ZEOServer(self.options)
Beispiel #15
0
 def run(cls, args=None):
     options = ZEOOptions()
     options.realize(args=args)
     s = cls(options)
     s.main()
Beispiel #16
0
 def __init__(self, port, file):
     self.options = ZEOOptions()
     self.options.realize(["-f", file, "-a", "localhost:%d" % port])
     self.server = ZEOServer(self.options)