コード例 #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
コード例 #2
0
ファイル: conftest.py プロジェクト: barkinet/zerodb
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
コード例 #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
コード例 #4
0
def zeo_server(request, pass_file, tempdir):
    sock = do_zeo_server(request, pass_file, tempdir)
    create_objects_and_close(sock)
    return sock
コード例 #5
0
ファイル: test_aes256_compat.py プロジェクト: micxjo/zerodb
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
コード例 #6
0
def zeo_server(request, tempdir):
    sock = do_zeo_server(request, tempdir, name="zeo_server")
    create_objects_and_close(sock)
    return sock
コード例 #7
0
def zeo_server(request, pass_file, tempdir):
    sock = do_zeo_server(request, pass_file, tempdir)
    create_objects_and_close(sock)
    return sock
コード例 #8
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