def cli2(cliLooper, tdir, tdirWithClientPoolTxns, tdirWithNodeKeepInited,
         tconf):
    tempDir = os.path.join(tdirWithClientPoolTxns, "cl2")
    initDirWithGenesisTxns(tempDir, tconf, tdirWithClientPoolTxns)
    cli = newCLI(cliLooper, tempDir, tempDir)
    yield cli
    cli.close()
Пример #2
0
def newCLI(looper,
           tdir,
           subDirectory=None,
           conf=None,
           poolDir=None,
           domainDir=None,
           multiPoolNodes=None):
    tempDir = os.path.join(tdir, subDirectory) if subDirectory else tdir
    if poolDir or domainDir:
        initDirWithGenesisTxns(tempDir, conf, poolDir, domainDir)

    if multiPoolNodes:
        conf.ENVS = {}
        for pool in multiPoolNodes:
            conf.poolTransactionsFile = "pool_transactions_{}".format(
                pool.name)
            conf.domainTransactionsFile = "transactions_{}".format(pool.name)
            conf.ENVS[pool.name] = \
                Environment("pool_transactions_{}".format(pool.name),
                                "transactions_{}".format(pool.name))
            initDirWithGenesisTxns(
                tempDir, conf, os.path.join(pool.tdirWithPoolTxns, pool.name),
                os.path.join(pool.tdirWithDomainTxns, pool.name))

    return newPlenumCLI(looper,
                        tempDir,
                        cliClass=TestCLI,
                        nodeClass=TestNode,
                        clientClass=TestClient,
                        config=conf)
Пример #3
0
def newCLI(looper, tdir, subDirectory=None, conf=None, poolDir=None,
           domainDir=None, multiPoolNodes=None, unique_name=None,
           logFileName=None, cliClass=TestCLI, name=None, agent=None):
    tempDir = os.path.join(tdir, subDirectory) if subDirectory else tdir
    if poolDir or domainDir:
        initDirWithGenesisTxns(tempDir, conf, poolDir, domainDir)

    if multiPoolNodes:
        conf.ENVS = {}
        for pool in multiPoolNodes:
            conf.poolTransactionsFile = "pool_transactions_{}".format(pool.name)
            conf.domainTransactionsFile = "transactions_{}".format(pool.name)
            conf.ENVS[pool.name] = \
                Environment("pool_transactions_{}".format(pool.name),
                                "transactions_{}".format(pool.name))
            initDirWithGenesisTxns(
                tempDir, conf, os.path.join(pool.tdirWithPoolTxns, pool.name),
                os.path.join(pool.tdirWithDomainTxns, pool.name))
    from sovrin_node.test.helper import TestNode
    new_cli = newPlenumCLI(looper, tempDir, cliClass=cliClass,
                           nodeClass=TestNode, clientClass=TestClient, config=conf,
                           unique_name=unique_name, logFileName=logFileName,
                           name=name, agentCreator=True)
    if isinstance(new_cli, SovrinCli) and agent is not None:
        new_cli.agent = agent
    return new_cli
Пример #4
0
def newCLI(looper, tdir, subDirectory=None, conf=None, poolDir=None,
           domainDir=None, multiPoolNodes=None, unique_name=None,
           logFileName=None, cliClass=TestCLI, name=None, agent=None):
    tempDir = os.path.join(tdir, subDirectory) if subDirectory else tdir
    if poolDir or domainDir:
        initDirWithGenesisTxns(tempDir, conf, poolDir, domainDir)

    if multiPoolNodes:
        conf.ENVS = {}
        for pool in multiPoolNodes:
            conf.poolTransactionsFile = "pool_transactions_{}".format(pool.name)
            conf.domainTransactionsFile = "transactions_{}".format(pool.name)
            conf.ENVS[pool.name] = \
                Environment("pool_transactions_{}".format(pool.name),
                                "transactions_{}".format(pool.name))
            initDirWithGenesisTxns(
                tempDir, conf, os.path.join(pool.tdirWithPoolTxns, pool.name),
                os.path.join(pool.tdirWithDomainTxns, pool.name))
    from sovrin_node.test.helper import TestNode
    new_cli = newPlenumCLI(looper, tempDir, cliClass=cliClass,
                           nodeClass=TestNode, clientClass=TestClient, config=conf,
                           unique_name=unique_name, logFileName=logFileName,
                           name=name, agentCreator=True)
    if isinstance(new_cli, SovrinCli) and agent is not None:
        new_cli.agent = agent
    return new_cli
Пример #5
0
def cli1(cliLooper, tdir, tdirWithPoolTxns, tdirWithDomainTxns,
         tdirWithNodeKeepInited, tconf):
    tempDir = os.path.join(tdir, "cl1")
    initDirWithGenesisTxns(tempDir, tconf, tdirWithPoolTxns,
                           tdirWithDomainTxns)
    cli = newCLI(cliLooper, tempDir)
    yield cli
    cli.close()
Пример #6
0
def newCLI(looper,
           client_tdir,
           network='sandbox',
           conf=None,
           poolDir=None,
           domainDir=None,
           multiPoolNodes=None,
           unique_name=None,
           logFileName=None,
           cliClass=TestCLI,
           name=None,
           agent=None,
           nodes_chroot: str = None):
    ledger_base_dir = os.path.join(client_tdir, 'networks')
    tempDir = os.path.join(ledger_base_dir, network)
    os.makedirs(tempDir, exist_ok=True)
    if poolDir or domainDir:
        initDirWithGenesisTxns(tempDir, conf, poolDir, domainDir)

    if multiPoolNodes:
        for pool in multiPoolNodes:
            initDirWithGenesisTxns(os.path.join(ledger_base_dir, pool.name),
                                   conf, pool.tdirWithPoolTxns,
                                   pool.tdirWithDomainTxns)
    from indy_node.test.helper import TestNode
    new_cli = newPlenumCLI(looper,
                           client_tdir,
                           ledger_base_dir,
                           cliClass=cliClass,
                           nodeClass=TestNode,
                           clientClass=TestClient,
                           config=conf,
                           unique_name=unique_name,
                           logFileName=logFileName,
                           name=name,
                           agentCreator=True,
                           nodes_chroot=nodes_chroot)
    if isinstance(new_cli, IndyCli) and agent is not None:
        new_cli.agent = agent
    new_cli.txn_dir = network
    return new_cli
Пример #7
0
def newCLI(looper,
           tdir,
           subDirectory=None,
           conf=None,
           poolDir=None,
           domainDir=None,
           multiPoolNodes=None,
           unique_name=None,
           logFileName=None,
           cliClass=TestCLI,
           name=None,
           agent=None):
    tempDir = os.path.join(tdir, subDirectory) if subDirectory else tdir
    if poolDir or domainDir:
        initDirWithGenesisTxns(tempDir, conf, poolDir, domainDir)

    if multiPoolNodes:
        for pool in multiPoolNodes:
            initDirWithGenesisTxns(
                tdir, conf, os.path.join(pool.tdirWithPoolTxns, pool.name),
                os.path.join(pool.tdirWithDomainTxns, pool.name))
    from indy_node.test.helper import TestNode
    new_cli = newPlenumCLI(looper,
                           tdir,
                           tdir,
                           cliClass=cliClass,
                           nodeClass=TestNode,
                           clientClass=TestClient,
                           config=conf,
                           unique_name=unique_name,
                           logFileName=logFileName,
                           name=name,
                           agentCreator=True)
    if isinstance(new_cli, IndyCli) and agent is not None:
        new_cli.agent = agent
    new_cli.txn_dir = subDirectory
    return new_cli
Пример #8
0
def newCLI(looper, client_tdir, network='sandbox', conf=None, poolDir=None,
           domainDir=None, multiPoolNodes=None, unique_name=None,
           logFileName=None, cliClass=TestCLI, name=None, agent=None,
           nodes_chroot: str = None):
    ledger_base_dir = os.path.join(client_tdir, 'networks')
    tempDir = os.path.join(ledger_base_dir, network)
    os.makedirs(tempDir, exist_ok=True)
    if poolDir or domainDir:
        initDirWithGenesisTxns(tempDir, conf, poolDir, domainDir)

    if multiPoolNodes:
        for pool in multiPoolNodes:
            initDirWithGenesisTxns(
                os.path.join(ledger_base_dir, pool.name),
                conf,
                pool.tdirWithPoolTxns,
                pool.tdirWithDomainTxns
            )
    from indy_node.test.helper import TestNode
    new_cli = newPlenumCLI(
        looper,
        client_tdir,
        ledger_base_dir,
        cliClass=cliClass,
        nodeClass=TestNode,
        clientClass=TestClient,
        config=conf,
        unique_name=unique_name,
        logFileName=logFileName,
        name=name,
        agentCreator=True,
        nodes_chroot=nodes_chroot)
    if isinstance(new_cli, IndyCli) and agent is not None:
        new_cli.agent = agent
    new_cli.txn_dir = network
    return new_cli
def cli2(cliLooper, tdir, tdirWithPoolTxns, tdirWithDomainTxns,
         tdirWithNodeKeepInited, tconf):
    tempDir = os.path.join(tdir, "cl2")
    initDirWithGenesisTxns(tempDir, tconf, tdirWithPoolTxns,
                           tdirWithDomainTxns)
    return newCLI(cliLooper, tempDir)