示例#1
0
def multiPoolNodesCreated(request, tconf, looper, tdir, nodeAndClientInfoFilePath,
                          namesOfPools=("pool1", "pool2")):
    oldENVS = tconf.ENVS
    oldPoolTxnFile = tconf.poolTransactionsFile
    oldDomainTxnFile = tconf.domainTransactionsFile

    multiNodes=[]
    for poolName in namesOfPools:
        newPoolTxnNodeNames = [poolName + n for n
                               in ("Alpha", "Beta", "Gamma", "Delta")]
        newTdir = os.path.join(tdir, poolName + "basedir")
        newPoolTxnData = getPoolTxnData(
            nodeAndClientInfoFilePath, poolName, newPoolTxnNodeNames)
        newTdirWithPoolTxns = tdirWithPoolTxns(newPoolTxnData, newTdir, tconf)
        newTdirWithDomainTxns = tdirWithDomainTxns(
            newPoolTxnData, newTdir, tconf, domainTxnOrderedFields())
        testPoolNode = TestMultiNode(
            poolName, newPoolTxnNodeNames, newTdir, tconf,
            newPoolTxnData, newTdirWithPoolTxns, newTdirWithDomainTxns, None)

        poolCLIBabyGen = CliBuilder(newTdir, newTdirWithPoolTxns,
                                       newTdirWithDomainTxns, tconf)
        poolCLIBaby = next(poolCLIBabyGen(poolName, looper))
        poolCli = poolCLI(poolCLIBaby, newPoolTxnData, newPoolTxnNodeNames)
        testPoolNode.poolCli = poolCli
        multiNodes.append(testPoolNode)
        ensureNodesCreated(poolCli, newPoolTxnNodeNames)

    def reset():
        tconf.ENVS = oldENVS
        tconf.poolTransactionsFile = oldPoolTxnFile
        tconf.domainTransactionsFile = oldDomainTxnFile

    request.addfinalizer(reset)
    return multiNodes
示例#2
0
def multiPoolNodesCreated(request, tconf, looper, tdir, nodeAndClientInfoFilePath,
                          cliTempLogger, namesOfPools=("pool1", "pool2")):
    oldENVS = tconf.ENVS
    oldPoolTxnFile = tconf.poolTransactionsFile
    oldDomainTxnFile = tconf.domainTransactionsFile

    multiNodes=[]
    for poolName in namesOfPools:
        newPoolTxnNodeNames = [poolName + n for n
                               in ("Alpha", "Beta", "Gamma", "Delta")]
        newTdir = os.path.join(tdir, poolName + "basedir")
        newPoolTxnData = getPoolTxnData(
            nodeAndClientInfoFilePath, poolName, newPoolTxnNodeNames)
        newTdirWithPoolTxns = tdirWithPoolTxns(newPoolTxnData, newTdir, tconf)
        newTdirWithDomainTxns = tdirWithDomainTxns(
            newPoolTxnData, newTdir, tconf, domainTxnOrderedFields())
        testPoolNode = TestMultiNode(
            poolName, newPoolTxnNodeNames, newTdir, tconf,
            newPoolTxnData, newTdirWithPoolTxns, newTdirWithDomainTxns, None)

        poolCLIBabyGen = CliBuilder(newTdir, newTdirWithPoolTxns,
                                    newTdirWithDomainTxns, tconf,
                                    cliTempLogger)
        poolCLIBaby = next(poolCLIBabyGen(poolName, looper))
        poolCli = poolCLI(poolCLIBaby, newPoolTxnData, newPoolTxnNodeNames,
                          tconf)
        testPoolNode.poolCli = poolCli
        multiNodes.append(testPoolNode)
        ensureNodesCreated(poolCli, newPoolTxnNodeNames)

    def reset():
        tconf.ENVS = oldENVS
        tconf.poolTransactionsFile = oldPoolTxnFile
        tconf.domainTransactionsFile = oldDomainTxnFile

    request.addfinalizer(reset)
    return multiNodes
示例#3
0
def poolNodesCreated(poolCLI, poolTxnNodeNames):
    ensureNodesCreated(poolCLI, poolTxnNodeNames)
    return poolCLI
示例#4
0
def poolNodesCreated(poolCLI, poolTxnNodeNames):
    ensureNodesCreated(poolCLI, poolTxnNodeNames)
    return poolCLI