Beispiel #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
Beispiel #2
0
def multiPoolNodesCreated(request, tconf, looper, tdir,
                          cliTempLogger, namesOfPools=("pool1", "pool2")):

    multiNodes = []
    for poolName in namesOfPools:
        newPoolTxnNodeNames = [poolName + n for n
                               in ("Alpha", "Beta", "Gamma", "Delta")]
        newTdir = os.path.join(tdir, poolName)
        newPoolTxnData = getPoolTxnData(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)

    return multiNodes
Beispiel #3
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