def test_node_does_not_reschedule_cancelled_upgrade_after_restart(
        upgradeScheduled, looper, nodeSet, validUpgrade,
        testNodeClass, tdir, tconf, allPluginsPath,
        trustee, trusteeWallet):

    # Cancel the scheduled upgrade
    valid_upgrade_cancel = deepcopy(validUpgrade)
    valid_upgrade_cancel[ACTION] = CANCEL
    del valid_upgrade_cancel[SCHEDULE]

    ensureUpgradeSent(looper, trustee, trusteeWallet, valid_upgrade_cancel)

    # Verify that no upgrade is scheduled now
    looper.run(
        eventually(
            checkNoUpgradeScheduled,
            nodeSet,
            retryWait=1,
            timeout=waits.expectedNoUpgradeScheduled()))

    # Restart all the nodes
    names = []
    while nodeSet:
        node = nodeSet.pop()
        names.append(node.name)
        node.cleanupOnStopping = False
        looper.removeProdable(node)
        node.stop()
        del node

    for nm in names:
        config_helper = NodeConfigHelper(nm, tconf, chroot=tdir)
        node = testNodeClass(nm, config_helper=config_helper,
                             config=tconf, pluginPaths=allPluginsPath)
        looper.add(node)
        nodeSet.append(node)

    looper.run(checkNodesConnected(nodeSet))
    ensureElectionsDone(looper=looper, nodes=nodeSet, retryWait=1)

    # Verify that still no upgrade is scheduled
    looper.run(
        eventually(
            checkNoUpgradeScheduled,
            nodeSet,
            retryWait=1,
            timeout=waits.expectedNoUpgradeScheduled()))
Ejemplo n.º 2
0
def testPoolUpgradeCancelled(poolUpgradeCancelled, poolNodesStarted):
    nodes = poolNodesStarted.nodes.values()
    timeout = waits.expectedNoUpgradeScheduled()
    poolNodesStarted.looper.run(
        eventually(checkNoUpgradeScheduled,
                   nodes,
                   retryWait=1,
                   timeout=timeout))
Ejemplo n.º 3
0
def testTrustyCancelsUpgrade(validUpgradeSent, looper, nodeSet, sdk_pool_handle,
                             sdk_wallet_trustee, validUpgrade):
    validUpgradeCopy = deepcopy(validUpgrade)
    validUpgradeCopy[ACTION] = CANCEL
    validUpgradeCopy[JUSTIFICATION] = '"never gonna give you one"'

    validUpgradeCopy.pop(SCHEDULE, None)
    sdk_send_upgrade(looper, sdk_pool_handle, sdk_wallet_trustee, validUpgradeCopy)

    looper.run(eventually(checkNoUpgradeScheduled, nodeSet, retryWait=1,
                          timeout=waits.expectedNoUpgradeScheduled()))
Ejemplo n.º 4
0
def testTrustyCancelsUpgrade(validUpgradeSent, looper, nodeSet,
                             sdk_pool_handle, sdk_wallet_trustee,
                             validUpgrade):
    validUpgradeCopy = deepcopy(validUpgrade)
    validUpgradeCopy[ACTION] = CANCEL
    validUpgradeCopy[JUSTIFICATION] = '"never gonna give you one"'

    validUpgradeCopy.pop(SCHEDULE, None)
    sdk_send_upgrade(looper, sdk_pool_handle, sdk_wallet_trustee,
                     validUpgradeCopy)

    looper.run(
        eventually(checkNoUpgradeScheduled,
                   nodeSet,
                   retryWait=1,
                   timeout=waits.expectedNoUpgradeScheduled()))
def testTrustyCancelsUpgrade(validUpgradeSent, looper, nodeSet, trustee,
                             trusteeWallet, validUpgrade):
    validUpgradeCopy = deepcopy(validUpgrade)
    validUpgradeCopy[ACTION] = CANCEL
    validUpgradeCopy[JUSTIFICATION] = '"not gonna give you one"'

    validUpgradeCopy.pop(SCHEDULE, None)
    upgrade, req = sendUpgrade(trustee, trusteeWallet, validUpgradeCopy)

    def check():
        assert trusteeWallet.getPoolUpgrade(upgrade.key).seqNo

    timeout = plenumWaits.expectedTransactionExecutionTime(len(nodeSet))
    looper.run(eventually(check, retryWait=1, timeout=timeout))

    looper.run(eventually(checkNoUpgradeScheduled, nodeSet, retryWait=1,
                          timeout=waits.expectedNoUpgradeScheduled()))
Ejemplo n.º 6
0
def testTrustyCancelsUpgrade(validUpgradeSent, looper, nodeSet, trustee,
                             trusteeWallet, validUpgrade):
    validUpgradeCopy = deepcopy(validUpgrade)
    validUpgradeCopy[ACTION] = CANCEL
    validUpgradeCopy[JUSTIFICATION] = '"not gonna give you one"'

    validUpgradeCopy.pop(SCHEDULE, None)
    upgrade, req = sendUpgrade(trustee, trusteeWallet, validUpgradeCopy)

    def check():
        assert trusteeWallet.getPoolUpgrade(upgrade.key).seqNo

    timeout = plenumWaits.expectedTransactionExecutionTime(len(nodeSet))
    looper.run(eventually(check, retryWait=1, timeout=timeout))

    looper.run(
        eventually(checkNoUpgradeScheduled,
                   nodeSet,
                   retryWait=1,
                   timeout=waits.expectedNoUpgradeScheduled()))
Ejemplo n.º 7
0
def testPoolUpgradeCancelled(poolUpgradeCancelled, poolNodesStarted):
    nodes = poolNodesStarted.nodes.values()
    timeout = waits.expectedNoUpgradeScheduled()
    poolNodesStarted.looper.run(
        eventually(checkNoUpgradeScheduled,
                   nodes, retryWait=1, timeout=timeout))