Пример #1
0
def testAddInactiveNodeThenActivate(looper, txnPoolNodeSet, tdirWithPoolTxns,
                                    tconf, steward1, stewardWallet,
                                    allPluginsPath):
    newStewardName = "testClientSteward" + randomString(3)
    newNodeName = "Kappa"

    # adding a new node without SERVICES field
    # it means the node is in the inactive state
    def del_services(op):
        del op[DATA][SERVICES]

    newSteward, newStewardWallet, newNode = \
        addNewStewardAndNode(looper,
                             steward1, stewardWallet,
                             newStewardName, newNodeName,
                             tdirWithPoolTxns, tconf, allPluginsPath,
                             transformNodeOpFunc=del_services)
    looper.run(checkNodesConnected(txnPoolNodeSet))

    # turn the new node on
    node_data = {ALIAS: newNode.name, SERVICES: [VALIDATOR]}

    updateNodeDataAndReconnect(looper, newSteward, newStewardWallet, newNode,
                               node_data, tdirWithPoolTxns, tconf,
                               txnPoolNodeSet + [newNode])
Пример #2
0
def testNodePortChanged(looper, txnPoolNodeSet, tdirWithPoolTxns, tconf,
                        steward1, stewardWallet, nodeThetaAdded):
    """
    An running node's port is changed
    """
    newSteward, newStewardWallet, newNode = nodeThetaAdded
    nodeNewHa = genHa(1)
    new_port = nodeNewHa.port

    node_ha = txnPoolNodeSet[0].nodeReg[newNode.name]
    cli_ha = txnPoolNodeSet[0].cliNodeReg[newNode.name + CLIENT_STACK_SUFFIX]
    node_data = {
        ALIAS: newNode.name,
        NODE_PORT: new_port,
        NODE_IP: node_ha.host,
        CLIENT_PORT: cli_ha.port,
        CLIENT_IP: cli_ha.host,
    }

    node = updateNodeDataAndReconnect(looper, newSteward, newStewardWallet,
                                      newNode, node_data, tdirWithPoolTxns,
                                      tconf, txnPoolNodeSet)

    waitNodeDataEquality(looper, node, *txnPoolNodeSet[:-1])

    ensureClientConnectedToNodesAndPoolLedgerSame(looper, steward1,
                                                  *txnPoolNodeSet)
    ensureClientConnectedToNodesAndPoolLedgerSame(looper, newSteward,
                                                  *txnPoolNodeSet)