Ejemplo n.º 1
0
def zeo_server(request, pass_file, tempdir):
    """
    :return: Temporary UNIX socket
    :rtype: str
    """
    sock = path.join(tempdir, "zeosocket_auth")
    zeroconf_file = path.join(tempdir, "zeo.config")
    dbfile = path.join(tempdir, "db2.fs")
    with open(zeroconf_file, "w") as f:
        f.write(ZEO_CONFIG % {
            "sock": sock,
            "pass_file": pass_file,
            "dbfile": dbfile
        })
    server = Process(target=ZEOServer.run,
                     kwargs={"args": ("-C", zeroconf_file)})

    @request.addfinalizer
    def fin():
        server.terminate()
        server.join()

    server.start()

    create_objects_and_close(sock)

    return sock
Ejemplo n.º 2
0
def zeo_server(request, pass_file, tempdir):
    """
    :return: Temporary UNIX socket
    :rtype: str
    """
    sock = path.join(tempdir, "zeosocket_auth")
    zeroconf_file = path.join(tempdir, "zeo.config")
    dbfile = path.join(tempdir, "db2.fs")
    with open(zeroconf_file, "w") as f:
        f.write(ZEO_CONFIG % {
            "sock": sock,
            "pass_file": pass_file,
            "dbfile": dbfile})
    server = Process(target=ZEOServer.run, kwargs={"args": ("-C", zeroconf_file)})

    @request.addfinalizer
    def fin():
        server.terminate()
        server.join()

    server.start()

    create_objects_and_close(sock)

    return sock
Ejemplo n.º 3
0
def zeo_server_pre(request, pass_file, tempdir):
    """
    :return: Temporary UNIX socket
    :rtype: str
    """
    global DB

    class ReDB(zerodb.DB):
        # This should go into a separate module, along with afgh plugin
        auth_module = afgh
        db_factory = afgh.DbFactory

    DB = ReDB

    afgh.register_auth()

    sock = path.join(tempdir, "zeosocket_auth_pre")
    zeroconf_file = path.join(tempdir, "zeo_pre.config")
    dbfile = path.join(tempdir, "db_pre.fs")
    with open(zeroconf_file, "w") as f:
        f.write(ZEO_CONFIG % {
            "sock": sock,
            "pass_file": pass_file,
            "dbfile": dbfile})
    server = Process(target=ZEOServer.run, kwargs={"args": ("-C", zeroconf_file)})

    @request.addfinalizer
    def fin():
        server.terminate()
        server.join()

    server.start()

    create_objects_and_close(sock, count=20, dbclass=ReDB)

    return sock
Ejemplo n.º 4
0
def zeo_server(request, pass_file, tempdir):
    sock = do_zeo_server(request, pass_file, tempdir)
    create_objects_and_close(sock)
    return sock
Ejemplo n.º 5
0
def zeo_server_aes_v0(request, pass_file, tempdir):
    # Use old pycryptodome encryption
    sock = do_zeo_server(request, pass_file, tempdir, dbclass=DBAESv0)
    create_objects_and_close(sock)
    return sock
Ejemplo n.º 6
0
def zeo_server(request, tempdir):
    sock = do_zeo_server(request, tempdir, name="zeo_server")
    create_objects_and_close(sock)
    return sock
Ejemplo n.º 7
0
def zeo_server(request, pass_file, tempdir):
    sock = do_zeo_server(request, pass_file, tempdir)
    create_objects_and_close(sock)
    return sock
def zeo_server_aes_v0(request, pass_file, tempdir):
    # Use old pycryptodome encryption
    sock = do_zeo_server(request, pass_file, tempdir, dbclass=DBAESv0)
    create_objects_and_close(sock)
    return sock